You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .readme-partials.yml
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,28 @@ introduction: |-
4
4
and automatic, synchronous replication for high availability.
5
5
6
6
body: |-
7
+
## Metrics
8
+
9
+
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.
10
+
11
+
Client-side metrics are measured from the time a request leaves your application to the time your application receives the response.
12
+
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.
13
+
14
+
These metrics are enabled by default. You can opt out of using client-side metrics with the following code:
15
+
16
+
```javascript
17
+
const spanner = new Spanner({
18
+
disableBuiltInMetrics: true
19
+
});
20
+
```
21
+
22
+
You can also disable these metrics by setting `SPANNER_DISABLE_BUILTIN_METRICS` to `true`.
23
+
24
+
> 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.
25
+
26
+
## Traces
27
+
Refer to the Observability README to know more about tracing support in the Cloud Spanner client.
28
+
7
29
## Multiplexed Sessions
8
30
9
31
Spanner's Multiplexed Sessions can now be used as an efficient alternative to the default session pool. This feature helps reduce
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.
86
+
87
+
Client-side metrics are measured from the time a request leaves your application to the time your application receives the response.
88
+
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.
89
+
90
+
These metrics are enabled by default. You can opt out of using client-side metrics with the following code:
91
+
92
+
```javascript
93
+
constspanner=newSpanner({
94
+
disableBuiltInMetrics:true
95
+
});
96
+
```
97
+
98
+
You can also disable these metrics by setting `SPANNER_DISABLE_BUILTIN_METRICS` to `true`.
99
+
100
+
> 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.
101
+
102
+
## Traces
103
+
Refer to the Observability README to know more about tracing support in the Cloud Spanner client.
104
+
83
105
## Multiplexed Sessions
84
106
85
107
Spanner's Multiplexed Sessions can now be used as an efficient alternative to the default session pool. This feature helps reduce
0 commit comments