diff --git a/exporters/metric/prometheus/prometheus.go b/exporters/metric/prometheus/prometheus.go index e0db3fe8726..d1f64b6a7a5 100644 --- a/exporters/metric/prometheus/prometheus.go +++ b/exporters/metric/prometheus/prometheus.go @@ -130,13 +130,13 @@ func NewExportPipeline(config Config, options ...controller.Option) (*Exporter, // InstallNewPipeline instantiates a NewExportPipeline and registers it globally. // Typically called as: // -// hf, err := prometheus.InstallNewPipeline(prometheus.Config{...}) +// exporter, err := prometheus.InstallNewPipeline(prometheus.Config{...}) // // if err != nil { // ... // } -// http.HandleFunc("/metrics", hf) -// defer pipeline.Stop() +// http.HandleFunc("/metrics", exporter) +// defer exporter.Controller().Stop(context.TODO()) // ... Done func InstallNewPipeline(config Config, options ...controller.Option) (*Exporter, error) { exp, err := NewExportPipeline(config, options...)