Skip to content

ref(o11y): Add set_attribute calls to sdk#117661

Open
alexander-alderman-webb wants to merge 3 commits into
masterfrom
webb/sdk/set-attribute
Open

ref(o11y): Add set_attribute calls to sdk#117661
alexander-alderman-webb wants to merge 3 commits into
masterfrom
webb/sdk/set-attribute

Conversation

@alexander-alderman-webb

Copy link
Copy Markdown
Contributor

Supplement existing set_tag/set_context/set_extra calls with set_attribute so that data gets added to attributes-based telemetry as well. This will make the migration to span streaming easier.

Related to getsentry/sentry-python#6537

@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner June 15, 2026 07:35
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 15, 2026
Comment thread src/sentry/utils/sdk.py Outdated

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9d36cef. Configure here.

Comment thread src/sentry/utils/sdk.py
"organization", {"multiple possible": org_slugs, "source": source or "unknown"}
)
scope.set_attribute("organization.multiple possible", org_slugs)
scope.set_attribute("organization.source", source or "unknown")

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.

Stale org scope attributes

Medium Severity

bind_ambiguous_org_context now writes organization fields via set_attribute, but existing flows still only manage tags and context. clear_tags_and_context removes organization tags and context without touching scope attributes, and bind_organization_context still sets tags/context without updating matching attributes. Isolation scopes can then carry outdated organization attribute values while tags reflect the current org.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9d36cef. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will take a look

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

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant