Closed
@mayurkale22

Description

Is your feature request related to a problem? Please describe.
Customers run into the Cloud Spanner session pool tuning issues for their specific workload on a regular basis. Improved visibility into the state of the session pool (or client side metrics) maintained by each client can provide actionable insight and help users take informed decisions.

This will also help customers in identifying a session s.

Describe the solution you'd like
Instrument Spanner client (session pool) with OpenCensus metrics. we need to capture things including - number of max sessions, number of sessions in use, sessions, count of active spanner requests, count of released and acquired sessions.

Describe alternatives you've considered
N/A

Additional context
N/A

===================================================================
Edit1: Agreed list of useful metrics:

All the metrics will be prefixed by “cloud.google.com/java/spanner/”.

MetricDescriptionTypeLabels
max_in_use_sessionsThe maximum number of sessions in use during the last 10 minute intervalGaugedatabase, instance_id, library_version
max_allowed_sessionsThe maximum number of sessions allowed. Configurable by the userGaugedatabase, instance_id, library_version
in_use_sessionsThe number of sessions currently in useGaugedatabase, instance_id, library_version
get_session_timeoutsThe number of get sessions timeouts due to pool exhaustionCounterdatabase, instance_id, library_version
num_acquired_sessionsThe number of sessions acquired from the session poolCounterdatabase, instance_id, library_version
num_released_sessionsThe number of sessions released by the user and pool maintainerCounterdatabase, instance_id, library_version
num_sessions_in_poolThe number of sessions in the pool.Gaugedatabase, instance_id, library_version, Type
  • Type : num_in_use_sessions | num_sessions_being_prepared | num_read_sessions | num_write_prepared_sessions

/cc @skuruppu