Skip to content

Comments

feat: add WebSocket-specific Prometheus metrics#374

Merged
ppcano merged 1 commit intomainfrom
pepe/ws-instrumentation
Jan 15, 2026
Merged

feat: add WebSocket-specific Prometheus metrics#374
ppcano merged 1 commit intomainfrom
pepe/ws-instrumentation

Conversation

@ppcano
Copy link
Collaborator

@ppcano ppcano commented Jan 15, 2026

WebSocket connections were skewing HTTP latency metrics because their connection duration was being recorded as request duration.

This PR:

  • Excludes /ws from Prometheus HTTP metrics (isInternalRoute)
  • Excludes /ws from OTel tracing and metrics (excludeWebSocketFromOTel)
  • Adds 4 dedicated WebSocket metrics via melody hooks:
    • quickpizza_server_ws_connections_active (Gauge)
    • quickpizza_server_ws_connection_duration_seconds (Native Histogram)
    • quickpizza_server_ws_messages_received_total (Counter)
    • quickpizza_server_ws_message_processing_duration_seconds (Native Histogram)

@ppcano ppcano requested a review from a team as a code owner January 15, 2026 09:55
@ppcano ppcano requested review from Lantero and federicotdn January 15, 2026 09:55
@ppcano ppcano merged commit 56ce74d into main Jan 15, 2026
14 checks passed
@ppcano ppcano deleted the pepe/ws-instrumentation branch January 15, 2026 10:25
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