Skip to content

Commit 81e0f78

Browse files
committed
docs
1 parent 912b418 commit 81e0f78

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/opentelemetry-tracing.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ We also need to tell OpenTelemetry which exporter to use. To export Spanner trac
3838
# can modify it though using the environment variable
3939
# SPANNER_ENABLE_EXTENDED_TRACING=false.
4040
enable_extended_tracing=False,
41+
42+
# By default end to end tracing is set to False. Set to True
43+
# for getting spans for Spanner server.
44+
enable_end_to_end_tracing=True,
4145
)
4246
spanner = spanner.NewClient(project_id, observability_options=observability_options)
4347
@@ -71,3 +75,22 @@ leak. Sadly due to legacy behavior, we cannot simply turn off this behavior by d
7175
SPANNER_ENABLE_EXTENDED_TRACING=false
7276

7377
to turn it off globally or when creating each SpannerClient, please set `observability_options.enable_extended_tracing=false`
78+
79+
End to end tracing
80+
~~~~~~~~~~~~~~~~~~~~~~~~~
81+
82+
In addition to client-side tracing, you can opt in for end-to-end tracing. End-to-end tracing helps you understand and debug latency issues that are specific to Spanner. Refer [here](https://cloud.google.com/spanner/docs/tracing-overview) for more information.
83+
84+
To configure end-to-end tracing.
85+
86+
1. Opt in for end-to-end tracing. You can opt-in by either:
87+
- Setting the environment variable `SPANNER_ENABLE_END_TO_END_TRACING=true` before your application is started
88+
- In code, by setting `observability_options.enable_end_to_end_tracing=true` when creating each SpannerClient.
89+
90+
2. Set the trace context propagation in OpenTelemetry.
91+
92+
.. code:: python
93+
94+
from opentelemetry.propagate import set_global_textmap
95+
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
96+
set_global_textmap(TraceContextTextMapPropagator())

0 commit comments

Comments
 (0)