Skip to content

feat(Spanner): Add the built in metrics feature#9055

Open
Hectorhammett wants to merge 11 commits intomainfrom
builtin-metrics
Open

feat(Spanner): Add the built in metrics feature#9055
Hectorhammett wants to merge 11 commits intomainfrom
builtin-metrics

Conversation

@Hectorhammett
Copy link
Copy Markdown
Collaborator

Adds the Client built in metrics for Spanner.

b/406082122

@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Mar 27, 2026
@Hectorhammett Hectorhammett marked this pull request as ready for review April 10, 2026 22:48
@Hectorhammett Hectorhammett requested a review from a team as a code owner April 10, 2026 22:48
@Hectorhammett Hectorhammett added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 10, 2026
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"global" location is only a fallback , if customer application is not deployed on GCP. We need to detect Client location , if not available then fall back to GCP

Refer https://github.com/googleapis/java-spanner/blob/main/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInMetricsProvider.java#L217

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

instance_id can not be blank as it is a monitored resource. If for some reason (should not be happening) the instance_id is not available use a default value like 'unknown' , else customer would see error

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should not be hardcoding the status to "OK" . We should wait for RPC completion and record the actual status. This is what has been done for other languages

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 Spanner API. do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants