Skip to content

Commit 3cc55d0

Browse files
authored
Add attribute name to type warning message.
Without this, the error message simply specifies that some attribute has the incorrect type, but this is very difficult to debug without knowing which attribute it was.
1 parent af83ef1 commit 3cc55d0

File tree

1 file changed

+2
-1
lines changed
  • opentelemetry-api/src/opentelemetry/attributes

1 file changed

+2
-1
lines changed

opentelemetry-api/src/opentelemetry/attributes/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ def _clean_attribute(
9797
return tuple(cleaned_seq)
9898

9999
_logger.warning(
100-
"Invalid type %s for attribute value. Expected one of %s or a "
100+
"Invalid type %s for attribute '%s' value. Expected one of %s or a "
101101
"sequence of those types",
102102
type(value).__name__,
103+
key,
103104
[valid_type.__name__ for valid_type in _VALID_ATTR_VALUE_TYPES],
104105
)
105106
return None

0 commit comments

Comments
 (0)