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?
-
Add configuration option controlling if this endpoint is enabled -
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Related: #32145 (closed)
Edited by Paweł Chojnacki