Action Cable metrics: add labels to transmit
What does this MR do and why?
This expands on !117253 (merged) to improve labels for the Action Cable action_cable_single_client_transmissions_total
Prometheus metric. It:
- adds a
caller
label so we can see if a transmission was initiated directly in response to an RPC or via a broadcasted message - adds the
broadcasting
label to transmissions that originated in a GraphQL subscription event
This allows us to:
- Correlate event triggers by topic with upstream transmissions to clients: how many data transmissions were initiated in response to publishing to a specific topic?
- Measure the fan-out ratio of events broken down by topic or operation: how do transmissions distribute across the different kinds of events we trigger?
Screenshots or screen recordings
How to set up and validate locally
For these hooks to be installed, you need to comment out https://gitlab.com/gitlab-org/gitlab/-/blob/e4f942238223a5f4485553157150b32017ca8716/config/initializers/zz_metrics.rb#L17 until we fix #407145 (closed)
Once installed:
- Use a feature that runs a GraphQL subscription such as changing issue assignees in the issue sidebar
-
curl /-/metrics
to check if these labels are added
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #404957 (closed)
Edited by Matthias Käppler