跳转至

CoreDNS

·


CoreDNS 采集器用于采集 CoreDNS 相关的指标数据。

配置

前置条件

  • CoreDNS 配置启用 prometheus 插件

采集器配置

进入 DataKit 安装目录下的 conf.d/coredns 目录,复制 coredns.conf.sample 并命名为 coredns.conf。示例如下:

[[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"

配置好后,重启 DataKit 即可。

通过 DataKit 来开启[ kubernetesprometheus 采集器(https://docs.guance.com/integrations/kubernetesprometheus/)。

[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"

指标

coredns_acl

  • 标签
Tag Description
host Host name
instance Instance endpoint
server Server responsible for the request.
zone Zone name used for the request/response.
  • 指标列表
Metric Description
allowed_requests_total Counter of DNS requests being allowed
Type: float
Unit: count
blocked_requests_total Counter of DNS requests being blocked
Type: float
Unit: count
dropped_requests_total Counter of DNS requests being dropped
Type: float
Unit: count
filtered_requests_total Counter of DNS requests being filtered
Type: float
Unit: count

coredns_cache

  • 标签
Tag Description
host Host name
instance Instance endpoint
server Server responsible for the request
type Cache type
zones Zone name used for the request/response
  • 指标列表
Metric Description
drops_total The number responses that are not cached, because the reply is malformed
Type: float
Unit: count
entries The number of elements in the cache
Type: float
Unit: count
evictions_total The count of cache evictions
Type: float
Unit: count
hits_total The count of cache hits
Type: float
Unit: count
misses_total The count of cache misses. Deprecated, derive misses from cache hits/requests counters
Type: float
Unit: count
prefetch_total The number of times the cache has prefetched a cached item.
Type: float
Unit: count
requests_total The count of cache requests
Type: float
Unit: count
served_stale_total The number of requests served from stale cache entries
Type: float
Unit: count

coredns_dnssec

  • 标签
Tag Description
host Host name
instance Instance endpoint
server Server responsible for the request
type signature
  • 指标列表
Metric Description
cache_entries The number of elements in the dnssec cache
Type: float
Unit: count
cache_hits_total The count of cache hits
Type: float
Unit: count
cache_misses_total The count of cache misses
Type: float
Unit: count

coredns_forward

  • 标签
Tag Description
host Host name
instance Instance endpoint
proto Transport protocol like udp, tcp, tcp-tls
rcode Upstream returned RCODE
to Upstream server
  • 指标列表
Metric Description
conn_cache_hits_total Counter of connection cache hits per upstream and protocol
Type: float
Unit: count
conn_cache_misses_total Counter of connection cache misses per upstream and protocol
Type: float
Unit: count
healthcheck_broken_total Counter of the number of complete failures of the health checks
Type: float
Unit: count
healthcheck_failures_total Counter of the number of failed health checks
Type: float
Unit: count
max_concurrent_rejects_total Counter of the number of queries rejected because the concurrent queries were at maximum
Type: float
Unit: count
request_duration_seconds Histogram of the time each request took
Type: float
Unit: time,s
requests_total Counter of requests made per upstream
Type: float
Unit: count
responses_total Counter of responses received per upstream
Type: float
Unit: count

coredns_grpc

  • 标签
Tag Description
host Host name
instance Instance endpoint
rcode Upstream returned RCODE
to Upstream server
  • 指标列表
Metric Description
request_duration_seconds Histogram of the time each request took
Type: float
Unit: time,s
requests_total Counter of requests made per upstream
Type: float
Unit: count
responses_total Counter of requests made per upstream
Type: float
Unit: count

coredns_hosts

  • 标签
Tag Description
host Host name
instance Instance endpoint
  • 指标列表
Metric Description
entries The combined number of entries in hosts and Corefile
Type: float
Unit: count
reload_timestamp_seconds The timestamp of the last reload of hosts file
Type: float
Unit: timeStamp,sec

coredns_template

  • 标签
Tag Description
class The query class (usually IN)
host Host name
instance Instance endpoint
section Section label
server Server responsible for the request
template Template label
type The RR type requested (e.g. PTR
view View name
zone Zone name
  • 指标列表
Metric Description
failures_total Counter of go template failures
Type: float
Unit: count
matches_total Counter of template regex matches
Type: float
Unit: count
rr_failures_total Counter of mis-templated RRs
Type: float
Unit: count

coredns

  • 标签
Tag Description
goversion Golang version
hash Is sha512
host Host name
instance Instance endpoint
name Handler name
plugin The name of the plugin that made the write to the client
proto Transport protocol like udp, tcp, tcp-tls
rcode Upstream returned RCODE
revision Gitcommit contains the commit where we built CoreDNS from
server Server responsible for the request
service_kind Service kind
status HTTPs status code
value The returned hash value
version CoreDNS version
view View name
zone Zone name used for the request/response
  • 指标列表
Metric Description
autopath_success_total Counter of requests that did auto path
Type: float
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
Unit: bool
dns64_requests_translated_total Counter of DNS requests translated by dns64
Type: float
Unit: count
dns_do_requests_total Counter of DNS requests with DO bit set per zone
Type: float
Unit: count
dns_https_responses_total Counter of DoH responses per server and http status code
Type: float
Unit: count
dns_panics_total A metrics that counts the number of panics
Type: float
Unit: count
dns_plugin_enabled A metric that indicates whether a plugin is enabled on per server and zone basis
Type: float
Unit: bool
dns_request_duration_seconds Histogram of the time (in seconds) each request took per zone
Type: float
Unit: time,s
dns_request_size_bytes Size of the EDNS0 UDP buffer in bytes (64K for TCP) per zone and protocol
Type: float
Unit: digital,B
dns_requests_total Counter of DNS requests made per zone, protocol and family
Type: float
Unit: count
dns_response_size_bytes Size of the returned response in bytes
Type: float
Unit: digital,B
dns_responses_total Counter of response status codes
Type: float
Unit: count
health_request_duration_seconds Histogram of the time (in seconds) each request took
Type: float
Unit: time,s
health_request_failures_total The number of times the health checks failed
Type: float
Unit: count
kubernetes_dns_programming_duration_seconds Histogram of the time (in seconds) it took to program a dns instance
Type: float
Unit: time,s
local_localhost_requests_total Counter of localhost. domain requests
Type: float
Unit: count
reload_failed_total Counter of the number of failed reload attempts
Type: float
Unit: count
reload_version_info A metric with a constant '1' value labeled by hash, and value which type of hash generated
Type: float
Unit: bool

文档评价

文档内容是否对您有帮助? ×