201
202 if cfg.Prometheus.Enabled {
203 app.PromRegisterer.MustRegister(prometheus.NewGoCollector())
204 app.PromRegisterer.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))205 http.Handle(cfg.Prometheus.Endpoint, promhttp.HandlerFor(app.PromRegistry, promhttp.HandlerOpts{}))
206 }
207 if err = app.Start(BuildVersion); err != nil {
200 }
201
202 if cfg.Prometheus.Enabled {
203 app.PromRegisterer.MustRegister(prometheus.NewGoCollector())204 app.PromRegisterer.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
205 http.Handle(cfg.Prometheus.Endpoint, promhttp.HandlerFor(app.PromRegistry, promhttp.HandlerOpts{}))
206 }
Sometimes a function, variable, constant, field, or whole package becomes redundant or unnecessary but must be kept for compatibility with existing programs. These should not be used except for compatibility with legacy systems.