Ingest traces (OTLP)
Changed onAccepts OTLP/HTTP JSON or protobuf. The span fields accepted by POST /api/request-logs/ are not valid here. The Sample two-span trace example creates a workflow root span and one chat child span. Before rerunning it, replace traceId and spanId with new 32-hex and 16-hex IDs to create a separate trace.
For SDK setup, see the Tracing quickstart or the OpenTelemetry integration, which configures the exporter automatically.
Request
- Base URLhttps://api.respan.ai
- URLhttps://api.respan.ai/api/v2/traces
- AuthHTTP bearer
Request body
Example request
{
"resourceSpans": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "my-service"
}
}
]
},
"scopeSpans": [
{
"scope": {
"name": "manual",
"version": "1.0.0"
},
"spans": [
{
"traceId": "0af7651916cd43dd8448eb211c80319c",
"spanId": "b7ad6b7169203332",
"name": "my-operation",
"startTimeUnixNano": "1700000000000000000",
"endTimeUnixNano": "1700000001000000000",
"status": {
"code": 1
},
"attributes": [
{
"key": "gen_ai.request.model",
"value": {
"stringValue": "gpt-4"
}
}
]
}
]
}
]
}
]
}Response
Spans accepted.
Changes
- breaking
request body became required
- breaking
removed the enum value
1of the request property/////// - breaking
removed the enum value
2of the request property/////// - breaking
the
///////request property type changed fromstringtointeger - info
api operation id
traces_createTraceremoved and replaced withcreateTrace - info
api tag
Tracesadded - info
api tag
tracesremoved - info
added the new
1.00enum value to the request property/////// - info
added the new
2.00enum value to the request property///////
- breaking
- warning
removed the optional property
from the response with the status - info
added the non-success response with the status
- info
removed the non-success response with the status
- info
added the required property
to the response with the status
- warning