NylorunDocsBeta
Runtime APISessions

Read a turn's trace

GET
/v1/sessions/{sessionId}/turns/{turnId}/trace

The turn's spans as OTLP/HTTP JSON (resourceSpans), as the Runtime posts them to an OTLP collector: a root span for the turn, a span for each model, tool and egress crossing, ids derived so every read agrees. Post it to a collector's /v1/traces to backfill. A turn still running has no root span yet; a turn the session never had has no spans.

Authorization

applicationKey
headerAuthorizationBearer <token>

An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).

Path Parameters

sessionId*string
turnId*string

Header Parameters

Nylorun-Protocol*string

The protocol version, 18

Response Body

The turn's spans

application/json
  1. response
resourceSpans*array<>
[key: string]?unknown
import { createClient } from "@nylorun/agents";const client = await createClient();const trace = await client.session("ses_123").trace("turn_123");
{  "resourceSpans": [    {      "resource": {        "attributes": [          {            "key": "string",            "value": {              "property1": null,              "property2": null            },            "property1": null,            "property2": null          }        ],        "property1": null,        "property2": null      },      "scopeSpans": [        {          "scope": {            "name": "string",            "version": "string",            "property1": null,            "property2": null          },          "spans": [            {              "traceId": "string",              "spanId": "string",              "parentSpanId": "string",              "name": "string",              "kind": 0,              "startTimeUnixNano": "string",              "endTimeUnixNano": "string",              "attributes": [                {                  "key": "string",                  "value": {                    "property1": null,                    "property2": null                  },                  "property1": null,                  "property2": null                }              ],              "status": {                "code": 0,                "message": "string",                "property1": null,                "property2": null              },              "property1": null,              "property2": null            }          ],          "property1": null,          "property2": null        }      ],      "property1": null,      "property2": null    }  ],  "property1": null,  "property2": null}