Bump prometheus/common to v0.63.0 (#16210)

* Bump prometheus/common to v0.63.0

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* nolint usage of deprecated model.NameValidationScheme

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
This commit is contained in:
Arthur Silva Sens 2025-03-13 16:42:42 -03:00 committed by GitHub
parent 0bfbd462ac
commit 95f49dd84b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 13 additions and 8 deletions

View file

@ -141,6 +141,7 @@ var (
func init() { func init() {
// This can be removed when the legacy global mode is fully deprecated. // This can be removed when the legacy global mode is fully deprecated.
//nolint:staticcheck
model.NameValidationScheme = model.UTF8Validation model.NameValidationScheme = model.UTF8Validation
prometheus.MustRegister(versioncollector.NewCollector(strings.ReplaceAll(appName, "-", "_"))) prometheus.MustRegister(versioncollector.NewCollector(strings.ReplaceAll(appName, "-", "_")))

View file

@ -45,6 +45,7 @@ import (
func init() { func init() {
// This can be removed when the legacy global mode is fully deprecated. // This can be removed when the legacy global mode is fully deprecated.
//nolint:staticcheck
model.NameValidationScheme = model.UTF8Validation model.NameValidationScheme = model.UTF8Validation
} }

View file

@ -64,6 +64,7 @@ import (
func init() { func init() {
// This can be removed when the legacy global mode is fully deprecated. // This can be removed when the legacy global mode is fully deprecated.
//nolint:staticcheck
model.NameValidationScheme = model.UTF8Validation model.NameValidationScheme = model.UTF8Validation
} }

View file

@ -41,6 +41,7 @@ import (
func init() { func init() {
// This can be removed when the legacy global mode is fully deprecated. // This can be removed when the legacy global mode is fully deprecated.
//nolint:staticcheck
model.NameValidationScheme = model.UTF8Validation model.NameValidationScheme = model.UTF8Validation
} }

View file

@ -837,6 +837,7 @@ func (c *ScrapeConfig) Validate(globalConfig GlobalConfig) error {
} }
} }
//nolint:staticcheck
if model.NameValidationScheme != model.UTF8Validation { if model.NameValidationScheme != model.UTF8Validation {
return errors.New("model.NameValidationScheme must be set to UTF8") return errors.New("model.NameValidationScheme must be set to UTF8")
} }

2
go.mod
View file

@ -53,7 +53,7 @@ require (
github.com/prometheus/alertmanager v0.28.0 github.com/prometheus/alertmanager v0.28.0
github.com/prometheus/client_golang v1.21.0-rc.0 github.com/prometheus/client_golang v1.21.0-rc.0
github.com/prometheus/client_model v0.6.1 github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.62.0 github.com/prometheus/common v0.63.0
github.com/prometheus/common/assets v0.2.0 github.com/prometheus/common/assets v0.2.0
github.com/prometheus/exporter-toolkit v0.14.0 github.com/prometheus/exporter-toolkit v0.14.0
github.com/prometheus/sigv4 v0.1.2 github.com/prometheus/sigv4 v0.1.2

4
go.sum
View file

@ -441,8 +441,8 @@ github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k=
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18=
github.com/prometheus/common/assets v0.2.0 h1:0P5OrzoHrYBOSM1OigWL3mY8ZvV2N4zIE/5AahrSrfM= github.com/prometheus/common/assets v0.2.0 h1:0P5OrzoHrYBOSM1OigWL3mY8ZvV2N4zIE/5AahrSrfM=
github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI= github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI=
github.com/prometheus/exporter-toolkit v0.14.0 h1:NMlswfibpcZZ+H0sZBiTjrA3/aBFHkNZqE+iCj5EmRg= github.com/prometheus/exporter-toolkit v0.14.0 h1:NMlswfibpcZZ+H0sZBiTjrA3/aBFHkNZqE+iCj5EmRg=

View file

@ -45,7 +45,7 @@ func NewJSONFileLogger(s string) (*JSONFileLogger, error) {
return nil, fmt.Errorf("can't create json log file: %w", err) return nil, fmt.Errorf("can't create json log file: %w", err)
} }
jsonFmt := &promslog.AllowedFormat{} jsonFmt := promslog.NewFormat()
_ = jsonFmt.Set("json") _ = jsonFmt.Set("json")
return &JSONFileLogger{ return &JSONFileLogger{
handler: promslog.New(&promslog.Config{Format: jsonFmt, Writer: f}).Handler(), handler: promslog.New(&promslog.Config{Format: jsonFmt, Writer: f}).Handler(),

View file

@ -480,15 +480,15 @@ func TestEndpoints(t *testing.T) {
u, err := url.Parse(server.URL) u, err := url.Parse(server.URL)
require.NoError(t, err) require.NoError(t, err)
al := promslog.AllowedLevel{} al := promslog.NewLevel()
require.NoError(t, al.Set("debug")) require.NoError(t, al.Set("debug"))
af := promslog.AllowedFormat{} af := promslog.NewFormat()
require.NoError(t, af.Set("logfmt")) require.NoError(t, af.Set("logfmt"))
promslogConfig := promslog.Config{ promslogConfig := promslog.Config{
Level: &al, Level: al,
Format: &af, Format: af,
} }
dbDir := t.TempDir() dbDir := t.TempDir()