Create line change metrics#12299
Conversation
Replaces the separate `gemini_cli.lines.added` and `gemini_cli.lines.removed` counters with a single `gemini_cli.lines.changed` counter.
The new metric uses a `type` attribute ("added" or "removed") to differentiate the line changes. This simplifies the telemetry implementation and aligns with OpenTelemetry best practices for using attributes to reduce metric cardinality.
All related logic in `metrics.ts`, `loggers.ts`, and their corresponding tests have been updated. The documentation in `docs/cli/telemetry.md` has also been updated to reflect this change.
Summary of ChangesHello @jerop, 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 refactors the telemetry system for tracking line changes within the Gemini CLI. It streamlines the process by replacing several distinct metrics for added and removed lines with a single, unified Highlights
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
|
There was a problem hiding this comment.
Code Review
This pull request refactors the telemetry for line changes, consolidating multiple attributes into a single gemini_cli.lines.changed metric. The changes are well-structured and include updates to documentation and tests. However, I've identified a regression where user-initiated line changes are no longer being tracked. My review includes a suggestion to fix this to ensure no telemetry data is lost.
|
Size Change: +800 B (0%) Total Size: 20.3 MB ℹ️ View Unchanged
|
|
/patch preview |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
Summary
This PR refactors the telemetry metrics for line changes by in a single
gemini_cli.lines.changedmetric.Details
The new
gemini_cli.lines.changedmetric uses atypeattribute ("added"or"removed") to differentiate the line changes. This change simplifies the telemetry for line changes.How to Validate
git diff --statPre-Merge Checklist