Skip to content

OpenTelemetry

sinks:
otlp:
endpoint: http://collector:4318/v1/metrics
service: ghchronicle
headers:
Authorization: Bearer ${OTLP_TOKEN}
raw: false
batch: 2000

OTLP over HTTP with the JSON encoding, which every receiver worth using accepts on the same endpoint. That is a deliberate trade: JSON is larger on the wire, and it keeps a code generator, a protobuf runtime and their transitive dependencies out of a tool whose entire dependency list is one YAML parser.

endpoint is the full URL of the metrics path, not a base. headers go with every request, which is where an API key or a tenant id belongs. service becomes the resource attribute the backend groups by. batch is how many data points go in one request, 2000 unless it is lowered for a receiver with a smaller body limit.

Metric names use dots, following the OpenTelemetry convention: github.workflow.run.duration.seconds. A receiver exporting onward to Prometheus converts them itself; going the other way it cannot.

Sends the same reduced current values as the Prometheus exporter. Safe with any backend, including Prometheus’s own OTLP receiver, because nothing in the payload is older than the sweep.

A gauge asserted once and then never again fades from the dashboards, and a family that runs every twelve hours would be a flat line with a dot in it. With repeat set, the sink keeps asserting the newest value of every series it has seen until the next sweep replaces it.

sinks:
otlp:
endpoint: http://collector:4318/v1/metrics
repeat: 1m

This matters for a backend that answers an instant query from the last sample within a lookback window.

The usual arrangement is a collector that receives from here and exports onward, which is what makes this sink worth having at all: the tool speaks one protocol and the pipeline decides where the data ends up.

receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
exporters:
prometheusremotewrite:
endpoint: http://prometheus:9090/api/v1/write
service:
pipelines:
metrics:
receivers: [otlp]
exporters: [prometheusremotewrite]

With that pipeline, keep raw: false: the exporter at the far end is Prometheus, and the constraint follows the data rather than the protocol.

  • Choosing a store compares OpenTelemetry with the other nine, and holds the write ledger every one of them shares.
  • The dashboards says which of the five is drawn against which store, and what a panel a store cannot answer becomes.