coredns/plugin
Miek Gieben 6953ab2b4f
Metrics: expand coredns_dns_responses_total with plugin label (#4914)
* Metrics: expand coredns_dns_responses_total with plugin label

This adds (somewhat hacky?) code to add a plugin label to the
coredns_dns_responses_total metric. It's completely obvlious to the
plugin as we just check who called the *recorder.WriteMsg method. We use
runtime.Caller( 1 2 3) to get multiple levels of callers, this should be
deep enough, but it depends on the dns.ResponseWriter wrapping that's
occuring.

README.md of metrics updates and test added in test/metrics_test.go to
check for the label being set.

I went through the plugin to see what metrics could be removed, but
actually didn't find any, the plugin push out metrics that make sense.

Due to the path fiddling to figure out the plugin name I doubt this
works (out-of-the-box) for external plugins, but I haven't tested that.

Signed-off-by: Miek Gieben <miek@miek.nl>

* better comment

Signed-off-by: Miek Gieben <miek@miek.nl>

* Metrics: expand coredns_dns_responses_total with plugin label

This adds (somewhat hacky?) code to add a plugin label to the
coredns_dns_responses_total metric. It's completely obvlious to the
plugin as we just check who called the *recorder.WriteMsg method. We use
runtime.Caller( 1 2 3) to get multiple levels of callers, this should be
deep enough, but it depends on the dns.ResponseWriter wrapping that's
occuring.

README.md of metrics updates and test added in test/metrics_test.go to
check for the label being set.

I went through the plugin to see what metrics could be removed, but
actually didn't find any, the plugin push out metrics that make sense.

Due to the path fiddling to figure out the plugin name I doubt this
works (out-of-the-box) for external plugins, but I haven't tested that.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Update core/dnsserver/server.go

Co-authored-by: dilyevsky <ilyevsky@gmail.com>

* Use [3]string

Signed-off-by: Miek Gieben <miek@miek.nl>

* imports

Signed-off-by: Miek Gieben <miek@miek.nl>

* remove dnstest changes

Signed-off-by: Miek Gieben <miek@miek.nl>

* revert

Signed-off-by: Miek Gieben <miek@miek.nl>

* Add some sleeps to make it less flaky

Signed-off-by: Miek Gieben <miek@miek.nl>

* Revert "Add some sleeps to make it less flaky"

This reverts commit b5c6655196.

* Remove forward when not needed

Signed-off-by: Miek Gieben <miek@miek.nl>

* remove newline

Signed-off-by: Miek Gieben <miek@miek.nl>

Co-authored-by: dilyevsky <ilyevsky@gmail.com>
2021-11-12 16:07:05 +00:00
..
acl reverse zone: fix Normalize (#4621) 2021-05-17 13:19:54 -07:00
any docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
auto cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
autopath reverse zone: fix Normalize (#4621) 2021-05-17 13:19:54 -07:00
azure d-Updated Azure plugin NS record (#4383) 2021-01-11 14:58:56 -08:00
bind plugin/bind: exclude interface or ip address (#4543) 2021-03-25 16:38:17 +01:00
bufsize For caddy v1 in our org (#4018) 2020-09-24 18:14:41 +02:00
cache Update cache metrics (#4781) 2021-08-16 13:54:36 +08:00
cancel docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
chaos plugin/header: run go gen and small doc updates (#4754) 2021-07-15 10:10:16 +02:00
clouddns fix record missing for zone with many of records (#4328) 2021-01-12 13:38:18 +01:00
debug docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
deprecated For caddy v1 in our org (#4018) 2020-09-24 18:14:41 +02:00
dns64 docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
dnssec cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
dnstap Fix import ordering presubmit test (#4422) 2021-01-24 17:28:49 +00:00
erratic docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
errors auto go fmt 2021-07-12 10:32:17 +00:00
etcd reverse zone: fix Normalize (#4621) 2021-05-17 13:19:54 -07:00
file cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
forward cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
geoip Fix a typo in plugin/geoip/README.md (#4978) 2021-11-10 21:20:40 -05:00
grpc cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
header plugin/header: run go gen and small doc updates (#4754) 2021-07-15 10:10:16 +02:00
health cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
hosts The IPv4 parser no longer accepts leading zeros (#4844) 2021-09-04 08:34:57 +02:00
import docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
k8s_external plugin/k8s_external: fix SRV queries doesn't work with AWS ELB/NLB (#4929) 2021-10-27 09:59:21 -04:00
kubernetes plugin/kubernetes: Don't use pod names longer than 63 characters as dns labels (#4908) 2021-10-06 15:59:37 +00:00
loadbalance plugin/loadbalance: More consistent shuffling (#4961) 2021-11-12 16:00:20 +00:00
local add local plugin (#4262) 2020-11-05 15:02:07 +01:00
log cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
loop deprecate Normalize and MustNormalize (#4648) 2021-05-27 13:26:14 +02:00
metadata Create geoip plugin (#4688) 2021-07-14 09:25:30 +02:00
metrics Metrics: expand coredns_dns_responses_total with plugin label (#4914) 2021-11-12 16:07:05 +00:00
minimal plugin/minimal: fix import path (#4523) 2021-03-16 10:55:21 +01:00
nsid docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
pkg plugin/pkg/cache: fix data race (#4932) 2021-10-23 20:17:47 -07:00
pprof docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
ready dont return 200 during shutdown (#4167) 2020-10-01 16:13:23 +02:00
reload docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
rewrite restore 1.8.3 question revert logic; add tests (#4840) 2021-08-31 10:34:26 +02:00
root cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
route53 plugin/route53: Configurable AWS Endpoint (#4963) 2021-11-08 06:45:45 -08:00
secondary plugin/secondary: doc updates (#4686) 2021-06-11 10:54:49 -07:00
sign cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
template reverse zone: fix Normalize (#4621) 2021-05-17 13:19:54 -07:00
test cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
tls docs: move Also See to See Also (#4245) 2020-10-28 10:56:35 -07:00
trace auto remove trailing whitespaces 2021-07-20 10:28:21 +00:00
transfer Fix a typo in plugin/transfer/README.md (#4946) 2021-11-01 11:06:13 -04:00
whoami For caddy v1 in our org (#4018) 2020-09-24 18:14:41 +02:00
backend.go Cherry-pick: Implement notifies for transfer plugin (#3972) (#4142) 2020-09-24 20:30:39 +02:00
backend_lookup.go plugin/etcd: Fix inconsistent names of glue records with TargetStrip (#4595) 2021-05-03 08:48:51 -07:00
done.go go report card fixes (#3182) 2019-08-24 18:14:25 +00:00
log_test.go Clean up tests logging (#1979) 2018-07-19 16:23:06 +01:00
normalize.go Fix IPv6 case for CIDR format reverse zones (#4652) 2021-06-04 10:17:17 +02:00
normalize_test.go Fix IPv6 case for CIDR format reverse zones (#4652) 2021-06-04 10:17:17 +02:00
plugin.go Reduce the cardinality of health endpoint metrics (#4650) 2021-05-27 15:16:38 +02:00
register.go For caddy v1 in our org (#4018) 2020-09-24 18:14:41 +02:00