Traces

Ingest traces (OTLP)

Changed on

Accepts 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.

post/api/v2/traces

Request

  • Base URL
    https://api.respan.ai
  • URL
    https://api.respan.ai/api/v2/traces
  • Auth
    HTTP 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 1 of the request property ///////

    • breaking

      removed the enum value 2 of the request property ///////

    • breaking

      the /////// request property type changed from string to integer

    • info

      api operation id traces_createTrace removed and replaced with createTrace

    • info

      api tag Traces added

    • info

      api tag traces removed

    • info

      added the new 1.00 enum value to the request property ///////

    • info

      added the new 2.00 enum value to the request property ///////

    • 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