Track ActionCable settings in Usage Ping

In order to understand better how many users enable ActionCable for real-time events in Omnibus, we should extend Usage Ping to count the related setting(s).

https://docs.gitlab.com/ee/development/telemetry/usage_ping.html#usage-ping-guide

What we would like to track:

  • whether ActionCable is enabled
  • if it's enabled, is it running in in-app or standalone mode
  • if it's enabled, what is the configured pool size

Since Usage Ping data is collected from a Sidekiq job, and since furthermore ActionCable config does not reside in gitlab.yml but is rather configured through the environment, we think that the most promising way to get our hands on this data is by querying Prometheus (we export ActionCable metrics as of #217314 (closed)). We already have a similar Usage-Ping-via-Prometheus integration for our topology usage data: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/usage_data/topology.rb

If we decide to go down that route, what we could do is the following:

  • query Prometheus for action_cable_max_pool_size; this will carry the pool size as configured via ACTION_CABLE_WORKER_POOL_SIZE
  • if that query comes back empty, we know that AC is disabled
  • if the query comes back with results:
    • read the result value and submit as the new pool size UP metric
    • read the server_mode label and submit as the new in-app vs standalone UP metric

The Prometheus metrics are documented here: https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html#metrics-available

On the UP payload side, we need to decide still where best to add these new metrics. See issue discussion as well.

Edited by Matthias Käppler