Add metrics for Redis usage during Sidekiq job execution
What does this MR do?
Adds Redis metrics for jobs being executed on Sidekiq:
-
sidekiq_redis_requests_total
- Counts the amount of calls to Redis servers -
sidekiq_redis_requests_duration_seconds_bucket
- Adds query time spent on Redis servers
localhost:3807/metrics
Example from sidekiq_redis_requests_total{queue="mailers",worker="ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper",urgency="",external_dependencies="no",feature_category="",boundary="",job_status="done"} 5
sidekiq_redis_requests_total{queue="project_export",worker="ProjectExportWorker",urgency="throttled",external_dependencies="no",feature_category="importers",boundary="memory",job_status="done"} 27
sidekiq_redis_requests_duration_seconds_bucket{queue="cronjob:ci_archive_traces_cron",worker="Ci::ArchiveTracesCronWorker",urgency="low",external_dependencies="no",feature_category="continuous_integration",boundary="",job_status="done",le="+Inf"} 2
sidekiq_redis_requests_duration_seconds_bucket{queue="cronjob:ci_archive_traces_cron",worker="Ci::ArchiveTracesCronWorker",urgency="low",external_dependencies="no",feature_category="continuous_integration",boundary="",job_status="done",le="0.001"} 1
sidekiq_redis_requests_duration_seconds_bucket{queue="cronjob:ci_archive_traces_cron",worker="Ci::ArchiveTracesCronWorker",urgency="low",external_dependencies="no",feature_category="continuous_integration",boundary="",job_status="done",le="0.0025"} 1
sidekiq_redis_requests_duration_seconds_bucket{queue="cronjob:ci_archive_traces_cron",worker="Ci::ArchiveTracesCronWorker",urgency="low",external_dependencies="no",feature_category="continuous_integration",boundary="",job_status="done",le="0.005"} 1
sidekiq_redis_requests_duration_seconds_bucket{queue="cronjob:ci_archive_traces_cron",worker="Ci::ArchiveTracesCronWorker",urgency="low",external_dependencies="no",feature_category="continuous_integration",boundary="",job_status="done",le="0.01"} 1
sidekiq_redis_requests_duration_seconds_bucket{queue="cronjob:ci_archive_traces_cron",worker="Ci::ArchiveTracesCronWorker",urgency="low",external_dependencies="no",feature_category="continuous_integration",boundary="",job_status="done",le="0.025"} 1
sidekiq_redis_requests_duration_seconds_bucket{queue="cronjob:ci_archive_traces_cron",worker="Ci::ArchiveTracesCronWorker",urgency="low",external_dependencies="no",feature_category="continuous_integration",boundary="",job_status="done",le="0.05"} 2
That's part of gitlab-com/gl-infra/scalability#315 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
Edited by Oswaldo Ferreira