feat: add Prometheus metrics to NATS pubsub for parity with PGPubsub (#26441)

This commit is contained in:
Jon Ayers
2026-06-23 11:59:48 -05:00
committed by GitHub
parent d104d0dcb3
commit 6da322d59f
9 changed files with 613 additions and 10 deletions
+39
View File
@@ -82,6 +82,45 @@ coder_derp_server_unknown_frames_total 0
# HELP coder_derp_server_watchers Current watchers.
# TYPE coder_derp_server_watchers gauge
coder_derp_server_watchers 0
# HELP coder_nats_pubsub_connected Whether we are connected (1) or not connected (0) to nats
# TYPE coder_nats_pubsub_connected gauge
coder_nats_pubsub_connected 0
# HELP coder_nats_pubsub_current_events The current number of pubsub event channels listened for
# TYPE coder_nats_pubsub_current_events gauge
coder_nats_pubsub_current_events 0
# HELP coder_nats_pubsub_current_subscribers The current number of active pubsub subscribers
# TYPE coder_nats_pubsub_current_subscribers gauge
coder_nats_pubsub_current_subscribers 0
# HELP coder_nats_pubsub_disconnections_total Total number of times we disconnected unexpectedly from nats
# TYPE coder_nats_pubsub_disconnections_total counter
coder_nats_pubsub_disconnections_total 0
# HELP coder_nats_pubsub_latency_measure_errs_total The number of pubsub latency measurement failures
# TYPE coder_nats_pubsub_latency_measure_errs_total counter
coder_nats_pubsub_latency_measure_errs_total 0
# HELP coder_nats_pubsub_latency_measures_total The number of pubsub latency measurements
# TYPE coder_nats_pubsub_latency_measures_total counter
coder_nats_pubsub_latency_measures_total 0
# HELP coder_nats_pubsub_messages_total Total number of messages received from nats
# TYPE coder_nats_pubsub_messages_total counter
coder_nats_pubsub_messages_total{size=""} 0
# HELP coder_nats_pubsub_published_bytes_total Total number of bytes successfully published across all publishes
# TYPE coder_nats_pubsub_published_bytes_total counter
coder_nats_pubsub_published_bytes_total 0
# HELP coder_nats_pubsub_publishes_total Total number of calls to Publish
# TYPE coder_nats_pubsub_publishes_total counter
coder_nats_pubsub_publishes_total{success=""} 0
# HELP coder_nats_pubsub_receive_latency_seconds The time taken to receive a message from a pubsub event channel
# TYPE coder_nats_pubsub_receive_latency_seconds gauge
coder_nats_pubsub_receive_latency_seconds 0
# HELP coder_nats_pubsub_received_bytes_total Total number of bytes received across all messages
# TYPE coder_nats_pubsub_received_bytes_total counter
coder_nats_pubsub_received_bytes_total 0
# HELP coder_nats_pubsub_send_latency_seconds The time taken to send a message into a pubsub event channel
# TYPE coder_nats_pubsub_send_latency_seconds gauge
coder_nats_pubsub_send_latency_seconds 0
# HELP coder_nats_pubsub_subscribes_total Total number of calls to Subscribe/SubscribeWithErr
# TYPE coder_nats_pubsub_subscribes_total counter
coder_nats_pubsub_subscribes_total{success=""} 0
# HELP coder_pubsub_connected Whether we are connected (1) or not connected (0) to postgres
# TYPE coder_pubsub_connected gauge
coder_pubsub_connected 0