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
tracing: update OpenTelemetry dependencies from 2021 to 2024 (#1199)
This change non-invasively introduces dependencies of opentelemetry
bringing in the latest dependencies and modernizing them.
While here also brought in modern span attributes:
* otel.scope.name
* otel.scope.version
Also added a modernized example to produce traces as well
with gRPC-instrumentation enabled, and updated the docs.
Updates #1170Fixes#1173
Built from PR #1172
# [Optional] Installs the cloud monitoring exporter, however you can use any exporter of your choice
14
-
pip install opentelemetry-exporter-google-cloud
11
+
pip install opentelemetry-api opentelemetry-sdk
12
+
pip install opentelemetry-exporter-gcp-trace
15
13
16
14
We also need to tell OpenTelemetry which exporter to use. To export Spanner traces to `Cloud Tracing <https://cloud.google.com/trace>`_, add the following lines to your application:
17
15
18
16
.. code:: python
19
17
20
18
from opentelemetry import trace
21
19
from opentelemetry.sdk.trace import TracerProvider
22
-
from opentelemetry.trace.sampling importProbabilitySampler
20
+
from opentelemetry.sdk.trace.sampling importTraceIdRatioBased
23
21
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
24
-
#BatchExportSpanProcessor exports spans to Cloud Trace
22
+
#BatchSpanProcessor exports spans to Cloud Trace
25
23
# in a seperate thread to not block on the main thread
26
-
from opentelemetry.sdk.trace.export importBatchExportSpanProcessor
24
+
from opentelemetry.sdk.trace.export importBatchSpanProcessor
0 commit comments