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: java-spanner/.readme-partials.yaml
+37-3Lines changed: 37 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -57,17 +57,51 @@ custom_content: |
57
57
Client-side metrics are measured from the time a request leaves your application to the time your application receives the response.
58
58
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.
59
59
60
-
These metrics are enabled by default. You can opt out of using client-side metrics with the following code:
60
+
The default Cloud Monitoring export for these metrics is enabled by default. You can opt out of the default Cloud Monitoring export with the following code:
You can also disable these metrics by setting `SPANNER_DISABLE_BUILTIN_METRICS` to `true`.
68
+
You can also disable the default Cloud Monitoring export by setting `SPANNER_DISABLE_BUILTIN_METRICS` to `true`. These controls affect only the Cloud Monitoring export. They do not affect a caller-owned client-metrics export configured with `CustomOpenTelemetryMetricsProvider`.
69
69
70
-
> 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.
70
+
> Note: Client-side metrics needs `monitoring.timeSeries.create` IAM permission to export metrics data to Cloud Monitoring. 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.
71
+
72
+
#### Exporting client metrics to OpenTelemetry
73
+
74
+
Client metrics export to a caller-owned OpenTelemetry destination is controlled by a `MetricsProvider`,
75
+
set with `SpannerOptions.Builder.setClientMetricsProvider(MetricsProvider)`. The available
76
+
providers are:
77
+
78
+
* `DefaultMetricsProvider` (the default): no caller-owned client-metrics destination is configured.
79
+
The built-in Cloud Monitoring export follows `setBuiltInMetricsEnabled` and the
Cloud Spanner client supports OpenTelemetry Traces, which gives insight into the client internals and aids in debugging/troubleshooting production issues.
Client-side metrics are measured from the time a request leaves your application to the time your application receives the response.
156
156
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.
157
157
158
-
These metrics are enabled by default. You can opt out of using client-side metrics with the following code:
158
+
The default Cloud Monitoring export for these metrics is enabled by default. You can opt out of the default Cloud Monitoring export with the following code:
You can also disable these metrics by setting `SPANNER_DISABLE_BUILTIN_METRICS` to `true`.
166
+
You can also disable the default Cloud Monitoring export by setting `SPANNER_DISABLE_BUILTIN_METRICS` to `true`. These controls affect only the Cloud Monitoring export. They do not affect a caller-owned client-metrics export configured with `CustomOpenTelemetryMetricsProvider`.
167
167
168
-
> 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.
168
+
> Note: Client-side metrics needs `monitoring.timeSeries.create` IAM permission to export metrics data to Cloud Monitoring. 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.
169
+
170
+
#### Exporting client metrics to OpenTelemetry
171
+
172
+
Client metrics export to a caller-owned OpenTelemetry destination is controlled by a `MetricsProvider`,
173
+
set with `SpannerOptions.Builder.setClientMetricsProvider(MetricsProvider)`. The available
174
+
providers are:
175
+
176
+
*`DefaultMetricsProvider` (the default): no caller-owned client-metrics destination is configured.
177
+
The built-in Cloud Monitoring export follows `setBuiltInMetricsEnabled` and the
Cloud Spanner client supports OpenTelemetry Traces, which gives insight into the client internals and aids in debugging/troubleshooting production issues.
0 commit comments