-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[PRW 2.0] write_handler: Support for rc.2 spec & improved error handling for v2. #14427
Conversation
b8beed1
to
634504d
Compare
errors.Is(err, storage.ErrDuplicateSampleForTimestamp) || | ||
errors.Is(err, storage.ErrTooOldSample) { | ||
// TODO(bwplotka): Not too spammy log? | ||
level.Error(h.logger).Log("msg", "Out of order sample from remote write", "err", err.Error(), "series", ls.String(), "timestamp", s.Timestamp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially, can we use the dedupe logger here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's dedupe logger? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I see
prometheus/util/logging/dedupe.go
Line 54 in c954cd9
func Dedupe(next log.Logger, repeat time.Duration) *Deduper { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we log timestamp, series etc, this will not help I think.. I would say let's fix in further PRs if this becomes a problem somewhere.
a3c47c1
to
e133aac
Compare
e133aac
to
baae06b
Compare
…ing for v2. Fixes: #14359 Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
baae06b
to
6ca09c0
Compare
Signed-off-by: bwplotka <[email protected]>
6ca09c0
to
536a69a
Compare
Chained on top of #14427 Fixes #14359 Signed-off-by: bwplotka <[email protected]>
Chained on top of #14427 Fixes #14359 Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Co-authored-by: Callum Styan <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]>
if len(badRequestErrs) == 0 { | ||
return samplesWithoutMetadata, 0, nil | ||
} | ||
// TODO(bwplotka): Better concat formatting? Perhaps add size limit? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the next PR https://github.com/prometheus/prometheus/pulls/bwplotka
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
Chained on top of #14427 Fixes #14359 Signed-off-by: bwplotka <[email protected]>
Chained on top of #14427 Fixes #14359 Signed-off-by: bwplotka <[email protected]>
Chained on top of #14427 Fixes #14359 Signed-off-by: bwplotka <[email protected]>
Chained on top of #14427 Fixes #14359 Signed-off-by: bwplotka <[email protected]>
Chained on top of #14427 Fixes #14359 Signed-off-by: bwplotka <[email protected]>
…4444) * [PRW 2.0] Added Sender support for Response Stats. Chained on top of #14427 Fixes #14359 Signed-off-by: bwplotka <[email protected]> * Addressed comments. Signed-off-by: bwplotka <[email protected]> * move write stats to it's own file Signed-off-by: Callum Styan <[email protected]> * Clean up header usage Signed-off-by: Callum Styan <[email protected]> * add missing license to new stats file Signed-off-by: Callum Styan <[email protected]> * Addressed all comments. Signed-off-by: bwplotka <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> Signed-off-by: Callum Styan <[email protected]> Co-authored-by: Callum Styan <[email protected]>
…ing for v2. (prometheus#14427) * [PRW 2.0] write_handler: Support for rc.2 spec & improved error handling for v2. Fixes: prometheus#14359 Signed-off-by: bwplotka <[email protected]> * Addressed Callum comments. Signed-off-by: bwplotka <[email protected]> * Added missing lock on flush. Signed-off-by: bwplotka <[email protected]> * Fixed lint. Signed-off-by: bwplotka <[email protected]> * Added tests. Signed-off-by: bwplotka <[email protected]> * Addressed Callum's comments & updated re spec. Signed-off-by: bwplotka <[email protected]> * Update storage/remote/write_handler_test.go Co-authored-by: Callum Styan <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> Co-authored-by: Callum Styan <[email protected]> Signed-off-by: kushagra Shukla <[email protected]>
…ing for v2. (prometheus#14427) * [PRW 2.0] write_handler: Support for rc.2 spec & improved error handling for v2. Fixes: prometheus#14359 Signed-off-by: bwplotka <[email protected]> * Addressed Callum comments. Signed-off-by: bwplotka <[email protected]> * Added missing lock on flush. Signed-off-by: bwplotka <[email protected]> * Fixed lint. Signed-off-by: bwplotka <[email protected]> * Added tests. Signed-off-by: bwplotka <[email protected]> * Addressed Callum's comments & updated re spec. Signed-off-by: bwplotka <[email protected]> * Update storage/remote/write_handler_test.go Co-authored-by: Callum Styan <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> Co-authored-by: Callum Styan <[email protected]>
Fixes: #14359, but also refactors v2 error handling to support partial writes (for non-retriable errors) and adds extensive tests for stats and error handling in general.