curl and raw JSON
No SDK required. Two formats, same store, same response contract.
Native JSON
A bare array of spans, or {"spans": [...]}. Times are Unix nanoseconds.
curl -s https://api.trazadb.com/v1/spans \
-H "Authorization: Bearer $TRAZA_API_KEY" \
-H 'Content-Type: application/json' \
-d '[{
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736", "span_id": "llm-1",
"name": "openai.chat", "service": "support-agent", "status": "ok",
"start_time_unix_nano": 1792062221000000000,
"end_time_unix_nano": 1792062221820000000,
"attributes": {
"session.id": "sess-42",
"gen_ai.operation.name": "chat",
"gen_ai.request.model": "gpt-4o-2024-08-06",
"gen_ai.usage.input_tokens": 412,
"gen_ai.usage.output_tokens": 23,
"gen_ai.prompt.0.role": "user",
"gen_ai.prompt.0.content": "Where is order 1042?",
"gen_ai.completion.0.role": "assistant",
"gen_ai.completion.0.content": "It shipped on October 14."
}
}]'
{"accepted":1,"durability":"wal"}
A batch is atomic: one invalid span stores none of them, and the 400 names
the span and the reason. The data model
defines every field.
OTLP/HTTP JSON
curl -s https://api.trazadb.com/v1/traces \
-H "Authorization: Bearer $TRAZA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"resourceSpans":[{
"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"support-agent"}}]},
"scopeSpans":[{"spans":[{
"traceId":"5b8efff798038103d269b633813fc60c","spanId":"eee19b7ec3c1b174",
"name":"search_orders.tool",
"startTimeUnixNano":"1792062222000000000","endTimeUnixNano":"1792062222300000000",
"attributes":[{"key":"session.id","value":{"stringValue":"sess-42"}},
{"key":"gen_ai.tool.name","value":{"stringValue":"search_orders"}}]
}]}]}]}'
{"partialSuccess":{}}
Compressed
Both routes accept Content-Encoding: gzip:
gzip -c batch.json | curl -s https://api.trazadb.com/v1/spans \
-H "Authorization: Bearer $TRAZA_API_KEY" \
-H 'Content-Type: application/json' -H 'Content-Encoding: gzip' \
--data-binary @-
Watching it arrive
curl -sN https://api.trazadb.com/v1/tail -H "Authorization: Bearer $TRAZA_API_KEY"
Live tail streams spans as they are admitted, as server-sent events, to a
read or full key.