Export ActionCable metrics to Prometheus
What does this MR do?
See #217314 (closed)
We recently shipped realtime issue assignee updates via ActionCable. We now want to track useful metrics into Prometheus to monitor the feature in production (Note: this is an experimental feature and neither widely announced nor enabled on .com yet).
We start simple by only tracking the number of clients connected to the current server in the action_cable_active_connections
metric.
The server_mode
label will tell us whether AC is running in standalone (dedicated server) or in-app (embedded into a web server) mode. We will also later use this in Usage Ping so as to understand how customers most commonly deploy ActionCable.
NOTE that while the MR prepares for the handling of a possible standalone mode by attaching that label, it does not add support for scraping dedicated AC nodes.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Tested that in both in_app
and standalone
mode the correct label is applied (this requires a bit of local configuration and manually booting servers); my approach:
- In
gck.env
, setUSE_CABLE_SERVER=[in_app|standalone]
(I think "standalone" can be anything that is not in_app actually) make up-cable up-web
- For
in_app
, bothweb
containers should export metrics withserver_mode=in-app
;cable
should boot-to-exit-0 - For
standalone
, neitherweb
container should export AC metrics;cable
should boot into Puma and export withserver_mode=standalone
This worked for me.