Skip to content

pika: add visibility to sampler to messagging spans attributes - #5313

Merged
xrmx merged 3 commits into
open-telemetry:mainfrom
xrmx:pika-sampler-visibility
Nov 11, 2026
Merged

xrmx merged 3 commits into
open-telemetry:mainfrom
xrmx:pika-sampler-visibility

Conversation

@xrmx

@xrmx xrmx commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Description

Add known attributes at span creation time so that the sampler has visibility on them.

Refs #5253

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

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

  • I am a human and not a bot
  • I have run tox -e precommit
  • I have run tox -e typecheck
  • I have run the relevant tests and linting tox environments
  • This requires the following PR in core:

@xrmx
xrmx requested a review from a team as a code owner November 9, 2026 10:16
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-11-11 17:11 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the change to expose Pika messaging attributes at span creation for attribute-based sampling.

No open issues 🎉

What changed in this PR

Updates Pika instrumentation to expose known messaging attributes when spans are created, enabling attribute-based sampling as requested in #5253.

Changes:

  • Collects messaging and connection attributes before calling start_span.
  • Adds sampling tests for publishing, callbacks, and generator consumption, plus exception-propagation checks.
  • Updates utility tests and adds a changelog entry.
File Description
instrumentation/​opentelemetry-instrumentation-pika/​tests/​test_utils.py Updates tests for attribute collection and span creation.
instrumentation/​opentelemetry-instrumentation-pika/​tests/​test_sampling.py Tests sampler visibility, sampling decisions, and error propagation.
instrumentation/​opentelemetry-instrumentation-pika/​src/​opentelemetry/​instrumentation/​pika/​utils.py Passes known attributes directly to span creation.
.changelog/​5313.changed Documents sampler visibility for Pika attributes.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Nov 11, 2026
@xrmx
xrmx enabled auto-merge November 11, 2026 16:49
@xrmx
xrmx added this pull request to the merge queue Nov 11, 2026
Merged via the queue into open-telemetry:main with commit 5018dbf Nov 11, 2026
1532 of 1534 checks passed
@xrmx
xrmx deleted the pika-sampler-visibility branch November 11, 2026 17:10
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Python PR digest Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants