Commit 19913c3c authored by Ahmad Sherif's avatar Ahmad Sherif

Merge branch 'add-sidekiq-stats-metrics' into 'master'

Add Sidekiq::Stats metrics

See merge request gitlab-org/gitlab-monitor!94
parents 2d9e4c19 86e40b81
Pipeline #113054 passed with stage
in 51 seconds
......@@ -50,9 +50,25 @@ metrics.
* `process_smaps_private_dirty_bytes`
* `process_smaps_swap_bytes`
* `process_smaps_pss_bytes`
1. [Sidekiq](lib/gitlab_monitor/sidekiq.rb) -- `sidekiq_queue_size`, `sidekiq_queue_paused`,
`sidekiq_queue_latency_seconds`, `sidekiq_enqueued_jobs`, `sidekiq_dead_jobs`,
`sidekiq_running_jobs`, `sidekiq_to_be_retried_jobs`
1. [Sidekiq](lib/gitlab_monitor/sidekiq.rb)
* Stats
* `sidekiq_jobs_processed_total`
* `sidekiq_jobs_failed_total`
* `sidekiq_jobs_enqueued_size`
* `sidekiq_jobs_scheduled_size`
* `sidekiq_jobs_retry_size`
* `sidekiq_jobs_dead_size`
* `sidekiq_default_queue_latency_seconds`
* `sidekiq_processes_size`
* `sidekiq_workers_size`
* Queues
* `sidekiq_queue_size`
* `sidekiq_queue_paused`
* `sidekiq_queue_latency_seconds`
* Jobs
* `sidekiq_enqueued_jobs`
* `sidekiq_running_jobs`
* `sidekiq_to_be_retried_jobs`
### Setup with GitLab Development Kit
......
......@@ -83,11 +83,11 @@ probes:
sidekiq: &sidekiq
methods:
- probe_stats
- probe_queues
- probe_jobs
- probe_workers
- probe_retries
- probe_dead
opts:
redis_url: "redis://localhost:6379"
redis_enable_client: true
......
......@@ -274,6 +274,7 @@ module GitLab
validate!
::GitLab::Monitor::SidekiqProber.new(redis_url: @redis_url)
.probe_stats
.probe_queues
.probe_jobs
.probe_workers
......
......@@ -21,6 +21,25 @@ module GitLab
ensure_queue_job_stats_script_loaded
end
def probe_stats
return self unless connected?
stats = Sidekiq::Stats.new
@metrics.add("sidekiq_jobs_processed_total", stats.processed)
@metrics.add("sidekiq_jobs_failed_total", stats.failed)
@metrics.add("sidekiq_jobs_enqueued_size", stats.enqueued)
@metrics.add("sidekiq_jobs_scheduled_size", stats.scheduled_size)
@metrics.add("sidekiq_jobs_retry_size", stats.retry_size)
@metrics.add("sidekiq_jobs_dead_size", stats.dead_size)
@metrics.add("sidekiq_default_queue_latency_seconds", stats.default_queue_latency)
@metrics.add("sidekiq_processes_size", stats.processes_size)
@metrics.add("sidekiq_workers_size", stats.workers_size)
self
end
def probe_queues
return self unless connected?
......@@ -92,6 +111,9 @@ module GitLab
end
def probe_dead
puts "[DEPRECATED] probe_dead is now considered obsolete and will be removed in future major versions,"\
" please use probe_stats instead"
return self unless connected?
@metrics.add("sidekiq_dead_jobs", Sidekiq::Stats.new.dead_size)
......
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