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.
Activation
CoreDNS is enabled by default for your environment. If necessary, you can disable CoreDNS monitoring at the host level.
Disable CoreDNS monitoring at the host level
- In the Dynatrace menu, go to Hosts and then select your host.
- Open the More (…) menu and select Settings.
- In the Monitored technologies table, search for the CoreDNS entry. You can sort by Type and look for the OneAgent extension type.
- 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.
Environment
- In the Dynatrace menu, go to Settings.
- Select Monitoring > Monitored technologies.
- Find CoreDNS and select Edit.
- Add a non-default Prometheus endpoint in the CoreDNS Prometheus endpoint for collecting metrics field.
Single host
- In the Dynatrace menu, go to Hosts and select your host.
- Open the More (…) menu and select Settings.
- In the Monitored technologies table, search for the CoreDNS entry. You can sort by Type and look for the OneAgent extension type.
- Select Edit, turn on Use host configuration.
- 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.
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.