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: spanner/README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,4 +113,27 @@ defer client.Close()
113
113
// Example Log message for when transaction is recycled
114
114
// session <session-info> checked out of pool at <session-checkout-time> is long running and will be removed due to possible session leak for goroutine
115
115
// <Stack Trace of transaction>
116
-
```
116
+
```
117
+
118
+
## Metrics
119
+
120
+
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.
121
+
122
+
Client-side metrics are measured from the time a request leaves your application to the time your application receives the response.
123
+
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.
124
+
125
+
These metrics are enabled by default. You can opt out of using client-side metrics with the following code:
You can also disable these metrics by setting `SPANNER_DISABLE_BUILTIN_METRICS` to `true`.
138
+
139
+
> Note: Exporting client-side metrics requires the `monitoring.timeSeries.create` IAM permission. To grant this, ask your administrator to assign the [Monitoring Metric Writer](https://cloud.google.com/iam/docs/roles-permissions/monitoring#monitoring.metricWriter) (`roles/monitoring.metricWriter`) IAM role to your application's service account.
0 commit comments