miketheman / heroku-buildpack-datadog

Heroku Buildpack to run Datadog DogStatsD in a Dyno
http://miketheman.github.io/heroku-buildpack-datadog
MIT License
55 stars 35 forks source link

Selectively disable the datadog agent. This can be useful for some heroku run invocations. #8

Closed dreid closed 8 years ago

dreid commented 8 years ago

An alternative approach would be to check if the DYNO env var matched run.[0-9]+ and then bail but this is a much lower impact change.

miketheman commented 8 years ago

Nice, thanks! Can you elaborate a bit on why someone might not want to start the agent, but have the it installed anyhow?

dreid commented 8 years ago

heroku run is the primary use case, since a slug for an app is used by all dynos you can't really prevent the agent from being installed in the one-off dynos used by heroku run.

miketheman commented 8 years ago

:+1: Thanks!

miketheman commented 8 years ago

@dreid I tried this today:

$ heroku run --env DISABLE_DATADOG_AGENT=true bash
Running bash on $DYNONAME... up, run.5324
DISABLE_DATADOG_AGENT environment variable is set, not starting the agent.
$

I get immediately disconnected, and cannot use bash in the environment. Have you had success with this?

dreid commented 8 years ago

It appears to not work because of the early exit (I guess all the scripts run in the same shell)

I will try to find time to work on a patch next week.