-
Notifications
You must be signed in to change notification settings - Fork 112
fix: Correctly determine project ID for metrics export #2427
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
Merged
+124
−75
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3fd589f to
dd60592
Compare
dd60592 to
91f9bc0
Compare
sakthivelmanii
previously approved these changes
Sep 30, 2025
91f9bc0 to
74cf585
Compare
sakthivelmanii
approved these changes
Oct 7, 2025
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Oct 8, 2025
🤖 I have created a release *beep* *boop* --- ## [8.2.2](https://togithub.com/googleapis/nodejs-spanner/compare/v8.2.1...v8.2.2) (2025-10-07) ### Bug Fixes * Correctly determine project ID for metrics export ([#2427](https://togithub.com/googleapis/nodejs-spanner/issues/2427)) ([0d63312](https://togithub.com/googleapis/nodejs-spanner/commit/0d633126a87c1274abfd59550cb94052a819fcaa)) * Metrics Export Error log ([#2425](https://togithub.com/googleapis/nodejs-spanner/issues/2425)) ([110923e](https://togithub.com/googleapis/nodejs-spanner/commit/110923ea1dc6f6c891e0f70406b3839224a25b9e)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api: spanner
Issues related to the googleapis/nodejs-spanner API.
size: m
Pull request size is medium.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2420
This PR addresses an issue where the project ID for metrics export was not being correctly determined when not explicitly provided.
Specifically, this PR introduces the following changes:
Infers Project ID from Credentials: When a Spanner instance is created without a projectId in the spanner options, the project ID is now fetched from the authentication credentials. This ensures that metrics are correctly exported to the appropriate project, resolving an issue where a placeholder {{project_id}} was being used.
This PR also makes the
projectIdattribute to be non-optional inMetricsTracerFactory.getInstancemethod