Allow a piece of Context to be "Promoted" to a Tag in Sentry UI
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 10m
- Merged PRs (30d)
- 635
Description
### Problem Statement
AFAIK currently there is no way to instruct Sentry to treat a piece of processed context as a Tag. In order to achieve this, SDK users must manually create a tag from some context as part of the API call.
For example: I want to see user `locale` information in Issue trends and create useful metrics for if all issue events are from the same locale.
To achieve this I would either need to add it to `beforeSend` or `configureScope`
```
options.beforeSend = { event ->
val deviceContext = event.contexts["device"] as? Map<*, *>
val locale = deviceContext?.get("locale") as? String
locale?.let { event.setTag("locale", it) }
event // Always return the event
}
```
```
Sentry.configureScope { scope ->
val deviceContext = scope.getContexts()["device"] as? Map<*, *>
val locale = deviceContext?.get("locale") as? String
locale?.let { scope.setTag("locale", it) }
```
This seems particularly cumbersome and a maintenance burden when this context is already present in the data Sentry receives.
I would request that a piece of Context be 'promotable' to a Tag, either in the Contexts UI or Issues -> Configure -> Tags perhaps.
### Solution Brainstorm
_No response_
### Are you willing to submit a PR?
_No response_
Contributor guide
Research direction
The issue does not name implementation files, tests, or an entry point. Start by tracing the Sentry UI's Contexts view and Issues → Configure → Tags flow, then determine the product and design scope for promoting a context field. Done should include an agreed interaction, supported context values, and verification that the promoted value is available as a tag for trends and metrics.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100