File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,18 @@ func main() {
37
37
// Create a new registry.
38
38
reg := prometheus .NewRegistry ()
39
39
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
+ )
45
52
46
53
// Expose the registered metrics via HTTP.
47
54
http .Handle ("/metrics" , promhttp .HandlerFor (
You can’t perform that action at this time.
0 commit comments