You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: grok_exporter.go
+22-15Lines changed: 22 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,10 @@ import (
32
32
)
33
33
34
34
var (
35
-
printVersion=flag.Bool("version", false, "Print the grok_exporter version.")
36
-
configPath=flag.String("config", "", "Path to the config file. Try '-config ./example/config.yml' to get started.")
37
-
showConfig=flag.Bool("showconfig", false, "Print the current configuration to the console. Example: 'grok_exporter -showconfig -config ./example/config.yml'")
35
+
printVersion=flag.Bool("version", false, "Print the grok_exporter version.")
36
+
configPath=flag.String("config", "", "Path to the config file. Try '-config ./example/config.yml' to get started.")
37
+
showConfig=flag.Bool("showconfig", false, "Print the current configuration to the console. Example: 'grok_exporter -showconfig -config ./example/config.yml'")
38
+
disableExporterMetrics=flag.Bool("disable-exporter-metrics", false, "If this flag is set, the metrics about the exporter itself (go_*, process_*, promhttp_*) will be excluded from /metrics")
38
39
)
39
40
40
41
var (
@@ -67,23 +68,29 @@ func main() {
67
68
fmt.Printf("%v\n", cfg)
68
69
return
69
70
}
71
+
registry:=prometheus.NewRegistry()
72
+
if!*disableExporterMetrics {
73
+
// init like the default registry, see client_golang/prometheus/registry.go init()
0 commit comments