Skip to content

fix(tracemetrics): Pass project and env in request filters for filter#115920

Merged
narsaynorath merged 2 commits into
masterfrom
nar/fix/tracemetrics-detectors-filter-bar-should-pass-project-environment-filters
May 20, 2026
Merged

fix(tracemetrics): Pass project and env in request filters for filter#115920
narsaynorath merged 2 commits into
masterfrom
nar/fix/tracemetrics-detectors-filter-bar-should-pass-project-environment-filters

Conversation

@narsaynorath
Copy link
Copy Markdown
Member

If we don't pass these along explicitly from the form state, usePageFilters gives us the locally stored values which can cause conflicts if it doesn't match the selection.

To repro a problem scenario:

  • go to an org
  • select a project A from any of the page filters dropdowns
  • go to monitors and create a metric alert for application metrics
  • open devtools and select the network tab
  • change the project to some project B
  • change the metric to something in project B

A request for attributes will be made, but it will have the project A ID in it, which conflicts with the metric since it's part of project B

I debated not passing down environment and only project, but since the metric selector already does both maybe it makes sense for us to pass them both along. I can remove them if we decide we just want the user to see everything in that project

@narsaynorath narsaynorath requested review from a team as code owners May 20, 2026 18:08
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 20, 2026
Comment thread static/app/views/explore/metrics/metricToolbar/filter.tsx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.57%

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 e60a103. Configure here.

Comment thread static/app/views/explore/utils/traceItemAttributeKeysOptions.tsx
@narsaynorath narsaynorath merged commit dd7e61d into master May 20, 2026
71 checks passed
@narsaynorath narsaynorath deleted the nar/fix/tracemetrics-detectors-filter-bar-should-pass-project-environment-filters branch May 20, 2026 18:46
JonasBa pushed a commit that referenced this pull request May 21, 2026
…#115920)

If we don't pass these along explicitly from the form state,
`usePageFilters` gives us the locally stored values which can cause
conflicts if it doesn't match the selection.

To repro a problem scenario:
- go to an org
- select a project A from any of the page filters dropdowns
- go to monitors and create a metric alert for application metrics
- open devtools and select the network tab
- change the project to some project B
- change the metric to something in project B

A request for attributes will be made, but it will have the project A ID
in it, which conflicts with the metric since it's part of project B

I debated _not_ passing down environment and only project, but since the
metric selector already does both maybe it makes sense for us to pass
them both along. I can remove them if we decide we just want the user to
see everything in that project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants