Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace not being used with Sidekiq Pro #292

Open
travisTheOrange opened this issue Aug 22, 2024 · 5 comments
Open

Namespace not being used with Sidekiq Pro #292

travisTheOrange opened this issue Aug 22, 2024 · 5 comments

Comments

@travisTheOrange
Copy link

travisTheOrange commented Aug 22, 2024

We're using Datadog and have configured both DD and Sidekiq Pro to send Sidekiq metrics to our Datadog agent. However, when in Datadog the only way we can view the various metrics from Sidekiq is with the prefix jobs.*, rather than sidekiq.jobs.*.

Our Sidekiq config file (located in config/initializers/sidekiq.rb) looks like this:

require 'datadog/statsd' # gem 'dogstatsd-ruby'

Sidekiq.configure_server do |config|
  config.dogstatsd = ->{ Datadog::Statsd.new(socket_path: ENV['SOCKET_PATH'], namespace: 'sidekiq') }
  config.server_middleware do |chain|
    require 'sidekiq/middleware/server/statsd'
    chain.add Sidekiq::Middleware::Server::Statsd
  end
end

The first line within the Sidekiq.configure_server block was originally not there. Previously we had this line outside the config block, set as:

Sidekiq::Pro.dogstatsd = ->{ Datadog::Statsd.new(socket_path: ENV['SOCKET_PATH'], namespace:'sidekiq') }

Which resulted in no metrics being sent, maybe. We are seeing metrics in DD now, but we're unsure if it's because of the aforementioned code change or using the prefix jobs.* instead of sidekiq.jobs.*

@travisTheOrange
Copy link
Author

Is anyone able to help with this?

@carlosroman
Copy link

Any reason why you've chosen the namespace as being sidekiq? This is causing all metrics to have sidekiq appended to them, see here.

@travisTheOrange
Copy link
Author

@carlosroman are you suggesting that even metrics not belonging to Sidekiq would have the prefix sidekiq.*? So metrics from Datadog would all be prefixed with sidekiq.*?

And I'd say that in theory it would cause all metrics to have the sidekiq.* prefix, however, as per my raised issue, no metrics are being prefixed with sidekiq.*

@carlosroman
Copy link

Sorry, I thought you meant that all your metrics are getting sidekiq appended to them. So adding a namespace doesn't seem to actually prefix the metrics at the moment?

@travisTheOrange
Copy link
Author

@carlosroman yeah exactly. Although I raised this issue in the Sidekiq repo and was told the issue is known and being worked on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants