CoreDNS
CoreDNS collector is used to collect metric data related to CoreDNS.
Configuration¶
Preconditions¶
- CoreDNS configuration; Enable the
prometheusplug-in
Collector Configuration¶
Go to the conf.d/samples directory under the DataKit installation directory, copy coredns.conf.sample and name it coredns.conf. Examples are as follows:
[[inputs.prom]]
url = "http://127.0.0.1:9153/metrics"
source = "coredns"
metric_types = ["counter", "gauge"]
## filter metrics by names
metric_name_filter = ["^coredns_(acl|cache|dnssec|forward|grpc|hosts|template|dns)_([a-z_]+)$"]
# measurement_prefix = ""
# measurement_name = "prom"
interval = "10s"
# tags_ignore = [""]
## TLS config
tls_open = false
# tls_ca = "/tmp/ca.crt"
# tls_cert = "/tmp/peer.crt"
# tls_key = "/tmp/peer.key"
## customize metrics
[[inputs.prom.measurements]]
prefix = "coredns_acl_"
name = "coredns_acl"
[[inputs.prom.measurements]]
prefix = "coredns_cache_"
name = "coredns_cache"
[[inputs.prom.measurements]]
prefix = "coredns_dnssec_"
name = "coredns_dnssec"
[[inputs.prom.measurements]]
prefix = "coredns_forward_"
name = "coredns_forward"
[[inputs.prom.measurements]]
prefix = "coredns_grpc_"
name = "coredns_grpc"
[[inputs.prom.measurements]]
prefix = "coredns_hosts_"
name = "coredns_hosts"
[[inputs.prom.measurements]]
prefix = "coredns_template_"
name = "coredns_template"
[[inputs.prom.measurements]]
prefix = "coredns_dns_"
name = "coredns"
Once configured, restart DataKit.
Enable [kubernetesprometheus(https://docs.guance.com/integrations/kubernetesprometheus/) through DataKit .
[inputs.kubernetesprometheus]
[[inputs.kubernetesprometheus.instances]]
role = "pod"
namespaces = ["kube-system"]
selector = "k8s-app=kube-dns"
port = "__kubernetes_pod_container_coredns_port_metrics_number"
[inputs.kubernetesprometheus.instances.custom]
[inputs.kubernetesprometheus.instances.custom.tags]
cluster = "demo"
Metric¶
coredns_acl¶
| Tags & Fields | Description |
|---|---|
| host ( tag) |
Host name |
| instance ( tag) |
Instance endpoint |
| server ( tag) |
Server responsible for the request. |
| zone ( tag) |
Zone name used for the request/response. |
| allowed_requests_total | Counter of DNS requests being allowed Type: float | (count) Unit: count |
| blocked_requests_total | Counter of DNS requests being blocked Type: float | (count) Unit: count |
| dropped_requests_total | Counter of DNS requests being dropped Type: float | (count) Unit: count |
| filtered_requests_total | Counter of DNS requests being filtered Type: float | (count) Unit: count |
coredns_cache¶
| Tags & Fields | Description |
|---|---|
| host ( tag) |
Host name |
| instance ( tag) |
Instance endpoint |
| server ( tag) |
Server responsible for the request |
| type ( tag) |
Cache type |
| zones ( tag) |
Zone name used for the request/response |
| drops_total | The number responses that are not cached, because the reply is malformed Type: float | (count) Unit: count |
| entries | The number of elements in the cache Type: float | (gauge) Unit: count |
| evictions_total | The count of cache evictions Type: float | (count) Unit: count |
| hits_total | The count of cache hits Type: float | (count) Unit: count |
| misses_total | The count of cache misses. Deprecated, derive misses from cache hits/requests counters Type: float | (count) Unit: count |
| prefetch_total | The number of times the cache has prefetched a cached item. Type: float | (count) Unit: count |
| requests_total | The count of cache requests Type: float | (count) Unit: count |
| served_stale_total | The number of requests served from stale cache entries Type: float | (count) Unit: count |
coredns_dnssec¶
| Tags & Fields | Description |
|---|---|
| host ( tag) |
Host name |
| instance ( tag) |
Instance endpoint |
| server ( tag) |
Server responsible for the request |
| type ( tag) |
signature |
| cache_entries | The number of elements in the dnssec cache Type: float | (gauge) Unit: count |
| cache_hits_total | The count of cache hits Type: float | (count) Unit: count |
| cache_misses_total | The count of cache misses Type: float | (count) Unit: count |
coredns_forward¶
| Tags & Fields | Description |
|---|---|
| host ( tag) |
Host name |
| instance ( tag) |
Instance endpoint |
| proto ( tag) |
Transport protocol like udp, tcp, tcp-tls |
| rcode ( tag) |
Upstream returned RCODE |
| to ( tag) |
Upstream server |
| conn_cache_hits_total | Counter of connection cache hits per upstream and protocol Type: float | (count) Unit: count |
| conn_cache_misses_total | Counter of connection cache misses per upstream and protocol Type: float | (count) Unit: count |
| healthcheck_broken_total | Counter of the number of complete failures of the health checks Type: float | (count) Unit: count |
| healthcheck_failures_total | Counter of the number of failed health checks Type: float | (count) Unit: count |
| max_concurrent_rejects_total | Counter of the number of queries rejected because the concurrent queries were at maximum Type: float | (count) Unit: count |
| request_duration_seconds | Histogram of the time each request took Type: float | (histogram) Unit: time,s |
| requests_total | Counter of requests made per upstream Type: float | (count) Unit: count |
| responses_total | Counter of responses received per upstream Type: float | (count) Unit: count |
coredns_grpc¶
| Tags & Fields | Description |
|---|---|
| host ( tag) |
Host name |
| instance ( tag) |
Instance endpoint |
| rcode ( tag) |
Upstream returned RCODE |
| to ( tag) |
Upstream server |
| request_duration_seconds | Histogram of the time each request took Type: float | (histogram) Unit: time,s |
| requests_total | Counter of requests made per upstream Type: float | (count) Unit: count |
| responses_total | Counter of requests made per upstream Type: float | (count) Unit: count |
coredns_hosts¶
| Tags & Fields | Description |
|---|---|
| host ( tag) |
Host name |
| instance ( tag) |
Instance endpoint |
| entries | The combined number of entries in hosts and Corefile Type: float | (gauge) Unit: count |
| reload_timestamp_seconds | The timestamp of the last reload of hosts file Type: float | (gauge) Unit: timeStamp,sec |
coredns_template¶
| Tags & Fields | Description |
|---|---|
| class ( tag) |
The query class (usually IN) |
| host ( tag) |
Host name |
| instance ( tag) |
Instance endpoint |
| section ( tag) |
Section label |
| server ( tag) |
Server responsible for the request |
| template ( tag) |
Template label |
| type ( tag) |
The RR type requested (e.g. PTR |
| view ( tag) |
View name |
| zone ( tag) |
Zone name |
| failures_total | Counter of go template failures Type: float | (count) Unit: count |
| matches_total | Counter of template regex matches Type: float | (count) Unit: count |
| rr_failures_total | Counter of mis-templated RRs Type: float | (count) Unit: count |
coredns¶
| Tags & Fields | Description |
|---|---|
| goversion ( tag) |
Golang version |
| hash ( tag) |
Is sha512 |
| host ( tag) |
Host name |
| instance ( tag) |
Instance endpoint |
| name ( tag) |
Handler name |
| plugin ( tag) |
The name of the plugin that made the write to the client |
| proto ( tag) |
Transport protocol like udp, tcp, tcp-tls |
| rcode ( tag) |
Upstream returned RCODE |
| revision ( tag) |
Gitcommit contains the commit where we built CoreDNS from |
| server ( tag) |
Server responsible for the request |
| service_kind ( tag) |
Service kind |
| status ( tag) |
HTTPs status code |
| value ( tag) |
The returned hash value |
| version ( tag) |
CoreDNS version |
| view ( tag) |
View name |
| zone ( tag) |
Zone name used for the request/response |
| autopath_success_total | Counter of requests that did auto path Type: float | (count) Unit: count |
| build_info | A metric with a constant '1' value labeled by version, revision, and Go version from which CoreDNS was built Type: float | (gauge) Unit: bool |
| dns64_requests_translated_total | Counter of DNS requests translated by dns64 Type: float | (count) Unit: count |
| dns_do_requests_total | Counter of DNS requests with DO bit set per zone Type: float | (count) Unit: count |
| dns_https_responses_total | Counter of DoH responses per server and http status code Type: float | (count) Unit: count |
| dns_panics_total | A metrics that counts the number of panics Type: float | (count) Unit: count |
| dns_plugin_enabled | A metric that indicates whether a plugin is enabled on per server and zone basis Type: float | (gauge) Unit: bool |
| dns_request_duration_seconds | Histogram of the time (in seconds) each request took per zone Type: float | (histogram) Unit: time,s |
| dns_request_size_bytes | Size of the EDNS0 UDP buffer in bytes (64K for TCP) per zone and protocolType: float | (histogram) Unit: digital,B |
| dns_requests_total | Counter of DNS requests made per zone, protocol and family Type: float | (count) Unit: count |
| dns_response_size_bytes | Size of the returned response in bytes Type: float | (histogram) Unit: digital,B |
| dns_responses_total | Counter of response status codes Type: float | (count) Unit: count |
| health_request_duration_seconds | Histogram of the time (in seconds) each request took Type: float | (histogram) Unit: time,s |
| health_request_failures_total | The number of times the health checks failed Type: float | (count) Unit: count |
| kubernetes_dns_programming_duration_seconds | Histogram of the time (in seconds) it took to program a dns instance Type: float | (histogram) Unit: time,s |
| local_localhost_requests_total | Counter of localhost. domain requestsType: float | (count) Unit: count |
| reload_failed_total | Counter of the number of failed reload attempts Type: float | (count) Unit: count |
| reload_version_info | A metric with a constant '1' value labeled by hash, and value which type of hash generated Type: float | (gauge) Unit: bool |