mirror of
https://github.com/coredns/coredns.git
synced 2025-12-07 10:55:17 -05:00
middleware/metrics: export ListenAddr (#366)
ListenAddr is the address where the prometheus metric are exported. This can be used in tests to listen on "localhost:0" and then later retrieve the metrics from there. It makes the tests indepent on each other.
This commit is contained in:
@@ -38,7 +38,7 @@ func setup(c *caddy.Controller) error {
|
||||
|
||||
func prometheusParse(c *caddy.Controller) (*Metrics, error) {
|
||||
var (
|
||||
met = &Metrics{Addr: Addr, zoneMap: make(map[string]bool)}
|
||||
met = &Metrics{Addr: addr, zoneMap: make(map[string]bool)}
|
||||
err error
|
||||
)
|
||||
|
||||
@@ -88,4 +88,4 @@ func prometheusParse(c *caddy.Controller) (*Metrics, error) {
|
||||
var metricsOnce sync.Once
|
||||
|
||||
// Addr is the address the where the metrics are exported by default.
|
||||
const Addr = "localhost:9153"
|
||||
const addr = "localhost:9153"
|
||||
|
||||
Reference in New Issue
Block a user