Fix prometheus output cannot be reloaded (#3053)
(cherry picked from commit 82ea04f188
)
This commit is contained in:
parent
7bbd3daa98
commit
d4536ad29e
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue