How to customize statsd tags in Sidekiq Pro?

221 views
Skip to first unread message

Jordan Brough

unread,
Oct 28, 2021, 1:59:54 PM10/28/21
to Sidekiq
We have a multi-tenant application and we'd like to add a "tenant" tag to our Sidekiq statsd metrics.  Is there a supported way to do that?

Thanks.

Mike Perham

unread,
Oct 28, 2021, 2:20:49 PM10/28/21
to sid...@googlegroups.com
Hi Jordan, dogstatsd has the concept of global tags, set when creating the connection `Dogstatsd::Client.new(tags: ["foo:bar"])` and then per-metric tags. You can add your own tags to any of your own custom metrics but there's no way to set thread-local tags for each metric that Pro/Ent create internally. That would be a reasonable feature request if you want to open an issue. Can you give me more specifics about your usecase? Which metric(s) do you want to track per-tenant?

On Thu, Oct 28, 2021 at 10:59 AM Jordan Brough <jor...@broughs.net> wrote:
We have a multi-tenant application and we'd like to add a "tenant" tag to our Sidekiq statsd metrics.  Is there a supported way to do that?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/5dd288ad-bc86-414d-be5a-19a9dd3167a9n%40googlegroups.com.


--
Mike Perham – CEO, Contributed Systems
Smart, effective open source infrastructure for your apps.

Jordan Brough

unread,
Oct 28, 2021, 2:51:26 PM10/28/21
to Sidekiq
Thanks Mike.

> Can you give me more specifics about your usecase?

We'd like to be able to group or filter metrics by tenant using the existing metrics that Pro provides ("jobs.count/perform/success/failure").

E.g. in Datadog we'd like to be able to create graphs for queries like this:
sum:sidekiq.jobs.count{env:production} by {tenant}.as_count()
or this:
max:sidekiq.jobs.perform.max{env:production,tenant:some-tenant}

If it were possible to do something like set thread-local tags that Sidekiq would include on any metrics it emits that could work great.

> That would be a reasonable feature request if you want to open an issue

Great, if that sounds reasonable should I post the above on https://github.com/mperham/sidekiq/issues then?

Mike Perham

unread,
Oct 28, 2021, 3:14:10 PM10/28/21
to sid...@googlegroups.com
Yep, mperham/sidekiq/issues/new

--
Mike Perham, CEO — Contributed Systems

Jordan Brough

unread,
Oct 28, 2021, 3:26:59 PM10/28/21
to Sidekiq
Reply all
Reply to author
Forward
0 new messages