Skip to content

Commit

Permalink
chore: improves logs for warning (#1810)
Browse files Browse the repository at this point in the history
Co-authored-by: alrex <[email protected]>
  • Loading branch information
jcchavezs and alrex authored May 10, 2021
1 parent 8a1cbf7 commit 684f57d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Propagators use the root context as default for `extract` and do not modify
the context if extracting from carrier does not work.
([#1811](https://github.com/open-telemetry/opentelemetry-python/pull/1811))
- Improve warning when failing to decode byte attribute
([#1810](https://github.com/open-telemetry/opentelemetry-python/pull/1810))

### Removed
- Moved `opentelemetry-instrumentation` to contrib repository.
Expand Down
5 changes: 4 additions & 1 deletion opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,10 @@ def set_attributes(
try:
value = value.decode()
except ValueError:
logger.warning("Byte attribute could not be decoded.")
logger.warning(
"Byte attribute could not be decoded for key `%s`.",
key,
)
return
self._attributes[key] = value

Expand Down

0 comments on commit 684f57d

Please sign in to comment.