Enable the spanmetrics connector in the OpenTelemetry Collector to generate RED metrics from trace spans

domain: opentelemetry.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Add the spanmetrics connector to the connectors section of the Collector config; specify dimensions to extract as metric labels (e.g., http.method, http.status_code, service.name)
  2. Wire the connector so it receives trace data from a traces pipeline output and emits metrics to a metrics pipeline input; in the pipelines section the traces pipeline lists spanmetrics in its exporters and the metrics pipeline lists spanmetrics in its receivers
  3. Configure the histogram block to choose between explicit bucket boundaries (latency buckets in milliseconds) or exponential histograms for higher-fidelity quantile estimation
  4. Set the metrics_flush_interval to control how often accumulated span metrics are emitted downstream; align this with your scrape interval if exporting to Prometheus
  5. Add a Prometheus exporter or remote_write exporter in the metrics pipeline to forward the generated calls_total and duration histogram metrics to your metrics backend
  6. Validate the output by querying for otelcol_spanmetrics_calls_total or your configured namespace prefix in Prometheus or your metrics backend

Known gotchas

Related routes

Generate RED metrics from trace spans using the OTel Collector spanmetrics connector
opentelemetry.io · 6 steps · unrated
Generate span metrics from traces using the OTel Collector spanmetrics connector
opentelemetry.io · 5 steps · unrated
Configure the OTel Collector spanmetrics connector with explicit histogram bucket boundaries and dimension overrides
opentelemetry.io · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans