Logging is here!




The Ruby integration allows you to monitor custom metrics by simply adding a few lines of code to your Ruby application. For example, you can have a metric that returns the number of page views or the time of any function call. For additional information about the Ruby integration, please refer to the guide on submitting metrics. For advanced usage, please refer to the documentation in the repositories listed below. You can also review the API docs for details on how to use the API with Ruby.

Datadog offers two libraries to assist you with the implementation of Ruby application metrics:

  • dogstatsd-ruby A client for DogStatsD, an extension of the StatsD metric server for Datadog.
  • dogapi-rb The Ruby client is a library suitable for inclusion in existing Ruby projects or for development of standalone scripts. It provides an abstraction on top of Datadog’s raw HTTP interface for reporting events and metrics.



  1. To install the Ruby client for the Datadog API:

    gem install dogapi

    To install the dogstatsd-ruby client for DogStatsD:

    gem install dogstatsd-ruby
  2. Start instrumenting your code using the Datadog API: ```ruby

require ‘rubygems’ require ‘dogapi’

api_key = “abcdef123456” application_key = “fedcba654321”

dog = Dogapi::Client.new(api_key, application_key)

dog.emit_event(Dogapi::Event.new(‘Testing done, FTW’), :host => “my_host”)

Start instrumenting your code using the DogStatsD client:

require 'datadog/statsd'

statsd = Datadog::Statsd.new('localhost', 8125)


statsd.gauge('users.online', 123, :sample_rate=>0.5)


There is nothing that you need to do in the Datadog application to configure Ruby.


Go to the Metrics explorer page and see that it just works!


Need help? Contact Datadog Support.

Further Reading

Learn more about infrastructure monitoring and all our integrations on our blog