Skip to content

Fix ActionMailer job metric labels

Sean McGivern requested to merge fix-actionmailer-job-metric-labels into master

When we emit metrics for Sidekiq workers, we were only adding some labels for workers defined in our application code. ActionMailer::MailDeliveryJob comes from Rails - we don't define that class. But we still want to add these labels to the metrics. The urgency label in particular is important, as it's used for calculating SLIs; without that label, we current have no SLIs for the mailers queue.

For instance, see https://thanos.gitlab.net/graph?g0.range_input=1h&g0.max_source_resolution=0s&g0.expr=sum%20by%20(feature_category%2C%20external_dependencies%2C%20urgency)%20(sidekiq_jobs_completion_seconds_bucket%7Bworker%3D%22ActionMailer%3A%3AMailDeliveryJob%22%7D)&g0.tab=1. There is no urgency label there.

To test this, enable Prometheus in the GDK and create a mailer job by adding a comment that mentions someone. You'll see that sidekiq_jobs_completion_seconds_bucket{worker="ActionMailer::MailDeliveryJob"} now shows urgency="low" in your local Prometheus:

image

For gitlab-com/gl-infra/scalability#868 (closed).

Merge request reports

Loading