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
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 3 additions and 1 deletions

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 {