Skip to content

[Telemetry] Start collecting Telemetry data by adding a new "telemetry" command to GCluster CLI!#5602

Merged
kadupoornima merged 9 commits into
GoogleCloudPlatform:developfrom
kadupoornima:telemetry-21
May 8, 2026
Merged

[Telemetry] Start collecting Telemetry data by adding a new "telemetry" command to GCluster CLI!#5602
kadupoornima merged 9 commits into
GoogleCloudPlatform:developfrom
kadupoornima:telemetry-21

Conversation

@kadupoornima

@kadupoornima kadupoornima commented May 5, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a Telemetry framework to the GCluster CLI to improve feature usage tracking. It modifies the root command lifecycle to initialize telemetry collection and report execution results, while providing users with a dedicated CLI command to manage their telemetry preferences. The changes also include robust error handling to ensure exit codes are correctly captured and reported.

Changes:

  • Telemetry Framework Integration: Integrated a telemetry collector into the root command execution flow to capture command usage and exit status.
  • New CLI Command: Added a 'telemetry' command allowing users to toggle telemetry reporting on or off.
  • Error Handling: Updated the root command execution to capture and unwrap exit codes from errors, ensuring accurate telemetry reporting.
  • Documentation: Added a privacy notice to the README detailing telemetry collection and opt-out instructions.

KINDLY NOTE THAT TELEMETRY DATA IS GOING TO COLLECTED (MARKED AS TEST) AFTER THIS PR IS MERGED TO MAIN BRANCH.

@kadupoornima kadupoornima changed the title [Telemetry] Add [Telemetry] Add Telemetry command to GCluster CLI May 5, 2026
@kadupoornima kadupoornima added the release-key-new-features Added to release notes under the "Key New Features" heading. label May 5, 2026
@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 introduces a telemetry framework to the toolkit, enabling the collection of usage data and command execution results. It updates the core command execution logic to conditionally report telemetry based on user configuration and provides a new CLI interface for managing the telemetry state.

Highlights

  • Telemetry Integration: Integrated the telemetry collector into the root command execution flow to capture command usage and exit status.
  • New CLI Command: Added a new 'telemetry' command allowing users to easily enable or disable telemetry reporting.
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.

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 introduces a telemetry collection system, including a new telemetry command to enable or disable the feature and logic in the root command to capture and report execution exit codes. Key feedback includes addressing a compilation error where the Execute method is called on the collector instead of the intended metrics collection method, implementing timeouts for network-dependent initialization to ensure CLI responsiveness, and adding missing unit tests for the new command as required by the style guide.

Comment thread cmd/root.go
Comment thread cmd/root.go
Comment thread cmd/telemetry.go
@kadupoornima kadupoornima changed the title [Telemetry] Add Telemetry command to GCluster CLI [Telemetry] Add Telemetry command to GCluster CLI to start collecting data! (Test mode) May 6, 2026
@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini summary

@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini review

@kadupoornima kadupoornima marked this pull request as ready for review May 6, 2026 07:38
@kadupoornima kadupoornima requested a review from a team as a code owner May 6, 2026 07:38
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request introduces a telemetry framework to the GCluster CLI to improve feature usage tracking. It modifies the root command lifecycle to initialize telemetry collection and report execution results, while providing users with a dedicated CLI command to manage their telemetry preferences. The changes also include robust error handling to ensure exit codes are correctly captured and reported.

Highlights

  • Telemetry Framework Integration: Integrated a telemetry collector into the root command execution flow to capture command usage and exit status.
  • New CLI Command: Added a 'telemetry' command allowing users to toggle telemetry reporting on or off.
  • Error Handling: Updated the root command execution to capture and unwrap exit codes from errors, ensuring accurate telemetry reporting.
  • Documentation: Added a privacy notice to the README detailing telemetry collection and opt-out instructions.
Activity
  • Gemini Code Assist performed an initial review and provided feedback on telemetry implementation, initialization performance, and testing requirements.
  • The author clarified that config initialization is local-only and does not block network I/O.
  • The author added unit tests for the new telemetry command and the execution logic as requested.
  • The author confirmed the existence of the Execute method in the telemetry package.

@kadupoornima kadupoornima changed the title [Telemetry] Add Telemetry command to GCluster CLI to start collecting data! (Test mode) [Telemetry] Start collecting Telemetry data by adding a new Telemetry command to GCluster CLI! May 6, 2026
@kadupoornima kadupoornima changed the title [Telemetry] Start collecting Telemetry data by adding a new Telemetry command to GCluster CLI! [Telemetry] Start collecting Telemetry data (Test mode) by adding a new Telemetry command to GCluster CLI! May 6, 2026

@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 telemetry feature to the Cluster Toolkit, allowing users to opt-in or opt-out of usage statistics collection. The changes include a new 'telemetry' command, updates to the root command to initialize and execute telemetry collection with exit code capture, and corresponding documentation in the README. Comprehensive unit tests were added for both the new command and the telemetry integration. The review identified an improvement opportunity regarding the order of operations in the telemetry command: the success message should only be logged after the configuration is successfully persisted, and unknown input values should be explicitly handled with a warning.

Comment thread cmd/telemetry.go
@kadupoornima kadupoornima changed the title [Telemetry] Start collecting Telemetry data (Test mode) by adding a new Telemetry command to GCluster CLI! [Telemetry] Start collecting Telemetry data (Test mode) by adding a new "telemetry" command to GCluster CLI! May 6, 2026
@kadupoornima kadupoornima changed the title [Telemetry] Start collecting Telemetry data (Test mode) by adding a new "telemetry" command to GCluster CLI! [Telemetry] Start collecting Telemetry data by adding a new "telemetry" command to GCluster CLI! May 6, 2026
Comment thread README.md

@SwarnaBharathiMantena SwarnaBharathiMantena 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!

Discussed offline.

@kadupoornima kadupoornima merged commit 606c67f into GoogleCloudPlatform:develop May 8, 2026
15 of 82 checks passed
@kadupoornima kadupoornima deleted the telemetry-21 branch May 8, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-key-new-features Added to release notes under the "Key New Features" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants