@@ -57,13 +57,13 @@ implementation 'com.google.cloud:google-cloud-spanner'
57
57
If you are using Gradle without BOM, add this to your dependencies:
58
58
59
59
``` Groovy
60
- implementation 'com.google.cloud:google-cloud-spanner:6.70 .0'
60
+ implementation 'com.google.cloud:google-cloud-spanner:6.71 .0'
61
61
```
62
62
63
63
If you are using SBT, add this to your dependencies:
64
64
65
65
``` Scala
66
- libraryDependencies += " com.google.cloud" % " google-cloud-spanner" % " 6.70 .0"
66
+ libraryDependencies += " com.google.cloud" % " google-cloud-spanner" % " 6.71 .0"
67
67
```
68
68
<!-- {x-version-update-end} -->
69
69
@@ -289,6 +289,7 @@ This option can also be enabled by setting the environment variable
289
289
290
290
> Note: The attribute keys that are used for additional information about retry attempts and the number of requests might change in a future release.
291
291
292
+
292
293
### Instrument with OpenCensus
293
294
294
295
> Note: OpenCensus project is deprecated. See [ Sunsetting OpenCensus] ( https://opentelemetry.io/blog/2023/sunsetting-opencensus/ ) .
@@ -422,6 +423,38 @@ SpannerOptions options = SpannerOptions.newBuilder()
422
423
Spanner spanner = options. getService();
423
424
```
424
425
426
+ #### OpenTelemetry SQL Statement Tracing
427
+ The OpenTelemetry traces that are generated by the Java client include any request and transaction
428
+ tags that have been set. The traces can also include the SQL statements that are executed and the
429
+ name of the thread that executes the statement. Enable this with the ` enableExtendedTracing `
430
+ option:
431
+
432
+ ```
433
+ SpannerOptions options = SpannerOptions.newBuilder()
434
+ .setOpenTelemetry(openTelemetry)
435
+ .setEnableExtendedTracing(true)
436
+ .build();
437
+ ```
438
+
439
+ This option can also be enabled by setting the environment variable
440
+ ` SPANNER_ENABLE_EXTENDED_TRACING=true ` .
441
+
442
+ #### OpenTelemetry API Tracing
443
+ You can enable tracing of each API call that the Spanner client executes with the ` enableApiTracing `
444
+ option. These traces also include any retry attempts for an API call:
445
+
446
+ ```
447
+ SpannerOptions options = SpannerOptions.newBuilder()
448
+ .setOpenTelemetry(openTelemetry)
449
+ .setEnableApiTracing(true)
450
+ .build();
451
+ ```
452
+
453
+ This option can also be enabled by setting the environment variable
454
+ ` SPANNER_ENABLE_API_TRACING=true ` .
455
+
456
+ > Note: The attribute keys that are used for additional information about retry attempts and the number of requests might change in a future release.
457
+
425
458
## Migrate from OpenCensus to OpenTelemetry
426
459
427
460
> Using the [ OpenTelemetry OpenCensus Bridge] ( https://mvnrepository.com/artifact/io.opentelemetry/opentelemetry-opencensus-shim ) , you can immediately begin exporting your metrics and traces with OpenTelemetry
@@ -688,7 +721,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
688
721
[ kokoro-badge-link-5 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.html
689
722
[ stability-image ] : https://img.shields.io/badge/stability-stable-green
690
723
[ maven-version-image ] : https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg
691
- [ maven-version-link ] : https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.70 .0
724
+ [ maven-version-link ] : https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.71 .0
692
725
[ authentication ] : https://github.com/googleapis/google-cloud-java#authentication
693
726
[ auth-scopes ] : https://developers.google.com/identity/protocols/oauth2/scopes
694
727
[ predefined-iam-roles ] : https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
0 commit comments