CP-35087: Upgrade Prometheus to 3.x with backward compatibility #545
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prometheus 3.0 was released and includes performance improvements and new features. We want to upgrade to the latest stable version (3.7.3) while maintaining backward compatibility for customers who may be using custom Prometheus 2.x images.
Impact:
Before: Chart used Prometheus 2.55.1 by default. Prometheus 3.x images would produce warnings about unknown flag "--enable-feature=agent" since the agent mode flag changed between versions.
After: Chart uses Prometheus 3.7.3 by default. Both 2.x and 3.x versions work correctly with automatic flag detection based on image version.
Scope: All customers, but particularly those using custom Prometheus images via server.image.tag or components.prometheus.image.tag overrides.
Implementation Approach:
Prometheus 3.x changed the agent mode flag from
--enable-feature=agentto just--agent. To support both versions seamlessly, we needed version-aware flag selection that respects the same image tag fallback chain used for actual image generation.Solution:
Updated Chart.AppVersion from v2.55.1 to v3.7.3 in helm/Chart.yaml
Created cloudzero-agent.prometheusAgentFlag helper in helm/templates/_helpers.tpl that:
Updated helm/templates/agent-deploy.yaml and helm/templates/agent-daemonset.yaml to use the new helper instead of hardcoded flags
Updated helm/tests/agent_mode_derivation_test.yaml to expect "--agent" flag for default Chart.AppVersion (now 3.7.3)
Added comprehensive test suite in helm/tests/prometheus_version_flag_test.yaml covering:
Validation: