Skip to content

Agent Architecture

alq666 edited this page Dec 14, 2012 · 18 revisions

Introduction

This page gives you an overview of the agent, what its components are, how they interact with each other, how we collect data on the machine and how it is transmitted to Datadog HQ (https://app.datadoghq.com)

Components

The agent is composed of 5 major components, all written in Python. Each component runs in a separate process.

  1. The collector (agent.py), responsible for gathering system and application metrics from the machine.
  2. The forwarder (ddagent.py), responsible for buffering and communicating with Datadog HQ over SSL.
  3. dogstatsd (dogstatsd.py), responsible for aggregating local metrics sent from your code
  4. pup (pup.py), a simple web-socket frontend to display metrics being collected in real time
  5. supervisord, responsible for keeping all previous processes up and running.

When running on platforms with Python <= 2.4, only the collector and dogstatsd are available.

Supervision, Privileges and Network Ports

supervisord runs a master process as root and forks all subprocesses as the user dd-agent. The agent configuration resides at /etc/dd-agent/datadog.conf and must be readable by dd-agent. The recommended permissions on that file are 0600 since it contains your API key and other credentials needed to access metrics (e.g. mysql, postgresql metrics).

The following ports are open for normal operations:

  • forwarder tcp/17123 for normal operations and tcp/17124 if graphite support is turned on
  • dogstatsd udp/8125
  • pup tcp/17125

All listening processes are bound by default to 127.0.0.1 and/or ::1 on v 3.4.1 and greater of the agent. In earlier versions, they were bound to 0.0.0.0 (i.e. all interfaces).

The Collector

This is where all standard metrics