mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/coredns/coredns/plugin"
|
||||
"github.com/coredns/coredns/plugin/metrics/vars"
|
||||
"github.com/coredns/coredns/plugin/pkg/reuseport"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
@@ -95,7 +96,7 @@ func (m *Metrics) ZoneNames() []string {
|
||||
|
||||
// OnStartup sets up the metrics on startup.
|
||||
func (m *Metrics) OnStartup() error {
|
||||
ln, err := net.Listen("tcp", m.Addr)
|
||||
ln, err := reuseport.Listen("tcp", m.Addr)
|
||||
if err != nil {
|
||||
log.Errorf("Failed to start metrics handler: %s", err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user