Fix prometheus output cannot be reloaded (#3053)

(cherry picked from commit 82ea04f188)
This commit is contained in:
Daniel Nelson
2017-07-25 15:41:18 -07:00
committed by Daniel Nelson
parent 7bbd3daa98
commit d4536ad29e

View File

@@ -94,7 +94,9 @@ func (p *PrometheusClient) Connect() error {
func (p *PrometheusClient) Close() error {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()
return p.server.Shutdown(ctx)
err := p.server.Shutdown(ctx)
prometheus.Unregister(p)
return err
}
func (p *PrometheusClient) SampleConfig() string {