Skip to content

[Telemetry] Set up a base skeleton framework - Resubmit#5475

Merged
kadupoornima merged 6 commits into
GoogleCloudPlatform:developfrom
kadupoornima:telemetry-final-1
Apr 9, 2026
Merged

[Telemetry] Set up a base skeleton framework - Resubmit#5475
kadupoornima merged 6 commits into
GoogleCloudPlatform:developfrom
kadupoornima:telemetry-final-1

Conversation

@kadupoornima

@kadupoornima kadupoornima commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Cluster Toolkit Telemetry

The objective of this effort is to design a robust telemetry system for Cluster Toolkit that captures anonymized usage data. This is a proposed enhancement to help the team understand how modules and blueprints are being used across different environments. When enabled, the system will automatically collect non-sensitive metrics (no PII) and deployment outcomes, enabling better product decisions and roadmap planning based on real usage insights. Clients would be able to choose whether or not to opt-in.

This PR - Setting up a base skeleton framework

We will be collecting data from each CLI run and the data is then sent in the form of an HTTP POST request to Clearcut.

Introduced a new pkg/telemetry:

  • collector.go: The required metrics are collected here. Support for COMMAND_NAME, IS_TEST_DATA, RUNTIME_MS, EXIT_CODE has been added in this PR.
  • telemetry.go: Contains methods to construct the payload and handle the complete telemetry flow.
  • uploader.go: Includes a Flush() method to send the event payload to the internal server for future analysis.

Added unit tests for the new code introduced and performed local testing.
This PR has no effect on production, DATA IS NOT BEING COLLECTED NOW.

@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 new telemetry system to the Cluster Toolkit. The primary goal is to gather anonymous usage data, such as command execution patterns, performance metrics, and application exit statuses, to help improve the tool's development and user experience. The changes involve creating dedicated modules for data collection, processing, and secure transmission, alongside a refactor of how the application's version is managed for consistency.

Highlights

  • Telemetry Implementation: Introduced a new telemetry package to collect and send usage metrics for the Cluster Toolkit. This includes capturing command execution details, latency, and exit codes.
  • Centralized Version Management: Refactored the toolkit's version handling by introducing a centralized GetToolkitVersion() function in the pkg/config package, which is now used by the root command and telemetry components.
  • Comprehensive Testing: Added extensive unit tests for all new telemetry components, including the collector, payload builder, and uploader, ensuring robust and reliable data collection.
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.

@kadupoornima kadupoornima changed the title Telemetry final 1 [Telemetry] Set up a base skeleton framework - Resubmit Apr 9, 2026
@kadupoornima kadupoornima added the release-key-new-features Added to release notes under the "Key New Features" heading. label Apr 9, 2026
@kadupoornima kadupoornima marked this pull request as ready for review April 9, 2026 08:28
@kadupoornima kadupoornima requested review from a team and samskillman as code owners April 9, 2026 08:28
@kadupoornima kadupoornima enabled auto-merge (squash) April 9, 2026 08:28

@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 telemetry collection system for the HPC Toolkit, including a Collector to gather command execution metrics and an uploader to send events to a backend service. The implementation includes comprehensive unit tests for the collector, payload building, and network flushing logic. Feedback focuses on improving the robustness of blueprint parsing to avoid performance regressions, ensuring telemetry errors do not interfere with the user's console output, and hardening the network response handling against potential memory issues.

Comment thread pkg/telemetry/collector_util.go
Comment thread pkg/telemetry/telemetry.go
Comment thread pkg/telemetry/uploader.go Outdated
@kadupoornima kadupoornima marked this pull request as draft April 9, 2026 08:35
auto-merge was automatically disabled April 9, 2026 08:35

Pull request was converted to draft

@kadupoornima kadupoornima marked this pull request as ready for review April 9, 2026 08:45
@kadupoornima kadupoornima enabled auto-merge (squash) April 9, 2026 08:50
@kadupoornima kadupoornima merged commit 89192f7 into GoogleCloudPlatform:develop Apr 9, 2026
16 of 74 checks passed
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.

2 participants