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
We also need to tell OpenTelemetry which exporter to use. For example, to export python-spanner traces to `Cloud Tracing <https://cloud.google.com/trace>`_, add the following lines to your application:
13
+
14
+
.. code:: python
15
+
16
+
from opentelemetry import trace
17
+
from opentelemetry.sdk.trace import TracerProvider
18
+
from opentelemetry.trace.sampling import ProbabilitySampler
19
+
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
20
+
# BatchExportSpanProcessor exports spans to Cloud Trace
21
+
# in a seperate thread to not block on the main thread
22
+
from opentelemetry.sdk.trace.export import BatchExportSpanProcessor
Generated spanner traces should now be available on `Cloud Trace <https://console.cloud.google.com/traces>`_.
34
+
35
+
Tracing is most effective when many libraries are instrumented to provide insight over the entire lifespan of a request.
36
+
For a list of libraries that can be instrumented, see the `OpenTelemetry Integrations` section of the `OpenTelemetry Python docs <https://opentelemetry-python.readthedocs.io/en/stable/>`_
0 commit comments