We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e6aad7 commit ca20cd0Copy full SHA for ca20cd0
opentelemetry-api/src/opentelemetry/attributes/__init__.py
@@ -180,6 +180,11 @@ def _clean_extended_attribute_value( # pylint: disable=too-many-branches
180
# Freeze mutable sequences defensively
181
return tuple(cleaned_seq)
182
183
+ # Some applications such as Django add values to log records whose types fall outside the
184
+ # primitive types and `_VALID_ANY_VALUE_TYPES`, i.e., they are not of type `AnyValue`.
185
+ # Rather than attempt to whitelist every possible instrumentation, we stringify those values here
186
+ # so they can still be represented as attributes, falling back to the original TypeError only if
187
+ # converting to string raises.
188
try:
189
return str(value)
190
except Exception:
0 commit comments