Trace exports
Send a trace span for every request to Langfuse, Datadog or any OpenTelemetry backend.
Trace exports send each recorded request to your own observability tools as an OpenTelemetry span over OTLP/HTTP. One protocol covers Langfuse, Datadog, Honeycomb, Grafana, New Relic, Axiom and any OpenTelemetry Collector.
Only metadata is exported: the model, token counts, cost, timing, outcome, and the customer, member and key. Hixel never stores prompts or responses, so it never exports them.
Add a destination#
An environment has up to 3 destinations. Add one in the dashboard under Developers → Trace exports, or:
curl https://api.hixel.dev/v1/trace_export_destinations \
-H "Authorization: Bearer $HIXEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://cloud.langfuse.com/api/public/otel/v1/traces",
"label": "Langfuse",
"headers": [
{ "name": "Authorization", "value": "Basic <base64 of public_key:secret_key>" },
{ "name": "x-langfuse-ingestion-version", "value": "4" }
]
}'const destination = await hixel.traceExportDestinations.create({
url: "https://cloud.langfuse.com/api/public/otel/v1/traces",
label: "Langfuse",
headers: [
{ name: "Authorization", value: "Basic <base64 of public_key:secret_key>" },
{ name: "x-langfuse-ingestion-version", value: "4" },
],
});urlis the full OTLP/HTTP traces endpoint (usually ending in/v1/traces), sent to exactly as given. It must behttps://on a public host name.headerscarry your vendor's credentials: at most 8. Their values are stored encrypted, sent only to this URL, and never returned (a read shows the last four characters of a long value). Changing the URL requires sending the headers again, so a credential never goes to a URL it was not given for.- Spans are sent as JSON (
application/json), not protobuf. Check that your endpoint accepts OTLP/HTTP JSON.
POST /v1/trace_export_destinations/{id}/test sends one test span now and tells you how the
destination answered. GET, PATCH and DELETE on /v1/trace_export_destinations/{id} read,
change and remove a destination.
What a span holds#
One span per recorded request, sent within about a minute. Spans follow the OpenTelemetry GenAI
conventions where they can, with Hixel's own fields under hixel.:
- name
{operation} {model}, such aschat claude-sonnet; kindCLIENT; start and end from the request's start and duration; statusERRORwhen the request did not complete; gen_ai.operation.name,gen_ai.provider.name,gen_ai.request.model,gen_ai.usage.input_tokens,gen_ai.usage.output_tokensand the cache token counts;user.idset to your customer id,hixel.customer,hixel.member,hixel.key_id,hixel.tags;hixel.request_id(thex-hixel-request-id),hixel.cost_micros,hixel.billed_micros,hixel.payer,hixel.outcome,hixel.attempts,hixel.cached,hixel.mocked.
The trace and span ids are derived from the usage record, so a span sent twice is recognisably
the same span. Your own traceparent is not carried through; correlate on hixel.request_id.
Delivery#
Spans go out in batches of up to 200, retried with backoff on 408, 429, 502, 503, 504 and timeouts,
for up to 72 hours. Any other error drops that batch. A destination that fails for a day is
disabled; PATCH it with {"enabled": true} to resume. A read shows its counts
(exported_spans, failed_spans, dropped_spans) and its last error.
Requests refused before reaching a provider have no usage record and no span.