Skip to content

Namespace not being used with Sidekiq Pro #292

@travisTheOrange

Description

@travisTheOrange

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.*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions