Skip to content

Export ActionCable metrics to Prometheus

Matthias Käppler requested to merge 217314-actioncable-prometheus into master

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.

Screenshot_from_2020-09-07_16-20-31

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.

Screenshot_from_2020-09-07_15-27-32

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

Availability and Testing

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:

  1. In gck.env, set USE_CABLE_SERVER=[in_app|standalone] (I think "standalone" can be anything that is not in_app actually)
  2. make up-cable up-web
  3. For in_app, both web containers should export metrics with server_mode=in-app; cable should boot-to-exit-0
  4. For standalone, neither web container should export AC metrics; cable should boot into Puma and export with server_mode=standalone

This worked for me.

Edited by Matthias Käppler

Merge request reports