Add noop-monitor backend for convos connection monitoring - #1
Draft
qeggleston wants to merge 1 commit into
Draft
Conversation
Adds a streaming-daemon backend that holds a handed-off client
connection open, sending only periodic `: ping` SSE keepalives and
recording connection volume/concurrency/duration in Prometheus. No LLM,
Redis, message data, or per-user logging — the daemon side of the convos
streaming connection monitor.
- backends/noop_monitor.go: NoopMonitor backend (registers via init,
selected by handoff `{"backend":"noop-monitor"}`). Ping loop detects
client disconnect via write failure; ctx cancel distinguishes
max_lifetime (deadline) from shutdown. Exposes noop_monitor_active
gauge and noop_monitor_closed_total counter, labeled by source/reason.
The client-influenced source label is clamped to {detail,message_list,
other} to bound metric cardinality.
- backends/backend.go: HandoffData gains Source and ConnectionID.
- config: NoopMonitorConfig{ping_interval_ms} (default 25000) + validation.
- README/example.yaml: document the backend.
Deployment (dedicated systemd instance, chef, :9091 Prometheus scrape)
is a separate rollout step per the daemon plan.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Daemon (Go) side of the convos streaming connection monitor. Adds a
noop-monitorbackend toexamples/streaming-daemon-gothat receives a handed-off client socket, holds it open sending nothing but periodic: pingkeepalives, and lets us read connection volume / concurrency / duration straight from the daemon's Prometheus metrics. No LLM, Redis, message data, or per-user logging.Companion to the Etsyweb
Api_Member_Conversations_StreamingMonitorendpoint (separate PR) which sets the handoff headers. Implements the daemon plan inconvos-streaming-noop-daemon-plan.md.What's included
backends/noop_monitor.go—NoopMonitorbackend. Self-registers viainit(); routed to byX-Handoff-Data{"backend":"noop-monitor"}. Ping loop detects client disconnect via write failure;ctxcancellation distinguishesmax_lifetime(deadline) fromshutdown. A client disconnect returns(0, nil)— it's normal, not an error.noop_monitor_active{source}(gauge) andnoop_monitor_closed_total{source,reason}(counter), on top of the built-indaemon_*connection metrics. The client-influencedsourcelabel is clamped to{detail, message_list, other}to bound Prometheus cardinality.backends/backend.go—HandoffDatagainsSourceandConnectionID.config/config.go—NoopMonitorConfig{ping_interval_ms}(default25000) + validation.README.md+config/example.yaml.backends/noop_monitor_test.go:client_disconnect/shutdown/max_lifetimereason paths, ping write, gauge/counter movement, source normalization.Verification
make fmt,make vet,make build, andmake test(go test -race ./...) all pass.Out of scope (separate rollout steps per the plan)
Dedicated
convos-streaming-monitor.servicesystemd instance, chef recipe, and the:9091Prometheus scrape target.🤖 Generated with Claude Code