Skip to content

Add sidekiq metrics endpoint and add http server to sidekiq

Add endpoint to Sidekiq that exposes prometheus metrics.

For that I picked Thin. Decided to go with WebRick since its already available and doesn't require another Gem. I've tested this setup and it works great locally in my GDK.

Prometheus Sidekiq exporter:

Prometheus can scrape HTTP endpoint containing metrics. Sidekiq doesn't have any built-in server http server. So to be able to expose metrics from a sidekiq process we need to add some HTTP Server and add /metric endpoint using default prometheus-client-mmap middleware.

The /metric endpoint is text based and is human readable, it exposes all metrics collected by prometheus-client-mmap.

cc: @bjk-gitlab

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Related: #32145 (closed)

Edited by Paweł Chojnacki

Merge request reports