Traces
SDK reference for traces — Find execution traces and read their spans.
Find execution traces and read their spans.
listExecutions
List recent executions and agent sessions for a project
GET
Usage:
const result = await swirls.client.traces.listExecutions({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
limit | number | No | |
beforeTimestamp | string | No |
getTrace
Fetch every span in a trace, scoped to the project
GET
Usage:
const result = await swirls.client.traces.getTrace({
projectId: '...',
traceId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
traceId | string | Yes |
getExecutionSpans
Fetch the spans for one execution id
GET
Usage:
const result = await swirls.client.traces.getExecutionSpans({
projectId: '...',
executionId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
executionId | string | Yes |
resolveExecutionTrace
Resolve the trace id an execution id belongs to (e.g. a parent run)
GET
Usage:
const result = await swirls.client.traces.resolveExecutionTrace({
projectId: '...',
executionId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
executionId | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
traceId | string | null |
export.list
List trace-export destinations for a project (no secret values)
GET
Usage:
const result = await swirls.client.traces.export.list({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes |
export.get
Fetch one trace-export destination (no secret values), or null
GET
Usage:
const result = await swirls.client.traces.export.get({
projectId: '...',
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
id | string | Yes |
export.create
Create a trace-export destination. Validates the endpoint, encrypts credentials, sets status=pending. Requires the trace_export entitlement.
POST
Usage:
const result = await swirls.client.traces.export.create({
projectId: '...',
vendor: '...',
endpoint: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
vendor | "datadog" | "honeycomb" | "grafana_tempo" | "newrelic" | "neatlogs" | "otlp_generic" | Yes | |
protocol | "otlp_grpc" | "otlp_http" | No | |
endpoint | string | Yes | |
headerTemplate | object | No | |
contentPolicy | "full" | "redacted" | No | |
samplingRatio | number | No | |
secrets | object | No |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
enabled | boolean | |
vendor | "datadog" | "honeycomb" | "grafana_tempo" | "newrelic" | "neatlogs" | "otlp_generic" | |
protocol | "otlp_grpc" | "otlp_http" | |
endpoint | string | |
headerTemplate | object | |
contentPolicy | "full" | "redacted" | |
samplingRatio | number | |
status | "pending" | "active" | "error" | "disabled" | |
configuredSecretHeaders | string[] | |
credentialsConfigured | boolean | |
lastExportAt | string | null | |
lastError | string | null | |
updatedAt | string |
export.update
Update a trace-export destination. Re-validates the endpoint and re-encrypts supplied credentials; sets status=pending.
POST
Usage:
const result = await swirls.client.traces.export.update({
projectId: '...',
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
id | string | Yes | |
vendor | "datadog" | "honeycomb" | "grafana_tempo" | "newrelic" | "neatlogs" | "otlp_generic" | No | |
protocol | "otlp_grpc" | "otlp_http" | No | |
endpoint | string | No | |
headerTemplate | object | No | |
contentPolicy | "full" | "redacted" | No | |
samplingRatio | number | No | |
secrets | object | No |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
enabled | boolean | |
vendor | "datadog" | "honeycomb" | "grafana_tempo" | "newrelic" | "neatlogs" | "otlp_generic" | |
protocol | "otlp_grpc" | "otlp_http" | |
endpoint | string | |
headerTemplate | object | |
contentPolicy | "full" | "redacted" | |
samplingRatio | number | |
status | "pending" | "active" | "error" | "disabled" | |
configuredSecretHeaders | string[] | |
credentialsConfigured | boolean | |
lastExportAt | string | null | |
lastError | string | null | |
updatedAt | string |
export.delete
Delete a trace-export destination
POST
Usage:
const result = await swirls.client.traces.export.delete({
projectId: '...',
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
id | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
deleted | boolean |
export.setEnabled
Enable or disable a destination. Enabling requires the trace_export entitlement and records an audited affirmation that trace data will be sent to the vendor.
POST
Usage:
const result = await swirls.client.traces.export.setEnabled({
projectId: '...',
id: '...',
enabled: true,
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
id | string | Yes | |
enabled | boolean | Yes |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
enabled | boolean | |
vendor | "datadog" | "honeycomb" | "grafana_tempo" | "newrelic" | "neatlogs" | "otlp_generic" | |
protocol | "otlp_grpc" | "otlp_http" | |
endpoint | string | |
headerTemplate | object | |
contentPolicy | "full" | "redacted" | |
samplingRatio | number | |
status | "pending" | "active" | "error" | "disabled" | |
configuredSecretHeaders | string[] | |
credentialsConfigured | boolean | |
lastExportAt | string | null | |
lastError | string | null | |
updatedAt | string |
export.sendTestSpan
Send one synthetic OTLP span to the destination endpoint out of band, validating reachability and credentials. Never sends real trace data.
POST
Usage:
const result = await swirls.client.traces.export.sendTestSpan({
projectId: '...',
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
id | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
delivered | boolean | |
status | number | |
error | string |