Skip to main content
skill CX Codex

monitoring-expert — Claude Code skill: metrics, logs, tracing

A skill that walks your agent through setting up metrics, structured logs, tracing and alerts. Useful when production is slow and you need to find out why.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Jeffallan/claude-skills --skill monitoring-expert -a claude-code
Open on GitHub

What monitoring-expert does

The skill runs a five-step workflow: work out what to monitor (SLIs, critical paths, business metrics), instrument the app, configure collection and storage, then build dashboards and alerts. Collection comes before visualization on purpose — if data never arrives, the dashboard shows nothing.

It ships with Node.js examples: structured logging via Pino, counters and histograms with prom-client, OpenTelemetry spans exported to Jaeger at http://jaeger:4318/v1/traces, a Prometheus alert rule on the 5xx ratio, and a k6 load test with p95 and error-rate thresholds. Dashboards follow the RED and USE methods. Topic references live under references/ — logging, metrics, tracing, alerting, profiling, capacity planning — and the agent pulls the one it needs.

Hard rules are spelled out too: never log passwords, tokens or PII, don't alert on every error, don't build log lines by string interpolation. In a distributed system, missing correlation IDs make incident triage pointless — the skill treats that as a requirement, not a suggestion.

What it helps with

  • add metrics and log collection to a new service
  • build a dashboard using the RED or USE method
  • write an alert rule for a rising error ratio
  • run a k6 load test and set thresholds
  • find a CPU or memory bottleneck through profiling

Example prompts for the agent

  • Add structured Pino logging and a request counter with prom-client to our Node.js service
  • Set up OpenTelemetry trace export to Jaeger and wrap order processing in a span
  • Write a Prometheus alert rule for a 5xx ratio above 5% sustained for two minutes

How to install monitoring-expert

1Skills CLI (Vercel)

npx skills add Jeffallan/claude-skills --skill monitoring-expert -a claude-code

2Manually: put the files in place

~/.claude/skills/monitoring-expert/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/monitoring-expert/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about monitoring-expert

How do I install monitoring-expert in Claude Code?

Run npx skills add Jeffallan/claude-skills --skill monitoring-expert -a claude-code. The skill lands in ~/.claude/skills/monitoring-expert/SKILL.md.

What does monitoring-expert do?

It guides the agent through setting up service monitoring: structured logs, Prometheus metrics, OpenTelemetry tracing, Grafana dashboards and alert rules. It also covers load testing, profiling and capacity planning.

Which tools does the skill assume?

The examples target Node.js: Pino for logs, prom-client for metrics, the OpenTelemetry SDK for traces, k6 for load tests. Per-topic references sit in references/.

Source text

SKILL.md · MIT
---
name: monitoring-expert
description: Configures monitoring systems, implements structured logging pipelines, creates Prometheus/Grafana dashboards, defines alerting rules, and instruments distributed tracing. Implements Prometheus/Grafana stacks, conducts load testing, performs application profiling, and plans infrastructure capacity. Use when setting up application monitoring, adding observability to services, debugging production issues with logs/metrics/traces, running load tests with k6 or Artillery, profiling CPU/memory bottlenecks, or forecasting capacity needs.
license: MIT
metadata:
  author: https://github.com/Jeffallan
  company: https://synergetic.solutions
  version: "1.1.0"
  domain: devops
  triggers: monitoring, observability, logging, metrics, tracing, alerting, Prometheus, Grafana, DataDog, APM, performance testing, load testing, profiling, capacity planning, bottleneck
  role: specialist
  scope: implementation
  output-format: code
  related-skills: devops-engineer, debugging-wizard, architecture-designer
---

# Monitoring Expert

Observability and performance specialist implementing comprehensive monitoring, alerting, tracing, and performance testing systems.

## Core Workflow

1. **Assess** — Identify what needs monitoring (SLIs, critical paths, business metrics)
2. **Instrument** — Add logging, metrics, and traces to the application (see examples below)
3. **Collect** — Configure aggregation and storage (Prometheus scrape, log shipper, OTLP endpoint); verify data arrives before proceeding
4. **Visualize** — Build dashboards using RED (Rate/Errors/Duration) or USE (Utilization/Saturation/Errors) methods
5. **Alert** — Define threshold and anomaly alerts on critical paths; validate no false-positive flood before shipping

## Quick-Start Examples

### Structured Logging (Node.js / Pino)
```js
import pino from 'pino';

const logger = pino({ level: 'info' });

// Good — structured fields, includes correlation ID
logger.info({ requestId: req.id, userId: req.user.id, durationMs: elapsed }, 'order.created');

// Bad — string interpolation, no correlation
console.log(`Order created for user ${userId}`);
```

### Prometheus Metrics (Node.js)
```js
import { Counter, Histogram, register } from 'prom-client';

const httpRequests = new Counter({
  name: 'http_requests_total',
  help: 'Total HTTP requests',
  labelNames: ['method', 'route', 'status'],
});

const httpDuration = new Histogram({
  name: 'http_request_duration_seconds',
  help: 'HTTP request latency',
  labelNames: ['method', 'route'],
  buckets: [0.05, 0.1, 0.3, 0.5, 1, 2, 5],
});

// Instrument a route
app.use((req, res, next) => {
  const end = httpDuration.startTimer({ method: req.method, route: req.path });
  res.on('finish', () => {
    httpRequests.inc({ method: req.method, route: req.path, status: res.statusCode });
    end();
  });
  next();
});

// Expose scrape endpoint
app.get('/metrics', async (req, res) => {
  res.set('Content-Type', register.contentType);
  res.end(await register.metrics());
});
```

### OpenTelemetry Tracing (Node.js)
```js
import { NodeSDK } from '@opentelemetry/sdk-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { trace } from '@opentelemetry/api';

const sdk = new NodeSDK({
  traceExporter: new OTLPTraceExporter({ url: 'http://jaeger:4318/v1/traces' }),
});
sdk.start();

// Manual span around a critical operation
const tracer = trace.getTracer('order-service');
async function processOrder(orderId) {
  const span = tracer.startSpan('order.process');
  span.setAttribute('order.id', orderId);
  try {
    const result = await db.saveOrder(orderId);
    span.setStatus({ code: SpanStatusCode.OK });
    return result;
  } catch (err) {
    span.recordException(err);
    span.setStatus({ code: SpanStatusCode.ERROR });
    throw err;
  } finally {
    span.end();
  }
}
```

### Prometheus Alerting Rule
```yaml
groups:
  - name: api.rules
    rules:
      - alert: HighErrorRate
        expr: |
          rate(http_requests_total{status=~"5.."}[5m])
          / rate(http_requests_total[5m]) > 0.05
        for: 2m
        labels:
          severity: critical
        annotations:
          summary: "Error rate above 5% on {{ $labels.route }}"
```

### k6 Load Test
```js
import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '1m', target: 50 },   // ramp up
    { duration: '5m', target: 50 },   // sustained load
    { duration: '1m', target: 0 },    // ramp down
  ],
  thresholds: {
    http_req_duration: ['p(95)<500'],  // 95th percentile < 500 ms
    http_req_failed:   ['rate<0.01'],  // error rate < 1%
  },
};

export default function () {
  const res = http.get('https://api.example.com/orders');
  check(res, { 'status is 200': (r) => r.status === 200 });
  sleep(1);
}
```

## Reference Guide

Load detailed guidance based on context:

| Topic | Reference | Load When |
|-------|-----------|-----------|
| Logging | `references/structured-logging.md` | Pino, JSON logging |
| Metrics | `references/prometheus-metrics.md` | Counter, Histogram, Gauge |
| Tracing | `references/opentelemetry.md` | OpenTelemetry, spans |
| Alerting | `references/alerting-rules.md` | Prometheus alerts |
| Dashboards | `references/dashboards.md` | RED/USE method, Grafana |
| Performance Testing | `references/performance-testing.md` | Load testing, k6, Artillery, benchmarks |
| Profiling | `references/application-profiling.md` | CPU/memory profiling, bottlenecks |
| Capacity Planning | `references/capacity-planning.md` | Scaling, forecasting, budgets |

## Constraints

### MUST DO
- Use structured logging (JSON)
- Include request IDs for correlation
- Set up alerts for critical paths
- Monitor business metrics, not just technical
- Use appropriate metric types (counter/gauge/histogram)
- Implement health check endpoints

### MUST NOT DO
- Log sensitive data (passwords, tokens, PII)
- Alert on every error (alert fatigue)
- Use string interpolation in logs (use structured fields)
- Skip correlation IDs in distributed systems

Maintained by [@jeffallan](https://github.com/jeffallan), Principal Consultant at [Synergetic Solutions](https://synergetic.solutions)

[Documentation](https://jeffallan.github.io/claude-skills/skills/devops/monitoring-expert/)

© https://github.com/Jeffallan · MIT · Jeffallan/claude-skills

Similar skills

All skills for DevOps and infrastructure →

From the same set67

The whole set →
java-architect Build Spring Boot services, implement reactive endpoints, tune JPA queries, and configure OAuth2 or JWT security with a skill that guides implementation and testing. CX Codex +1 6,000installs code-documenter Creates and validates code documentation, API specs, and guides. Use it when adding docstrings, JSDoc, OpenAPI files, or documentation sites. CX Codex +1 5,700installs pandas-pro Skill for efficient pandas work: data cleaning, aggregation, table joins, time series. Useful if you manipulate DataFrames often and want to skip indexing errors and row loops. CX Codex +1 5,700installs nextjs-developer Configures Next.js 14+ application architecture using App Router, React Server Components, and Server Actions. Useful when setting up SSR streaming, SEO metadata, and Vercel deployments. CX Codex +1 5,800installs fullstack-guardian Builds security-focused full-stack web features across frontend and backend layers. Useful for shipping authenticated APIs, CRUD forms, and database flows. CX Codex +1 5,600installs prompt-engineer A skill that writes, refactors and tests LLM prompts: templates, JSON schemas, scoring rubrics, test suites. Useful when model output is inconsistent and you need to know why. CX Codex +1 5,600installs react-expert A skill for React 18+, Next.js App Router, and create-react-app work. It writes components and hooks, debugs rendering, and migrates class components to functions. CX Codex +1 5,500installs terraform-engineer Skill for writing and managing infrastructure with Terraform. Designs reusable modules, configures remote state, validates code, and safely applies changes across AWS, Azure, and GCP. CX Codex +1 5,400installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor