tunneldns: Update reporting metrics for API breakage in CoreDNS.

Use the new metrics.WithServer(ctx) method to get a server name, as the vars.Report emethod name takes this as its first param.
This commit is contained in:
Paul Querna 2019-05-06 16:38:23 -07:00
parent 137928ecaf
commit 4a96d9f1ff
No known key found for this signature in database
GPG Key ID: E6B265F073D7A8CB
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/metrics"
"github.com/coredns/coredns/plugin/metrics/vars"
"github.com/coredns/coredns/plugin/pkg/dnstest"
"github.com/coredns/coredns/plugin/pkg/rcode"
@ -37,7 +38,7 @@ func (p MetricsPlugin) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dn
status, err := plugin.NextOrFailure(p.Name(), p.Next, ctx, rw, r)
// Update built-in metrics
vars.Report(ctx, state, ".", rcode.ToString(rw.Rcode), rw.Len, rw.Start)
vars.Report(metrics.WithServer(ctx), state, ".", rcode.ToString(rw.Rcode), rw.Len, rw.Start)
return status, err
}