| name | customerio-observability |
| description | Set up Customer.io monitoring and observability.
Use when implementing metrics, structured logging, alerting,
or Grafana dashboards for Customer.io integrations.
Trigger: "customer.io monitoring", "customer.io metrics",
"customer.io dashboard", "customer.io alerts", "customer.io observability".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(npx:*), Glob, Grep |
| version | 1.14.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","customer-io","monitoring","observability","prometheus"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Customer.io Observability
Overview
Implement comprehensive observability for Customer.io integrations: Prometheus metrics (latency, error rates, delivery funnel), structured JSON logging with PII redaction, OpenTelemetry tracing, and Grafana dashboard definitions.
Prerequisites
- Customer.io integration deployed
- Prometheus + Grafana (or compatible metrics stack)
- Structured logging system (pino recommended)
Key Metrics to Track
| Metric | Type | Description | Alert Threshold |
|---|
cio_api_duration_ms | Histogram | API call latency | p99 > 5000ms |
cio_api_requests_total | Counter | Total API requests by operation | N/A (rate) |
cio_api_errors_total | Counter | API errors by status code | > 1% error rate |
cio_email_sent_total | Counter | Transactional + campaign emails | N/A |
cio_email_bounced_total | Counter | Bounce count | > 5% of sends |
cio_email_complained_total | Counter | Spam complaints | > 0.1% of sends |
cio_webhook_received_total | Counter | Webhook events by metric type | N/A |
cio_queue_depth | Gauge | Pending items in event queue | > 10K |
Instructions
Step 1: Prometheus Metrics
import { Counter, Histogram, Gauge, Registry } from "prom-client";
const registry = new Registry();
cioMetrics = {
: ({
: ,
: ,
: [, ] ,
: [, , , , , , , , ],
: [registry],
}),
: ({
: ,
: ,
: [] ,
: [registry],
}),
: ({
: ,
: ,
: [, ] ,
: [registry],
}),
: ({
: ,
: ,
: [] ,
: [registry],
}),
: ({
: ,
: ,
: [registry],
}),
: ({
: ,
: ,
: [registry],
}),
: ({
: ,
: ,
: [] ,
: [registry],
}),
: ({
: ,
: ,
: [] ,
: [registry],
}),
};
{ registry };