-
Notifications
You must be signed in to change notification settings - Fork 17
Description
It seems that by mistake I chose the ambigous name worker
for use in metric or label names. It led to my confusion several times (e.g. in #11 (comment) or #13 (comment))
Even @mperham recommends against using it in https://www.mikeperham.com/2021/04/20/a-tour-of-the-sidekiq-api/:
…it helps to understand the basic entities in Sidekiq’s universe:
- A
job
is a unit of work in your Ruby application- A
queue
is a list of jobs which are ready to execute right now- A
process
is a Sidekiq process with one or more threads for executing jobs.NB: I never use the term
worker
as it is nebulous and confusing. Useprocess
,thread
orjob class
so your meaning is clear.
However, this is apparently a breaking change, so we probably should find a trade-off between the passion to name things right and not breaking things too much.
Code of interest is here:
yabeda-sidekiq/lib/yabeda/sidekiq.rb
Lines 21 to 46 in 91c8f4e
counter :jobs_enqueued_total, tags: %i[queue worker], comment: "A counter of the total number of jobs sidekiq enqueued." | |
next unless ::Sidekiq.server? | |
counter :jobs_executed_total, tags: %i[queue worker], comment: "A counter of the total number of jobs sidekiq executed." | |
counter :jobs_success_total, tags: %i[queue worker], comment: "A counter of the total number of jobs successfully processed by sidekiq." | |
counter :jobs_failed_total, tags: %i[queue worker], comment: "A counter of the total number of jobs failed in sidekiq." | |
gauge :jobs_waiting_count, tags: %i[queue], comment: "The number of jobs waiting to process in sidekiq." | |
gauge :active_workers_count, tags: [], comment: "The number of currently running machines with sidekiq workers." | |
gauge :jobs_scheduled_count, tags: [], comment: "The number of jobs scheduled for later execution." | |
gauge :jobs_retry_count, tags: [], comment: "The number of failed jobs waiting to be retried" | |
gauge :jobs_dead_count, tags: [], comment: "The number of jobs exceeded their retry count." | |
gauge :active_processes, tags: [], comment: "The number of active Sidekiq worker processes." | |
gauge :queue_latency, tags: %i[queue], comment: "The queue latency, the difference in seconds since the oldest job in the queue was enqueued" | |
gauge :running_job_runtime, tags: %i[queue worker], aggregation: :max, unit: :seconds, | |
comment: "How long currently running jobs are running (useful for detection of hung jobs)" | |
histogram :job_latency, comment: "The job latency, the difference in seconds between enqueued and running time", | |
unit: :seconds, per: :job, | |
tags: %i[queue worker], | |
buckets: LONG_RUNNING_JOB_RUNTIME_BUCKETS | |
histogram :job_runtime, comment: "A histogram of the job execution time.", | |
unit: :seconds, per: :job, | |
tags: %i[queue worker], | |
buckets: LONG_RUNNING_JOB_RUNTIME_BUCKETS |
README lists metrics here: https://github.com/yabeda-rb/yabeda-sidekiq/blob/91c8f4ed23a2687b396ac64add8236f3ed16f0cc/README.md#metrics