Opentelemetry Instrumentation

Instrument a service with OpenTelemetry: OTLP export, semantic conventions, the key spans and metrics, a sampling strategy (head vs tail), cardinality control, and trace/log correlation via propagated context.

mcorbett51090 Updated

File contents

OpenTelemetry Instrumentation

Purpose: make a service observable, vendor-neutrally.

Emit OTLP, route in the collector

App code emits OTLP to a collector; the collector routes to the backend. Don't bind app code to a vendor SDK.

Semantic conventions

Use standard attribute names (http.route, service.name, db.system). Portable + queryable.

Cardinality

High-cardinality identifiers (user-id, request-id) -> spans/logs, never metric labels. A metric label with unbounded values explodes the TSDB.

Sampling

  • Head sampling: decide at span start — cheap, blind.
  • Tail sampling: keep errored/slow traces — pricier, smarter.

Correlate

Propagate trace context so a metric anomaly -> exemplar trace -> request logs.

mcorbett51090/RavenClaude commit 6106743244

Frequently asked questions

npx get-skill add mcorbett51090/opentelemetry-instrumentation