Skip to content

chore: improves logs for warning #1810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
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