Skip to content
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

Get the size of the database #634

Open
MikielAgutu opened this issue Oct 4, 2021 · 1 comment
Open

Get the size of the database #634

MikielAgutu opened this issue Oct 4, 2021 · 1 comment
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner-jdbc API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@MikielAgutu
Copy link

Is your feature request related to a problem? Please describe.
I'd like to be able to determine the size of a Spanner database.

Describe the solution you'd like
Some kind of API in the JDBC driver that returns the size of the database.

Describe alternatives you've considered
We've tried querying the information schema to get the list of tables, then trying to figure out the data usage of each field in every table. However this is not performant, and error prone.

Additional context
n/a

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner-jdbc API. label Oct 4, 2021
@olavloite
Copy link
Collaborator

The difficult part of implementing this is that the gRPC API does not include any method that returns the size of a database. The Database message for example does not include a size property: https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#database

As far as I can tell, the only way of getting this for the JDBC driver would be to query the instance/storage/used_bytes metric in Cloud Monitoring, but that would only be possible when the Cloud Monitoring API is enabled and accessible for the credentials that are used for the JDBC driver.

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Nov 3, 2021
@olavloite olavloite added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Nov 4, 2021
@thiagotnunes thiagotnunes assigned ansh0l and unassigned thiagotnunes Mar 23, 2022
@ansh0l ansh0l assigned rajatbhatta and unassigned ansh0l May 24, 2022
@rajatbhatta rajatbhatta assigned olavloite and unassigned rajatbhatta Aug 17, 2023
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/java-spanner-jdbc API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

6 participants