OTLP & Grafana Cloud
Klag speaks OTLP (OpenTelemetry Protocol) over HTTP, so it works with Grafana Cloud, New Relic, and any OTLP-compatible metrics backend.
Enable
Section titled “Enable”METRICS_REPORTER=otlpOTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318OTEL_SERVICE_NAME=klagProtocol is HTTP only (port 4318) and aggregation temporality is cumulative.
Grafana Cloud
Section titled “Grafana Cloud”METRICS_REPORTER=otlpOTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-us-east-0.grafana.net/otlpOTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic <base64-encoded-credentials>OTEL_SERVICE_NAME=klag-productionLocal OpenTelemetry Collector
Section titled “Local OpenTelemetry Collector”METRICS_REPORTER=otlpOTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318OTEL_SERVICE_NAME=klag-devOTEL_RESOURCE_ATTRIBUTES=environment=development,cluster=localConfiguration variables
Section titled “Configuration variables”Klag honours the standard OTEL_* variables and also provides custom OTLP_*
overrides:
| Standard | Custom override | Purpose |
|---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | OTLP_ENDPOINT | Endpoint URL. |
OTEL_METRIC_EXPORT_INTERVAL | OTLP_STEP_MS | Export interval (ms). |
OTEL_EXPORTER_OTLP_HEADERS | OTLP_HEADERS | Auth headers (key1=value1,key2=value2). |
OTEL_RESOURCE_ATTRIBUTES | OTLP_RESOURCE_ATTRIBUTES | Resource 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.