Get metrics from CoreDNS in real time to visualize and monitor DNS failures and cache hits/misses.
Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the Autodiscovery Integration Templates for guidance on applying these instructions.
The CoreDNS check is included in the Datadog Agent package, so you don't need to install anything else on your servers.
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.
If you are using one dd-agent pod (daemon set) per kubernetes worker nodes, use the following annotations on your core-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.
Run the Agent's status
subcommand and look for coredns
under the Checks section.
See metadata.csv for a list of metrics provided by this integration.
The CoreDNS check does not include any events.
coredns.prometheus.health
:
Returns CRITICAL
if the Agent cannot reach the metrics endpoints.
Need help? Contact Datadog support.
See the main documentation for more details about how to test and develop Agent based integrations.