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

Remote read first class: workflow structure #8370

Merged
merged 3 commits into from
Jun 14, 2024

Conversation

krajorama
Copy link
Contributor

@krajorama krajorama commented Jun 14, 2024

What this PR does

Make place for a remote read roundtripper that would wrap limits and blocking checks.

Update the format of how we log the remote read query matchers in query stats and activity tracker. This will enable having the same string in the logs and also the query blocker.

Which issue(s) this PR fixes or relates to

Relates to https://github.com/grafana/pir-actions/issues/10 (internal, make remote read first class)

Checklist

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

Make place for a remote read roundtripper that would
wrap limits and blocking checks.

Update the format of how we log the remote read query matchers in query
stats and activity tracker. This will enable having the same string in
the logs and also the query blocker.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama force-pushed the apply-middlewares-to-remote-read branch from f89272f to 381148f Compare June 14, 2024 07:30
@krajorama krajorama marked this pull request as ready for review June 14, 2024 07:30
@krajorama krajorama requested a review from a team as a code owner June 14, 2024 07:30
@pracucci pracucci self-requested a review June 14, 2024 07:33
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM. I left few nits I would be glad if you could look at before merging. I would like to discuss with you the AddDetails(), but we can do it async after this PR has been merged.

pkg/frontend/querymiddleware/remote_read.go Outdated Show resolved Hide resolved
pkg/frontend/querymiddleware/remote_read.go Outdated Show resolved Hide resolved
pkg/frontend/querymiddleware/remote_read.go Outdated Show resolved Hide resolved
pkg/frontend/querymiddleware/remote_read.go Outdated Show resolved Hide resolved
pkg/frontend/querymiddleware/remote_read.go Outdated Show resolved Hide resolved
pkg/frontend/querymiddleware/remote_read.go Outdated Show resolved Hide resolved
}))
_, error := handler.Do(req.Context(), metricsRequest)
if error != nil {
return nil, apierror.AddDetails(error, fmt.Sprintf("remote read error (%s_%d: %s)", matchersLogKey, i, metricsRequest.GetQuery()))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't want to block on this, and we can address it separately, but I'm not 💯 convinced about the AddDetails() here. The design smell to me is that it's very easy to forget to use AddDetails() instead of the generic errors.Wrap(). I would like to make this stuff work with the normal errors.Wrap().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure that's a good idea as our Wrap would behave differently than the standard one (not in terms of the string returned, but the structure), but I'll update in the next PR.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama enabled auto-merge (squash) June 14, 2024 08:13
@krajorama krajorama merged commit 1c03a6e into main Jun 14, 2024
29 checks passed
@krajorama krajorama deleted the apply-middlewares-to-remote-read branch June 14, 2024 08:25
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