Skip to content

feat: add opt-in attributes cluster_name, vhost - #4962

Draft
abhishuraina wants to merge 6 commits into
open-telemetry:mainfrom
abhishuraina:main
Draft

feat: add opt-in attributes cluster_name, vhost#4962
abhishuraina wants to merge 6 commits into
open-telemetry:mainfrom
abhishuraina:main

Conversation

@abhishuraina

@abhishuraina abhishuraina commented Aug 16, 2026

Copy link
Copy Markdown

Description

Adds two opt-in span attributes to opentelemetry-instrumentation-pika:

Neither 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_NAME and OTEL_PYTHON_PIKA_CAPTURE_CLUSTER_NAME.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • tox -e py312-test-instrumentation-pika-0 — unit tests cover both attributes enabled
    independently, both enabled together, both disabled (default), and the "unique connection"
    (_impl) code path.
  • Manual smoke test against a live 3-node RabbitMQ cluster via opentelemetry-instrument
    (console and OTLP export) — confirmed messaging.rabbitmq.cluster.name matches the broker's
    actual rabbitmqctl set_cluster_name value, and that both attributes are absent when the env
    vars are unset.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@abhishuraina
abhishuraina marked this pull request as draft August 16, 2026 14:59
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 16, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-08-21 07:09 UTC

Move out of draft to request review.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@abhishuraina
abhishuraina marked this pull request as ready for review August 17, 2026 11:39
@abhishuraina
abhishuraina requested a review from a team as a code owner August 17, 2026 11:39
abhishuraina and others added 2 commits August 20, 2026 09:05
- 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>
@xrmx

xrmx commented Aug 21, 2026

Copy link
Copy Markdown
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
xrmx marked this pull request as draft August 21, 2026 07:09
@abhishuraina

Copy link
Copy Markdown
Author

@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.

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

pika: add opt-in messaging.rabbitmq.cluster.name / messaging.rabbitmq.vhost.name span attributes

2 participants