aboutsummaryrefslogtreecommitdiff
path: root/plugin/metrics/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/metrics/context.go')
-rw-r--r--plugin/metrics/context.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/plugin/metrics/context.go b/plugin/metrics/context.go
index 4cce871f5..ac3010c71 100644
--- a/plugin/metrics/context.go
+++ b/plugin/metrics/context.go
@@ -1,7 +1,7 @@
package metrics
import (
- "github.com/coredns/coredns/plugin"
+ "github.com/coredns/coredns/plugin/metrics/vars"
"golang.org/x/net/context"
)
@@ -15,10 +15,4 @@ import (
// Basic usage with a metric:
//
// <metric>.WithLabelValues(metrics.WithServer(ctx), labels..).Add(1)
-func WithServer(ctx context.Context) string {
- srv := ctx.Value(plugin.ServerCtx{})
- if srv == nil {
- return ""
- }
- return srv.(string)
-}
+func WithServer(ctx context.Context) string { return vars.WithServer(ctx) }