fix(dashboard): reject MRI queries with actionable tracemetrics guidance#601
Merged
fix(dashboard): reject MRI queries with actionable tracemetrics guidance#601
Conversation
MRI-style queries like `avg(g:custom/node.runtime.mem.rss@byte)` passed validation but produced widgets rendering as "Internal Error" in the dashboard UI. Add MRI syntax detection (ported from Sentry's canonical Python parser) to `validateAggregateNames`, throwing a ValidationError with the correct `--dataset tracemetrics` format suggestion. Closes #539
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 129 passed | Total: 129 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 95.74%. Project has 1307 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.63% 95.62% -0.01%
==========================================
Files 203 203 —
Lines 29799 29846 +47
Branches 0 0 —
==========================================
+ Hits 28496 28539 +43
- Misses 1303 1307 +4
- Partials 0 0 —Generated by Codecov Action |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
--queryarguments and reject with aValidationErrorthat suggests the correct--dataset tracemetricsformatsentry/snuba/metrics/naming_layer/mri.pyProblem
MRI-style queries like
avg(g:custom/node.runtime.mem.rss@byte)with--dataset metricspassed CLI validation (since "avg" is a valid function name) but produced widgets that render as "Internal Error" in the Sentry dashboard UI.Solution
Added
parseMri()andrejectMriQueries()to the aggregate validation pipeline insrc/types/dashboard.ts. When MRI syntax is detected, the error message includes:avg(value,node.runtime.mem.rss,gauge,byte)--dataset tracemetricsif not already using itExample error:
Closes #539