- Trace only: Focus on bottleneck/error root-cause analysis
- Metrics only: Focus on cost/usage dashboards
- Unified (recommended): Trace + Metrics + Diagnostics
The default operating mode is Unified.
# extension enable flag (use according to project policy)
export PI_OTEL_ENABLE=1
# optional project label override (auto-detected from project by default)
# export OTEL_SERVICE_NAME=my-project-name
# traces endpoint
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces
# metrics endpoint
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics
# optional auth headers
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <token>"For always-on personal usage, run a local backend stack and access only web UIs via Tailscale.
- overview/policy: self-host-local-tailscale.md
- runnable compose/runbook: ../examples/self-host/README.md
Purpose: inspect the current telemetry pipeline status
Expected output includes:
- extension enabled state
- resolved service name (project auto-detect or manual override)
- active exporter types
- trace/metrics endpoints
- cumulative session/turn/tool/prompt counts
- cumulative token/cost usage
- last session/turn/tool duration
- privacy profile (
strict/detailed-with-redaction) - last error (if present)
Purpose: generate/open the current session trace URL
Expected output includes:
- trace id
- primary trace URL (Jaeger/Tempo)
- remote-access URL (when available)
- Verify endpoint validity
- Verify exporter initialization success
- Verify
session_startevent capture
- Ensure orphan spans are not increasing due to missing
tool_result - Ensure successful flush within the metrics export interval
- Ensure there are no logs indicating redaction-application failure
- OTLP transmission failures must not interrupt agent execution.
- Transmission failures are recorded in internal state (
last error) and logs. - Retry behavior for transient failures follows the exporter default policy.
Provisioned starter dashboards (self-host bundle):
Pi OTel OverviewPi OTel Ops LivePi OTel Efficiency & Decision
Key interpretation lens:
- Usage Overview
- sessions/day, turns/day, prompts/day
- Cost & Tokens
- input/output/cache tokens, daily cost, cost/turn
- Tool Reliability
- tool success rate, failure burst, p95 tool duration
- Session Quality
- turns per session, avg/p95 turn duration
- Collector down (
up{job="pi-otel-collector"} < 1, 5m) - Tool error rate warning/critical (>5% / >10%, 10m)
- Turn p95 warning/critical (>8s / >12s, 15m)
- Cost-per-turn regression warning (>1.3x vs 7-day baseline, 30m)
Tune thresholds to your own baseline after 1-2 weeks of data.