Skip to content
This repository has been archived by the owner on Dec 2, 2018. It is now read-only.

Add dyno name to host name #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ Once started, provides a listening port on 8125 for statsd/dotstatsd metrics and

An example using Ruby is [here](https://github.com/miketheman/buildpack-example-ruby).

## Extra configuration

- If `$DATADOG_USE_DYNO_NAME` is set, reporting to datadog will include the dyno
name instead of just the application name.


## Todo

Things that have not been tested, tried, figured out.
Expand Down
7 changes: 6 additions & 1 deletion extra/run-dogstatsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ else
fi

if [[ $HEROKU_APP_NAME ]]; then
sed -i -e "s/^.*hostname:.*$/hostname: ${HEROKU_APP_NAME}/" /app/.apt/opt/datadog-agent/agent/datadog.conf
if [[ $DATADOG_USE_DYNO_NAME ]]; then
hostname=${HEROKU_APP_NAME}.${DYNO}
else
hostname=${HEROKU_APP_NAME}
fi
sed -i -e "s/^.*hostname:.*$/hostname: ${hostname}/" /app/.apt/opt/datadog-agent/agent/datadog.conf
else
echo "HEROKU_APP_NAME environment variable not set. Run: heroku apps:info|grep ===|cut -d' ' -f2"
exit 1
Expand Down