Send data

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.

MethodPathBody
POST/v1/tracesExportTraceServiceRequest
POST/v1/logsExportLogsServiceRequest

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-resolved

With a key bound to an environment you see:

x-axonpush-resolved-environment: prod
x-axonpush-resolved-via: apiKey

The 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.

CredentialHeaderAlso accepted as
API key (ak_) with events:publishX-API-KeyX-Axonpush-Api-Key, Authorization: Bearer ak_...
Public ingest token (pt_)X-Public-TokenAuthorization: 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:

CredentialX-Axonpush-EnvironmentResultx-axonpush-resolved-via
API key bound to an environmentnone, or that same environmentThe key’s environmentapiKey
API key bound to an environmenta different environment400 environment override forbidden
Public tokennone, or its own environmentThe token’s environmentpublicToken
Public tokena different environment400 environment override forbidden
Unbound API keya slug or IDThat environmentheader
Unbound API keynoneThe org’s default environmentdefault

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 when Content-Type is anything else) or application/json. The response uses the same encoding.
  • Content-Encoding: gzip is supported. Both the raw and the decompressed body are capped at 6 MB; over that is 413.
  • 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 unavailable and 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 402 or 429 with the reason. Self-hosted installs have no plan gate.
  • A 200 means 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.