- Create metrics derived from traces (e.g., span counts) without changing instrumented applications.
- Translate signals inside the collector to power downstream monitoring (Prometheus, remote write, etc.).
- Implement lightweight transformations or aggregations between pipelines.
count. The connector receives traces from the traces pipeline and emits metrics into the metrics pipeline.
Prometheus remote write + debug exporters
Below is an exporter configuration that sends metrics to Prometheus remote write and also prints output via the debug exporter for visibility:
- Traces enter the
tracespipeline via theotlpreceiver (OTLP protocol). - The
tracespipeline applies processors (attributes, batch) and exports traces to configured exporters (e.g., debug, Jaeger). - Because
countis listed as an exporter on thetracespipeline, the connector also receives the trace data there. - The connector implements counting logic and emits a metric (for example,
trace.span.count) representing the number of spans observed. - Since
countis also listed as a receiver on themetricspipeline, the generated metric is ingested and processed by the metrics pipeline and forwarded to exporters such as Prometheus remote write and debug.
| Connector role | Pipeline placement | Purpose |
|---|---|---|
| Exporter (source) | service.pipelines.traces.exporters | Receives traces from the traces pipeline and performs conversion/aggregation. |
| Receiver (destination) | service.pipelines.metrics.receivers | Accepts the emitted metric into the metrics pipeline for further processing/export. |
The connector functions as an exporter on the source pipeline and as a receiver on the destination pipeline. That dual role is why it must be listed in both places.
debug exporter prints the generated metric. Example debug output (abbreviated) showing trace.span.count with value 5:
- Ensure the connector name is registered both as an exporter for the source pipeline and as a receiver for the destination pipeline; omitting either registration breaks the flow.
- Use the
debugexporter when testing to validate that the generated metrics look correct before sending them to a production backend. - Consider aggregation temporality and monotonicity: this example produces a monotonic sum with delta temporality; choose semantics that match your monitoring needs.
- If you translate high-volume signals into metrics, review resource and cardinality implications to avoid metric explosion.
Be careful to register the connector name both where it should act as an exporter (source pipeline) and where it should act as a receiver (destination pipeline). Omitting either will break the flow.
- OpenTelemetry Collector: Connectors
- OpenTelemetry Collector Documentation
- OTLP protocol specification
- Prometheus remote write configuration
- Jaeger Tracing