Skip to content

feat(observability): add HealthMetrics singleton for agent health tracking - #404

Open
telleroutlook wants to merge 1 commit into
mainfrom
feat/health-metrics
Open

feat(observability): add HealthMetrics singleton for agent health tracking#404
telleroutlook wants to merge 1 commit into
mainfrom
feat/health-metrics

Conversation

@telleroutlook

Copy link
Copy Markdown
Collaborator

Closes #388

Adds a lightweight HealthMetrics singleton to track agent operational health at runtime:

  • HealthMetrics class (singleton) with counters for tool latency, failures, timeouts, policy denials, and token resource usage
  • getSnapshot() returns a read-only HealthSnapshot struct
  • Instrumented in ToolCallingAgent: input/output/tool guardrail tripwires, node_error path, parallel tool path (latency timing + timeout/failure classification), model_done token usage
  • Cloudflare Worker /health endpoint now includes a metrics field with the live snapshot
  • 8 unit tests, all passing

Manually implemented by operator — bot hit budget limit on this task.

…cking

Closes #388

Adds a lightweight HealthMetrics singleton to track agent operational
health at runtime:

- HealthMetrics class (singleton) with counters for tool latency,
  failures, timeouts, policy denials, and token resource usage
- getSnapshot() returns a read-only HealthSnapshot struct
- Instrumented in ToolCallingAgent: guardrail tripwires (input/output/tool),
  node_error path, parallel tool path (latency + timeout detection),
  model_done resource usage
- Cloudflare Worker health endpoint now includes metrics snapshot
- 8 unit tests, all pass

Manually implemented by operator — bot hit budget limit on this task.
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.

[milestone Milestone 10] Add runtime health metrics for latency, failures, timeouts, policy denials, and ...

1 participant