feat: add opt-in attributes cluster_name, vhost - #4962
Draft
abhishuraina wants to merge 6 commits into
Draft
Conversation
abhishuraina
marked this pull request as draft
August 16, 2026 14:59
Pull request dashboard statusWaiting on the author · refreshed 2026-08-21 07:09 UTC Move out of draft to request review. Status above doesn't look right?
|
abhishuraina
marked this pull request as ready for review
August 17, 2026 11:39
- Strip trailing whitespace in utils.py (ruff W291 / pylint C0303) - Disable too-many-public-methods on TestUtils (21/20 after adding opt-in gating test coverage), matching this file's existing pylint-disable precedent Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
|
@abhishuraina Thanks for the PR but we cannot add attributes not specified in the semantic conventions, moving as draft. Make it ready for review when the semantic conventions get accepted. |
xrmx
marked this pull request as draft
August 21, 2026 07:09
Author
Hi @xrmx I raise a PR for semantic conventions but it got closed automatically open-telemetry/semantic-conventions#4004 can you please help me with the next steps ? |
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
Adds two opt-in span attributes to
opentelemetry-instrumentation-pika:messaging.rabbitmq.vhost.name←connection.params.virtual_hostmessaging.rabbitmq.cluster.name←connection.server_properties.get("cluster_name")Fixes pika: add opt-in
messaging.rabbitmq.cluster.name/messaging.rabbitmq.vhost.namespan attributes #4963Neither is an official semantic-conventions attribute yet (tracked in
open-telemetry/semantic-conventions#3997),
so both are disabled by default and gated independently behind two env vars:
OTEL_PYTHON_PIKA_CAPTURE_VHOST_NAMEandOTEL_PYTHON_PIKA_CAPTURE_CLUSTER_NAME.Type of change
How Has This Been Tested?
tox -e py312-test-instrumentation-pika-0— unit tests cover both attributes enabledindependently, both enabled together, both disabled (default), and the "unique connection"
(
_impl) code path.opentelemetry-instrument(console and OTLP export) — confirmed
messaging.rabbitmq.cluster.namematches the broker'sactual
rabbitmqctl set_cluster_namevalue, and that both attributes are absent when the envvars are unset.
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.