aboutsummaryrefslogtreecommitdiff
path: root/plugin/metrics
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2019-03-25 19:04:03 +0000
committerGravatar GitHub <noreply@github.com> 2019-03-25 19:04:03 +0000
commit93f635023a7515087bb92d542f059d29a4d7c711 (patch)
tree54a9fa7c3169f21dd2801f6ccc3ad6d70afa4b31 /plugin/metrics
parent9a8c301a42433ed9bd2479ef7ab13e1d6d6e7627 (diff)
downloadcoredns-93f635023a7515087bb92d542f059d29a4d7c711.tar.gz
coredns-93f635023a7515087bb92d542f059d29a4d7c711.tar.zst
coredns-93f635023a7515087bb92d542f059d29a4d7c711.zip
Don't double report metrics on error (#2719)
* Don't double report metrics on error When there is an error use a different function to report the metrics, in case the plugin chain handled the request the metrics are already reported. Fixes: #2717 Signed-off-by: Miek Gieben <miek@miek.nl> * Compile again Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/metrics')
-rw-r--r--plugin/metrics/vars/report.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugin/metrics/vars/report.go b/plugin/metrics/vars/report.go
index fe6a5dccd..343d98a22 100644
--- a/plugin/metrics/vars/report.go
+++ b/plugin/metrics/vars/report.go
@@ -8,7 +8,9 @@ import (
"github.com/miekg/dns"
)
-// Report reports the metrics data associated with request.
+// Report reports the metrics data associated with request. This function is exported because it is also
+// called from core/dnsserver to report requests hitting the server that should not be handled and are thus
+// not sent down the plugin chain.
func Report(server string, req request.Request, zone, rcode string, size int, start time.Time) {
// Proto and Family.
net := req.Proto()