Created
November 28, 2019 01:43
-
-
Save tatey/cb0a94f2bac162538301ea6a19326fb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Datadog bills by the number of unique hosts that were used in the month and | |
# every time we launch a one off dyno it results in a new | |
# host (e.g. run.4030404). This script is executed when the dyno launches and | |
# determines whether the agent should be running to reduce the number of | |
# unique hosts that we are billed for. | |
# Disable the Datadog Agent for one-off runs (e.g. console, release). | |
if [ "$DYNOTYPE" == "run" ] || [ "$DYNOTYPE" == "release" ]; then | |
echo "[Datadog Prerun] Disabling agent because this is a one-off dyno" | |
DISABLE_DATADOG_AGENT="true" | |
fi | |
# Disable APM reporting on non-web dynos. | |
if [ "$DYNOTYPE" != "web" ]; then | |
echo "[Datadog Prerun] Disabling APM because this is not a web dyno" | |
DD_APM_ENABLED="false" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment