Skip to content

feat: Telemetry Extension β€” Phase 1 (structured event capture)#47

Merged
dgarson merged 1 commit intoobservability/mainfrom
xavier/telemetry-extension-phase1
Feb 22, 2026
Merged

feat: Telemetry Extension β€” Phase 1 (structured event capture)#47
dgarson merged 1 commit intoobservability/mainfrom
xavier/telemetry-extension-phase1

Conversation

@dgarson
Copy link
Owner

@dgarson dgarson commented Feb 22, 2026

Summary

Adds extensions/telemetry/ β€” a pure plugin extension that captures structured telemetry events from agent sessions and writes them as JSONL.

Spec: /Users/openclaw/.openclaw/workspace/drew/TELEMETRY_SPEC.md (Phase 1 scope only)

What it does

Hooks into four event sources and emits structured JSON events:

Event Source Captures
session_start session_start lifecycle hook Session begins
session_end session_end lifecycle hook Duration, message count
agent_end agent_end lifecycle hook Success/failure, duration, errors
model_usage onDiagnosticEvent (model.usage) Tokens, model, provider, estimated cost

Sink

Events write to a configurable JSONL file (default: ~/.openclaw/telemetry/events.jsonl) and/or stdout. Non-blocking, best-effort writes β€” never blocks the agent runtime.

Config

diagnostics:
  enabled: true
  telemetry:
    enabled: true
    file: ~/.openclaw/telemetry/events.jsonl
    stdout: false

Files

  • extensions/telemetry/index.ts β€” Plugin entry, registers service
  • extensions/telemetry/src/types.ts β€” Event schema + config types
  • extensions/telemetry/src/sink.ts β€” JSONL file/stdout writer
  • extensions/telemetry/src/hooks.ts β€” Hook registrations
  • extensions/telemetry/openclaw.plugin.json β€” Plugin manifest
  • extensions/telemetry/package.json β€” Package config
  • extensions/telemetry/README.md β€” Documentation

Constraints met

  • βœ… Extension-only β€” zero changes to src/
  • βœ… No new root dependencies
  • βœ… Follows diagnostics-otel + memory-core patterns
  • βœ… TypeScript type-checks cleanly
  • βœ… Small and functional for Phase 1

Phase 2 (future)

SQLite storage, CLI commands (openclaw telemetry costs/errors/sessions), agent query tools, cost estimation with pricing table, retention/cleanup.

Adds extensions/telemetry/ β€” a pure extension that captures structured
telemetry events from agent sessions and writes them to JSONL.

Event hooks:
  - session_start: via plugin lifecycle hook
  - session_end: via plugin lifecycle hook (duration, message count)
  - agent_end: via plugin lifecycle hook (success/fail, duration, errors)
  - model_usage: via onDiagnosticEvent (tokens, model, provider, cost)

Sink: configurable file (default ~/.openclaw/telemetry/events.jsonl)
and/or stdout. Non-blocking, best-effort writes.

No changes to core src/ β€” extension-only, additive.
No new root dependencies.

Phase 2 will add SQLite storage, CLI commands, and agent query tools.
@dgarson dgarson changed the base branch from dgarson/fork to observability/main February 22, 2026 05:50
dgarson added a commit that referenced this pull request Feb 22, 2026
…Editor (Piper)

AgentScheduler: 7 seed schedules, list+calendar toggle, master/detail, run now/edit/delete
TokenLedger: 10 ledger entries, cost by agent+model breakdown, 7-day bar chart
ThemeEditor (Piper): preset themes, live preview panel, CSS var export; fixed TS errors

Sprint total: 47 views
dgarson added a commit that referenced this pull request Feb 22, 2026
ThemeEditor: now fully wired into nav + router
PermissionsManager (Reed): permission matrix, 5 agents, edit mode toggle

Sprint total: 48 views
@dgarson dgarson merged commit 8f87209 into observability/main Feb 22, 2026
2 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant