packages/agent/docs/telemetry-schema.md
Schema version: 1
pi.ai.requestOne logical request to an AI provider
ok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.ai.operation | string | yes | stream, fetch_deferred, cancel_deferred, generate_images | Logical provider operation | |
pi.ai.provider | string | yes | Selected provider id | ||
pi.ai.model | string | yes | Requested model id | ||
pi.ai.api | string | yes | Provider API id | ||
pi.ai.streaming | boolean | yes | Whether this operation returns a stream | ||
pi.ai.deferred | boolean | no | Whether the operation requests or participates in deferred execution |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.ai.response.model | string | Concrete response model | ||
pi.ai.response.id | string | high cardinality | Provider response id | |
pi.ai.response.stop_reason | string | stop, length, tool_use, error, aborted, deferred | Normalized terminal response reason | |
pi.ai.http.status_code | number | Final HTTP status | ||
pi.ai.usage.input_tokens | number | Reported input tokens | ||
pi.ai.usage.output_tokens | number | Reported output tokens | ||
pi.ai.usage.cache_read_tokens | number | Reported cache-read tokens | ||
pi.ai.usage.cache_write_tokens | number | Reported cache-write tokens | ||
pi.ai.usage.reasoning_tokens | number | Reported reasoning tokens | ||
pi.ai.usage.total_tokens | number | Reported total tokens | ||
pi.ai.usage.cost | number | Reported total cost | ||
pi.ai.stream.chunk_count | number | Streamed update chunk count | ||
pi.ai.stream.time_to_first_chunk_ms | number | Elapsed milliseconds to first update chunk | ||
pi.ai.error.type | string | low cardinality | Provider or transport error class |
No declared span events.
Schema version: 1
pi.harness.runOne admitted in-process run invocation
ok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.session.id | string | yes | high cardinality | Session id | |
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | yes | high cardinality | Durable operation id | |
pi.operation.recovery | boolean | yes | Whether this invocation resumes durable work | ||
pi.operation.kind | string | yes | run | Run operation kind |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.operation.outcome | string | completed, aborted, failed, suspended | Run invocation outcome | |
pi.error.code | string | low cardinality | Stable operation error code | |
pi.error.type | string | low cardinality | Low-cardinality operation error class |
No declared span events.
pi.harness.compactionOne admitted in-process manual compaction invocation
ok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.session.id | string | yes | high cardinality | Session id | |
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | yes | high cardinality | Durable operation id | |
pi.operation.recovery | boolean | yes | Whether this invocation resumes durable work | ||
pi.operation.kind | string | yes | compaction | Compaction operation kind |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.operation.outcome | string | completed, declined, aborted, failed | Compaction invocation outcome | |
pi.error.code | string | low cardinality | Stable operation error code | |
pi.error.type | string | low cardinality | Low-cardinality operation error class |
No declared span events.
pi.harness.navigationOne admitted in-process navigation invocation
ok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.session.id | string | yes | high cardinality | Session id | |
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | yes | high cardinality | Durable operation id | |
pi.operation.recovery | boolean | yes | Whether this invocation resumes durable work | ||
pi.operation.kind | string | yes | navigation | Navigation operation kind |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.operation.outcome | string | completed, declined, aborted, failed | Navigation invocation outcome | |
pi.error.code | string | low cardinality | Stable operation error code | |
pi.error.type | string | low cardinality | Low-cardinality operation error class |
No declared span events.
pi.harness.checkpointOne run checkpoint
pi.harness.runok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | yes | high cardinality | Durable operation id | |
pi.checkpoint.kind | string | yes | normal, failure_drain, abort_reconcile | Checkpoint purpose |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
| none |
No declared span events.
pi.harness.turnOne assistant response and its tool batch
pi.harness.runok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | yes | high cardinality | Durable operation id | |
pi.turn.id | string | yes | high cardinality | Invocation-local turn id |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
| none |
No declared span events.
pi.harness.stepOne durable retry attempt
pi.harness.turn, pi.harness.checkpoint, pi.harness.compaction, pi.harness.navigationok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | yes | high cardinality | Durable operation id | |
pi.step.kind | string | yes | assistant, compaction, branch_summary | Retryable step kind | |
pi.step.attempt | number | yes | One-based durable attempt number | ||
pi.compaction.reason | string | no | manual, threshold, overflow | Compaction trigger |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.step.outcome | string | succeeded, retry, failed, aborted, deferred, overflow | Attempt outcome |
No declared span events.
pi.harness.toolOne raw phase-2 tool execution
pi.harness.turn, pi.harness.runok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | yes | high cardinality | Durable operation id | |
pi.turn.id | string | no | high cardinality | Invocation-local live turn id | |
pi.tool.name | string | yes | Tool name | ||
pi.tool.call_id | string | yes | high cardinality | Tool call id | |
pi.tool.replay | string | yes | never, safe | Declared replay policy | |
pi.tool.recovery | boolean | yes | Whether this is recovery execution |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.tool.is_error | boolean | Whether raw phase-2 execution returned an error |
No declared span events.
pi.harness.hookOne registered hook handler invocation
ok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | no | high cardinality | Durable operation id when accepted | |
pi.hook.name | string | yes | before_run, before_resume, before_run_end, transform_context, before_request, before_payload, after_response, before_tool, after_tool, before_compaction, before_navigation | Hook name | |
pi.hook.registration_id | string | no | Stable hook registration id |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.hook.outcome | string | completed, skipped, blocked, failed | Handler outcome |
No declared span events.
pi.harness.sleepOne retry delay
pi.harness.step, pi.harness.runok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.operation.id | string | yes | high cardinality | Durable operation id | |
pi.sleep.delay_ms | number | yes | Requested delay in milliseconds |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.sleep.outcome | string | elapsed, aborted | Delay outcome |
No declared span events.
pi.harness.event_handlerOne passive event listener invocation
ok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.event.type | string | yes | run_start, run_resume, run_suspend, run_abort, run_end, fault, handler_error, turn_start, turn_end, retry_scheduled, retry_start, retry_end, message_start, message_update, message_end, tool_start, tool_update, tool_end, entry_added, write_pending, queue_update, fact_update, config_update, compaction_start, compaction_end, navigation_start, navigation_end, lane_created, usage | low cardinality | Delivered harness event type |
pi.lane.name | string | no | high cardinality | Lane name for lane-scoped events |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
| none |
No declared span events.
pi.session.writeOne committed session mutation
ok| Name | Type | Required | Values | Notes | Description |
|---|---|---|---|---|---|
pi.lane.name | string | yes | high cardinality | Lane name | |
pi.operation.id | string | no | high cardinality | Durable operation id when accepted | |
pi.session.mutation | string | yes | entry, record, lane, fact | Session mutation kind | |
pi.session.item_type | string | no | Entry, record, lane, or fact subtype |
All end attributes are optional completion enrichment.
| Name | Type | Values | Notes | Description |
|---|---|---|---|---|
pi.session.seq | number | Committed session sequence when exposed |
No declared span events.