You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to follow the instructions to setup dd-agent using Docker containers in Heroku but I ran into two issues:
datadog-agent won't start without DD_HOSTNAME being set. There's code in datadog.sh that sets it but how is DD_HOSTAME supposed to be set without the buildpack?
# Set the hostname to dyno name and ensure rfc1123 compliance.
HAN="$(echo "$HEROKU_APP_NAME"| sed -e 's/[^a-zA-Z0-9-]/-/g' -e 's/^-//g')"
if [ "$HAN"!="$HEROKU_APP_NAME" ];then
if [ "$DD_LOG_LEVEL_LOWER"=="debug" ];then
echo"WARNING: The appname \"$HEROKU_APP_NAME\" contains invalid characters. Using \"$HAN\" instead."
fi
fi
D="$(echo "$DYNO"| sed -e 's/[^a-zA-Z0-9.-]/-/g' -e 's/^-//g')"
export DD_HOSTNAME="$HAN.$D"
else
# Set the hostname to the dyno host
DD_HOSTNAME="$(echo "$DYNOHOST"| sed -e 's/[^a-zA-Z0-9-]/-/g' -e 's/^-//g')"
export DD_HOSTNAME
fi
else
# Generate a warning about DD_HOSTNAME deprecation.
if [ "$DD_LOG_LEVEL_LOWER"=="debug" ];then
echo"WARNING: DD_HOSTNAME has been set. Setting this environment variable may result in metrics errors. To remove it, run: heroku config:unset DD_HOSTNAME"
fi
fi
CMD ["./scripts/entrypoint.sh"] does not start the agent. I can't find anything in Heroku documentation that would explain how to run multiple processes in a container. If I just run the script from the command line in the dyno the agent starts, there are no errors.
PS. It would also be helpful to have an example of minimal datadog.yaml config file to get everything going using Docker.
The text was updated successfully, but these errors were encountered:
You can set DD_HOSTNAME as an environment variable in Heroku and it will be passed to the container.
In a docker file, only the last CMD will be executed. The simplest way to work around this is to create a small script file that you can call from the CMD line. In that script file, you can call entrypoint.sh and start whatever other process you need.
Makes sense. But in this case if I have multiple dynos which all have their unique internal host names, this information will be lost and in DD their traces will be all grouped together.
Yes but there's also heroku.yml which specifies a run command for each type of dyno and they all share the same Dockerfile so I don't see how that's going to work.
I'm trying to follow the instructions to setup
dd-agent
using Docker containers in Heroku but I ran into two issues:datadog-agent
won't start withoutDD_HOSTNAME
being set. There's code indatadog.sh
that sets it but how isDD_HOSTAME
supposed to be set without the buildpack?heroku-buildpack-datadog/extra/datadog.sh
Lines 116 to 138 in 2f197c9
CMD ["./scripts/entrypoint.sh"]
does not start the agent. I can't find anything in Heroku documentation that would explain how to run multiple processes in a container. If I just run the script from the command line in the dyno the agent starts, there are no errors.PS. It would also be helpful to have an example of minimal
datadog.yaml
config file to get everything going using Docker.The text was updated successfully, but these errors were encountered: