This commit is contained in:
pegasko 2023-10-29 19:04:05 +03:00
parent 8d1e9e7334
commit ca40b25c5e

View file

@ -2,16 +2,11 @@ package dnsstat
import ( import (
"context" "context"
"fmt"
"io"
"os"
"github.com/coredns/caddy" "github.com/coredns/caddy"
"github.com/coredns/coredns/core/dnsserver" "github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin" "github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/pkg/dnstest" "github.com/coredns/coredns/plugin/metrics"
"github.com/coredns/coredns/plugin/pkg/replacer"
"github.com/coredns/coredns/request"
"github.com/miekg/dns" "github.com/miekg/dns"
) )
@ -39,7 +34,6 @@ func setup(c *caddy.Controller) error {
// ServeDNS implements the plugin.Handler interface. // ServeDNS implements the plugin.Handler interface.
func (d DNSStat) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { func (d DNSStat) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
state := request.Request{W: w, Req: r}
// Metric increment // Metric increment
requestCount.WithLabelValues(metrics.WithServer(ctx)).Inc() requestCount.WithLabelValues(metrics.WithServer(ctx)).Inc()