Incidentary Docs

Traces

Retrieve and query causal traces via the Incidentary REST API

Traces

A trace is the causal chain of events captured by the SDK across one or more services. Traces are stored automatically when the SDK flushes on alert or on a configurable flush interval.

Get Trace

GET /v1/traces/:id

Response:

{
  "id": "trc_01HABC",
  "service": "order-service",
  "rootSpan": {
    "id": "spn_01H001",
    "name": "handle-request",
    "startedAt": "2026-03-01T02:13:50Z",
    "endedAt": "2026-03-01T02:13:51.240Z",
    "durationMs": 1240,
    "events": [
      {
        "name": "order.validation.started",
        "timestamp": "2026-03-01T02:13:50.100Z",
        "attributes": {}
      }
    ]
  },
  "spans": [...],
  "capturedAt": "2026-03-01T02:14:00Z",
  "preArmWindowMs": 30000
}

List Spans

GET /v1/traces/:id/spans

Returns all spans in the trace in topological order (root first, children following).

Response:

{
  "data": [
    {
      "id": "spn_01H001",
      "parentId": null,
      "name": "handle-request",
      "service": "order-service",
      "startedAt": "2026-03-01T02:13:50Z",
      "endedAt": "2026-03-01T02:13:51.240Z",
      "durationMs": 1240,
      "status": "ok",
      "events": [...]
    },
    {
      "id": "spn_01H002",
      "parentId": "spn_01H001",
      "name": "db.query",
      "service": "order-service",
      "startedAt": "2026-03-01T02:13:50.200Z",
      "endedAt": "2026-03-01T02:13:50.850Z",
      "durationMs": 650,
      "status": "ok",
      "events": []
    }
  ]
}

List Events for a Span

GET /v1/traces/:traceId/spans/:spanId/events

Returns all causal events emitted within a span, ordered by timestamp.

Search Traces

GET /v1/traces?service=order-service&from=2026-03-01T00:00:00Z

Query Parameters:

ParamTypeDescription
servicestringFilter by service name
fromISO 8601Start of time range
toISO 8601End of time range
incidentIdstringReturn traces linked to a specific incident
cursorstringPagination cursor
limitintegerMax 100, default 20

On this page