Skip to content

Commit 921da8b

Browse files
authored
fix(celery): coerce timelimit values to strings in span attributes (#4361)
1 parent 4619835 commit 921da8b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

  • instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7373

7474
### Fixed
7575

76+
- `opentelemetry-instrumentation-celery`: Coerce timelimit values to strings in `set_attributes_from_context()` to prevent mixed-type span attribute warning
77+
([#4361](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4361))
7678
- `opentelemetry-docker-tests`: Replace deprecated `SpanAttributes` from `opentelemetry.semconv.trace` with `opentelemetry.semconv._incubating.attributes`
7779
([#4339](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4339))
7880
- `opentelemetry-instrumentation-confluent-kafka`: Skip `recv` span creation when `poll()` returns no message or `consume()` returns an empty list, avoiding empty spans on idle polls

instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def set_attributes_from_context(span, context):
6565
if value in [(None, None), [None, None]]:
6666
continue
6767
if None in value:
68-
value = ["" if tl is None else tl for tl in value]
68+
value = ["" if tl is None else str(tl) for tl in value]
6969

7070
# Skip `retries` if it's value is `0`
7171
if key == "retries" and value == 0:

0 commit comments

Comments
 (0)