Start a separate metrics server that can serve Sidekiq metrics
What does this MR do and why?
This MR will spin up a separate metrics server that serves Sidekiq metrics. For backwards compatibility, we default the Sidekiq health checks to the same settings as this new sidekiq metrics server, context: !74875 (merged).
Since we can not run two processes on the same port, the metrics server will only spin up if a different port has been set for the health check server (instead of defaulting to the sidekiq_exporter settings). This allows us to slowly migrate to different servers for Sidekiq metrics serving and Sidekiq health checks.
How to set up and validate locally
- We will have to overwrite the default settings for
Settings.monitoring.sidekiq_health_checks.port
, since they default toSettings.monitoring.sidekiq_exporter.port
. With gdk you can change thegitlab.yml
and setSettings.monitoring.sidekiq_health_checks.port
to any other number. e.g.
sidekiq_exporter:
enabled: true
address: 127.0.0.1
port: 3807
sidekiq_health_checks:
port: 3907
- Open rails console
- Start the metrics server:
require_relative 'metrics_server/metrics_server'
MetricsServer.spawn('sidekiq')
- See if the sidekiq workers are healthy
curl localhost:3907/liveness
- See if the metrics server is serving metrics
curl localhost:3807/metrics
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 #346256 (closed)
Edited by Roy Zwambag