Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(ingress-nginx): always pass --enable-metrics flag explicitly#2207

Draft
IvanHunters 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
Draft

fix(ingress-nginx): always pass --enable-metrics flag explicitly#2207
IvanHunters 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

@IvanHunters
Copy link
Collaborator

Summary

  • Fix conditional logic for --enable-metrics flag in ingress-nginx controller params template
  • The flag is now always passed explicitly using the value from controller.metrics.enabled

Problem

The previous logic only passed --enable-metrics=false when metrics were disabled, but omitted the flag entirely when metrics.enabled: true. The custom protobuf-exporter controller image does not default to enabling per-request Prometheus metrics, so without the explicit flag, counters like nginx_ingress_controller_requests (with ingress, service, status labels) are not exposed. Only process-level metrics are available on :10254/metrics.

Test plan

  • Deploy ingress-nginx with controller.metrics.enabled: true and verify nginx_ingress_controller_requests metric appears on :10254/metrics after sending a request through an Ingress
  • Deploy with controller.metrics.enabled: false and verify --enable-metrics=false is still passed correctly

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>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 ingress-nginx Helm chart where per-request Prometheus metrics were not reliably exposed. By modifying the controller parameters template, the --enable-metrics flag is now always explicitly passed, ensuring that metrics are correctly enabled or disabled according to the controller.metrics.enabled setting, particularly benefiting custom controller images that do not default to enabling these metrics.

Highlights

  • Metrics Flag Logic: Corrected the conditional logic for the --enable-metrics flag within the ingress-nginx controller parameters template.
  • Explicit Metrics Enabling: Ensured the --enable-metrics flag is now always explicitly passed, using the value from controller.metrics.enabled, rather than being omitted when metrics are enabled.
  • Prometheus Metrics Exposure: Resolved an issue where per-request Prometheus metrics (like nginx_ingress_controller_requests) were not exposed by custom protobuf-exporter controller images when metrics.enabled: true.

🧠 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
  • packages/system/ingress-nginx/charts/ingress-nginx/templates/_params.tpl
    • Removed the conditional if not .Values.controller.metrics.enabled block around the --enable-metrics flag, making it always present.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a36f8f37-193f-4b99-8a83-f554c16f3d6c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.