File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,32 @@ SpannerOptions options = SpannerOptions.newBuilder()
421
421
422
422
Spanner spanner = options. getService();
423
423
```
424
+ #### OpenTelemetry SQL Statement Tracing
425
+ The OpenTelemetry traces that are generated by the Java client include any request and transaction
426
+ tags that have been set. The traces can also include the SQL statements that are executed. Enable
427
+ this with the ` enableExtendedTracing ` option:
428
+
429
+ ```
430
+ SpannerOptions options = SpannerOptions.newBuilder()
431
+ .setOpenTelemetry(openTelemetry)
432
+ .setEnableExtendedTracing(true)
433
+ .build();
434
+ ```
435
+
436
+ This option can also be enabled by setting the environment variable
437
+ ` SPANNER_ENABLE_EXTENDED_TRACING=true ` .
438
+
439
+ #### OpenTelemetry API Tracing
440
+ You can enable tracing of each API call that the Spanner client executes with the ` enableApiTracing `
441
+ option. These traces also include any retry attempts for an API call:
442
+
443
+ ```
444
+ SpannerOptions options = SpannerOptions.newBuilder()
445
+ .setOpenTelemetry(openTelemetry)
446
+ .setEnableApiTracing(true)
447
+ .build();
448
+ ```
449
+
424
450
425
451
## Migrate from OpenCensus to OpenTelemetry
426
452
You can’t perform that action at this time.
0 commit comments