Skip to content

Conversation

@malwilley
Copy link
Member

When creating a new metric monitor, use "number of errors" as the default since it is the most commonly-used metric alert.

@malwilley malwilley requested a review from a team as a code owner December 12, 2025 19:30
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 12, 2025
Copy link
Member

@scttcper scttcper left a comment

Choose a reason for hiding this comment

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

i never did figure out a good solution for removing is:unresolved when switching

@malwilley malwilley enabled auto-merge (squash) December 12, 2025 19:33
aggregateFunction: 'count()',
interval: 60 * 60, // One hour in seconds
query: '',
query: 'is:unresolved',
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Error-specific query persists when switching to Spans dataset

The default query 'is:unresolved' is now set for the Errors dataset, but when users switch to the Spans dataset, this error-specific filter persists (as shown in the apdex test at line 731). The is:unresolved filter is meaningful for Errors but not for Spans. The dataset onChange handler in metric.tsx resets the aggregate and detection type when the dataset changes but does not clear or reset the query field. This results in submitting an irrelevant filter with Spans queries.

Additional Locations (1)

Fix in Cursor Fix in Web

const queryFromUrl = decodeScalar(location.query.query, '') ?? '';
const queryFromUrl = decodeScalar(location.query.query);
const defaultQuery = DEFAULT_THRESHOLD_METRIC_FORM_DATA.query ?? '';
const query = queryFromUrl === undefined ? defaultQuery : queryFromUrl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Empty query URL parameter incorrectly gets default value

When a user explicitly provides ?query= in the URL (intending an empty query filter), decodeScalar('') returns undefined because the function treats empty strings as falsy. The new logic then checks queryFromUrl === undefined and replaces it with the default 'is:unresolved'. This differs from the old behavior where decodeScalar(location.query.query, '') would preserve the empty string. Users navigating with an explicit empty query parameter (e.g., from shared links or other app sections) would unexpectedly get a pre-filled filter instead of no filter.

Fix in Cursor Fix in Web

@malwilley malwilley merged commit 2842b75 into master Dec 12, 2025
50 checks passed
@malwilley malwilley deleted the malwilley/feat/metric-monitor-form-should-default-to-number-of-errors branch December 12, 2025 19:41
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants