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

Ensure that DoNotLogErrors set DoNotLogError header in the HTTP response #6522

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

duricanikolic
Copy link
Contributor

What this PR does

This PR updates vendored dskit to revision 52f4e8d. That version of dskit introduced type middleware.DoNotLogError, representing errors that should not be logged, and a string server.DoNotLogErrorHeaderKey, that is used as a header key for marking erroneous HTTP response as non-loggable.

This PR removes mimir's log.DoNotLogError and uses dskit's middleware.DoNotLogError instead. Moreover, it ensures that when the push handler receives a middleware.DoNotLogError, the resulting HTTP response will contain a header with key httpgrpc.DoNotLogErrorHeaderKey.

Which issue(s) this PR fixes or relates to

Part of #6008

Checklist

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

@duricanikolic duricanikolic self-assigned this Oct 31, 2023
@duricanikolic duricanikolic requested review from grafanabot and a team as code owners October 31, 2023 15:31
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

lgtm, thank you

@@ -187,3 +189,10 @@ func toHTTPStatus(ctx context.Context, pushErr error, limits *validation.Overrid

return http.StatusInternalServerError
}

func addHeaders(w http.ResponseWriter, err error) {
Copy link
Member

Choose a reason for hiding this comment

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

@ying-jeanne this can be useful in your retry-after work :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact, after we had a call today I added the addHeaders method to make @ying-jeanne's work easier.

@duricanikolic duricanikolic merged commit 50d1c27 into main Oct 31, 2023
@duricanikolic duricanikolic deleted the yuri/handling-errors-new branch October 31, 2023 17:22
francoposa pushed a commit that referenced this pull request Oct 31, 2023
francoposa pushed a commit that referenced this pull request Nov 1, 2023
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