Skip to content

v0.2.5

Choose a tag to compare

@cliftonc cliftonc released this 17 Jun 07:57
e690b21

Native OpenTelemetry traces + metrics export (`--otel`)

Opt-in OTEL integration that exports the Pi session as a span tree (`session → turn → {chat, execute_tool}`) plus metrics (tokens, cost, durations, tool/turn counts), using the standard OpenTelemetry JS SDK and standard `OTEL_*` env vars. Built for orchestrators (lastlight) that forward OTEL config into a sandboxed agentic-pi process.

  • Off unless explicitly enabled (`--otel` or `AGENTIC_PI_OTEL_ENABLED=1`; `--no-otel` wins). A bare OTLP endpoint does not auto-enable.
  • Metadata-only by default; raw content only via `--otel-include-content` (bounded + truncated).
  • Safe by default: no-op + no SDK import when disabled; SDK diagnostics never reach stdout/stderr; an unreachable collector degrades to a warning, never fails the run.
  • Reads W3C `TRACEPARENT` for cross-process trace correlation.

New flags: `--otel`, `--no-otel`, `--otel-include-content`, `--otel-service-name`, `--otel-endpoint`. See README section 10.