Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/customerio-observability

@0d57af8
Run it yourself

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".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/customerio-observability

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesimplementation.md

≈952 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Customer.io Observability - Implementation Details

Configuration

Structured Logging for All CIO Operations

import pino from 'pino';

const logger = pino({ name: 'customerio', level: process.env.LOG_LEVEL ?? 'info' });

function logCioCall(op: string, userId: string, duration: number, ok: boolean, meta?: any) {
  const entry = { service: 'customerio', op, userId, duration_ms: duration, success: ok, ...meta };
  ok ? logger.info(entry, `CIO ${op} OK`) : logger.error(entry, `CIO ${op} FAILED`);
}

Advanced Patterns

Prometheus Metrics Instrumentation

import { Counter, Histogram, Gauge } from 'prom-client';

const cioRequests = new Counter({
  name: 'customerio_requests_total',
  help: 'Total Customer.io API requests',
  labelNames: ['operation', 'status'],
});

const cioLatency = new Histogram({
  name: 'customerio_request_duration_seconds',
  help: 'Customer.io request latency',
  labelNames: ['operation'],
  buckets: [0.05, 0.1, 0.25, 0.5, 1, 2.5, 5],
});

const cioQueueDepth = new Gauge({
  name: 'customerio_queue_depth',
  help: 'Number of pending CIO events in queue',
});

export async function instrumentedTrack(userId: string, event: string, data: any) {
  const end = cioLatency.startTimer({ operation: 'track' });
  try {
    await cio.track(userId, { name: event, data });
    cioRequests.inc({ operation: 'track', status: 'success' });
  } catch (err) {
    cioRequests.inc({ operation: 'track', status: 'error' });
    throw err;
  } finally {
    end();
  }
}

Alerting Rules

# prometheus-alerts.yml
groups:
  - name: customerio
    rules:
      - alert: CioHighErrorRate
        expr: >
          rate(customerio_requests_total{status="error"}[5m])
          / rate(customerio_requests_total[5m]) > 0.05
        for: 5m
        labels: { severity: warning }
        annotations:
          summary: "Customer.io error rate above 5%"
      - alert: CioHighLatency
        expr: >
          histogram_quantile(0.95,
            rate(customerio_request_duration_seconds_bucket[5m])
          ) > 2
        for: 5m
        labels: { severity: warning }
        annotations:
          summary: "Customer.io p95 latency above 2s"
      - alert: CioQueueBacklog
        expr: customerio_queue_depth > 1000
        for: 10m
        labels: { severity: critical }
        annotations:
          summary: "Customer.io event queue backlog exceeding 1000"

Grafana Dashboard JSON (Key Panels)

{
  "title": "Customer.io Operations",
  "panels": [
    {
      "title": "Request Rate",
      "type": "timeseries",
      "targets": [{ "expr": "rate(customerio_requests_total[5m])" }]
    },
    {
      "title": "Error Rate %",
      "type": "stat",
      "targets": [{ "expr": "rate(customerio_requests_total{status='error'}[5m]) / rate(customerio_requests_total[5m]) * 100" }]
    },
    {
      "title": "Latency P50 / P95 / P99",
      "type": "timeseries",
      "targets": [
        { "expr": "histogram_quantile(0.5, rate(customerio_request_duration_seconds_bucket[5m]))", "legendFormat": "p50" },
        { "expr": "histogram_quantile(0.95, rate(customerio_request_duration_seconds_bucket[5m]))", "legendFormat": "p95" },
        { "expr": "histogram_quantile(0.99, rate(customerio_request_duration_seconds_bucket[5m]))", "legendFormat": "p99" }
      ]
    }
  ]
}

Troubleshooting

Checking Metrics Locally

# Verify metrics endpoint
curl -s localhost:9090/metrics | grep customerio

# Quick error rate check
curl -s localhost:9090/api/v1/query?query='rate(customerio_requests_total{status="error"}[5m])' | jq '.data.result'

Tons of Skills by Intent Solutions | jeremylongshore.com

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides comprehensive instructions for implementing observability in Customer.io integrations, including metrics, structured logging with PII redaction, and alerting. It includes good security practices by explicitly redacting sensitive fields like emails and passwords. However, a potential attack surface for indirect prompt injection is identified because the skill processes data from external API responses and webhooks.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
What it can do
Reads files Edits files Runs commands
version
1.14.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "customer-io",
  "monitoring",
  "observability",
  "prometheus"
]
All 7 allowed tools
ReadWriteEditBash(npm:*)Bash(npx:*)GlobGrep
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/customerio-observability