Send OpenTelemetry (OTLP) trace data to automatically create events from deployment spans.
Post OTLP JSON trace data to the traces endpoint:
curl -X POST https://api.opstrails.dev/api/v1/otlp/traces \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"resourceSpans": [{
"resource": {
"attributes": [
{ "key": "service.name", "value": { "stringValue": "my-service" } }
]
},
"scopeSpans": [{
"spans": [{
"name": "deploy production",
"kind": 1,
"startTimeUnixNano": "1705312200000000000",
"endTimeUnixNano": "1705312260000000000",
"attributes": [
{ "key": "deployment.environment.name", "value": { "stringValue": "production" } },
{ "key": "service.version", "value": { "stringValue": "v1.2.3" } }
]
}]
}]
}]
}'OpsTrails maps OpenTelemetry span attributes to event fields:
| OTLP Attribute | Event Field |
|---|---|
service.name | source |
deployment.environment.name | subject |
service.version | version |
span.name | type (normalized) |
span.startTimeUnixNano | time |
If you're using the OpenTelemetry Collector, add OpsTrails as an OTLP/HTTP exporter:
exporters:
otlphttp/opstrails:
endpoint: https://api.opstrails.dev/api/v1/otlp
headers:
Authorization: "Bearer YOUR_API_KEY"
service:
pipelines:
traces:
exporters: [otlphttp/opstrails]