File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,18 @@ func main() {
3737 // Create a new registry.
3838 reg := prometheus .NewRegistry ()
3939
40- // Add Go module build info.
41- reg .MustRegister (collectors .NewBuildInfoCollector ())
42- reg .MustRegister (collectors .NewGoCollector (
43- collectors .WithGoCollectorRuntimeMetrics (collectors.GoRuntimeMetricsRule {Matcher : regexp .MustCompile ("/.*" )}),
44- ))
40+ // Register metrics from GoCollector collecting statistics from the Go Runtime.
41+ // This enabled default, recommended metrics with the additional, recommended metric for
42+ // goroutine scheduling latencies histogram that is currently bit too expensive for default option.
43+ //
44+ // See the related GopherConUK talk to learn more: https://www.youtube.com/watch?v=18dyI_8VFa0
45+ reg .MustRegister (
46+ collectors .NewGoCollector (
47+ collectors .WithGoCollectorRuntimeMetrics (
48+ collectors.GoRuntimeMetricsRule {Matcher : regexp .MustCompile ("/sched/latencies:seconds" )},
49+ ),
50+ ),
51+ )
4552
4653 // Expose the registered metrics via HTTP.
4754 http .Handle ("/metrics" , promhttp .HandlerFor (
You can’t perform that action at this time.
0 commit comments