---
title: CoreDNS
description: CoreDNS collects DNS metrics in Kubernetes.
breadcrumbs: Docs > Integrations > CoreDNS
---

# CoreDNS
Supported OS Integration version6.4.1
## Overview{% #overview %}

Get metrics from CoreDNS in real time to visualize and monitor DNS failures and cache hits or misses.

**Minimum Agent version:** 6.6.0

## Setup{% #setup %}

Starting with version 1.11.0, this OpenMetrics-based integration has a latest mode (enabled by setting `openmetrics_endpoint` to point to the target endpoint) and a legacy mode (enabled by setting `prometheus_url` instead). To get all the most up-to-date features, Datadog recommends enabling the latest mode. For more information, see [Latest and Legacy Versioning For OpenMetrics-based Integrations](https://docs.datadoghq.com/integrations/guide/versions-for-openmetrics-based-integrations.md).

The latest mode of the CoreDNS check requires Python 3 and submits `.bucket` metrics and submits the `.sum` and `.count` histogram samples as monotonic count type. These metrics were previously submitted as `gauge` type in the legacy mode. See the [`metadata.csv` file](https://github.com/DataDog/integrations-core/blob/master/coredns/metadata.csv) for a list of metrics available in each mode.

For hosts unable to use Python 3, or if you previously implemented this integration mode, see the `legacy` mode [configuration example](https://github.com/DataDog/integrations-core/blob/7.32.x/coredns/datadog_checks/coredns/data/conf.yaml.example). For Autodiscovery users relying on the `coredns.d/auto_conf.yaml` file, this file enables the `prometheus_url` option for the `legacy` mode of the check by default. See the sample [coredns.d/auto_conf.yaml](https://github.com/DataDog/integrations-core/blob/master/coredns/datadog_checks/coredns/data/auto_conf.yaml) for the default configuration options and the sample [coredns.d/conf.yaml.example](https://github.com/DataDog/integrations-core/blob/master/coredns/datadog_checks/coredns/data/conf.yaml.example) for all available configuration options.

### Installation{% #installation %}

The CoreDNS check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package, so you don't need to install anything else on your servers.

### Configuration{% #configuration %}

{% tab title="Docker" %}
#### Docker{% #docker %}

To configure this check for an Agent running on a container:

##### Metric collection{% #metric-collection %}

Set [Autodiscovery Integration Templates](http://docs.datadoghq.com/agent/docker/integrations.md?tab=docker) as Docker labels on your application container:

```yaml
LABEL "com.datadoghq.ad.check_names"='["coredns"]'
LABEL "com.datadoghq.ad.init_configs"='[{}]'
LABEL "com.datadoghq.ad.instances"='[{"openmetrics_endpoint":"http://%%host%%:9153/metrics", "tags":["dns-pod:%%host%%"]}]'
```

To enable the legacy mode of this OpenMetrics-based check, replace `openmetrics_endpoint` with `prometheus_url`:

```yaml
LABEL "com.datadoghq.ad.instances"='[{"prometheus_url":"http://%%host%%:9153/metrics", "tags":["dns-pod:%%host%%"]}]' 
```

**Notes**:

- The shipped `coredns.d/auto_conf.yaml` file enables the `prometheus_url` option by default for legacy mode.
- The `dns-pod` tag keeps track of the target DNS pod IP. The other tags are related to the Datadog Agent that is polling the information using the service discovery.
- The service discovery annotations need to be done on the pod. In case of a deployment, add the annotations to the metadata of the template's specifications. Do not add it at the outer specification level.

#### Log collection{% #log-collection %}

Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Docker Log Collection](https://docs.datadoghq.com/agent/docker/log.md?tab=containerinstallation).

Then, set [Log Integrations](https://docs.datadoghq.com/agent/docker/log.md?tab=containerinstallation#log-integrations) as Docker labels:

```yaml
LABEL "com.datadoghq.ad.logs"='[{"source":"coredns","service":"<SERVICE_NAME>"}]'
```

{% /tab %}

{% tab title="Kubernetes" %}
#### Kubernetes{% #kubernetes %}

To configure this check for an Agent running on Kubernetes:

##### Metric collection{% #metric-collection %}

Set [Autodiscovery Integrations Templates](https://docs.datadoghq.com/agent/kubernetes/integrations.md?tab=kubernetes) as pod annotations on your application container. Alternatively, you can configure templates with a [file, configmap, or key-value store](https://docs.datadoghq.com/agent/kubernetes/integrations.md?tab=kubernetes#configuration).

**Annotations v1** (for Datadog Agent < v7.36)

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: coredns
  annotations:
    ad.datadoghq.com/coredns.check_names: '["coredns"]'
    ad.datadoghq.com/coredns.init_configs: '[{}]'
    ad.datadoghq.com/coredns.instances: |
      [
        {
          "openmetrics_endpoint": "http://%%host%%:9153/metrics", 
          "tags": ["dns-pod:%%host%%"]
        }
      ]
  labels:
    name: coredns
spec:
  containers:
    - name: coredns
```

**Annotations v2** (for Datadog Agent v7.36 or later)

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: coredns
  annotations:
    ad.datadoghq.com/coredns.checks: |
      {
        "coredns": {
          "init_config": {},
          "instances": [
            {
              "openmetrics_endpoint": "http://%%host%%:9153/metrics", 
              "tags": ["dns-pod:%%host%%"]
            }
          ]
        }
      }
  labels:
    name: coredns
spec:
  containers:
    - name: coredns
```

To enable the legacy mode of this OpenMetrics-based check, replace `openmetrics_endpoint` with `prometheus_url`:

**Annotations v1** (for Datadog Agent < v7.36)

```yaml
    ad.datadoghq.com/coredns.instances: |
      [
        {
          "prometheus_url": "http://%%host%%:9153/metrics", 
          "tags": ["dns-pod:%%host%%"]
        }
      ]
```

**Annotations v2** (for Datadog Agent v7.36 or later)

```yaml
          "instances": [
            {
              "prometheus_url": "http://%%host%%:9153/metrics", 
              "tags": ["dns-pod:%%host%%"]
            }
          ]
```

**Notes**:

- The shipped `coredns.d/auto_conf.yaml` file enables the `prometheus_url` option by default for legacy mode.
- The `dns-pod` tag keeps track of the target DNS pod IP. The other tags are related to the Datadog Agent that is polling the information using the service discovery.
- The service discovery annotations need to be done on the pod. In case of a deployment, add the annotations to the metadata of the template's specifications. Do not add it at the outer specification level.

#### Log collection{% #log-collection %}

Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes Log Collection](https://docs.datadoghq.com/agent/kubernetes/log.md?tab=daemonset).

Then, set [Log Integrations](https://docs.datadoghq.com/agent/kubernetes/log.md?tab=kubernetes#examples---datadog-redis-integration) as pod annotations. Alternatively, you can configure this with a [file, configmap, or key-value store](https://docs.datadoghq.com/agent/kubernetes/integrations.md?tab=file).

**Annotations v1/v2**

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: coredns
  annotations:
    ad.datadoghq.com/coredns.logs: '[{"source": "coredns", "service": "<SERVICE_NAME>"}]'
  labels:
    name: coredns
```

{% /tab %}

{% tab title="ECS" %}
#### ECS{% #ecs %}

To configure this check for an Agent running on ECS:

##### Metric collection{% #metric-collection %}

Set [Autodiscovery Integrations Templates](https://docs.datadoghq.com/agent/amazon_ecs.md?tab=awscli#process-collection) as Docker labels on your application container:

```json
{
  "containerDefinitions": [{
    "name": "coredns",
    "image": "coredns:latest",
    "dockerLabels": {
      "com.datadoghq.ad.check_names": "[\"coredns\"]",
      "com.datadoghq.ad.init_configs": "[{}]",
      "com.datadoghq.ad.instances": "[{\"openmetrics_endpoint\":\"http://%%host%%:9153/metrics\", \"tags\":[\"dns-pod:%%host%%\"]}]"
    }
  }]
}
```

To enable the legacy mode of this OpenMetrics-based check, replace `openmetrics_endpoint` with `prometheus_url`:

```json
      "com.datadoghq.ad.instances": "[{\"prometheus_url\":\"http://%%host%%:9153/metrics\", \"tags\":[\"dns-pod:%%host%%\"]}]"
```

**Notes**:

- The shipped `coredns.d/auto_conf.yaml` file enables the `prometheus_url` option by default for legacy mode.
- The `dns-pod` tag keeps track of the target DNS pod IP. The other tags are related to the Datadog Agent that is polling the information using the service discovery.
- The service discovery annotations need to be done on the pod. In case of a deployment, add the annotations to the metadata of the template's specifications. Do not add it at the outer specification level.

##### Log collection{% #log-collection %}

Collecting logs is disabled by default in the Datadog Agent. To enable it, see [ECS Log Collection](https://docs.datadoghq.com/agent/amazon_ecs/logs.md?tab=linux).

Then, set [Log Integrations](https://docs.datadoghq.com/agent/amazon_ecs/logs.md?tab=linux#activate-log-integrations) as Docker labels:

```yaml
{
  "containerDefinitions": [{
    "name": "coredns",
    "image": "coredns:latest",
    "dockerLabels": {
      "com.datadoghq.ad.logs": "[{\"source\":\"coredns\",\"service\":\"<SERVICE_NAME>\"}]"
    }
  }]
}
```

{% /tab %}

### Validation{% #validation %}

[Run the Agent's `status` subcommand](https://docs.datadoghq.com/agent/guide/agent-commands.md#start-stop-and-restart-the-agent) and look for `coredns` under the Checks section.

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

### Metrics{% #metrics %}

|  |
|  |
| **coredns.acl.allowed\_requests**(count)                      | [OpenMetrics V1] Counter of DNS requests being allowed.*Shown as request*                                                            |
| **coredns.acl.allowed\_requests.count**(count)                | [OpenMetrics V2] Counter of DNS requests being allowed.*Shown as request*                                                            |
| **coredns.acl.blocked\_requests**(count)                      | [OpenMetrics V1] Counter of DNS requests being blocked.*Shown as request*                                                            |
| **coredns.acl.blocked\_requests.count**(count)                | [OpenMetrics V2] Counter of DNS requests being blocked.*Shown as request*                                                            |
| **coredns.autopath.success\_count**(count)                    | [OpenMetrics V1] Counter of requests that did autopath.*Shown as request*                                                            |
| **coredns.autopath.success\_count.count**(count)              | [OpenMetrics V2] Counter of requests that did autopath.*Shown as request*                                                            |
| **coredns.build\_info**(gauge)                                | [OpenMetrics V1 and V2] A metric with a constant '1' value labeled by version, revision, and goversion from which CoreDNS was built. |
| **coredns.cache\_drops\_count**(count)                        | [OpenMetrics V1] Counter of responses excluded from the cache due to request/response question name mismatch.*Shown as response*     |
| **coredns.cache\_drops\_count.count**(count)                  | [OpenMetrics V2] Counter of responses excluded from the cache due to request/response question name mismatch.*Shown as response*     |
| **coredns.cache\_hits\_count**(count)                         | [OpenMetrics V1] Counter of cache hits by cache type*Shown as hit*                                                                   |
| **coredns.cache\_hits\_count.count**(count)                   | [OpenMetrics V2] Counter of cache hits by cache type*Shown as hit*                                                                   |
| **coredns.cache\_misses\_count**(count)                       | [OpenMetrics V1] Counter of cache misses.*Shown as miss*                                                                             |
| **coredns.cache\_misses\_count.count**(count)                 | [OpenMetrics V2] Counter of cache misses.*Shown as miss*                                                                             |
| **coredns.cache\_prefetch\_count**(count)                     | [OpenMetrics V1] The number of time the cache has prefetched a cached item.                                                          |
| **coredns.cache\_prefetch\_count.count**(count)               | [OpenMetrics V2] The number of time the cache has prefetched a cached item.                                                          |
| **coredns.cache\_request\_count**(count)                      | [OpenMetrics V1] Counter of cache requests.*Shown as request*                                                                        |
| **coredns.cache\_request\_count.count**(count)                | [OpenMetrics V2] Counter of cache requests.*Shown as request*                                                                        |
| **coredns.cache\_size.count**(gauge)                          | [OpenMetrics V1 and V2]*Shown as entry*                                                                                              |
| **coredns.cache\_stale\_count**(count)                        | [OpenMetrics V1] Counter of requests served from stale cache entries.*Shown as request*                                              |
| **coredns.cache\_stale\_count.count**(count)                  | [OpenMetrics V2] Counter of requests served from stale cache entries.*Shown as request*                                              |
| **coredns.dnssec.cache\_hits**(count)                         | [OpenMetrics V1] Counter of cache hits.*Shown as hit*                                                                                |
| **coredns.dnssec.cache\_hits.count**(count)                   | [OpenMetrics V2] Counter of cache hits.*Shown as hit*                                                                                |
| **coredns.dnssec.cache\_misses**(count)                       | [OpenMetrics V1] Counter of cache misses.*Shown as miss*                                                                             |
| **coredns.dnssec.cache\_misses.count**(count)                 | [OpenMetrics V2] Counter of cache misses.*Shown as miss*                                                                             |
| **coredns.dnssec.cache\_size**(gauge)                         | [OpenMetrics V1 and V2] Total elements in the cache, type is signature.                                                              |
| **coredns.forward\_healthcheck\_broken\_count**(count)        | [OpenMetrics V1] counter of when all upstreams are unhealthy*Shown as entry*                                                         |
| **coredns.forward\_healthcheck\_broken\_count.count**(count)  | [OpenMetrics V2] counter of when all upstreams are unhealthy*Shown as entry*                                                         |
| **coredns.forward\_healthcheck\_failure\_count**(count)       | [OpenMetrics V1] number of failed health checks per upstream*Shown as entry*                                                         |
| **coredns.forward\_healthcheck\_failure\_count.count**(count) | [OpenMetrics V2] number of failed health checks per upstream*Shown as entry*                                                         |
| **coredns.forward\_max\_concurrent\_rejects**(count)          | [OpenMetrics V1] Counter of the number of queries rejected because the concurrent queries were at maximum.*Shown as query*           |
| **coredns.forward\_max\_concurrent\_rejects.count**(count)    | [OpenMetrics V2] Counter of the number of queries rejected because the concurrent queries were at maximum.*Shown as query*           |
| **coredns.forward\_request\_count**(count)                    | [OpenMetrics V1] query count per upstream*Shown as request*                                                                          |
| **coredns.forward\_request\_count.count**(count)              | [OpenMetrics V2] query count per upstream*Shown as request*                                                                          |
| **coredns.forward\_request\_duration.seconds.bucket**(count)  | [OpenMetrics V2] duration per upstream interaction*Shown as second*                                                                  |
| **coredns.forward\_request\_duration.seconds.count**(count)   | [OpenMetrics V1 and V2] duration per upstream interaction*Shown as second*                                                           |
| **coredns.forward\_request\_duration.seconds.sum**(count)     | [OpenMetrics V1 and V2] duration per upstream interaction*Shown as second*                                                           |
| **coredns.forward\_response\_rcode\_count**(count)            | [OpenMetrics V1] count of RCODEs per upstream*Shown as response*                                                                     |
| **coredns.forward\_response\_rcode\_count.count**(count)      | [OpenMetrics V2] count of RCODEs per upstream*Shown as response*                                                                     |
| **coredns.forward\_sockets\_open**(gauge)                     | [OpenMetrics V1 and V2] number of sockets open per upstream*Shown as connection*                                                     |
| **coredns.go.gc\_duration\_seconds.count**(count)             | [OpenMetrics V1 and V2] Count of the GC invocation durations.*Shown as second*                                                       |
| **coredns.go.gc\_duration\_seconds.quantile**(gauge)          | [OpenMetrics V1 and V2] Quantiles of the GC invocation durations.*Shown as second*                                                   |
| **coredns.go.gc\_duration\_seconds.sum**(count)               | [OpenMetrics V1 and V2] Sum of the GC invocation durations.*Shown as second*                                                         |
| **coredns.go.goroutines**(gauge)                              | [OpenMetrics V1 and V2] Number of goroutines that currently exist.*Shown as thread*                                                  |
| **coredns.go.info**(gauge)                                    | [OpenMetrics V1 and V2] Information about the Go environment.                                                                        |
| **coredns.go.memstats.alloc\_bytes**(gauge)                   | [OpenMetrics V1 and V2] Number of bytes allocated and still in use.*Shown as byte*                                                   |
| **coredns.go.memstats.alloc\_bytes\_total**(count)            | [OpenMetrics V1] Total number of bytes allocated even if freed.*Shown as byte*                                                       |
| **coredns.go.memstats.buck\_hash\_sys\_bytes**(gauge)         | [OpenMetrics V1 and V2] Number of bytes used by the profiling bucket hash table.*Shown as byte*                                      |
| **coredns.go.memstats.frees\_total**(count)                   | [OpenMetrics V1] Total number of frees.                                                                                              |
| **coredns.go.memstats.frees\_total.count**(count)             | [OpenMetrics V2] Total number of frees.                                                                                              |
| **coredns.go.memstats.gc\_cpu\_fraction**(gauge)              | [OpenMetrics V1 and V2] CPU taken up by GC*Shown as percent*                                                                         |
| **coredns.go.memstats.gc\_sys\_bytes**(gauge)                 | [OpenMetrics V1 and V2] Number of bytes used for garbage collection system metadata.*Shown as byte*                                  |
| **coredns.go.memstats.heap\_alloc\_bytes**(gauge)             | [OpenMetrics V1 and V2] Bytes allocated to the heap*Shown as byte*                                                                   |
| **coredns.go.memstats.heap\_idle\_bytes**(gauge)              | [OpenMetrics V1 and V2] Number of idle bytes in the heap*Shown as byte*                                                              |
| **coredns.go.memstats.heap\_inuse\_bytes**(gauge)             | [OpenMetrics V1 and V2] Number of Bytes in the heap*Shown as byte*                                                                   |
| **coredns.go.memstats.heap\_objects**(gauge)                  | [OpenMetrics V1 and V2] Number of objects in the heap*Shown as object*                                                               |
| **coredns.go.memstats.heap\_released\_bytes**(gauge)          | [OpenMetrics V1 and V2] Number of bytes released to the system in the last gc*Shown as byte*                                         |
| **coredns.go.memstats.heap\_released\_bytes.count**(count)    | [OpenMetrics V2] Count of bytes released to the system in the last gc*Shown as byte*                                                 |
| **coredns.go.memstats.heap\_sys\_bytes**(gauge)               | [OpenMetrics V1 and V2] Number of bytes used by the heap*Shown as byte*                                                              |
| **coredns.go.memstats.last\_gc\_time\_seconds**(gauge)        | [OpenMetrics V1 and V2] Length of last GC*Shown as second*                                                                           |
| **coredns.go.memstats.lookups\_total**(count)                 | [OpenMetrics V1] Number of lookups*Shown as operation*                                                                               |
| **coredns.go.memstats.lookups\_total.count**(count)           | [OpenMetrics V2] Number of lookups*Shown as operation*                                                                               |
| **coredns.go.memstats.mallocs\_total**(count)                 | [OpenMetrics V1] Number of mallocs*Shown as operation*                                                                               |
| **coredns.go.memstats.mallocs\_total.count**(count)           | [OpenMetrics V2] Number of mallocs*Shown as operation*                                                                               |
| **coredns.go.memstats.mcache\_inuse\_bytes**(gauge)           | [OpenMetrics V1 and V2] Number of bytes in use by mcache structures.*Shown as byte*                                                  |
| **coredns.go.memstats.mcache\_sys\_bytes**(gauge)             | [OpenMetrics V1 and V2] Number of bytes used for mcache structures obtained from system.*Shown as byte*                              |
| **coredns.go.memstats.mspan\_inuse\_bytes**(gauge)            | [OpenMetrics V1 and V2] Number of bytes in use by mspan structures.*Shown as byte*                                                   |
| **coredns.go.memstats.mspan\_sys\_bytes**(gauge)              | [OpenMetrics V1 and V2] Number of bytes used for mspan structures obtained from system.*Shown as byte*                               |
| **coredns.go.memstats.next\_gc\_bytes**(gauge)                | [OpenMetrics V1 and V2] Number of heap bytes when next garbage collection will take place*Shown as byte*                             |
| **coredns.go.memstats.other\_sys\_bytes**(gauge)              | [OpenMetrics V1 and V2] Number of bytes used for other system allocations*Shown as byte*                                             |
| **coredns.go.memstats.stack\_inuse\_bytes**(gauge)            | [OpenMetrics V1 and V2] Number of bytes in use by the stack allocator*Shown as byte*                                                 |
| **coredns.go.memstats.stack\_sys\_bytes**(gauge)              | [OpenMetrics V1 and V2] Number of bytes obtained from system for stack allocator*Shown as byte*                                      |
| **coredns.go.memstats.sys\_bytes**(gauge)                     | [OpenMetrics V1 and V2] Number of bytes obtained from system*Shown as byte*                                                          |
| **coredns.go.threads**(gauge)                                 | [OpenMetrics V1 and V2] Number of OS threads created.*Shown as thread*                                                               |
| **coredns.grpc.request\_count**(count)                        | [OpenMetrics V1] Query count per upstream.                                                                                           |
| **coredns.grpc.request\_count.count**(count)                  | [OpenMetrics V2] Query count per upstream.                                                                                           |
| **coredns.grpc.response\_rcode\_count**(count)                | [OpenMetrics V1] Count of RCODEs per upstream. and we are randomly (this always uses the random policy) spraying to an upstream.     |
| **coredns.grpc.response\_rcode\_count.count**(count)          | [OpenMetrics V2] Count of RCODEs per upstream. and we are randomly (this always uses the random policy) spraying to an upstream.     |
| **coredns.health\_request\_duration.bucket**(count)           | [OpenMetrics V2] Sample for the histogram of the time (in seconds) each request took.                                                |
| **coredns.health\_request\_duration.count**(count)            | [OpenMetrics V1 and V2] Count for the histogram of the time (in seconds) each request took.                                          |
| **coredns.health\_request\_duration.sum**(count)              | [OpenMetrics V1 and V2] Sum for the histogram of the time (in seconds) each request took.                                            |
| **coredns.hosts.entries\_count**(gauge)                       | [OpenMetrics V1 and V2] The combined number of entries in hosts and Corefile.                                                        |
| **coredns.hosts.reload\_timestamp**(gauge)                    | [OpenMetrics V1 and V2] The timestamp of the last reload of hosts file.*Shown as second*                                             |
| **coredns.panic\_count.count**(count)                         | [OpenMetrics V1 and V2]*Shown as entry*                                                                                              |
| **coredns.plugin\_enabled**(gauge)                            | [OpenMetrics V1 and V2] A metric that indicates whether a plugin is enabled on per server and zone basis.                            |
| **coredns.process.cpu\_seconds\_total**(count)                | [OpenMetrics V1 and V2] Total user and system CPU time spent in seconds.*Shown as second*                                            |
| **coredns.process.cpu\_seconds\_total.count**(count)          | [OpenMetrics V2] Count of user and system CPU time spent in seconds.*Shown as second*                                                |
| **coredns.process.max\_fds**(gauge)                           | [OpenMetrics V1 and V2] Maximum number of open file descriptors.*Shown as file*                                                      |
| **coredns.process.open\_fds**(gauge)                          | [OpenMetrics V1 and V2] Number of open file descriptors.*Shown as file*                                                              |
| **coredns.process.resident\_memory\_bytes**(gauge)            | [OpenMetrics V1 and V2] Resident memory size in bytes.*Shown as byte*                                                                |
| **coredns.process.start\_time\_seconds**(gauge)               | [OpenMetrics V1 and V2] Start time of the process since unix epoch in seconds.*Shown as second*                                      |
| **coredns.process.virtual\_memory\_bytes**(gauge)             | [OpenMetrics V1 and V2] Virtual memory size in bytes.*Shown as byte*                                                                 |
| **coredns.proxy\_request\_count**(count)                      | [OpenMetrics V1] query count per upstream.*Shown as request*                                                                         |
| **coredns.proxy\_request\_count.count**(count)                | [OpenMetrics V2] query count per upstream.*Shown as request*                                                                         |
| **coredns.proxy\_request\_duration.seconds.bucket**(count)    | [OpenMetrics V2] sample of duration per upstream interaction*Shown as second*                                                        |
| **coredns.proxy\_request\_duration.seconds.count**(count)     | [OpenMetrics V1 and V2] duration per upstream interaction*Shown as second*                                                           |
| **coredns.proxy\_request\_duration.seconds.sum**(count)       | [OpenMetrics V1 and V2] duration per upstream interaction*Shown as second*                                                           |
| **coredns.reload.failed\_count**(count)                       | [OpenMetrics V1] Counts the number of failed reload attempts.                                                                        |
| **coredns.reload.failed\_count.count**(count)                 | [OpenMetrics V2] Counts the number of failed reload attempts.                                                                        |
| **coredns.request\_count**(count)                             | [OpenMetrics V1] total query count.*Shown as request*                                                                                |
| **coredns.request\_count.count**(count)                       | [OpenMetrics V2] total query count.*Shown as request*                                                                                |
| **coredns.request\_duration.seconds.bucket**(count)           | [OpenMetrics V2] sample duration to process each query*Shown as second*                                                              |
| **coredns.request\_duration.seconds.count**(count)            | [OpenMetrics V1 and V2] duration to process each query*Shown as second*                                                              |
| **coredns.request\_duration.seconds.sum**(count)              | [OpenMetrics V1 and V2] duration to process each query*Shown as second*                                                              |
| **coredns.request\_size.bytes.bucket**(count)                 | [OpenMetrics V2] sample size of the request in bytes*Shown as byte*                                                                  |
| **coredns.request\_size.bytes.count**(count)                  | [OpenMetrics V1 and V2] size of the request in bytes*Shown as byte*                                                                  |
| **coredns.request\_size.bytes.sum**(count)                    | [OpenMetrics V1 and V2] size of the request in bytes*Shown as byte*                                                                  |
| **coredns.request\_type\_count**(count)                       | [OpenMetrics V1] counter of queries per zone and type                                                                                |
| **coredns.request\_type\_count.count**(count)                 | [OpenMetrics V2] counter of queries per zone and type                                                                                |
| **coredns.response\_code\_count**(count)                      | [OpenMetrics V1] number of responses per zone and rcode                                                                              |
| **coredns.response\_code\_count.count**(count)                | [OpenMetrics V2] number of responses per zone and rcode                                                                              |
| **coredns.response\_size.bytes.bucket**(count)                | [OpenMetrics V2] sample size of the request in bytes*Shown as byte*                                                                  |
| **coredns.response\_size.bytes.count**(count)                 | [OpenMetrics V1 and V2] size of the request in bytes*Shown as byte*                                                                  |
| **coredns.response\_size.bytes.sum**(count)                   | [OpenMetrics V1 and V2] size of the request in bytes*Shown as byte*                                                                  |
| **coredns.template.failures\_count**(count)                   | [OpenMetrics V1] The number of times the Go templating failed.*Shown as error*                                                       |
| **coredns.template.failures\_count.count**(count)             | [OpenMetrics V2] The number of times the Go templating failed.*Shown as error*                                                       |
| **coredns.template.matches\_count**(count)                    | [OpenMetrics V1] The total number of matched requests by regex.                                                                      |
| **coredns.template.matches\_count.count**(count)              | [OpenMetrics V2] The total number of matched requests by regex.                                                                      |
| **coredns.template.rr\_failures\_count**(count)               | [OpenMetrics V1] The number of times the templated resource record was invalid and could not be parsed.*Shown as error*              |
| **coredns.template.rr\_failures\_count.count**(count)         | [OpenMetrics V2] The number of times the templated resource record was invalid and could not be parsed.*Shown as error*              |

### Events{% #events %}

The CoreDNS check does not include any events.

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

**coredns.prometheus.health**

Returns `CRITICAL` if the check cannot access the metrics endpoint. Returns `OK` otherwise.

*Statuses: ok, critical*

## Troubleshooting{% #troubleshooting %}

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

## Further Reading{% #further-reading %}

- [Key metrics for CoreDNS monitoring](https://www.datadoghq.com/blog/coredns-metrics/)
- [Tools for collecting metrics and logs from CoreDNS](https://www.datadoghq.com/blog/coredns-monitoring-tools/)
- [How to monitor CoreDNS with Datadog](https://www.datadoghq.com/blog/monitoring-coredns-with-datadog/)
