Fix for ruler not honoring user error with local querier #7567
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.
What this PR does
Added new test case in TestRulerMetricsForInvalidQueriesAndNoFetchedSeries
with only the invalid query scenario where the user has entered an
invalid regex, but without selecting all chunks so the chunks limit
doesn't apply.
Since only one error happens, the error is of type errors.errorString
and not fmt.wrapError, which means the code to detect user errors and
cannot type assert to type QueryableError which in turn means it's treated
as a GRPC error, which it is not.
See
mimir/pkg/ruler/compat.go
Line 164 in fdf3812
Fix is restricted to local querier execution when GRPC errors are not exposed directly to the ruler.
Fix considers unwrapped errors as panics coming from the PromQL engine, most likely due to user error. Although it's hard to know exactly what errors the engine can return now and in the future. Would be nice if Prometheus had set rules on the types of error interfaces that it returns.
Which issue(s) this PR fixes or relates to
Related to CI run of #7558
https://github.com/grafana/mimir/actions/runs/8189224340/job/22393779459?pr=7558
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.