MCPcopy
hub / github.com/grafana/dskit / RegisterInstrumentationWithGatherer

Function RegisterInstrumentationWithGatherer

server/server.go:584–590  ·  view source on GitHub ↗

RegisterInstrumentationWithGatherer on the given router.

(router *mux.Router, gatherer prometheus.Gatherer)

Source from the content-addressed store, hash-verified

582
583// RegisterInstrumentationWithGatherer on the given router.
584func 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
592func 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)

Callers 2

newServerFunction · 0.85
RegisterInstrumentationFunction · 0.85

Calls 1

HandleMethod · 0.65

Tested by

no test coverage detected