The Service Map for APM is here!


Crawler Crawler


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:

require 'rubygems'
require 'dogapi'

api_key = "abcdef123456"
application_key = "fedcba654321"

# Submitting events does not require the application key.
dog =, application_key)

# Send a new event.
dog.emit_event('Testing done, FTW'), :host => "my_host")

Start instrumenting your code using the DogStatsD client:

# Load the dogstats module.
require 'datadog/statsd'

# Create a stats instance.
statsd ='localhost', 8125)

# Increment a counter.

# Record a gauge 50% of the time.
statsd.gauge('', 123, :sample_rate=>0.5)


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

Log collection

Available for Agent v>6.0

We recommend to use lograge as it helps bringing some sanity in logs that are noisy and hardly parseable. Follow our Ruby logging guide to start forwarding your Ruby on Rails logs to Datadog.


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


Need help? Contact Datadog Support.