Datadog-Kube DNS Integration

Overview

Get metrics from kube-dns service in real time to:

  • Visualize and monitor dns metrics collected via Kubernetes’ kube-dns addon through Prometheus

See https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns for more informations about kube-dns

Setup

Installation

Install the dd-check-kube_dns package manually or with your favorite configuration manager

Configuration

Edit the kube_dns.yaml file to point to your server and port, set the masters to monitor. See the sample kube_dns.yaml for all available configuration options.

Using with service discovery

If you are using 1 dd-agent pod per kubernetes worker nodes, you could use the following annotations on your kube-dns pod to get the data retrieve automatically.

apiVersion: v1
kind: Pod
metadata:
  annotations:
    service-discovery.datadoghq.com/kubedns.check_names: '["kube_dns"]'
    service-discovery.datadoghq.com/kubedns.init_configs: '[{}]'
    service-discovery.datadoghq.com/kubedns.instances: '[[{"prometheus_endpoint":"http://%%host%%:10055/metrics", "tags":["dns-pod:%%host%%"]}]]'

Remarks:

  • Notice the “dns-pod” tag that will keep track of the target dns pod IP. The other tags will be related to the dd-agent that is polling the informations 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 spec.

Validation

Run the Agent’s info subcommand and look for kube_dns under the Checks section:

Checks
======

    kube_dns
    -----------
      - instance #0 [OK]
      - Collected 39 metrics, 0 events & 7 service checks

Compatibility

The kube_dns check is compatible with all major platforms

Data Collected

Metrics

kubedns.response_size.bytes.sum
(gauge)
Size of the returns response in bytes.
shown as byte
kubedns.response_size.bytes.count
(gauge)
Number of responses on which the kubedns.response_size.bytes.sum metric is evaluated.
shown as response
kubedns.request_duration.seconds.sum
(gauge)
Time (in seconds) each request took to resolve.
shown as second
kubedns.request_duration.seconds.count
(gauge)
Number of requests on which the kubedns.request_duration.seconds.sum metric is evaluated.
shown as request
kubedns.request_count
(gauge)
Number of DNS requests made.
shown as request
kubedns.error_count
(gauge)
Number of DNS requests resulting in an error.
shown as error
kubedns.cachemiss_count
(gauge)
Number of DNS requests that result in a cache miss.
shown as request

Events

The Kube-DNS check does not include any event at this time.

Service Checks

The Kube-DNS check does not include any service check at this time.

Troubleshooting

Need help? Contact Datadog Support.

Further Reading

Learn more about infrastructure monitoring and all our integrations on our blog