diff options
author | 2017-12-27 14:14:53 +0000 | |
---|---|---|
committer | 2017-12-27 14:14:53 +0000 | |
commit | 99047aee9bea3a957e73ef774441ff881967de21 (patch) | |
tree | a5c0b2cb55c6aef81c6d97222b086fa38834046e /plugin/kubernetes/kubernetes.go | |
parent | c655589fa3b33a28306fd501d3001374af60f9cd (diff) | |
download | coredns-99047aee9bea3a957e73ef774441ff881967de21.tar.gz coredns-99047aee9bea3a957e73ef774441ff881967de21.tar.zst coredns-99047aee9bea3a957e73ef774441ff881967de21.zip |
plugin/metrics: convience MustRegister function (#1332)
This leave most of the code intact, but we need to stop vendoring
prometheus, because, again, plugins what want to use it. Not vendoring
prometheus makes my forward metrics show up again. Code looks bit
convoluted, but works:
~~~
c.OnStartup(func() error {
once.Do(func() {
m := dnsserver.GetConfig(c).Handler("prometheus")
if m == nil {
return
}
if x, ok := m.(*metrics.Metrics); ok {
x.MustRegister(RequestCount)
x.MustRegister(RcodeCount)
x.MustRegister(RequestDuration)
x.MustRegister(HealthcheckFailureCount)
x.MustRegister(SocketGauge)
}
})
})
~~~
Diffstat (limited to 'plugin/kubernetes/kubernetes.go')
0 files changed, 0 insertions, 0 deletions