Skip to content

Commit da541c8

Browse files
Remove "print(Context)" from basic tracer example (open-telemetry#428)
Two reasons to remove it: - Now Context is a class and it doesn't print any useful information. - We don't expect users to interact directly with the context, so avoid it.
1 parent 96943b2 commit da541c8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ pip install -e ./ext/opentelemetry-ext-{integration}
5151

5252
```python
5353
from opentelemetry import trace
54-
from opentelemetry.context import Context
5554
from opentelemetry.sdk.trace import TracerSource
5655
from opentelemetry.sdk.trace.export import ConsoleSpanExporter
5756
from opentelemetry.sdk.trace.export import SimpleExportSpanProcessor
@@ -64,7 +63,7 @@ tracer = trace.tracer_source().get_tracer(__name__)
6463
with tracer.start_as_current_span('foo'):
6564
with tracer.start_as_current_span('bar'):
6665
with tracer.start_as_current_span('baz'):
67-
print(Context)
66+
print("Hello world from OpenTelemetry Python!")
6867
```
6968

7069
### Metrics

examples/basic_tracer/tracer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import os
1818

1919
from opentelemetry import trace
20-
from opentelemetry.context import Context
2120
from opentelemetry.sdk.trace import TracerSource
2221
from opentelemetry.sdk.trace.export import (
2322
BatchExportSpanProcessor,
@@ -51,4 +50,4 @@
5150
with tracer.start_as_current_span("foo"):
5251
with tracer.start_as_current_span("bar"):
5352
with tracer.start_as_current_span("baz"):
54-
print(Context)
53+
print("Hello world from OpenTelemetry Python!")

0 commit comments

Comments
 (0)