-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(dataconnect): Add GA metric for Cloud SQL setup #9315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds a new Google Analytics metric, `dataconnect_cloud_sql`, to track the usage and duration of the `setupCloudSql` function. This metric includes the following labels: - source: init, mcp_init, deploy - action: created, created_failed, updated, updated_failed, get - location - enable_google_ml_integration: true, false - result: error, success - free_trial: true, false - database_version: postgres_17 The implementation also tracks the duration of the `setupCloudSql` operation. To differentiate between `init` and `mcp_init` sources, an `isMcp` flag was added to the `Setup` object.
Summary of ChangesHello @fredzqm, 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 enhances the Firebase CLI's Data Connect functionality by integrating a new Google Analytics metric for Cloud SQL setup operations. The primary goal is to gather detailed telemetry on how Cloud SQL instances are provisioned, updated, and retrieved, including success/failure rates and execution times. This data will be crucial for understanding user behavior, optimizing the setup process, and improving the overall reliability of Cloud SQL integration within Data Connect. 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.
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 Google Analytics tracking for the setupCloudSql function, which is a great addition for monitoring usage. The implementation correctly passes the source of the call through various functions. My review focuses on improving the maintainability of the new tracking logic in src/dataconnect/provisionCloudSql.ts. I've pointed out an inconsistency in the tracked database version and suggested refactoring duplicated code into helper functions to make the code cleaner and less error-prone.
|
/gemini review |
There was a problem hiding this comment.
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 successfully adds Google Analytics tracking for the setupCloudSql function, which is valuable for monitoring usage and performance. The implementation is clean, introducing a SetupStats type to gather metrics and consistently passing the source of the call across different workflows. The refactoring from a boolean freeTrial to a more descriptive freeTrialLabel is also a good improvement. I have one suggestion to refine the structure of the analytics event to better align with the PR description and improve the quality of the collected data for easier querying.
Adds a new Google Analytics metric,
dataconnect_cloud_sql, to track the usage and duration of thesetupCloudSqlfunction.This metric includes the following labels:
The implementation also tracks the duration of the
setupCloudSqloperation.Description
Scenarios Tested
Sample Commands