-
Notifications
You must be signed in to change notification settings - Fork 597
chore: upgrade prometheus to version 3.1.0 #4805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: upgrade prometheus to version 3.1.0 #4805
Conversation
@@ -364,7 +364,7 @@ func TestQuantileOverTime(t *testing.T) { | |||
0, | |||
}, | |||
}, | |||
`{p="0.5", span.foo="bar"}`: TimeSeries{ | |||
`{p="0.5", "span.foo"="bar"}`: TimeSeries{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can still keep the name label unquoted. The simplest way to do it would be to use a modified label version.Labels.String() without quoting the name
// TODO the passed logger does not include any other context attribute | ||
// Should we standarize slog and deprecate go-kit/log too? | ||
func New(cfg *Config, o Overrides, tenant string, reg prometheus.Registerer, _ log.Logger) (Storage, error) { | ||
logger := slog.New(slog.NewTextHandler(os.Stdout, nil)).With("tenant", tenant) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this we lose some logger functionality, like adding the logging line.
This is how Thanos has adapted go-kit/log to slog, maybe we can do the same: https://github.com/SungJin1212/thanos/blob/c280c664de7e7ba591ca0f46908b80a5039b1bc3/pkg/logutil/logutil.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if adding a new dependency to deprecate an existing one is a wise choice
sloggk "github.com/tjhop/slog-gokit"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do a similar method to get the log level from the go-kit/log and include the contextual information for this PR. Eventually, we should pass the logger from the upstream code. But not for this PR, I have created a new issue for that #4819
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if adding a new dependency to deprecate an existing one is a wise choice
We're not deprecating one right now, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the ability to include the source (line of code and method name). I think it's ok for this PR
Checking the metrics-generator label sanitization, the prometheus regex hasn't changed. So that means attributes like Could you add some spanmetrics tests that lock in this functionality, so that when/if the regex changes it will be caught? Likely we will need to add some config option at that time to generate the new label names. But for now just protecting against those regex changes should be ok. (The existing tests only cover special cases like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does:
It upgrades prometheus to version 3.1.0
It fixes the following warning we get now on mod tidy:
❯ go mod tidy go: finding module for package github.com/prometheus/common/promlog go: github.com/grafana/tempo/cmd/tempo/build imports github.com/prometheus/prometheus/web/api/v1 tested by github.com/prometheus/prometheus/web/api/v1.test imports github.com/prometheus/common/promlog: module github.com/prometheus/common@latest found (v0.62.0), but does not contain package github.com/prometheus/common/promlog
Breaking changes
Prometheus has deprecated go-kit/log, and now we need to pass the built-in slog:
prometheus/prometheus#14355
Now, the metric name labels are also quoted:
prometheus/prometheus#15531
`{"span.foo"="baz"}`
This can be seen in the
promLabels
, but it doesn't affect the displayed labelChecklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]