Coder Social home page Coder Social logo

sidekiq-datadog's Introduction

sidekiq-datadog

Datadog intrumentation for Sidekiq, integrated via server middleware.

Installation

Add this line to your application's Gemfile:

gem 'sidekiq-datadog'

Or install:

$ gem install sidekiq-datadog

Configure it in an initializer:

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add Sidekiq::Middleware::Server::Datadog
  end
end

Options

Options can be configured to be passed to the middleware constructor when it is added to the chain

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add(Sidekiq::Middleware::Server::Datadog, statsd_port: 3334)
  end
end

Custom tags can be configured using the tags: property

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add(Sidekiq::Middleware::Server::Datadog, tags: ['runtime:jruby'])
  end
end

Dynamic tags can be configured by passing a lambda in the tags array. It is executed at runtime when the job is processed

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add(Sidekiq::Middleware::Server::Datadog, tags: [->(worker, job, queue, error){
      "source:#{job['source']}"
    }])
  end
end

supported options

  • hostname - the hostname used for instrumentation, defaults to system hostname. Can also be set with the INSTRUMENTATION_HOSTNAME env var.
  • metric_name - the metric name (prefix) to use, defaults to "sidekiq.job".
  • tags - array of custom tags. These can be plain strings or lambda blocks
  • statsd_host - the statsD host, defaults to "localhost". Can also be set with the STATSD_HOST env var
  • statsd_port - the statsD port, defaults to 8125. Can also be set with the STATSD_PORT env var
  • statsd - custom statsd instance

For more detailed configuration options, please see the Documentation.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Make a pull request

sidekiq-datadog's People

Contributors

dim avatar vietord avatar cte avatar austenito avatar bradurani avatar mcasper avatar

Watchers

Michael Kuhinica avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.