-
Notifications
You must be signed in to change notification settings - Fork 31
Prometheus dependency upgrades #349
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
base: main
Are you sure you want to change the base?
Conversation
| TLSCertFilePath: "/path/to/cert.pem", | ||
| TLSKeyFilePath: "/path/to/key.pem", | ||
| }, | ||
| PromConfig: &promconfig.Config{ |
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.
Prometheus library v0.308.0 populates additional default fields internally. Switched from exact struct comparison to field-by-field assertion to avoid test brittleness across library versions. Config loading behavior unchanged.
| "github.com/aws/amazon-cloudwatch-agent-operator/cmd/amazon-cloudwatch-agent-target-allocator/target" | ||
| ) | ||
|
|
||
| func init() { |
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.
Prometheus v0.308.0 changed default metric name validation. This aligns test validation scheme with prometheus-operator's config generation to prevent assertion mismatches.
| return nil, pmRetrieveErr | ||
| } | ||
|
|
||
| // Collect all namespaces from service monitors and pod monitors |
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.
prometheus-operator v0.87.0 changed GenerateServerConfiguration() to require a Prometheus CRD object. This constructs one dynamically using namespaces from discovered monitors. Functionally equivalent to the previous parameter-based approach.
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 might want to make sure this is covered too
| newLabels := make([]labels.Label, len(lbls)) | ||
| index := 0 | ||
| // helper function converts from model.LabelSet to labels.Labels. | ||
| func convertLabelToPromLabelSet(lbls model.LabelSet) labels.Labels { |
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 want to make sure the changes made here are covered with unit tests
|
If @okankoAMZ signs off on the two above changes I pointed out (since he wrote this portion), it's fine by me |
Issue #, if available:
The operator needs a dependency upgrade for prometheus for compliance reason.
Description of changes:
Updates base image and dependencies to latest versions. Major version bumps include prometheus-operator (v0.70.0 → v0.87.0), prometheus (v0.48.1 → v0.308.0), and otel collector featuregate (v0.77.0 → v1.45.0).
Adapts code to breaking API changes:
No functional changes.