-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(explore): Add sentry conventions context to trace item attributes #117913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DominikB2014
merged 12 commits into
master
from
feat/trace-item-attribute-context-expand
Jun 18, 2026
+226
−1
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0c23d14
feat(explore): Add sentry conventions context to trace item attributes
DominikB2014 6f13f62
ref(explore): camelCase trace item attribute context fields
DominikB2014 ea57e79
ref(explore): only attach attribute context to sentry-source attributes
DominikB2014 df73fdc
ref(explore): drop last_received note from build_attribute_context do…
DominikB2014 cb8e550
ref(explore): drop duplicate data-browsing-attribute-context flag reg…
DominikB2014 a299662
Merge remote-tracking branch 'origin/master' into feat/trace-item-att…
DominikB2014 182ccaa
ref(explore): exclude internal expand param from OpenAPI spec
DominikB2014 97bc7e1
ref(explore): drop context from public trace item attribute example
DominikB2014 1571889
ref(explore): make brief and isDeprecated required in attribute context
DominikB2014 ff1a26d
ref(explore): rename build_attribute_context to build_sentry_conventi…
DominikB2014 50dbdfb
ref(explore): guard additional_context against scalar string in conte…
DominikB2014 7e4aaa4
test(explore): Drop defaulted store_segment args from context test he…
DominikB2014 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
33 changes: 32 additions & 1 deletion
33
src/sentry/api/endpoints/organization_trace_item_attributes_types.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,45 @@ | ||
| from typing import Literal, NotRequired, TypedDict | ||
| from typing import Any, Literal, NotRequired, TypedDict | ||
|
|
||
|
|
||
| class TraceItemAttributeSource(TypedDict): | ||
| source_type: Literal["sentry", "user"] | ||
| is_transformed_alias: NotRequired[bool] | ||
|
|
||
|
|
||
| class TraceItemAttributeContext(TypedDict): | ||
| """ | ||
| Additional, mostly-static metadata about an attribute sourced from the | ||
| sentry conventions (``sentry_conventions.attributes.ATTRIBUTE_METADATA``). | ||
|
|
||
| Only attributes that map to a known sentry convention have context, and | ||
| within the context only the fields actually present in the conventions | ||
| metadata are included. This is only attached when the caller passes | ||
| ``expand=context`` and the ``data-browsing-attribute-context`` feature is | ||
| enabled. | ||
| """ | ||
|
|
||
| # A short, human-readable description of the attribute. Always present for a | ||
| # known convention. | ||
| brief: str | ||
| # Whether the convention has been deprecated. Always present for a known | ||
| # convention. | ||
| isDeprecated: bool | ||
| # Longer-form notes that add nuance beyond the brief (e.g. caveats, | ||
| # double-counting warnings). Sourced from the convention's | ||
| # ``additional_context``. | ||
| details: NotRequired[list[str]] | ||
| # Example value(s) for the attribute, normalized to a list. | ||
| examples: NotRequired[list[Any]] | ||
| # The attribute that replaces this one, when deprecated. | ||
| replacementAttribute: NotRequired[str] | ||
|
|
||
|
|
||
| class TraceItemAttributeKey(TypedDict): | ||
| key: str | ||
| name: str | ||
| secondaryAliases: NotRequired[list[str]] | ||
| attributeSource: TraceItemAttributeSource | ||
| attributeType: Literal["string", "number", "boolean"] | ||
| # Sentry conventions metadata, only present when requested via | ||
| # ``expand=context`` (and gated behind the feature flag). | ||
| context: NotRequired[TraceItemAttributeContext] |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.