Skip to content

Commit

Permalink
Add YABEDA_SIDEKIQ_GENERAL_METRICS_DISABLE to control general metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
  • Loading branch information
mrexox committed May 7, 2021
1 parent 91c8f4e commit 3cba342
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.8.0 - 2021-05-07

### Added

- Add env variable YABEDA_SIDEKIQ_GENERAL_METRICS_DISABLE to control collecting of common metrics. See [#20](https://github.com/yabeda-rb/yabeda-sidekiq/pull/20). @mrexox

## 0.7.0 - 2020-07-15

### Changed
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ end
- Time of job run: `sidekiq_job_runtime` (seconds per job execution, segmented by queue and class name)
- Time of the queue latency `sidekiq_queue_latency` (the difference in seconds since the oldest job in the queue was enqueued)
- Time of the job latency `sidekiq_job_latency` (the difference in seconds since the enqueuing until running job)

These can be disabled with setting `YABEDA_SIDEKIQ_GENERAL_METRICS_DISABLE=1`:

- Number of jobs in queues: `sidekiq_jobs_waiting_count` (segmented by queue)
- Number of scheduled jobs:`sidekiq_jobs_scheduled_count`
- Number of jobs in retry set: `sidekiq_jobs_retry_count`
Expand Down
2 changes: 2 additions & 0 deletions lib/yabeda/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ module Sidekiq
tags: %i[queue worker],
buckets: LONG_RUNNING_JOB_RUNTIME_BUCKETS

next if ENV["YABEDA_SIDEKIQ_GENERAL_METRICS_DISABLE"]

collect do
stats = ::Sidekiq::Stats.new

Expand Down
2 changes: 1 addition & 1 deletion lib/yabeda/sidekiq/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Yabeda
module Sidekiq
VERSION = "0.7.0"
VERSION = "0.8.0"
end
end

0 comments on commit 3cba342

Please sign in to comment.