feat(telemetry): add keychain availability and token storage metrics#18971
feat(telemetry): add keychain availability and token storage metrics#18971abhipatel12 merged 2 commits intomainfrom
Conversation
Summary of ChangesHello @abhipatel12, 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 significantly improves the robustness and observability of the credential management system. By refactoring telemetry collection to use a pub-sub model, it reduces tight coupling within the codebase and enhances the security posture by preventing sensitive information from being logged. The added metrics provide valuable insights into the reliability and usage patterns of keychain and token storage, which will aid in diagnosing issues and understanding user environments. Highlights
Changelog
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 effectively refactors the telemetry for keychain availability and token storage by introducing a pub-sub model, which successfully decouples these components from Config. The security hardening to prevent PII leakage from keychain error messages is a valuable addition. The implementation is clean and the new telemetry events are well-integrated. I have one high-severity suggestion to fully align a type definition with the security hardening goal, reinforcing the 'fail-closed' principle for security.
|
Size Change: +7.13 kB (+0.03%) Total Size: 24.4 MB
ℹ️ View Unchanged
|
This commit introduces telemetry logging for the Token Storage providers (Hybrid and Keychain). It utilizes the global `coreEvents` pub-sub model to emit `TelemetryKeychainAvailability` and `TelemetryTokenStorageType` events which are logged by the telemetry SDK, avoiding tight coupling between the token storage implementations and the Config/ClearcutLogger. To prevent any potential PII leakage from OS-level keychain error messages (e.g. from keytar), the keychain availability event does not include any raw error string reasons.
bcdfdbc to
2464c85
Compare
Summary
Refactors the telemetry metrics collection for Keychain availability and token storage initialization to avoid tightly coupling these components with
Config.Details
This PR introduces telemetry logging for Token Storage providers (
HybridTokenStorageandKeychainTokenStorage) utilizing the globally availablecoreEventspub-sub model. This explicitly avoids threadingConfigdeep into MCP and authentication layers just for logging.Security Hardening: To definitively prevent any potential PII leakage from OS-level keychain error messages (e.g., from
keytar), thereasonfield has been explicitly completely removed from theKeychainAvailabilityEvententirely.Related Issues
How to Validate
npm run test -w packages/core -- src/telemetrynpm run preflightPre-Merge Checklist