Skip to content

Conversation

@sushanb
Copy link
Contributor

@sushanb sushanb commented Dec 29, 2025

TODO: on adding the transport type as we need to make Prime() rpc blocking.

@sushanb sushanb requested a review from nimf December 29, 2025 21:50
@sushanb sushanb requested review from a team as code owners December 29, 2025 21:50
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Dec 29, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @sushanb, 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 Bigtable Go client by adding client startup time metrics. It measures the duration from the initiation of client creation to the full initialization of the connection pool, providing valuable insights into the client's readiness performance. The implementation uses OpenTelemetry for metric collection, with a planned future enhancement to accurately determine and record the transport type.

Highlights

  • Client Startup Time Metrics: Introduced a new metric to measure the total time taken for the Bigtable client to complete its initialization logic within NewClientWithConfig.
  • OpenTelemetry Integration: The startup time is recorded as a Float64Histogram using OpenTelemetry, with predefined bucket boundaries for latency analysis.
  • Function Signature Update: The NewBigtableChannelPool function now accepts a startupTimer argument to facilitate the measurement of client startup duration.
  • Test Coverage: Existing tests for NewBigtableChannelPool have been updated to pass the new startupTimer argument, and a dedicated test TestRecordClientStartUp has been added to verify the metric recording.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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

  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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 adds a new metric to track client startup time, which is a valuable addition for monitoring. The implementation is mostly correct, but I've identified a few areas for improvement regarding code clarity, robustness, and testing. My feedback includes fixing a typo in a variable name, improving the metric recording logic to be more robust, and enhancing the corresponding unit tests.

@sushanb sushanb requested a review from nimf December 30, 2025 20:33
@sushanb sushanb requested a review from nimf December 30, 2025 22:03
Copy link
Contributor

@nimf nimf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I don't like in this PR is adding the new clientCreationTimestamp argument to the NewBigtableChannelPool function. It already has 5 arguments. We don't really need this argument because we can get the time instant inside the NewBigtableChannelPool. But we "need" this to test the client startup metric, so I was thinking how can we do this in another way.

We provide the dial function as one of the arguments. What if for that test we add time.Sleep inside the dialFunc we create in the test? As our test runs with synctest the test won't acutally sleep but rather fast-forward time.

On the other hand this is internal API, so we can leave it as is and make this change later. Up to you.

@sushanb
Copy link
Contributor Author

sushanb commented Jan 7, 2026

The only thing I don't like in this PR is adding the new clientCreationTimestamp argument to the NewBigtableChannelPool function. It already has 5 arguments. We don't really need this argument because we can get the time instant inside the NewBigtableChannelPool. But we "need" this to test the client startup metric, so I was thinking how can we do this in another way.

We provide the dial function as one of the arguments. What if for that test we add time.Sleep inside the dialFunc we create in the test? As our test runs with synctest the test won't acutally sleep but rather fast-forward time.

On the other hand this is internal API, so we can leave it as is and make this change later. Up to you.

i agree as the most time intensive part is in NewBigtableChannelPool. Semantically, we want to measure the time when customer intiialize NewClientWithConfig to when client ready so that;s why we add the clientCreationTimestamp

@sushanb sushanb merged commit 8f90da3 into googleapis:main Jan 7, 2026
13 of 15 checks passed
@bhshkh
Copy link
Contributor

bhshkh commented Jan 8, 2026

@sushanb please do not merge PRs without first updating the branch.

#13552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants