What do the `spanmetrics` and `servicegraph` connectors do?
AdvancedConceptTracing & OpenTelemetry
Answer
Both turn traces into Prometheus-style metrics inside the Collector.
spanmetrics: emits request counts and duration histograms perservice.name, span name, kind and status: instant RED metrics for every instrumented service.servicegraph: pairs CLIENT and SERVER spans (or PRODUCER/CONSUMER) to emit edge metrics liketraces_service_graph_request_total{client="orders",server="payments"}, which power a service map.
connectors:
spanmetrics:
histogram:
explicit: { buckets: [50ms, 100ms, 250ms, 500ms, 1s, 2s, 5s] }
dimensions:
- name: http.request.method
service:
pipelines:
traces: { receivers: [otlp], exporters: [spanmetrics, otlp/tempo] }
metrics: { receivers: [spanmetrics], exporters: [prometheusremotewrite] }
They must run before sampling, or the metrics are biased. Tempo's metrics-generator offers the same features server side.
More on Tracing & OpenTelemetry
What is distributed tracing, and what are a trace, a span and a span context?BeginnerWhat fields does an OpenTelemetry span carry?BeginnerWhat are span kinds and why do they matter?IntermediateWhat does the W3C `traceparent` header look like?IntermediateWhat is baggage, and how is it different from span attributes?IntermediateWhat is OpenTelemetry and what are its main parts?Beginner