Describe your environment
Python 3.6, 3.7, 3.8
Code in master, hash: a89bbc8
Steps to reproduce
Add logging to stdout in pytest.ini
[pytest]
log_cli = true
...
and run tests
OR
Run tracing example https://github.com/open-telemetry/opentelemetry-python/tree/8fa21e6bcbb0b28917039661ca2ba369d0dee6b2#tracing
What is the expected behavior?
No warning messages in positive tests and examples.
What is the actual behavior?
Multiple warning logs:
opentelemetry.sdk.trace:__init__.py:287 Calling set_status() on an ended span.
Additional context
It happens because we call set_status after ending a span
|
self.set_status(Status(canonical_code=StatusCanonicalCode.OK)) |
which check if the (already ended) span is ended
Describe your environment
Python 3.6, 3.7, 3.8
Code in master, hash: a89bbc8
Steps to reproduce
Add logging to stdout in pytest.ini
and run tests
OR
Run tracing example https://github.com/open-telemetry/opentelemetry-python/tree/8fa21e6bcbb0b28917039661ca2ba369d0dee6b2#tracing
What is the expected behavior?
No warning messages in positive tests and examples.
What is the actual behavior?
Multiple warning logs:
opentelemetry.sdk.trace:__init__.py:287 Calling set_status() on an ended span.Additional context
It happens because we call
set_statusafter ending a spanopentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Line 268 in 8fa21e6
opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Line 286 in 8fa21e6