From be80d62ff9f8dccab12c117dc2b2ab4011476978 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Fri, 5 Nov 2021 09:03:37 -0700 Subject: [PATCH] Add sample code --- Pro-Changes.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Pro-Changes.md b/Pro-Changes.md index c8d4c958..982debbb 100644 --- a/Pro-Changes.md +++ b/Pro-Changes.md @@ -9,6 +9,14 @@ HEAD - Fix thread-safety issue with Sidekiq::Pro::Config - Allow job-specific options in Statsd metrics [#5037] +```ruby +# add to your initializer +Sidekiq::Server::Middleware::Statsd.options = ->(klass, job, q) do + {tags: ["worker:#{klass}", "queue:#{q}"]}.tap do |h| + h[:tags] << "tenant:#{job['tenant_id']}" if job["tenant_id"] + end +end +``` 5.2.4 ---------