Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TestMiddlewaresConsistency #8373

Merged
merged 3 commits into from
Jun 14, 2024

Conversation

pracucci
Copy link
Collaborator

@pracucci pracucci commented Jun 14, 2024

What this PR does

In this PR I propose to add TestMiddlewaresConsistency. This test will help us to ensure that we'll not forget to add a new query-frontend middleware (in the future) to each type of request. If a middleware is specific to a type of request, then the test allows to define exclusions from the check (e.g. splitAndCacheMiddleware is intentionally only used by range queries).

All middlewares are excluded for remote read because we're still working on making it a first class citizen.

Which issue(s) this PR fixes or relates to

N/A

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@pracucci pracucci requested a review from krajorama June 14, 2024 08:52
@@ -15,6 +15,12 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"
)

type instrumentMiddleware struct {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note to reviewers: this is a small refactoring to make the instrument middleware detectable via reflection. Before it was an anonymous HandlerFunc.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci force-pushed the test-query-frontend-middlewares-consistency branch from e6750c0 to 9a3ffcd Compare June 14, 2024 08:54
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci marked this pull request as ready for review June 14, 2024 08:58
@pracucci pracucci requested a review from a team as a code owner June 14, 2024 08:58
Copy link
Contributor

@krajorama krajorama left a comment

Choose a reason for hiding this comment

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

LGTM

@pracucci pracucci merged commit 023e3a6 into main Jun 14, 2024
29 checks passed
@pracucci pracucci deleted the test-query-frontend-middlewares-consistency branch June 14, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants