Commit 6a755250 authored by Peter Leitzen's avatar Peter Leitzen

Don't export http_request_duration_seconds metrics in sidekiq exporter

The sidekiq exporter does not use `Gitlab::Metrics::RequestsRackMiddleware`
and `http_request_duration_seconds` bucket because it uses the WEBrick server
which does not use any middlewares at all.

Therefore, we don't need to initialize those metrics so the are not
exported which saves traffic and Prometheus storage.
parent d8af8dd1
---
title: Don't expose http_request_duration_seconds metrics in sidekiq exporter
merge_request: 43941
author:
type: performance
......@@ -69,7 +69,9 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
Gitlab::Metrics.gauge(:deployments, 'GitLab Version', {}, :max).set({ version: Gitlab::VERSION }, 1)
Gitlab::Metrics::RequestsRackMiddleware.initialize_http_request_duration_seconds
unless Gitlab::Runtime.sidekiq?
Gitlab::Metrics::RequestsRackMiddleware.initialize_http_request_duration_seconds
end
rescue IOError => e
Gitlab::ErrorTracking.track_exception(e)
Gitlab::Metrics.error_detected!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment