The Service Map for APM is here!

CoreDNS

Agent Check Agent Check

Supported OS: Linux

Overview

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

Setup

Installation

The CoreDNS check is included in the Datadog Agent package, so you don’t need to install anything else on your servers.

Configuration

Edit the coredns.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s configuration directory, to point to your server and port and set the masters to monitor. See the sample coredns.d/conf.yaml for all available configuration options.

Using with service discovery

If you are using one dd-agent pod (daemon set) per kubernetes worker nodes, use the following annotations on your kube-dns pod to retrieve the data automatically.

metadata:
  annotations:
    ad.datadoghq.com/coredns.check_names: '["coredns"]'
    ad.datadoghq.com/coredns.init_configs: '[{}]'
    ad.datadoghq.com/coredns.instances: '[{"prometheus_url":"http://%%host%%:9153/metrics", "tags":["dns-pod:%%host%%"]}]'

Note:

  • The dns-pod tag keeps track of the target dns pod IP. The other tags are related to the dd-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.

Validation

Run the Agent’s status subcommand and look for coredns under the Checks section.

Data Collected

Metrics

coredns.response_code_count
(gauge)
number of responses per zone and rcode
coredns.proxy_request_count
(gauge)
query count per upstream.
shown as request
coredns.cache_hits_count
(gauge)
Counter of cache hits by cache type
shown as hit
coredns.cache_misses_count
(gauge)
Counter of cache misses.
shown as miss
coredns.request_count
(gauge)
total query count.
shown as request
coredns.request_type_count
(gauge)
counter of queries per zone and type
coredns.request_duration.seconds.sum
(gauge)
duration to process each query
shown as second
coredns.request_duration.seconds.count
(count)
duration to process each query
shown as second
coredns.proxy_request_duration.seconds.sum
(gauge)
duration per upstream interaction
shown as second
coredns.proxy_request_duration.seconds.count
(count)
duration per upstream interaction
shown as second
coredns.request_size.bytes.sum
(gauge)
size of the request in bytes
shown as byte
coredns.request_size.bytes.count
(count)
size of the request in bytes
shown as byte
coredns.response_size.bytes.sum
(gauge)
size of the request in bytes
shown as byte
coredns.response_size.bytes.count
(count)
size of the request in bytes
shown as byte
coredns.cache_size.count
(count)

shown as entry
coredns.panic_count.count
(count)

shown as entry
coredns.go.gc_duration_seconds.count
(gauge)
Count of the GC invocation durations.
shown as second
coredns.go.gc_duration_seconds.sum
(gauge)
Sum of the GC invocation durations.
shown as second
coredns.go.goroutines
(gauge)
Number of goroutines that currently exist.
shown as thread
coredns.go.info
(gauge)
Information about the Go environment.
coredns.go.memstats.alloc_bytes
(gauge)
Number of bytes allocated and still in use.
shown as byte
coredns.go.memstats.alloc_bytes_total
(gauge)
Total number of bytes allocated even if freed.
shown as byte
coredns.go.memstats.buck_hash_sys_bytes
(gauge)
Number of bytes used by the profiling bucket hash table.
shown as byte
coredns.go.memstats.frees_total
(gauge)
Total number of frees.
coredns.go.memstats.gc_cpu_fraction
(gauge)
CPU taken up by GC
shown as percent
coredns.go.memstats.gc_sys_bytes
(gauge)
Number of bytes used for garbage collection system metadata.
shown as byte
coredns.go.memstats.heap_alloc_bytes
(gauge)
Bytes allocated to the heap
shown as byte
coredns.go.memstats.heap_idle_bytes
(gauge)
Number of idle bytes in the heap
shown as byte
coredns.go.memstats.heap_inuse_bytes
(gauge)
Number of Bytes in the heap
shown as byte
coredns.go.memstats.heap_objects
(gauge)
Number of objects in the heap
shown as object
coredns.go.memstats.heap_released_bytes
(gauge)
Number of bytes released to the system in the last gc
shown as byte
coredns.go.memstats.heap_sys_bytes
(gauge)
Number of bytes used by the heap
shown as byte
coredns.go.memstats.last_gc_time_seconds
(gauge)
Length of last GC
shown as second
coredns.go.memstats.lookups_total
(gauge)
Number of lookups
shown as operation
coredns.go.memstats.mallocs_total
(gauge)
Number of mallocs
shown as operation
coredns.go.memstats.mcache_inuse_bytes
(gauge)
Number of bytes in use by mcache structures.
shown as byte
coredns.go.memstats.mcache_sys_bytes
(gauge)
Number of bytes used for mcache structures obtained from system.
shown as byte
coredns.go.memstats.mspan_inuse_bytes
(gauge)
Number of bytes in use by mspan structures.
shown as byte
coredns.go.memstats.mspan_sys_bytes
(gauge)
Number of bytes used for mspan structures obtained from system.
shown as byte
coredns.go.memstats.next_gc_bytes
(gauge)
Number of heap bytes when next garbage collection will take place
shown as byte
coredns.go.memstats.other_sys_bytes
(gauge)
Number of bytes used for other system allocations
shown as byte
coredns.go.memstats.stack_inuse_bytes
(gauge)
Number of bytes in use by the stack allocator
shown as byte
coredns.go.memstats.stack_sys_bytes
(gauge)
Number of bytes obtained from system for stack allocator
shown as byte
coredns.go.memstats.sys_bytes
(gauge)
Number of bytes obtained from system
shown as byte
coredns.go.threads
(gauge)
Number of OS threads created.
shown as thread
coredns.process.max_fds
(gauge)
Maximum number of open file descriptors.
shown as file
coredns.process.open_fds
(gauge)
Number of open file descriptors.
shown as file
coredns.process.resident_memory_bytes
(gauge)
Resident memory size in bytes.
shown as byte
coredns.process.start_time_seconds
(gauge)
Start time of the process since unix epoch in seconds.
shown as second
coredns.process.virtual_memory_bytes
(gauge)
Virtual memory size in bytes.
shown as byte

Events

The CoreDNS check does not include any events.

Service Checks

The CoreDNS check does not include any service checks.

Troubleshooting

Need help? Contact Datadog support.

Development

See the main documentation for more details about how to test and develop Agent based integrations.


Mistake in the docs? Feel free to contribute!