intercom-observability
Set up observability for Intercom integrations with metrics, traces, and alerts. Use when implementing monitoring for Intercom API operations, setting up dashboards, or configuring alerting for integration health. Trigger with phrases like "intercom monitoring", "intercom metrics", "intercom observability", "monitor intercom", "intercom alerts", "intercom tracing".
What this skill does
# Intercom Observability
## Overview
Comprehensive observability for Intercom integrations covering Prometheus metrics, OpenTelemetry traces, structured logging, and alert rules for error rates, latency, and rate limit usage.
## Prerequisites
- Prometheus or compatible metrics backend
- OpenTelemetry SDK (optional, for tracing)
- Pino or similar structured logger
- Grafana or alerting system
## Instructions
### Step 1: Prometheus Metrics for Intercom API Calls
```typescript
import { Registry, Counter, Histogram, Gauge } from "prom-client";
const registry = new Registry();
// Total API requests by endpoint and status
const intercomRequests = new Counter({
name: "intercom_api_requests_total",
help: "Total Intercom API requests",
labelNames: ["endpoint", "method", "status"] as const,
registers: [registry],
});
// Request duration by endpoint
const intercomDuration = new Histogram({
name: "intercom_api_request_duration_seconds",
help: "Intercom API request duration in seconds",
labelNames: ["endpoint", "method"] as const,
buckets: [0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10],
registers: [registry],
});
// Error counter by type
const intercomErrors = new Counter({
name: "intercom_api_errors_total",
help: "Intercom API errors by type",
labelNames: ["endpoint", "error_code", "status_code"] as const,
registers: [registry],
});
// Rate limit remaining gauge
const intercomRateLimit = new Gauge({
name: "intercom_rate_limit_remaining",
help: "Intercom API rate limit remaining requests",
registers: [registry],
});
// Webhook processing metrics
const webhookProcessed = new Counter({
name: "intercom_webhooks_processed_total",
help: "Intercom webhooks processed by topic",
labelNames: ["topic", "status"] as const,
registers: [registry],
});
```
### Step 2: Instrumented API Client Wrapper
```typescript
import { IntercomClient, IntercomError } from "intercom-client";
function instrumentedClient(client: IntercomClient): IntercomClient {
return new Proxy(client, {
get(target, prop) {
const value = (target as any)[prop];
if (typeof value === "object" && value !== null) {
// Wrap service objects (contacts, conversations, etc.)
return new Proxy(value, {
get(serviceTarget, methodName) {
const method = (serviceTarget as any)[methodName];
if (typeof method !== "function") return method;
return async (...args: any[]) => {
const endpoint = `${String(prop)}.${String(methodName)}`;
const timer = intercomDuration.startTimer({ endpoint, method: "API" });
try {
const result = await method.apply(serviceTarget, args);
intercomRequests.inc({ endpoint, method: "API", status: "success" });
return result;
} catch (err) {
if (err instanceof IntercomError) {
const statusCode = String(err.statusCode ?? "unknown");
const errorCode = err.body?.errors?.[0]?.code ?? "unknown";
intercomRequests.inc({ endpoint, method: "API", status: "error" });
intercomErrors.inc({ endpoint, error_code: errorCode, status_code: statusCode });
// Track rate limit from error response
if (err.statusCode === 429) {
intercomRateLimit.set(0);
}
}
throw err;
} finally {
timer();
}
};
},
});
}
return value;
},
});
}
// Usage
const rawClient = new IntercomClient({ token: process.env.INTERCOM_ACCESS_TOKEN! });
const client = instrumentedClient(rawClient);
```
### Step 3: Structured Logging
```typescript
import pino from "pino";
const logger = pino({
name: "intercom",
level: process.env.LOG_LEVEL || "info",
serializers: {
// Redact PII from logs
contact: (contact: any) => ({
id: contact.id,
role: contact.role,
// Never log email, name, phone
}),
err: pino.stdSerializers.err,
},
});
// Intercom operation logger
function logIntercomOp(
operation: string,
details: Record<string, any>,
durationMs: number
): void {
logger.info({
service: "intercom",
operation,
duration_ms: Math.round(durationMs),
...details,
});
}
// Webhook logger
function logWebhook(
topic: string,
notificationId: string,
status: "processed" | "failed" | "skipped",
durationMs?: number
): void {
logger.info({
service: "intercom",
type: "webhook",
topic,
notification_id: notificationId,
status,
duration_ms: durationMs ? Math.round(durationMs) : undefined,
});
}
```
### Step 4: OpenTelemetry Tracing
```typescript
import { trace, SpanStatusCode, Span } from "@opentelemetry/api";
const tracer = trace.getTracer("intercom-integration");
async function tracedIntercomCall<T>(
operationName: string,
attributes: Record<string, string>,
operation: () => Promise<T>
): Promise<T> {
return tracer.startActiveSpan(
`intercom.${operationName}`,
{ attributes },
async (span: Span) => {
try {
const result = await operation();
span.setStatus({ code: SpanStatusCode.OK });
return result;
} catch (err: any) {
span.setStatus({ code: SpanStatusCode.ERROR, message: err.message });
span.recordException(err);
if (err instanceof IntercomError) {
span.setAttribute("intercom.status_code", err.statusCode ?? 0);
span.setAttribute("intercom.error_code", err.body?.errors?.[0]?.code ?? "unknown");
span.setAttribute("intercom.request_id", err.body?.request_id ?? "");
}
throw err;
} finally {
span.end();
}
}
);
}
// Usage
const contact = await tracedIntercomCall(
"contacts.find",
{ "intercom.contact_id": contactId },
() => client.contacts.find({ contactId })
);
```
### Step 5: Alert Rules
```yaml
# prometheus/intercom-alerts.yml
groups:
- name: intercom_integration
rules:
- alert: IntercomHighErrorRate
expr: |
rate(intercom_api_errors_total[5m]) /
rate(intercom_api_requests_total[5m]) > 0.05
for: 5m
labels:
severity: warning
annotations:
summary: "Intercom error rate > 5%"
description: "{{ $value | humanizePercentage }} of requests failing"
- alert: IntercomHighLatency
expr: |
histogram_quantile(0.95,
rate(intercom_api_request_duration_seconds_bucket[5m])
) > 3
for: 5m
labels:
severity: warning
annotations:
summary: "Intercom P95 latency > 3s"
- alert: IntercomRateLimitLow
expr: intercom_rate_limit_remaining < 1000
for: 1m
labels:
severity: critical
annotations:
summary: "Intercom rate limit < 1000 remaining"
description: "Only {{ $value }} requests remaining before rate limit"
- alert: IntercomAuthFailures
expr: rate(intercom_api_errors_total{status_code="401"}[5m]) > 0
for: 1m
labels:
severity: critical
annotations:
summary: "Intercom authentication failures detected"
- alert: IntercomWebhookFailures
expr: |
rate(intercom_webhooks_processed_total{status="failed"}[5m]) > 0.1
for: 5m
labels:
severity: warning
annotations:
summary: "Intercom webhook processing failures"
```
### Step 6: Metrics Endpoint
```typescript
// Expose Prometheus metrics
app.get("/metrics", async (req, res) => {
res.set("Content-Type", registry.contentType);
res.send(await registry.metrics());
});
```
## Key Metrics Summary
| Metric | Type | Alert Threshold |
|--------|------|----------------|
| `intercom_api_requests_total` | Counter | N/A (baseline) |
| `inteRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.