gocollector: Reverted client_golang v1.12 addition of runtime/metrics… · prometheus/client_golang@7eb9d11 (original) (raw)
4 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
1 | +## Unreleased | |
2 | + | |
3 | +* [CHANGE] Minimum required Go version is now 1.16. | |
4 | +* [CHANGE] Added `collectors.WithGoCollections` that allows to choose what collection of Go runtime metrics user wants: Equivalent of [`MemStats` structure](https://pkg.go.dev/runtime#MemStats) configured using `GoRuntimeMemStatsCollection`, new based on dedicated [runtime/metrics](https://pkg.go.dev/runtime/metrics) metrics represented by `GoRuntimeMetricsCollection` option, or both by specifying `GoRuntimeMemStatsCollection | GoRuntimeMetricsCollection` flag. | |
5 | +* [CHANGE] ⚠️ Change in `collectors.NewGoCollector` metrics: Reverting addition of new ~80 runtime metrics by default. You can enable this back with `GoRuntimeMetricsCollection` option or `GoRuntimeMemStatsCollection | GoRuntimeMetricsCollection` for smooth transition. | |
6 | + | |
1 | 7 | ## 1.12.1 / 2022-01-29 |
2 | 8 | |
3 | 9 | * [BUGFIX] Make the Go 1.17 collector concurrency-safe #969 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -70,8 +70,8 @@ const ( | ||
70 | 70 | // WithGoCollections(GoRuntimeMemStatsCollection | GoRuntimeMetricsCollection) means both GoRuntimeMemStatsCollection |
71 | 71 | // metrics and GoRuntimeMetricsCollection will be exposed. |
72 | 72 | // |
73 | -// Use WithGoCollections(GoRuntimeMemStatsCollection) to have Go collector working in | |
74 | -// the compatibility mode with client_golang pre v1.12 (move to runtime/metrics). | |
73 | +// The current default is GoRuntimeMemStatsCollection, so the compatibility mode with | |
74 | +// client_golang pre v1.12 (move to runtime/metrics). | |
75 | 75 | func WithGoCollections(flags uint32) goOption { |
76 | 76 | return func(o *goOptions) { |
77 | 77 | o.EnabledCollections = flags |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -132,7 +132,7 @@ func (c GoCollectorOptions) isEnabled(flag uint32) bool { | ||
132 | 132 | return c.EnabledCollections&flag != 0 |
133 | 133 | } |
134 | 134 | |
135 | -const defaultGoCollections = goRuntimeMemStatsCollection | goRuntimeMetricsCollection | |
135 | +const defaultGoCollections = goRuntimeMemStatsCollection | |
136 | 136 | |
137 | 137 | // NewGoCollector is the obsolete version of collectors.NewGoCollector. |
138 | 138 | // See there for documentation. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -117,7 +117,7 @@ func TestGoCollector(t *testing.T) { | ||
117 | 117 | var sink interface{} |
118 | 118 | |
119 | 119 | func TestBatchHistogram(t *testing.T) { |
120 | -goMetrics := collectGoMetrics(t, defaultGoCollections) | |
120 | +goMetrics := collectGoMetrics(t, goRuntimeMetricsCollection) | |
121 | 121 | |
122 | 122 | var mhist Metric |
123 | 123 | for _, m := range goMetrics { |