---
title: Datadog Agent
description: Monitor the health and performance of the Datadog Agent through its telemetry.
breadcrumbs: Docs > Integrations > Datadog Agent
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Datadog Agent
Supported OS 
{% callout %}
# Important note for users on the following Datadog sites: us2.ddog-gov.com

{% alert level="info" %}
To find out if this integration is available in your organization, see your [Datadog Integrations](https://app.datadoghq.com/integrations) page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email [support@ddog-gov.com](mailto:support@ddog-gov.com).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

This check monitors the [Datadog Agent](https://docs.datadoghq.com/agent.md) itself by scraping the internal telemetry it exposes in the OpenMetrics format. Use it to track the health and throughput of the Agent's core components, such as the forwarder, DogStatsD, the aggregator, the check scheduler, and the Logs Agent.

This integration replaces the deprecated [Agent Metrics](https://docs.datadoghq.com/integrations/agent_metrics.md) integration, which collects similar data through the `go_expvar` check. Compared to the expvar endpoint, the telemetry endpoint provides typed metrics, more granular tags, and a larger set of available metrics.

**Note:** The Agent's internal telemetry might change between minor Agent versions. Such changes might not be mentioned in the Agent's changelog.

## Setup{% #setup %}

### Installation{% #installation %}

The Datadog Agent check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package. No additional installation is needed.

Some default metrics require Agent v7.86.0 or later. Earlier Agent versions report only part of the default set.

### Configuration{% #configuration %}

The Agent always serves its telemetry at `/telemetry` on the port set by `expvar_port` in [`datadog.yaml`](https://docs.datadoghq.com/agent/configuration/agent-configuration-files.md), which defaults to `5000`. This check does not require `telemetry.enabled: true`. That setting only enables additional telemetry.

1. Edit the `datadog_agent.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory](https://docs.datadoghq.com/agent/configuration/agent-configuration-files.md). See the [sample datadog_agent.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/datadog_agent/datadog_checks/datadog_agent/data/conf.yaml.example) for all available configuration options. For example:

   ```yaml
   init_config:
   
   instances:
     - openmetrics_endpoint: http://localhost:5000/telemetry
   ```

To collect telemetry beyond the default set, list the metrics to add with the `extra_metrics` option. You can view all available metrics by querying the `/telemetry` endpoint directly.

1. [Restart the Agent](https://docs.datadoghq.com/agent/configuration/agent-commands.md#start-stop-and-restart-the-agent).

### Validation{% #validation %}

[Run the Agent's status subcommand](https://docs.datadoghq.com/agent/configuration/agent-commands.md#agent-status-and-information) and look for `datadog_agent` under the Checks section.

### Migrating from Agent Metrics{% #migrating-from-agent-metrics %}

The Datadog Agent integration collects similar data to the [Agent Metrics](https://docs.datadoghq.com/integrations/agent_metrics.md) integration, but most metric names, types, and tags differ. You must update any dashboards and monitors that query metrics from the Agent Metrics integration.

1. Configure the Datadog Agent integration as described in Configuration.
1. Optionally, keep `go_expvar.d/agent_stats.yaml` in place while you update your dashboards and monitors, so that you can compare the old and new metrics. Three metrics have the same name in both integrations: `datadog.agent.aggregator.dogstatsd_contexts`, `datadog.agent.forwarder.transactions.retry_queue_size`, and `datadog.agent.scheduler.checks_entered`. While both checks run, each check submits these metrics.
1. Update your dashboards and monitors using the metric mapping.
1. Remove `go_expvar.d/agent_stats.yaml` and [restart the Agent](https://docs.datadoghq.com/agent/configuration/agent-commands.md#start-stop-and-restart-the-agent).

#### Behavior changes{% #behavior-changes %}

- **Counters are submitted as counts.** Agent Metrics submitted counters as per-second rates. The Datadog Agent integration submits them as counts with a `.count` suffix. For example, to get the equivalent of `datadog.agent.forwarder.transactions.success`, query `datadog.agent.forwarder.transactions.success.count` with the `.as_rate()` function.

- **Related metrics are combined and distinguished by tags.** For example, `datadog.agent.dogstatsd.processed.count`, tagged by `message_type` and `state`, replaces the separate DogStatsD packet and parse error metrics.

- **Some metrics are now under the `datadog.agent.` namespace.** Agent Metrics submitted `scheduler.queues.size`, `scheduler.queues.interval`, `batch_strategy.idle_time`, and `batch_strategy.in_use_time` without a namespace.

- **Go runtime metrics are not collected by default.** Agent Metrics also collected Go memory statistics, such as `datadog.agent.memstats.heap_alloc`. The telemetry endpoint exposes them as `go_memstats_*` and `go_gc_*` metrics. To collect them, use the `extra_metrics` option. For example:

  ```yaml
  instances:
    - openmetrics_endpoint: http://localhost:5000/telemetry
      extra_metrics:
        - go_memstats_heap_alloc_bytes: go.memstats.heap_alloc
        - go_memstats_heap_inuse_bytes: go.memstats.heap_inuse
  ```

#### Metric mapping{% #metric-mapping %}

Unless noted otherwise, all metric names in the table are prefixed with `datadog.agent.`.

| Agent Metrics metric                                          | Datadog Agent metric                                                                                                 |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `forwarder.transactions.success`                              | `forwarder.transactions.success.count`                                                                               |
| `forwarder.transactions.errors`                               | `forwarder.transactions.errors.count`                                                                                |
| `forwarder.transactions.errors_by_type.dns_errors`            | `forwarder.transactions.errors.count` with `error_type:dns_lookup_failure`                                           |
| `forwarder.transactions.errors_by_type.tls_errors`            | `forwarder.transactions.errors.count` with `error_type:tls_handshake_failure`                                        |
| `forwarder.transactions.errors_by_type.connection_errors`     | `forwarder.transactions.errors.count` with `error_type:connection_failure`                                           |
| `forwarder.transactions.errors_by_type.wrote_request_errors`  | `forwarder.transactions.errors.count` with `error_type:writing_failure`                                              |
| `forwarder.transactions.errors_by_type.sent_request_errors`   | `forwarder.transactions.errors.count` with `error_type:invalid_request`                                              |
| `forwarder.transactions.http_errors`                          | `forwarder.transactions.http_errors.count`, tagged by `code`                                                         |
| `forwarder.transactions.retry_queue_size`                     | `forwarder.transactions.retry_queue_size`, tagged by `domain`                                                        |
| `forwarder.transactions.dropped_on_input`                     | No longer reported by the Agent. See `forwarder.transactions.dropped.count`.                                         |
| `dogstatsd.metric_packets`                                    | `dogstatsd.processed.count` with `message_type:metrics` and `state:ok`                                               |
| `dogstatsd.metric_parse_errors`                               | `dogstatsd.processed.count` with `message_type:metrics` and `state:error`                                            |
| `dogstatsd.event_packets`                                     | `dogstatsd.processed.count` with `message_type:events` and `state:ok`                                                |
| `dogstatsd.event_parse_errors`                                | `dogstatsd.processed.count` with `message_type:events` and `state:error`                                             |
| `dogstatsd.service_check_packets`                             | `dogstatsd.processed.count` with `message_type:service_checks` and `state:ok`                                        |
| `dogstatsd.service_check_parse_errors`                        | `dogstatsd.processed.count` with `message_type:service_checks` and `state:error`                                     |
| `dogstatsd_udp.packets`                                       | `dogstatsd_udp.packets.count` with `state:ok`                                                                        |
| `dogstatsd_udp.packet_reading_errors`                         | `dogstatsd_udp.packets.count` with `state:error`                                                                     |
| `dogstatsd_uds.packets`                                       | `dogstatsd_uds.packets.count` with `state:ok`                                                                        |
| `dogstatsd_uds.packet_reading_errors`                         | `dogstatsd_uds.packets.count` with `state:error`                                                                     |
| `dogstatsd_uds.origin_detection_errors`                       | `dogstatsd_uds.origin_detection_errors.count`                                                                        |
| `aggregator.dogstatsd_contexts`                               | `aggregator.dogstatsd_contexts`, tagged by `shard`                                                                   |
| `aggregator.series_flushed`                                   | `aggregator.flush.count` with `data_type:series`                                                                     |
| `aggregator.service_check_flushed`                            | `aggregator.flush.count` with `data_type:service_checks`                                                             |
| `aggregator.events_flushed`                                   | `aggregator.flush.count` with `data_type:events`                                                                     |
| `aggregator.checks_metric_sample`                             | `aggregator.processed.count` with `data_type:metrics`                                                                |
| `aggregator.dogstatsd_metric_sample`                          | `aggregator.processed.count` with `data_type:dogstatsd_metrics`                                                      |
| `aggregator.service_check`                                    | `aggregator.processed.count` with `data_type:service_checks`                                                         |
| `aggregator.event`                                            | `aggregator.processed.count` with `data_type:events`                                                                 |
| `aggregator.number_of_flush`                                  | `aggregator.number_of_flush.count`                                                                                   |
| `aggregator.flush.main_flush_time.last_flush`                 | `aggregator.flush_time` with `flush_type:main`                                                                       |
| `aggregator.flush.checks_metric_sample_flush_time.last_flush` | `aggregator.flush_time` with `flush_type:checks_metric_sample`                                                       |
| `aggregator.flush.service_check_flush_time.last_flush`        | `aggregator.flush_time` with `flush_type:service_check`                                                              |
| `aggregator.flush.event_flush_time.last_flush`                | `aggregator.flush_time` with `flush_type:event`                                                                      |
| `aggregator.flush.metric_sketch_flush_time.last_flush`        | `aggregator.flush_time` with `flush_type:metric_sketch`                                                              |
| `aggregator.flush_count.series.last_flush`                    | `aggregator.flush_count` with `flush_type:series`                                                                    |
| `aggregator.flush_count.service_checks.last_flush`            | `aggregator.flush_count` with `flush_type:service_checks`                                                            |
| `aggregator.flush_count.events.last_flush`                    | `aggregator.flush_count` with `flush_type:events`                                                                    |
| `aggregator.flush_count.sketches.last_flush`                  | `aggregator.flush_count` with `flush_type:sketches`                                                                  |
| `aggregator.hostname_update`                                  | No longer reported by the Agent.                                                                                     |
| `scheduler.checks_entered`                                    | `scheduler.checks_entered`, tagged by `check_name`                                                                   |
| `scheduler.queues_count`                                      | `scheduler.queues_count.count`                                                                                       |
| `scheduler.queues.size` (no namespace)                        | `scheduler.queues.size`, tagged by `interval`                                                                        |
| `scheduler.queues.interval` (no namespace)                    | No equivalent. Use the `interval` tag of `scheduler.queues.size`.                                                    |
| `splitter.*`                                                  | No longer reported by the Agent.                                                                                     |
| `logs_agent.logs_decoded`                                     | `logs_agent.logs_decoded.count`                                                                                      |
| `logs_agent.logs_processed`                                   | `logs_agent.logs_processed.count`                                                                                    |
| `logs_agent.logs_sent`                                        | `logs_agent.logs_sent.count`                                                                                         |
| `logs_agent.bytes_sent`                                       | `logs_agent.bytes_sent.count`                                                                                        |
| `logs_agent.encoded_bytes_sent`                               | `logs_agent.encoded_bytes_sent.count`                                                                                |
| `logs_agent.destination_errors`                               | `logs_agent.destination_errors.count`                                                                                |
| `logs_agent.is_running`                                       | Not collected.                                                                                                       |
| `batch_strategy.idle_time` (no namespace)                     | `batch_strategy.idle_time.count`, tagged by `sender` (for example, `sender:logs_0_reliable_0` instead of `sender:0`) |
| `batch_strategy.in_use_time` (no namespace)                   | `batch_strategy.in_use_time.count`, tagged by `sender`                                                               |
| `memstats.*`                                                  | Not collected by default. See the `extra_metrics` example in Behavior changes.                                       |

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **datadog.agent.aggregator.dogstatsd_contexts**(gauge)                 | The number of DogStatsD contexts in the aggregator.                                                        |
| **datadog.agent.aggregator.flush.count**(count)                         | The number of metrics, service checks, and events flushed by the aggregator.*Shown as item*                |
| **datadog.agent.aggregator.flush_count**(gauge)                        | The number of items handled by the last aggregator flush, by flush type.*Shown as item*                    |
| **datadog.agent.aggregator.flush_time**(gauge)                         | The duration of the last aggregator flush, by flush type.*Shown as nanosecond*                             |
| **datadog.agent.aggregator.number_of_flush.count**(count)             | The number of flushes done by the aggregator.*Shown as flush*                                              |
| **datadog.agent.aggregator.processed.count**(count)                     | The number of metrics, service checks, and events processed by the aggregator.*Shown as item*              |
| **datadog.agent.batch_strategy.idle_time.count**(count)               | The time the Logs Agent's HTTP destinations spent idle.*Shown as millisecond*                              |
| **datadog.agent.batch_strategy.in_use_time.count**(count)            | The time the Logs Agent's HTTP destinations spent sending payloads.*Shown as millisecond*                  |
| **datadog.agent.dogstatsd.processed.count**(count)                      | The number of service checks, events, and metrics processed by DogStatsD.*Shown as message*                |
| **datadog.agent.dogstatsd_udp.packets.count**(count)                   | The number of DogStatsD packets received over UDP.*Shown as packet*                                        |
| **datadog.agent.dogstatsd_uds.origin_detection_errors.count**(count) | The number of DogStatsD origin detection errors on the Unix domain socket (UDS).*Shown as error*           |
| **datadog.agent.dogstatsd_uds.packets.count**(count)                   | The number of DogStatsD packets received over a Unix domain socket.*Shown as packet*                       |
| **datadog.agent.forwarder.transactions.dropped.count**(count)           | The number of transactions dropped by the forwarder.*Shown as transaction*                                 |
| **datadog.agent.forwarder.transactions.errors.count**(count)            | The number of forwarder transactions that failed, by error type.*Shown as transaction*                     |
| **datadog.agent.forwarder.transactions.http_errors.count**(count)      | The number of forwarder transactions that failed with an HTTP error, by status code.*Shown as transaction* |
| **datadog.agent.forwarder.transactions.retry_queue_size**(gauge)      | The number of transactions in the forwarder retry queue.*Shown as transaction*                             |
| **datadog.agent.forwarder.transactions.success.count**(count)           | The number of successful forwarder transactions.*Shown as transaction*                                     |
| **datadog.agent.logs_agent.bytes_sent.count**(count)                  | The number of bytes sent by the Logs Agent before encoding.*Shown as byte*                                 |
| **datadog.agent.logs_agent.destination_errors.count**(count)          | The number of network errors encountered by the Logs Agent.*Shown as error*                                |
| **datadog.agent.logs_agent.encoded_bytes_sent.count**(count)         | The number of bytes sent by the Logs Agent after encoding.*Shown as byte*                                  |
| **datadog.agent.logs_agent.logs_decoded.count**(count)                | The number of logs decoded by the Logs Agent.*Shown as entry*                                              |
| **datadog.agent.logs_agent.logs_processed.count**(count)              | The number of logs processed by the Logs Agent.*Shown as entry*                                            |
| **datadog.agent.logs_agent.logs_sent.count**(count)                   | The number of logs sent by the Logs Agent.*Shown as entry*                                                 |
| **datadog.agent.scheduler.checks_entered**(gauge)                      | The number of checks currently tracked by the scheduler, by check name.*Shown as check*                    |
| **datadog.agent.scheduler.queues.size**(gauge)                          | The number of checks scheduled in each job queue.*Shown as check*                                          |
| **datadog.agent.scheduler.queues_count.count**(count)                  | The number of scheduler job queues opened.                                                                 |

### Events{% #events %}

The Datadog Agent integration does not include any events.

### Service Checks{% #service-checks %}

**datadog.agent.openmetrics.health**

Returns `CRITICAL` if the check is unable to connect to the Datadog Agent's telemetry endpoint, otherwise returns `OK`.

*Statuses: ok, critical*

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
