Appearance
OpenTelemetry
Latency speaks OTLP, OpenTelemetry's native protocol. Any OpenTelemetry SDK, agent or Collector can send traces, metrics and logs straight to Latency. No Latency library, no extra container.
Before you start
Create one Stream per signal you want to send, and issue a key for each:
| Signal | Stream type |
|---|---|
| Traces | Traces |
| Metrics | Metrics |
| Logs | Logs |
New to streams? The Quick Start walks through creating one.
Why a key per signal?
Each stream has its own type and retention (keep traces 7 days and logs 30, for example), and each key can write to one stream only. A leaked key can't reach anything else.
Endpoints
| Signal | Endpoint |
|---|---|
| Traces | https://ws.latency.app/v1/telemetry/traces |
| Metrics | https://ws.latency.app/v1/telemetry/metrics |
| Logs | https://ws.latency.app/v1/telemetry/logs |
Latency accepts OTLP over HTTP, as protobuf or JSON, optionally compressed (gzip, deflate, br or zstd). gRPC isn't supported, so always set the protocol to http/protobuf.
Configuration
Every SDK reads the same environment variables. This is the whole setup for most languages:
bash
OTEL_SERVICE_NAME=checkout-api
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://ws.latency.app/v1/telemetry/traces
OTEL_EXPORTER_OTLP_TRACES_HEADERS=authorization=Bearer%20lit_your_traces_key
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://ws.latency.app/v1/telemetry/metrics
OTEL_EXPORTER_OTLP_METRICS_HEADERS=authorization=Bearer%20lit_your_metrics_key
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://ws.latency.app/v1/telemetry/logs
OTEL_EXPORTER_OTLP_LOGS_HEADERS=authorization=Bearer%20lit_your_logs_keyOTEL_SERVICE_NAMEis how your app shows up in Latency. Give every service its own.%20is a space. The header value isBearer lit_..., encoded.- The endpoints are used exactly as written. Don't add
/v1/tracesto them.
Sending only some signals
Turn off what you don't send, so the SDK doesn't try to reach a default endpoint that isn't there:
bash
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORTER=nonePick your language
| Node.js | Express, Fastify, NestJS, Next.js and more, with zero code |
| Deno | Built into the runtime: one environment variable |
| Python | Django, Flask, FastAPI and more, with zero code |
| Go | net/http, gRPC and database drivers |
| PHP | Laravel, Symfony, Slim and more |
| Ruby | Rails, Sinatra and more |
| Collector | Already run a Collector? Add Latency as an exporter |
Metrics settings
Two optional settings get the most out of metrics:
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta(included above) sends "how much since last time" instead of a running total. Totals from many servers then simply add up. Without it, Latency still works it out from the running totals, including restarts.OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=base2_exponential_bucket_histogramsends histograms in the same format Latency stores them in, for the sharpest percentiles. Regular bucketed histograms work too.
Not every SDK reads both. Where one doesn't, the defaults work fine.
Metrics arrive once a minute
SDKs export metrics every 60 seconds by default. Set OTEL_METRIC_EXPORT_INTERVAL=10000 to send every 10 seconds instead.
Something not showing up?
See Troubleshooting.