log_span
Record timing data for completed work as a single span, specifying duration, kind, and optional identifiers. Use for logging retrospective performance metrics.
Instructions
Record a completed span in one call (no separate start/end needed).
Useful for logging retrospective timing data (e.g. 'that DB query took 42ms').
Args:
name: Span label.
duration_ms: How long the work took in milliseconds.
kind: 'internal' | 'tool' | 'agent' | 'llm'. Default: 'internal'.
session_id: Session identifier. Optional.
run_id: FK to agent_runs. Optional.
parent_id: Parent span_id. Optional.
status: 'ok' | 'error'. Default: 'ok'.
tags: JSON string of metadata. Optional.
Returns the new span_id.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| duration_ms | Yes | ||
| kind | No | internal | |
| session_id | No | ||
| run_id | No | ||
| parent_id | No | ||
| status | No | ok | |
| tags | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |