/polymath-observability:tracing-strategy-otelfrom polymath-observability
Design an OpenTelemetry tracing strategy — sampling, attribute discipline, span hygiene, context propagation, baggage, cost-aware exporter config.
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.
Trace what matters at a sampling rate you can afford. Output is a service's tracing plan.
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.
[TBD: request rate], and the cost target stays a formula).ParentBased(TraceIdRatioBased(0.1)) keeps 10% of root spans, follows the parent decision for children. Cheap, deterministic, predictable cost.HTTP GET /v1/orders/{id}, not getOrder(42)).ERROR only when the span itself failed. Don't propagate child errors upward unless they cause the parent to fail.http.request.method, db.system, service.name, etc.).traceparent / tracestate headers on every outbound call. If you control both sides and have legacy clients, keep b3 headers as a fallback during migration.user_tier is fine; entire user object JSON is not. Strip baggage (and usually tracestate) at calls that leave your trust boundary — third parties receive whatever you propagate.Tracing strategy: refund-service
SDK: OpenTelemetry Go SDK 1.x, auto-instrumented (HTTP server,
HTTP client, database/sql).
Sampling:
App: export 100% to the in-cluster collector (load-balanced by trace ID).
Collector tail sampler: keep 100% of traces with an error or latency > 1s,
10% probabilistic of the rest.
(A 10% head sample in the app would hide 90% of errors from the tail sampler.)
Span hygiene:
Manual spans for: refund_create, downstream.stripe, db.refund_insert.
Span names use route templates, never raw paths with IDs.
Attribute conventions:
Always: service.name, service.version, deployment.environment.
Per span: http.request.method, http.response.status_code,
db.system, db.statement (sanitized).
User-related: user.tier (low cardinality). NEVER user.id as resource.
Propagation: W3C tracecontext only.
Baggage: user.tier only.
Exporter: OTLP/gRPC to in-cluster collector.
Collector → Tempo (traces) + sample to vendor X (errors only).
Cost target: $400/mo at 10% sampling + tail-based error capture.
Sample rate is the cheapest dial to turn if cost grows.
What SKILL.md sets; muted values are Claude Code's defaults
9 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
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-observability