OpsTrailsDocs
Console

OpenTelemetry

Send OpenTelemetry (OTLP) trace data to automatically create events from deployment spans.

Send Traces

Post OTLP JSON trace data to the traces endpoint:

bash
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" } }
          ]
        }]
      }]
    }]
  }'

Attribute Mapping

OpsTrails maps OpenTelemetry span attributes to event fields:

OTLP AttributeEvent Field
service.namesource
deployment.environment.namesubject
service.versionversion
span.nametype (normalized)
span.startTimeUnixNanotime

OTLP Collector Configuration

If you're using the OpenTelemetry Collector, add OpsTrails as an OTLP/HTTP exporter:

yaml
exporters:
  otlphttp/opstrails:
    endpoint: https://api.opstrails.dev/api/v1/otlp
    headers:
      Authorization: "Bearer YOUR_API_KEY"

service:
  pipelines:
    traces:
      exporters: [otlphttp/opstrails]