Skip to content

Commit

Permalink
custom metrics path
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Mikhaltsov committed Aug 1, 2024
1 parent 091cb62 commit 5672423
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var (
listenAddress = kingpin.Flag("web.listen-address", "The address to listen on for HTTP requests").Default(":9427").String()
configFile = kingpin.Flag("config.file", "Exporter configuration file").Default("/app/cfg/network_exporter.yml").String()
enableProfileing = kingpin.Flag("profiling", "Enable Profiling (pprof + fgprof)").Default("false").Bool()
MetricPath = kingpin.Flag("metrics-path", "metric path").Default("/metrics").String()
sc = &config.SafeConfig{Cfg: &config.Config{}}
logger log.Logger
icmpID *common.IcmpID // goroutine shared counter
Expand Down Expand Up @@ -111,7 +112,7 @@ func startConfigRefresh() {

func startServer() {
mux := http.NewServeMux()
metricsPath := "/metrics"
metricsPath := *MetricPath

reg := prometheus.NewRegistry()
reg.MustRegister(collectors.NewGoCollector())
Expand Down

0 comments on commit 5672423

Please sign in to comment.