Moved client id logging into createBasicLogEvent#13607
Conversation
…sion events include a client identifier.
Summary of ChangesHello @owenofbrien, 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 logging mechanism to ensure that all extension-related events are properly attributed with a client identifier. By centralizing the client ID assignment logic within the 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 correctly refactors the client identifier logic into createBasicLogEvent to ensure all telemetry events, including those for extensions, contain a client identifier. This centralization fixes the bug of missing identifiers and improves code maintainability. However, this change highlights a performance concern with repeated synchronous file I/O, for which I've left a comment.
| eventName: EventNames, | ||
| data: EventValue[] = [], | ||
| ): LogEvent { | ||
| const email = this.userAccountManager.getCachedGoogleAccount(); |
There was a problem hiding this comment.
The method getCachedGoogleAccount() performs a synchronous file read on every call. Since createBasicLogEvent is now called for every telemetry event, this synchronous I/O could block the Node.js event loop and cause performance issues, especially when many events are logged in quick succession. This could impact the application's responsiveness.
To mitigate this, consider caching the email within the ClearcutLogger instance. A more robust solution would be to add in-memory caching to the UserAccountManager itself to avoid repeated file reads across the application.
|
Size Change: -2 B (0%) Total Size: 21.1 MB ℹ️ View Unchanged
|
Summary
Moved client id logging into createBasicLogEvent to ensure that extension events include a client identifier.
Details
The lack of a client identifier may be causing the Clearcut pipeline to drop these events.
Related Issues
How to Validate
Pre-Merge Checklist