RegisterInstrumentationWithGatherer on the given router.
(router *mux.Router, gatherer prometheus.Gatherer)
| 582 | |
| 583 | // RegisterInstrumentationWithGatherer on the given router. |
| 584 | func RegisterInstrumentationWithGatherer(router *mux.Router, gatherer prometheus.Gatherer) { |
| 585 | router.Handle("/metrics", promhttp.HandlerFor(gatherer, promhttp.HandlerOpts{ |
| 586 | EnableOpenMetrics: true, |
| 587 | })) |
| 588 | router.Handle("/debug/pprof/cmdline", http.NotFoundHandler()) |
| 589 | router.PathPrefix("/debug/pprof").Handler(http.DefaultServeMux) |
| 590 | } |
| 591 | |
| 592 | func BuildHTTPMiddleware(cfg Config, router *mux.Router, metrics *Metrics, logger gokit_log.Logger) ([]middleware.Interface, error) { |
| 593 | sourceIPs, err := middleware.NewSourceIPs(cfg.LogSourceIPsHeader, cfg.LogSourceIPsRegex, cfg.LogSourceIPsFull) |
no test coverage detected