fix(ingress-nginx): always pass --enable-metrics flag explicitly#2207
fix(ingress-nginx): always pass --enable-metrics flag explicitly#2207IvanHunters wants to merge 1 commit intocozystack:maincozystack/cozystack:mainfrom IvanHunters:fix/ingress-nginx-enable-metricsIvanHunters/cozystack:fix/ingress-nginx-enable-metricsCopy head branch name to clipboard
Conversation
The previous conditional logic only passed --enable-metrics when metrics.enabled was false. When metrics.enabled was true (the Cozystack default), the flag was omitted entirely, relying on the controller binary's built-in default. The custom protobuf-exporter controller image does not default to enabling per-request Prometheus metrics, so the flag must be passed explicitly. Without it, the controller exposes only process-level metrics and omits per-request counters like nginx_ingress_controller_requests (with ingress, service, and status labels), which are needed for traffic-based autoscaling. Always pass the flag unconditionally using the value from controller.metrics.enabled. Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue in the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the ingress-nginx Helm chart to ensure the --enable-metrics flag is always passed to the controller explicitly. The previous logic only passed the flag when metrics were disabled, which caused issues with custom controller images that do not enable metrics by default. The change correctly removes the conditional logic, making the configuration explicit and reliable. The implementation is correct and addresses the stated problem.
Summary
--enable-metricsflag in ingress-nginx controller params templatecontroller.metrics.enabledProblem
The previous logic only passed
--enable-metrics=falsewhen metrics were disabled, but omitted the flag entirely whenmetrics.enabled: true. The custom protobuf-exporter controller image does not default to enabling per-request Prometheus metrics, so without the explicit flag, counters likenginx_ingress_controller_requests(withingress,service,statuslabels) are not exposed. Only process-level metrics are available on:10254/metrics.Test plan
controller.metrics.enabled: trueand verifynginx_ingress_controller_requestsmetric appears on:10254/metricsafter sending a request through an Ingresscontroller.metrics.enabled: falseand verify--enable-metrics=falseis still passed correctly