Conversation
EM-Tim
force-pushed
the
fix/celery-kombu-exchange-attributes
branch
from
September 25, 2026 20:49
1d85ec9 to
10d5261
Compare
EM-Tim
marked this pull request as ready for review
September 25, 2026 20:54
EM-Tim
force-pushed
the
fix/celery-kombu-exchange-attributes
branch
from
September 26, 2026 09:49
10d5261 to
3377320
Compare
Pull request dashboard statusWaiting on maintainers · refreshed 2026-10-01 16:11 UTC Merge when ready. Status above doesn't look right?
|
Normalize known Exchange and Queue names and skip empty names while preserving valid span attribute values. Assisted-by: OpenCode (openai/gpt-6-luna-pro)
EM-Tim
force-pushed
the
fix/celery-kombu-exchange-attributes
branch
from
October 1, 2026 12:06
3377320 to
ac5eba2
Compare
lzchen
approved these changes
Oct 1, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Kombu routing objects can reach Celery publish signals and be passed directly to
span.set_attribute, producing an invalid type warning forcelery.exchange. Normalize known KombuExchangeandQueuevalues to their.name, and skip names that are empty. Normal string names, valid OpenTelemetry primitives, and homogeneous sequences remain unchanged; unknown objects are not generically stringified.The custom-routing report is in #1195. Source inspection of Celery 5.6.3 found an additional native delayed-delivery path: it requires quorum queues to be detected, a non-direct selected exchange, and a countdown/ETA that resolves to a positive delay. Under those conditions Celery can construct
Exchange("celery_delayed_27", type="topic")and pass it throughbefore_task_publish. This is source-level evidence only; the delayed-delivery trigger has not been reproduced with RabbitMQ or in deployed services.Related earlier proposals #1196 and #4393 closed without merging. This change uses Kombu public types and avoids generic stringification; thanks to Heatstealer for the earlier work on this issue.
Fixes #1195
Type of change
How Has This Been Tested?
Local checks on the current single-commit PR head (
10d5261):uv tool run --from tox tox -e py312-test-instrumentation-celery— 34 passed, 31 dependency/Celery deprecation warnings. This tox environment uses the repository-pinned Celery 5.3.6 and Kombu 5.3.5.uv tool run --from tox tox -e lint-instrumentation-celery— pylint 10.00/10.opentelemetry.attributeswarnings.Exchange/Queueimports and.namechecks passed with Celery 5.6.3 and Kombu 5.6.2.The publish-signal regression dispatches Celery signals locally and does not require RabbitMQ. The native delayed-delivery path has not been reproduced against RabbitMQ or in production. GitHub Actions CI and changelog runs for this head are
action_requiredwith no jobs started (CI run, changelog run). The run-approval API requires repository admin rights, which this account does not have. Local test and lint results above are reproducible but are not GitHub-hosted checks. This PR remains a draft and no review was requested.Does This PR Require a Core Repo Change?
Checklist