Heroku Buildpack Datadog banner
DataDog DataDog

Heroku Buildpack Datadog

Development community

Description

Heroku Buildpack to run the Datadog Agent in a Dyno

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Datadog Heroku Buildpack

This [Heroku buildpack][1] installs the Datadog Agent in your Heroku dyno to collect system metrics, custom application metrics, and traces. To collect custom application metrics or traces, include the language appropriate [DogStatsD or Datadog APM library][2] in your application.

Installation

Follow the [in-app installation guide in Fleet Automation][33] to install the Datadog Agent on Heroku.

This guide assumes that you already have your application running on Heroku. See the [Heroku documentation][34] to learn how to deploy your application to Heroku.

  1. Go to [Datadog API settings][3] and copy your Datadog API key. Export it to an environment variable:

    export DD_API_KEY=
  2. Export your application name to the APPNAME environment variable:

    export APPNAME=
  3. Export your Datadog site to the DD_SITE environment variable:

    export DD_SITE={{< region-param key=dd_site code="true" >}}
  4. Add the Datadog buildpack to your project:

    cd 
    
    # Enable Heroku Labs Dyno Metadata to set HEROKU_APP_NAME env variable automatically
    heroku labs:enable runtime-dyno-metadata -a $APPNAME
    
    # Set hostname in Datadog as appname.dynotype.dynonumber for metrics continuity
    heroku config:add DD_DYNO_HOST=true -a $APPNAME
    
    # Set the DD_SITE env variable automatically
    heroku config:add DD_SITE=$DD_SITE -a $APPNAME
    
    # Add this buildpack and set your Datadog API key
    heroku buildpacks:add --index 1 https://github.com/DataDog/heroku-buildpack-datadog.git -a $APPNAME
    heroku config:add DD_API_KEY=$DD_API_KEY -a $APPNAME
    
    # Deploy to Heroku forcing a rebuild
    git commit --allow-empty -m "Rebuild slug"
    git push heroku main

Once complete, the Datadog Agent is started automatically when each dyno starts.

The Datadog Agent provides a listening port on `8125` for statsd/dogstatsd m