Skip to content

Adjust client middleware metrics Counter

Oswaldo Ferreira requested to merge osw-client-metrics-middleware-fix into master

What does this MR do?

According to https://github.com/mperham/sidekiq/wiki/Middleware the client middleware worker argument of Sidekiq can either be a String of a class name, or the class itself.

Here we're fixing the metrics by ensuring we're always passing a worker class to the create_labels method.

We can see locally that now we're storing the attributes correctly for latency sensitive and non-latency sensitive jobs:

sidekiq_enqueued_jobs_total{queue="new_issue",latency_sensitive="yes",external_dependencies="no",feature_category="issue_tracking",boundary="cpu"} 1
sidekiq_enqueued_jobs_total{queue="project_export",latency_sensitive="no",external_dependencies="no",feature_category="source_code_management",boundary="memory"} 1

gitlab-com/gl-infra/scalability#91 (closed)

Edited by Oswaldo Ferreira

Merge request reports