Basic Agent Usage for macOS

Overview

This page outlines the basic features of the Datadog Agent for macOS. See the Supported Platforms documentation for the complete list of supported macOS distributions and versions.

Install the Agent

To install the Agent on macOS, follow the in-app instructions in Fleet Automation, and run the generated script on your hosts.

In-app installation steps for the Datadog Agent on a MacOS host.
By default, the Agent is installed in a sandbox located at /opt/datadog-agent. You can move this folder anywhere; however, this documentation assumes a default installation location.

Commands

The launchctl service manager controls the Agent lifecycle, while other commands can be executed through the Agent binary, systray app, or web GUI.

DescriptionCommand
Start Agent as a servicelaunchctl start com.datadoghq.agent or systray app
Stop Agent running as a servicelaunchctl stop com.datadoghq.agent or systray app
Restart Agent running as a serviceStop and then start the Agent with:
launchctl stop com.datadoghq.agent
launchctl start com.datadoghq.agent
Or use the systray app
Status of Agent servicelaunchctl list com.datadoghq.agent or systray app
Status page of running Agentdatadog-agent status or web GUI
Send flaredatadog-agent flare or web GUI
Display command usagedatadog-agent --help
Run a checkdatadog-agent check <CHECK_NAME>

Configuration

The Datadog Agent configuration file is located in /etc/datadog-agent/datadog.yaml. This YAML file holds the host-wide connection details used to send data to Datadog including:

  • api_key: your organization’s Datadog API key
  • site: target Datadog region (for example datadoghq.com, datadoghq.eu, ddog-gov.com)
  • proxy: HTTP/HTTPS proxy endpoints for outbound traffic (see Datadog Agent Proxy Configuration)
  • Default tags, log levels, and Datadog configurations.

A fully commented reference file, located in /etc/datadog-agent/datadog.yaml.example, lists every available option for comparison or copy-paste. Alternatively, see the sample config_template.yaml file for all available configuration options.

Integration files

Configuration files for integrations are found in /etc/datadog-agent/conf.d/. Each integration has its own sub-directory, <INTEGRATION>.d/, which contains:

  • conf.yaml: the active configuration controlling how the integration gathers metrics and logs
  • conf.yaml.example: a sample illustrating supported keys and defaults

Uninstall the Agent

To uninstall the Agent, run the following command:

Single user installation

To remove the Agent and all Agent configuration files:

  1. Stop and close the Datadog Agent with the bone icon in the tray.
  2. Drag the Datadog application from the application folder to the trash bin.
  3. Run the following commands:
    sudo rm -rf /opt/datadog-agent
    sudo rm -rf /usr/local/bin/datadog-agent
    sudo rm -rf ~/.datadog-agent/** # to remove broken symlinks
    launchctl remove com.datadoghq.agent
    sudo rm -rf /var/log/datadog
    
  4. Reboot your machine for the changes to take effect.

Uninstall the Agent

To remove the Agent and all Agent configuration files:

  1. Drag the Datadog application from the application folder to the trash bin.
  2. To remove remaining files, run the following:
    sudo rm -rf /opt/datadog-agent
    sudo rm -rf /usr/local/bin/datadog-agent
    sudo rm -rf ~/.datadog-agent/** # to remove broken symlinks
    sudo launchctl disable system/com.datadoghq.agent && sudo launchctl bootout system/com.datadoghq.agent
    sudo launchctl unload /Library/LaunchDaemons/com.datadoghq.agent.plist
    sudo rm /Library/LaunchDaemons/com.datadoghq.agent.plist
    sudo rm -rf /var/log/datadog
    
  3. Reboot your machine for the changes to take effect.

Troubleshooting

See the Agent Troubleshooting documentation for troubleshooting steps.

Working with the embedded Agent

The Agent contains an embedded Python environment at /opt/datadog-agent/embedded/. Common binaries such as python and pip are contained within /opt/datadog-agent/embedded/bin/.

See the instructions on how to add packages to the embedded Agent for more information.

Further Reading