Skip to content

Commit cf109cc

Browse files
committed
Upgrade to prometheus/common 0.62.0 with breaking change
common 0.62.0 switches NameValidationScheme global variable to UTF8Validation. While relaxing validation this will likely yield test failures downstream. It's unfortunate, but the alternatives were worse: prometheus/common#724 Good news is that client_golang should work with older common deps and callers can easily change model.NameValidationScheme value to old value to solve any compatibility issues. Signed-off-by: bwplotka <[email protected]>
1 parent 7b39d01 commit cf109cc

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/klauspost/compress v1.17.11
1111
github.com/kylelemons/godebug v1.1.0
1212
github.com/prometheus/client_model v0.6.1
13-
github.com/prometheus/common v0.61.0
13+
github.com/prometheus/common v0.62.0
1414
github.com/prometheus/procfs v0.15.1
1515
golang.org/x/sys v0.28.0
1616
google.golang.org/protobuf v1.36.1
@@ -23,7 +23,7 @@ require (
2323
github.com/modern-go/reflect2 v1.0.2 // indirect
2424
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
2525
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
26-
golang.org/x/net v0.32.0 // indirect
26+
golang.org/x/net v0.33.0 // indirect
2727
golang.org/x/oauth2 v0.24.0 // indirect
2828
golang.org/x/text v0.21.0 // indirect
2929
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
3535
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3636
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
3737
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
38-
github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ=
39-
github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s=
38+
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
39+
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
4040
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
4141
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
4242
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
@@ -46,8 +46,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
4646
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
4747
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
4848
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
49-
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
50-
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
49+
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
50+
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
5151
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
5252
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
5353
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=

prometheus/internal/go_runtime_metrics.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ func RuntimeMetricsToProm(d *metrics.Description) (string, string, string, bool)
6666
name += "_total"
6767
}
6868

69-
valid := model.IsValidMetricName(model.LabelValue(namespace + "_" + subsystem + "_" + name))
69+
// Our current conversion moves to legacy naming, so use legacy validation.
70+
valid := model.IsValidLegacyMetricName(namespace + "_" + subsystem + "_" + name)
7071
switch d.Kind {
7172
case metrics.KindUint64:
7273
case metrics.KindFloat64:

0 commit comments

Comments
 (0)