curl https://otel.agnost.ai/v1/traces \
-X POST \
-H "X-Agnost-Org-ID: $AGNOST_ORG_ID" \
-H "Content-Type: application/json" \
--data-raw '{
"resourceSpans": [{
"resource": {
"attributes": [{
"key": "service.name",
"value": { "stringValue": "support-agent" }
}]
},
"scopeSpans": [{
"scope": { "name": "custom-otel-example" },
"spans": [{
"traceId": "0102030405060708090a0b0c0d0e0f10",
"spanId": "0102030405060708",
"name": "chat.completion",
"startTimeUnixNano": "1700000000000000000",
"endTimeUnixNano": "1700000002000000000",
"attributes": [{
"key": "agnost.user_id",
"value": { "stringValue": "user-42" }
}, {
"key": "agnost.session_id",
"value": { "stringValue": "conversation-abc123" }
}, {
"key": "input",
"value": { "stringValue": "What is the weather in San Francisco?" }
}, {
"key": "output",
"value": { "stringValue": "It is 72°F and sunny." }
}, {
"key": "gen_ai.request.model",
"value": { "stringValue": "gpt-5" }
}, {
"key": "gen_ai.response.model",
"value": { "stringValue": "gpt-5-2025-08-07" }
}, {
"key": "gen_ai.usage.input_tokens",
"value": { "intValue": "120" }
}, {
"key": "gen_ai.usage.output_tokens",
"value": { "intValue": "48" }
}, {
"key": "customer.tier",
"value": { "stringValue": "enterprise" }
}]
}, {
"traceId": "0102030405060708090a0b0c0d0e0f10",
"spanId": "1112131415161718",
"parentSpanId": "0102030405060708",
"name": "tool.get_weather",
"startTimeUnixNano": "1700000000200000000",
"endTimeUnixNano": "1700000001800000000",
"attributes": [{
"key": "agnost.session_id",
"value": { "stringValue": "conversation-abc123" }
}, {
"key": "input",
"value": { "stringValue": "San Francisco" }
}, {
"key": "output",
"value": { "stringValue": "72°F and sunny" }
}, {
"key": "feature.name",
"value": { "stringValue": "weather" }
}]
}]
}]
}]
}'