Skip to content

OTLP & Grafana Cloud

Klag speaks OTLP (OpenTelemetry Protocol) over HTTP, so it works with Grafana Cloud, New Relic, and any OTLP-compatible metrics backend.

Terminal window
METRICS_REPORTER=otlp
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
OTEL_SERVICE_NAME=klag

Protocol is HTTP only (port 4318) and aggregation temporality is cumulative.

Terminal window
METRICS_REPORTER=otlp
OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-us-east-0.grafana.net/otlp
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic <base64-encoded-credentials>
OTEL_SERVICE_NAME=klag-production
Terminal window
METRICS_REPORTER=otlp
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
OTEL_SERVICE_NAME=klag-dev
OTEL_RESOURCE_ATTRIBUTES=environment=development,cluster=local

Klag honours the standard OTEL_* variables and also provides custom OTLP_* overrides:

StandardCustom overridePurpose
OTEL_EXPORTER_OTLP_ENDPOINTOTLP_ENDPOINTEndpoint URL.
OTEL_METRIC_EXPORT_INTERVALOTLP_STEP_MSExport interval (ms).
OTEL_EXPORTER_OTLP_HEADERSOTLP_HEADERSAuth headers (key1=value1,key2=value2).
OTEL_RESOURCE_ATTRIBUTESOTLP_RESOURCE_ATTRIBUTESResource attributes.

OTEL_EXPORTER_OTLP_METRICS_ENDPOINT / OTEL_EXPORTER_OTLP_METRICS_HEADERS override the base endpoint/headers for metrics specifically. The custom OTLP_* variables take precedence over the OTEL_* ones. See the full Configuration Reference.