From 090efb48b6cd9eb46609335b0a990bac42d854d6 Mon Sep 17 00:00:00 2001 From: Ali Ebrahim Date: Thu, 12 Jan 2023 14:43:11 -0800 Subject: [PATCH] Add attribute name to type warning message. (#3124) --- CHANGELOG.md | 3 ++- opentelemetry-api/src/opentelemetry/attributes/__init__.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 919d382c1c8..c6f6a1e91ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased - Adds environment variables for log exporter ([#3037](https://github.com/open-telemetry/opentelemetry-python/pull/3037)) - +- Add attribute name to type warning message. + ([3124](https://github.com/open-telemetry/opentelemetry-python/pull/3124)) - Add db metric name to semantic conventions ([#3115](https://github.com/open-telemetry/opentelemetry-python/pull/3115)) diff --git a/opentelemetry-api/src/opentelemetry/attributes/__init__.py b/opentelemetry-api/src/opentelemetry/attributes/__init__.py index 20d9ae91e1d..0b7d056da99 100644 --- a/opentelemetry-api/src/opentelemetry/attributes/__init__.py +++ b/opentelemetry-api/src/opentelemetry/attributes/__init__.py @@ -97,9 +97,10 @@ def _clean_attribute( return tuple(cleaned_seq) _logger.warning( - "Invalid type %s for attribute value. Expected one of %s or a " + "Invalid type %s for attribute '%s' value. Expected one of %s or a " "sequence of those types", type(value).__name__, + key, [valid_type.__name__ for valid_type in _VALID_ATTR_VALUE_TYPES], ) return None