OpenTelemetry (OTLP)
Point an OTLP/HTTP exporter or collector at axonpush to send spans and log records, authenticated with a publish key or a public ingest token.
axonpush accepts OTLP over HTTP for traces and logs. If your app already uses OpenTelemetry, or runs an OpenTelemetry Collector, this is the least invasive way to get spans and logs in: add one exporter, keep your instrumentation.
| Method | Path | Body |
|---|---|---|
POST | /v1/traces | ExportTraceServiceRequest |
POST | /v1/logs | ExportLogsServiceRequest |
OTLP metrics (/v1/metrics) and OTLP/gRPC are not accepted. Use OTLP/HTTP.
Set it up
You need a credential. In the dashboard, open Integrations. Under
Send observations, expand Set up by hand and click
Create a publish key: that mints an ak_ key with only the
events:publish scope. The OpenTelemetry card on the same page shows the
traces endpoint, the logs endpoint and ready-to-copy env vars and Collector
config. See API keys for binding a key to one app or
environment.
export OTEL_EXPORTER_OTLP_ENDPOINT="https://api.axonpush.xyz"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_HEADERS="X-API-Key=$AXONPUSH_API_KEY"Set the endpoint to the bare API host. OTLP exporters append /v1/traces and
/v1/logs themselves. If you self-host, use your own API host instead of
https://api.axonpush.xyz.
Merge the exporter into your existing Collector pipelines rather than replacing them, and read the key from your secret store.
Check it worked
Send an empty export and read the routing headers on the response:
curl -si -X POST https://api.axonpush.xyz/v1/traces \
-H "X-API-Key: $AXONPUSH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"resourceSpans":[]}' | grep -i x-axonpush-resolvedWith a key bound to an environment you see:
x-axonpush-resolved-environment: prod
x-axonpush-resolved-via: apiKeyThe publish key from Integrations is not bound to an environment, so it
answers x-axonpush-resolved-via: default and its data goes to the org’s
default environment (see the table below). Then open Traces in the dashboard, or read them back with
GET /traces.
Credentials
The OTLP endpoints accept two kinds of credential.
| Credential | Header | Also accepted as |
|---|---|---|
API key (ak_) with events:publish | X-API-Key | X-Axonpush-Api-Key, Authorization: Bearer ak_... |
Public ingest token (pt_) | X-Public-Token | Authorization: Bearer pt_... |
An API key without events:publish gets 403 events:publish scope required.
Keep ak_ keys on your servers. For browser or mobile code, use a
public ingest token, which can only write to
the one channel and environment it was minted for.
Where the data lands
Every OTLP request resolves to one app, one channel and one environment before anything is stored.
App and channel. With an API key and no channel header, spans go to a
channel named otlp-traces and logs to otlp-logs. Both are created on first
use inside the key’s app. A key that is not bound to an app uses an app named
OTLP, also created on first use. To pick a channel yourself, send its ID in
X-Axonpush-Channel; it must belong to the key’s app. A public token always
writes to its own channel; naming a different one is a 403.
Environment. The rules, as the handler applies them:
| Credential | X-Axonpush-Environment | Result | x-axonpush-resolved-via |
|---|---|---|---|
| API key bound to an environment | none, or that same environment | The key’s environment | apiKey |
| API key bound to an environment | a different environment | 400 environment override forbidden | |
| Public token | none, or its own environment | The token’s environment | publicToken |
| Public token | a different environment | 400 environment override forbidden | |
| Unbound API key | a slug or ID | That environment | header |
| Unbound API key | none | The org’s default environment | default |
The header takes an environment slug or ID. An unknown or deleted environment
is 400 unknown environment. In the default case the
x-axonpush-resolved-environment header is not sent, because the default is
picked when the record is stored. See
Apps, channels and environments.
What gets stored
Each span becomes one app.span event and each log record one app.log
event in the events table, with source: "otlp".
Span name, kind, start and end times, status, events, links, attributes,
resource attributes and instrumentation scope are kept. Log records keep body,
severity, event name, trace and span IDs. If a log record has no log.level
attribute, axonpush adds one from the severity number (trace, debug,
info, warn, error or fatal).
Every attribute you set becomes queryable as a custom dimension. Your organisation’s telemetry policy is applied before anything is indexed, but it is a second layer: keep prompts, secrets and personal data out of span attributes at the source.
Limits and behaviour
- Bodies may be
application/x-protobuf(the default whenContent-Typeis anything else) orapplication/json. The response uses the same encoding. Content-Encoding: gzipis supported. Both the raw and the decompressed body are capped at 6 MB; over that is413.- An empty body is
400, and so is a body that does not decode as OTLP. - Records are written one at a time. If storage fails partway through, the
request returns
503 telemetry acceptance unavailableand records already written stay written. Retrying is safe: each record is deduplicated on a hash of its type, trace ID, span ID and content. - On axonpush cloud, an organisation over its plan’s limits gets a plain-text
402or429with the reason. Self-hosted installs have no plan gate. - A
200means the batch was accepted, not that it is already visible. Check for your spans with a trace read before you rely on them.
Avoid exporting the same model call twice, for example through both an OpenTelemetry exporter and an axonpush SDK integration. Both copies are stored, and token and cost totals double.
Related
- Python OpenTelemetry, TypeScript OpenTelemetry, .NET OpenTelemetry
- Sentry SDKs, if you already run Sentry
- What we receive
- Traces