Skip to content

Commit b4bbf10

Browse files
committed
review comment
1 parent ea2aa41 commit b4bbf10

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.readme-partials.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ custom_content: |
183183
184184
> Note: The attribute keys that are used for additional information about retry attempts and the number of requests might change in a future release.
185185
186+
186187
### Instrument with OpenCensus
187188
188189
> Note: OpenCensus project is deprecated. See [Sunsetting OpenCensus](https://opentelemetry.io/blog/2023/sunsetting-opencensus/).
@@ -315,6 +316,38 @@ custom_content: |
315316
316317
Spanner spanner = options.getService();
317318
```
319+
320+
#### OpenTelemetry SQL Statement Tracing
321+
The OpenTelemetry traces that are generated by the Java client include any request and transaction
322+
tags that have been set. The traces can also include the SQL statements that are executed and the
323+
name of the thread that executes the statement. Enable this with the `enableExtendedTracing`
324+
option:
325+
326+
```
327+
SpannerOptions options = SpannerOptions.newBuilder()
328+
.setOpenTelemetry(openTelemetry)
329+
.setEnableExtendedTracing(true)
330+
.build();
331+
```
332+
333+
This option can also be enabled by setting the environment variable
334+
`SPANNER_ENABLE_EXTENDED_TRACING=true`.
335+
336+
#### OpenTelemetry API Tracing
337+
You can enable tracing of each API call that the Spanner client executes with the `enableApiTracing`
338+
option. These traces also include any retry attempts for an API call:
339+
340+
```
341+
SpannerOptions options = SpannerOptions.newBuilder()
342+
.setOpenTelemetry(openTelemetry)
343+
.setEnableApiTracing(true)
344+
.build();
345+
```
346+
347+
This option can also be enabled by setting the environment variable
348+
`SPANNER_ENABLE_API_TRACING=true`.
349+
350+
> Note: The attribute keys that are used for additional information about retry attempts and the number of requests might change in a future release.
318351
319352
## Migrate from OpenCensus to OpenTelemetry
320353

0 commit comments

Comments
 (0)