Skip to content

Conversation

@mathewhany
Copy link
Contributor

@mathewhany mathewhany commented Nov 1, 2025

Project ID sent to Google Monitoring was different than the project ID sent in the labels, which was causing an error:

rpc error: code = InvalidArgument desc = Field resource.labels.project_id had an invalid value of "*": if present, must be the project number or ID in the request name (projects/*).

This happened when you run your app on a project but connect to Bigtable from a different project. The project in the monitoring request name would be the project that you are running on, and the project in the labels would be the Bigtable project, causing the mismatch.

Project ID sent to Google Monitoring was different than the project ID sent in the labels, which was causing an error:

```
rpc error: code = InvalidArgument desc = Field resource.labels.project_id had an invalid value of "*": if present, must be the project number or ID in the request name (projects/*).
```
@mathewhany mathewhany requested review from a team as code owners November 1, 2025 14:25
@google-cla
Copy link

google-cla bot commented Nov 1, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Nov 1, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @mathewhany, 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 change addresses a critical issue where OpenTelemetry metrics for Bigtable were failing to be exported to Google Monitoring due to an incorrect project ID being supplied. By updating the configuration to use the correct project identifier, the pull request ensures that monitoring data is accurately and consistently reported, preventing InvalidArgument errors and improving observability.

Highlights

  • Fix Project ID for OpenTelemetry Metrics: This pull request resolves an InvalidArgument error encountered in Google Monitoring by correcting the project ID used when exporting OpenTelemetry metrics. Previously, the project ID sent to Google Monitoring differed from the one in resource labels, causing validation failures.
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 addresses an InvalidArgument error that occurred when sending OpenTelemetry metrics to Google Monitoring. The issue stemmed from a mismatch between the project ID configured for the exporter and the project_id label on the monitored resource. The change correctly uses bmr.project for the exporter's project ID, ensuring consistency and resolving the error. The fix is accurate and effectively addresses the problem described.

Copy link
Contributor

@sushanb sushanb left a comment

Choose a reason for hiding this comment

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

thanks for finding this bug.

@sushanb sushanb added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 1, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 1, 2025
@sushanb sushanb added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 3, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 3, 2025
@sushanb sushanb enabled auto-merge (squash) November 5, 2025 21:18
@sushanb sushanb merged commit 4865868 into googleapis:main Nov 5, 2025
12 of 14 checks passed
@mathewhany
Copy link
Contributor Author

@bhshkh Any idea for when this is going to be released? We are seeing a lot of noise in our logs because of it

bhshkh added a commit that referenced this pull request Dec 15, 2025
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.7.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:718167d5c23ed389b41f617b3a00ac839bdd938a6bd2d48ae0c2f1fa51ab1c3d
<details><summary>bigtable: 1.41.0</summary>

##
[1.41.0](bigtable/v1.40.1...bigtable/v1.41.0)
(2025-12-15)

### Features

* add PeerInfo proto in Bigtable API (PiperOrigin-RevId: 829585900)
([185951b](185951b3))

* precompute featureflags in client and reuse (#13297)
([3b3253a](3b3253ac))

* Add experimental Bigtable connection pool with custom load balancing
strategy. (#12882)
([7aa9612](7aa96127))

* Enable ALTS hard bound token in Bigtable w/ direct access (#13153)
([9023934](90239341))

* Enable routing cookie and attempt headers for enhanced retries
(#12964)
([96cfd47](96cfd47a))

### Bug Fixes

* fix project id sent in otel (#13286)
([4865868](4865868c))

* screaming uppercase metric status (#13484)
([b35ee8f](b35ee8fd))

### Performance Improvements

* parallelize the exportTimeSeries function (#13004)
([bafd691](bafd691d))

</details>
@sushanb
Copy link
Contributor

sushanb commented Dec 17, 2025

@mathewhany we released 1.41.0 which has the fix.

FYI, we would like you to try Direct Access on golang. https://docs.google.com/document/d/1Auuo-cSTDExkOoQS29ac7euLCM5vK2w8lRdKpbbn6GA/edit?pli=1&tab=t.0

If you are running in GKE/GCE with no special firewall, setting an env var CBT_ENABLE_DIRECTPATH=true should do it. More details on doc. Happy to answer question if necessary.

I guess there must be low activity in December due to freezes. We can work with you in Jan to enable this feature.

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.

4 participants