Getting Started with the Agent
Overview
This guide introduces the Datadog Agent and covers:
What is the Datadog Agent?
The Datadog Agent is software that runs on your hosts. It collects events and metrics from hosts and sends them to Datadog, where you can analyze your monitoring and performance data.
The Agent can run on:
- Local hosts (Windows, macOS)
- Containerized environments (Docker, Kubernetes)
- On-premises data centers
You can also install and configure the Agent using configuration management tools like Chef, Puppet, or Ansible.
The Agent can collect 75-100 system-level metrics every 15-20 seconds. With additional configuration, it can send live data, logs, and traces from running processes to Datadog. The Datadog Agent is open source, and its source code is available on GitHub at DataDog/datadog-agent.
The Agent configuration file
The Agent’s main configuration file is datadog.yaml. The required parameters are:
See the sample config_template.yaml file for all available configuration options. You can adjust the Agent configuration files to take advantage of other Datadog features.
Installation
Prerequisites
Create a Datadog account.
Have your Datadog API key on hand.
Setup
Use Fleet Automation, the Datadog in-app workflow, to install, upgrade, configure, and troubleshoot the Datadog Agent on a single host or at scale.
See the Agent documentation for additional Agent configuration for your specific platform.
Data collected by the Agent
To give you full visibility into your infrastructure, the Datadog Agent reports metrics about its own health and configuration, as well as metrics gathered from your hosts and services through its default checks.
Agent metrics
The Agent reports the following metrics to Datadog about itself. These metrics provide information about which hosts or containers have running Agents, when each Agent started, and the Python version the Agent is using.
| Metric | Description |
|---|
datadog.agent.running | Shows a value of 1 if the Agent is reporting to Datadog. |
datadog.agent.started | A count sent with a value of 1 when the Agent starts (available in v6.12+). |
datadog.agent.python.version | The metric is tagged with the python_version. |
See the Agent Metrics integration for a full list of Agent metrics.
Checks
Depending on your platform, the Agent has several core checks enabled by default that collect metrics.
To collect metrics from other technologies, see the Integrations page.
Service checks
The Agent is set up to provide the following service checks:
datadog.agent.up: Returns OK if the Agent connects to Datadog.datadog.agent.check_status: Returns CRITICAL if an Agent check is unable to send metrics to Datadog; otherwise returns OK.
These checks can be used in Datadog to visualize the Agent status through monitors and dashboards at a glance. See Service Check Overview to learn more.
Advanced configurations and features
There are key differences between installing Agents on a host and in a containerized environment:
Additionally, see the Docker Agent or Kubernetes for a walkthrough on running the Agent in a containerized environment.
Tags add an additional layer of metadata to your metrics and events. They allow you to scope and compare your data in Datadog visualizations. When data is sent to Datadog from multiple hosts, tagging this information allows you to scope down to the data you are most interested in visualizing.
For example, let’s say you have data that is collected from different teams and you are only interested in seeing the metrics from team alpha, tagging those specific hosts with either the team:alpha or team:bravo tag gives you the ability to filter down to the metrics that are tagged with team:alpha. See Getting Started with Tags to learn more about tagging your data.
Locate your Agent’s main configuration file. For Ubuntu, the file location is /etc/datadog-agent/datadog.yaml.
In the datadog.yaml file, locate the tags parameter. Host-level tags can be set in the datadog.yaml configuration to apply tags on all metrics, traces and logs forwarded from this host.
## @param tags - list of key:value elements - optional
## @env DD_TAGS - space separated list of strings - optional
## List of host tags. Attached in-app to every metric, event, log, trace, and service check emitted by this Agent.
##
## This configuration value merges with `DD_EXTRA_TAGS`, allowing some
## tags to be set in a configuration file (`tags`), and additional tags to be added
## with an environment variable (`DD_EXTRA_TAGS`).
##
## Learn more about tagging: https://docs.datadoghq.com/tagging/
#
# tags:
# - team:infra
# - <TAG_KEY>:<TAG_VALUE>
Uncomment the tags parameter and the provided example team:infra tag. You can also add your own custom tag, for example test:agent_walkthrough.
## @param tags - list of key:value elements - optional
## @env DD_TAGS - space separated list of strings - optional
## List of host tags. Attached in-app to every metric, event, log, trace, and service check emitted by this Agent.
##
## This configuration value merges with `DD_EXTRA_TAGS`, allowing some
## tags to be set in a configuration file (`tags`), and additional tags to be added
## with an environment variable (`DD_EXTRA_TAGS`).
##
## Learn more about tagging: https://docs.datadoghq.com/tagging/
#
tags:
- team:infra
- test:agent_walkthrough
Restart the Agent by running the Agent’s restart command. The Ubuntu restart command:
sudo service datadog-agent restart
After a few minutes, go to the Metrics Summary page again, and click on the metric datadog.agent.started. In addition to the default host and version tags, you can also see the team tag and any personal tags you added. You can also filter metrics by the Tag field at the top of the page.
Go to the Events Explorer page and find the custom tags displayed with the latest Agent Event.
You can confirm the Agent is running correctly by checking its default metrics in the Datadog UI. Go to the Metrics Summary page and search for the metric datadog.agent.started or the metric datadog.agent.running. If these metrics are not visible right away, it may take a few minutes for the Agent to send the data to Datadog.
Click on either of the metrics and a Metric panel opens. This panel shows additional metadata about where these metrics are collected and any associated tags. If no tags are configured on a host, you should see only the default tags that Datadog assigns to the metrics including version and host. See the section above on setting tags through the Agent configuration files to learn more about how to add tags.
Explore other default metrics such as ntp.offset or system.cpu.idle.
The amount of space and resources the Agent takes up depends on the configuration and what data the Agent is sending. At the onset, you can expect around 0.08% CPU used on average with a disk space of roughly 880MB to 1.3GB.
See Agent Overhead to learn more about these benchmarks.
The collection of logs, traces, and processes data can be enabled through the Agent configuration file. These features are not enabled by default. For example, in the configuration file, the logs_enabled parameter is set to false.
##################################
## Log collection Configuration ##
##################################
## @param logs_enabled - boolean - optional - default: false
## @env DD_LOGS_ENABLED - boolean - optional - default: false
## Enable Datadog Agent log collection by setting logs_enabled to true.
#
# logs_enabled: false
Other Datadog features that can be configured through the Agent configuration file include:
Throughout your setup, when the documentation refers to the datadog.yaml file or the Agent configuration file, this is the file you need to configure.
Commands
See Agent Commands to Start, Stop or Restart your Agent.
Troubleshooting
For help troubleshooting the Agent:
Further Reading
Additional helpful documentation, links, and articles:
Next steps
After the Agent is installed: