Commit 7131ad46 authored by Ryan Cobb's avatar Ryan Cobb

Adds sidekiq worker label for ruby metrics

parent 8cd197a0
...@@ -19,12 +19,6 @@ Gitlab::Application.configure do |config| ...@@ -19,12 +19,6 @@ Gitlab::Application.configure do |config|
config.middleware.insert(1, Gitlab::Metrics::RequestsRackMiddleware) config.middleware.insert(1, Gitlab::Metrics::RequestsRackMiddleware)
end end
Sidekiq.configure_server do |config|
config.on(:startup) do
Gitlab::Metrics::SidekiqMetricsExporter.instance.start
end
end
if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled? if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
Gitlab::Cluster::LifecycleEvents.on_worker_start do Gitlab::Cluster::LifecycleEvents.on_worker_start do
defined?(::Prometheus::Client.reinitialize_on_pid_change) && Prometheus::Client.reinitialize_on_pid_change defined?(::Prometheus::Client.reinitialize_on_pid_change) && Prometheus::Client.reinitialize_on_pid_change
......
...@@ -77,10 +77,10 @@ module Gitlab ...@@ -77,10 +77,10 @@ module Gitlab
end end
def worker_label def worker_label
return { worker: 'sidekiq' } if Sidekiq.server?
return {} unless defined?(Unicorn::Worker) return {} unless defined?(Unicorn::Worker)
worker_no = ::Prometheus::Client::Support::Unicorn.worker_id worker_no = ::Prometheus::Client::Support::Unicorn.worker_id
if worker_no if worker_no
{ worker: worker_no } { worker: worker_no }
else else
......
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