I need to install the Datadog agent on the Amazon Linux ec2 instances that are under the elastic beanstalk. I’m following the below documentation however after doing that, when I ssh to the ec2 to check, it seems like the agent is not installed. I tried to run the agent installation command manually and it's working fine but when i add the same command in .ebextensions to automate the process, it doesn’t work.
this is the structure of the code:
I have checked all the logs before the datadog wasn’t mentioned at all it seems like the Elastic beanstalk doesn’t see the file i put in the .ebextensions directory because when i ssh into the ec2 , and do
$ sudo service datadog-agent status
$ cat /etc/datadog-agent/datadog.yaml
$ cat /var/log/datadog/agent.log
It doesn’t create anything related to the datadog at all. It doesn’t even create any datadog directory
I tried to run the below command manually and it's working fine and the agent is installed (i have added the API key instead of "unused" word). However, when I add the same command in .ebextensions to automate the process, it doesn’t work.
DD_API_KEY= unused SITE="datadoghq.eu" DD_APM_INSTRUMENTATION_ENABLED=host bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"
Your help will be much appreciated.
I tried to run the below command manually and it's working fine and the agent is installed (i have added the API key instead of "unused" word). However, when I add the same command in .ebextensions to automate the process, it doesn’t work.
I'm configure Datadog with Bamboo agent And what helps me - I'm create Datadog.yml config file manually (/etc/datadog-agent/datadog.yaml). Exactly in my case when containers are builded using container_commands.
Also it's not need to use DD_API_KEY instead of UNUSED. DD_API_KEY should be stored in Datadog.yml file in api_key parameter for connecting to site defined in that file. But don't forget about security and think how to implement this value to Datadog.yml file