/polymath-observability:metrics-designfrom polymath-observability
Design service metrics using RED (services) and USE (resources) — name, type, labels, cardinality budget; the smallest set that supports the SLO.
Ships in polymath-observability. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Pin RED metrics for services and USE metrics for resources. Output is a labeled metric list with a cardinality budget.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
polymath-sre:slo-design) — absent: design RED/USE and mark the SLI mapping [TBD: SLO].Most services need RED for themselves and USE for the resources they depend on (DB, queue, cache).
http_requests_total{route, method, status} — counter.http_request_duration_seconds{route, method} — histogram.errors_total{route, kind} — counter (kind = validation / upstream / internal).db_pool_in_use, db_pool_wait_seconds, db_errors_total.queue_depth, queue_enqueue_wait_seconds, queue_errors_total.cache_hits_total, cache_requests_total, cache_errors_total (compute the hit ratio in the query — a pre-computed ratio gauge can't be aggregated across instances).route (~20) × method (~5) × status (~10) = 1,000 series per metric. Fine.user_id on a request counter — millions of series. Don't.count by (__name__) checks._seconds histogram: [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5].<thing>_<unit>_total for counters with units, <thing>_seconds for time, no upper-case, no spaces.Metrics design: refund-service
RED (service):
http_requests_total{route, method, status} counter
http_request_duration_seconds{route, method} histogram
buckets (s): 0.005,0.01,0.025,0.05,0.1,0.25,0.5,1,2.5,5
errors_total{route, kind} counter
kind ∈ { validation, upstream, internal }
USE (resources):
db_pool_in_use gauge
db_pool_wait_seconds histogram (buckets s: 0.001,0.005,0.01,0.05,0.1)
db_errors_total counter
stripe_client_errors_total{kind} counter
stripe_client_request_duration_seconds histogram
Cardinality budget:
~5,000 active series. Reviewed monthly.
Forbidden labels: user_id, request_id, order_id (high cardinality).
SLI mapping:
refund-latency SLO → http_request_duration_seconds{route="/refunds"}
refund-availability SLO → 1 - (sum(rate(http_requests_total{route="/refunds",status=~"5.."}[5m]))
/ sum(rate(http_requests_total{route="/refunds"}[5m])))
Anti-cardinality guard:
CI rule: any new metric introducing a forbidden label fails the PR.
everything_total{thing,subthing,subsubthing} — cardinality bomb.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-observability9 skills in this plugin
/author-monitorAuthor a Datadog monitor — query, threshold, evaluation window, no-data behavior, notification routing; pair with polymath-sre:slo-design for SLO burn-rate monitors./dashboard-snapshotCapture a Grafana dashboard snapshot for incident timelines + postmortem evidence — snapshot URL, time range pinned, variables resolved./logging-strategyDefine a service's logging strategy — structured JSON, level discipline, redaction, sampling for noisy paths, cost-aware retention.Other plugins' skills for the same job