Skip to content

Instantly share code, notes, and snippets.

@obiyann
Last active April 18, 2024 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obiyann/1dd57b8bfe77a6800c1c16a789b0dd7d to your computer and use it in GitHub Desktop.
Save obiyann/1dd57b8bfe77a6800c1c16a789b0dd7d to your computer and use it in GitHub Desktop.
Minimum Datadog agent configuration: enable all Datadog agent configuration: logs, live processes and network traffic
##########
# 1- Install the Datadog agent
##########
# Install the agent with the command found on the Datadog instance agent page:
# https://app.datadoghq.com/account/settings/agent/latest
# HIGHLY RECOMMENDED: enable Single Step APM instrumentation so you won't have to do it later.
# For Ubuntu:
% DD_API_KEY=<API_KEY> DD_SITE="datadoghq.com" DD_APM_INSTRUMENTATION_ENABLED=host bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"
##########
# 2- Update the Datadog agent
##########
# Once the Datadog agent is installed, edit the minimum-datadog.yaml (see below) and update the <API_KEY>
# Then replace the current datadog.yaml file with this minimum datadog configuration file.
# For Ubuntu:
% vi minimum-datadog.yaml
% cp minimum-datadog.yaml /etc/datadog-agent/datadog.yaml
##########
# 3- Enable Network Traffic Monitoring
##########
# For Ubuntu:
# Copy the system-probe example configuration
% sudo -u dd-agent install -m 0640 /etc/datadog-agent/system-probe.yaml.example /etc/datadog-agent/system-probe.yaml
# Replace the content of the /etc/datadog-agent/system-probe.yaml with the two lines from the below system-probe.yaml file
% vi /etc/datadog-agent/system-probe.yaml
# Manually start the system-probe and enable it to start on boot
% sudo systemctl start datadog-agent-sysprobe
% sudo systemctl enable datadog-agent-sysprobe
##########
# 4- We're done: restart the agent
##########
% sudo systemctl restart datadog-agent
# Datadog instance key and site
# Replace <API_KEY> with your Datadog API key
# Update the site according to where your Datadog instance is hosted:
# US1: datadoghq.com
# US3: us3.datadoghq.com
# US5: us5.datadoghq.com
# EU1: datadoghq.eu
# US1-FED: ddog-gov.com
# AP1: ap1.datadoghq.com
# More info on Datadog sites: https://docs.datadoghq.com/getting_started/site/
api_key: <API_KEY>
site: datadoghq.com
# Set tags. Replace <TAG_KEY>:<TAG_VALUE> with a series of key:value pairs.
# replace <environment name> with an environment value. E.g. dev or prod orc qa.
tags:
- team:infra
- <TAG_KEY>:<TAG_VALUE>
env: <environment name>
# Enable agent log collection
logs_enabled: true
# Enable agent live process collection
process_config:
process_collection:
enabled: true
interval: 4h
network_config:
enabled: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment