This repository was archived by the owner on Mar 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy path.readme-partials.yml
More file actions
49 lines (34 loc) · 2.83 KB
/
.readme-partials.yml
File metadata and controls
49 lines (34 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
introduction: |-
[Cloud Spanner](https://cloud.google.com/spanner/docs/) is a fully managed, mission-critical, relational database service that
offers transactional consistency at global scale, schemas, SQL (ANSI 2011 with extensions),
and automatic, synchronous replication for high availability.
body: |-
## Metrics
Cloud Spanner client supports [client-side metrics](https://cloud.google.com/spanner/docs/view-manage-client-side-metrics) that you can use along with server-side metrics to optimize performance and troubleshoot performance issues if they occur.
Client-side metrics are measured from the time a request leaves your application to the time your application receives the response.
In contrast, server-side metrics are measured from the time Spanner receives a request until the last byte of data is sent to the client.
These metrics are enabled by default. You can opt out of using client-side metrics with the following code:
```javascript
const spanner = new Spanner({
disableBuiltInMetrics: true
});
```
You can also disable these metrics by setting `SPANNER_DISABLE_BUILTIN_METRICS` to `true`.
> Note: Client-side metrics needs `monitoring.timeSeries.create` IAM permission to export metrics data. Ask your administrator to grant your service account the [Monitoring Metric Writer](https://cloud.google.com/iam/docs/roles-permissions/monitoring#monitoring.metricWriter) (roles/monitoring.metricWriter) IAM role on the project.
## Traces
Refer to the Observability README to know more about tracing support in the Cloud Spanner client.
## Multiplexed Sessions
Spanner's Multiplexed Sessions is now default enabled session mode in node client. This feature helps reduce
session management overhead and minimize session-related errors.
For a detailed explanation on multiplexed sessions, please refer to the [official documentation](https://cloud.google.com/spanner/docs/sessions#multiplexed_sessions).
## Regular Sessions
To use regular sessions, disable the multiplexed sessions and set the following environment variables to `false`:
* **For Read-Only Transactions:**
- `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS`
* **For Partitioned Operations:**
- `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS`
- `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS`
* **For Read-Write Transactions:**
- `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS`
- `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW`
For a detailed explanation on session modes and env configurations, please refer to the [official documentation](https://cloud.google.com/spanner/docs/sessions).