Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
lzchen committed Jun 9, 2021
commit 5b5a79047a064756fc285279bf2236d7b84db173
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1897](https://github.com/open-telemetry/opentelemetry-python/pull/1897))
- Ignore calls to `Span.set_status` with `StatusCode.UNSET` and also if previous status already
had `StatusCode.OK`.
([#1897](https://github.com/open-telemetry/opentelemetry-python/pull/1897))
([#1902](https://github.com/open-telemetry/opentelemetry-python/pull/1902))

## [1.3.0-0.22b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.3.0-0.22b0) - 2021-06-01

Expand Down
7 changes: 5 additions & 2 deletions opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,11 @@ def is_recording(self) -> bool:
def set_status(self, status: trace_api.Status) -> None:
# Ignore future calls if status is already set to OK
# Ignore calls to set to StatusCode.UNSET
if self._status and self._status.status_code is StatusCode.OK \
or status.status_code is StatusCode.UNSET:
if (
self._status
and self._status.status_code is StatusCode.OK
or status.status_code is StatusCode.UNSET
):
return
self._status = status

Expand Down