prometheus_exporter icon indicating copy to clipboard operation
prometheus_exporter copied to clipboard

Dynamic labels for sidekiq jobs

Open edenisn opened this issue 1 year ago • 3 comments

Hi, thanks for this beautiful gem. I see that we can added static labels in sidekiq job (on official page of a gem): Custom labels can be added for individual jobs by defining a class method on the job class. These labels will be added to all Sidekiq metrics written by the job:

  class WorkerWithCustomLabels
    def self.custom_labels
      { my_label: 'value-here', other_label: 'second-val' }
    end

    def perform; end
  end

but, what about dynamic labels? How we can add those labels?

edenisn avatar Mar 16 '23 06:03 edenisn