Skip to content

chore: Update prometheus to version v3 #4094

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

simonswine
Copy link
Contributor

@simonswine simonswine commented Apr 10, 2025

Note this is change of behaviour as it will relax the label validation and allow the newer metric selectors format, which in turn needs to be used to use the full character set.

There is also some bigger impact to the remote write/metrics export, as there is a new version of remote write in prometheus v3: https://prometheus.io/docs/specs/prw/remote_write_spec_2_0/

This will be the new label selector format:

{"metric.name", "my.label.name"="bar"}

In order to override other validation at a later point, we also need to set:

import "github.com/prometheus/common/model"

func init() {
    model.NameValidationScheme = model.UTF8Validation
}

I am not planning to do this as part of this PR.

Copy link
Contributor

@marcsanmi marcsanmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

We need to update prometheus testutils that has changed and some tests that now with a more relaxed label validation might expect or fail with different results.

Note this will relax the label validation and allow the newer metric selectors
format to allow utf8 symbols.
Instead fully equality of the matcher object, which breaks with the
latest prometheus version.
@simonswine simonswine force-pushed the 20250410_update-prometheus-dependency branch from ccc29b4 to 358ed4e Compare April 16, 2025 12:15
This change is a consequence by the grpc-go change in v1.70.0, which got
merged here: grpc/grpc-go#7905

As we do call `WithDisableRetry()`, it should be a no-op.
@simonswine simonswine force-pushed the 20250410_update-prometheus-dependency branch from bed5aa8 to 0af7e31 Compare April 16, 2025 13:32
@simonswine simonswine changed the title chore: Update prometheus to version v3. chore: Update prometheus to version v3 Apr 16, 2025
Comment on lines +130 to 154
// The default gRPC service config is explicitly set to balance between
// instances.
const grpcServiceConfig = `{
"methodConfig": [{
"name": [{"service": ""}],
"retryPolicy": {}
}],
"healthCheckConfig": {
"serviceName": "pyroscope.segment-writer"
}
"methodConfig": [
{
"name": [
{
"service": ""
}
],
"retryPolicy": {
"maxAttempts": 4,
"initialBackoff": "0.1s",
"maxBackoff": "1s",
"backoffMultiplier": 2,
"retryableStatusCodes": [
"UNAVAILABLE"
]
}
}
],
"healthCheckConfig": {
"serviceName": "pyroscope.segment-writer"
}
}`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kolesnikovae please take a look at this, I think after grpc/grpc-go#7905 we cannot do this anymore using the service config.

@simonswine simonswine marked this pull request as ready for review April 16, 2025 14:02
@simonswine simonswine requested review from korniltsev and a team as code owners April 16, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants