Skip to content

Add 'broadcasting' label to Action Cable counter

Matthias Käppler requested to merge 404957-actioncable-prom-metrics into master

What does this MR do and why?

We are looking to refine existing Action Cable metrics to better forecast usage and event volume.

This MR takes a first step by adding a broadcasting label to the action_cable_broadcasts_total counter.

This allows us to see which Redis PubSub topics we most frequently broadcast too.

Extra data volume

I took care not to let extra data served into Prometheus get out of hand by collapsing broadcastings (pubsub channel names) with high cardinality, such as those including IDs. The code is quite defensive currently because any unknown broadcasting is rolled into the other label. This should avoid unpleasant surprises in label dimensionality should we ever use additional pubsub channels.

Screenshots or screen recordings

image

How to set up and validate locally

  1. Hit a page that opens a websocket connection, e.g. the issue page
  2. Trigger a sub that goes over Action Cable by changing labels or the epic link
  3. grep the /-/metrics endpoint for action_cable_broadcasts_total which should carry the new label

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #404957 (closed)

Edited by Matthias Käppler

Merge request reports

Loading