Skip to content

Add OpenClaw gateway hook for live telemetry#1

Merged
maxdraki merged 2 commits into
mainfrom
openclaw-hook
Mar 11, 2026
Merged

Add OpenClaw gateway hook for live telemetry#1
maxdraki merged 2 commits into
mainfrom
openclaw-hook

Conversation

@maxdraki
Copy link
Copy Markdown
Owner

Summary

  • Adds a TypeScript hook that runs inside the OpenClaw gateway container and sends traces, logs, health checks, and metrics to AgentWatch via the HTTP ingestion API
  • Fire-and-forget design — all POSTs are non-blocking so message processing latency is unaffected
  • Configurable via env vars (AGENTWATCH_URL, AGENTWATCH_TOKEN, AGENTWATCH_AGENT_NAME)
  • Filters heartbeat/noise messages, truncates content for storage efficiency
  • Includes HOOK.md with install instructions and config reference

What it tracks

Event AgentWatch type
gateway:startup health check + log
message:received trace + metric
message:sent trace + metric (+ error log on failure)
command:new, command:reset trace + log

Test plan

  • Hook loads on gateway restart (verified: "Registered hook: agentwatch -> gateway:startup, message:received, message:sent, command:new, command:reset")
  • Startup health check ingested into AgentWatch
  • Startup log ingested into AgentWatch
  • Send a WhatsApp message and verify inbound/outbound traces appear in dashboard

🤖 Generated with Claude Code

claude added 2 commits March 11, 2026 07:28
TypeScript hook that runs inside the OpenClaw gateway container and
sends traces, logs, health checks, and metrics to AgentWatch via the
HTTP ingestion API. Fire-and-forget design ensures zero impact on
message processing latency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of hardcoding 1ms duration, the hook now tracks message:received
timestamps by conversationId and computes actual round-trip time when
message:sent fires. Produces a waterfall trace with conversation + delivery
spans. Also adds response_time_ms metric and Docker network documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maxdraki maxdraki merged commit 5767517 into main Mar 11, 2026
4 of 5 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.

2 participants