CoreDNS monitoring

Deprecation notice

This extension documentation is now deprecated and will no longer be updated. We recommend using the new CoreDNS extension for improved functionality and support.

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.

  1. Go to Hosts or Hosts Classic (latest Dynatrace) and then select your host.
  2. Open the More () menu and select Settings.
  3. In the Monitored technologies table, search for the CoreDNS entry. You can sort by Type and look for the OneAgent extension type.
  4. Select Edit, turn on Use host configuration, and turn off Enable on this host.

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.

  1. Go to Settings.
  2. Select Monitoring > Monitored technologies.
  3. Find CoreDNS and select Edit.
  4. Add a non-default Prometheus endpoint in the CoreDNS Prometheus endpoint for collecting metrics field.
  1. Go to Hosts or Hosts Classic (latest Dynatrace) and select your host.
  2. Open the More () menu and select Settings.
  3. In the Monitored technologies table, search for the CoreDNS entry. You can sort by Type and look for the OneAgent extension type.
  4. Select Edit, turn on Use host configuration.
  5. Add a non-default Prometheus endpoint in the CoreDNS Prometheus endpoint for collecting metrics field.

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

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

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.