You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
So, for example above with static label when we start sidekiq job - WorkerWithCustomLabels it will add two labels - my_label = 'value-here' and other_label = 'second-val', those labels are static.
But, in some cases we want to add dynamic labels, for example:
class SomeTestJob
def perform(event_id)
event = Event.find(event_id)
label = event.type
end
end
and I want to set this label for this job with - label = event.type. Type of this label is not static - it's dynamic label.
And my question: how can we add those type of labels to Sidekiq jobs?
Thanks!
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:
but, what about dynamic labels? How we can add those labels?
The text was updated successfully, but these errors were encountered: