Skip to content

Running dd-agent in heroku containers #381

@Parad0X

Description

@Parad0X

I'm trying to follow the instructions to setup dd-agent using Docker containers in Heroku but I ran into two issues:

  1. 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?

if [ -z "$DD_HOSTNAME" ]; then
if [ "$DD_DYNO_HOST" == "true" ]; then
# 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

  1. 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.

  2. PS. It would also be helpful to have an example of minimal datadog.yaml config file to get everything going using Docker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions