CoreDNS

CoreDNS is an open source DNS server, based on plugins provided by all major cloud vendors. CoreDNS also integrates with Kubernetes. Dynatrace OneAgent connects to the Prometheus endpoint exposed in CoreDNS to ingest the metrics.

Prerequisites

  • Dynatrace version 1.204+
  • OneAgent version 1.203+
  • CoreDNS 1.0.0-1.6.9
  • Active Prometheus plugin in CoreDNS

Activation

CoreDNS is enabled by default for your environment. If necessary, you can disable CoreDNS monitoring at the host level.

CoreDNS Prometheus endpoint

OneAgent collects metrics for your CoreDNS server via the Prometheus endpoint exposed by an active Prometheus plugin.

Prometheus endpoint autodiscovery

OneAgent attempts to collect the CoreDNS metrics from the default Prometheus endpoint for CoreDNS installed alongside OneAgent, that is localhost:9153.

If the CoreDNS Prometheus plugin exposes metrics at a non-default port, OneAgent will attempt to autodiscover the port by analyzing the CoreDNS configuration and will update the port accordingly.

Set Prometheus endpoint

Prometheus endpoint autodiscovery doesn't work in two cases:

  • CoreDNS running in a Docker container
  • CoreDNS running as a Kubernetes Service

In such cases, or when for some reason OneAgent fails to autodiscover the endpoint, Dynatrace will display a configuration error in Settings > Monitoring > Monitored technologies > CoreDNS and you'll need to provide a working endpoint in the CoreDNS monitoring settings. You can define the Prometheus endpoint for the whole environment or a single host.

Use the following format:

  • CoreDNS runs on the same host alongside OneAgent (non-default port)
    • localhost:9999,
    • 127.0.0.1:9999,
    • or :9999
  • CoreDNS runs in a Docker container (default port)
    • <container-ip-address>:9153
  • CoreDNS runs as a Kubernetes Service (default port)
    • <dns-service-ip-address>:9153

Note: The full Prometheus endpoint URL is localhost:9999/metrics, but adding /metrics path is optional.

Metrics

See Built-in metrics for a complete list of CoreDNS metrics collected by OneAgent.

See your data

In Dynatrace, search for the CoreDNS process. With additional extension-based monitoring, the Process overview page contains the CoreDNS metrics and Further details tabs. Select CoreDNS metrics to analyze the key metrics such as Average request duration. Select Further details to see charts for more DNS resolution-related metrics as well as Go metrics in its own dedicated tab.