Skip to content

feat(gke): expose monitoring components as a parameter#5722

Merged
cboneti merged 1 commit into
GoogleCloudPlatform:developfrom
cboneti:expose-gke-monitoring-components
May 31, 2026
Merged

feat(gke): expose monitoring components as a parameter#5722
cboneti merged 1 commit into
GoogleCloudPlatform:developfrom
cboneti:expose-gke-monitoring-components

Conversation

@cboneti

@cboneti cboneti commented May 29, 2026

Copy link
Copy Markdown
Member

Exposes GKE monitoring components as a parameter. Default is the current list.

@cboneti cboneti requested a review from a team as a code owner May 29, 2026 16:36
@gemini-code-assist

Copy link
Copy Markdown
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 improves the flexibility of the GKE cluster module by exposing the GKE monitoring components as a configurable parameter. By moving away from a hardcoded local variable, users can now selectively enable or disable specific monitoring components to better manage costs and resource utilization, while maintaining full backward compatibility with previous configurations.

Highlights

  • Parameterization of Monitoring Components: Replaced the hardcoded list of GKE monitoring components with a configurable input variable monitoring_components to allow for greater customization.
  • Backward Compatibility: Maintained the existing default list of monitoring components as the default value for the new variable, ensuring no breaking changes for existing deployments.
  • Documentation: Added a design document detailing the rationale, cost implications, and usage of the new parameter, and updated the module README.
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 the 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 counterproductive. 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.

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.

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

Copy link
Copy Markdown
Contributor

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 exposes GKE monitoring components as a customizable input variable (monitoring_components) in the gke-cluster module, replacing a previously hardcoded list. This change is accompanied by a design document and updated module documentation. The review feedback suggests setting nullable = false on the new variable to prevent potential Terraform runtime errors if null is passed.

Comment thread modules/scheduler/gke-cluster/variables.tf
@cboneti cboneti force-pushed the expose-gke-monitoring-components branch 2 times, most recently from 057664e to 0f9ec04 Compare May 29, 2026 16:45
@cboneti cboneti added the release-improvements Added to release notes under the "Improvements" heading. label May 29, 2026
@cboneti

cboneti commented May 29, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@cboneti cboneti enabled auto-merge May 29, 2026 16:47

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

Copy link
Copy Markdown
Contributor

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 introduces a new monitoring_components variable to the GKE cluster module, allowing users to customize the enabled GKE monitoring components instead of relying on a hardcoded local list. The feedback suggests wrapping the concat logic with distinct() to prevent duplicate DCGM entries if it is already present in the user-provided list, and adding a validation block to the new variable to ensure only valid GKE monitoring components are specified.

Comment thread modules/scheduler/gke-cluster/main.tf Outdated
Comment thread modules/scheduler/gke-cluster/variables.tf
Exposes the monitoring_components list as an input variable in the gke-cluster module, allowing customers to customize which components expose metrics to Cloud Monitoring.

The default value is set to the current hardcoded list of components to ensure backward compatibility.

TAG=agy
CONV=ec98d4fc-5ce0-464b-9137-7a785b546753
@cboneti cboneti force-pushed the expose-gke-monitoring-components branch from 0f9ec04 to 2a658a9 Compare May 29, 2026 16:52
@cboneti

cboneti commented May 29, 2026

Copy link
Copy Markdown
Member Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 externalizes the GKE monitoring components configuration by introducing a new monitoring_components input variable, replacing the hardcoded local default. A review comment points out an issue where DCGM monitoring would still be enabled even if a user explicitly disables all other monitoring components by setting monitoring_components to an empty list. It is recommended to only enable DCGM monitoring when monitoring_components is not empty.

Comment thread modules/scheduler/gke-cluster/main.tf

@shubpal07 shubpal07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@cboneti cboneti merged commit 2394616 into GoogleCloudPlatform:develop May 31, 2026
14 of 76 checks passed
@cboneti cboneti deleted the expose-gke-monitoring-components branch June 4, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-improvements Added to release notes under the "Improvements" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants