Skip to content

[PRW 2.0] write_handler: Support for rc.2 spec & improved error handling for v2.#14427

Merged
bwplotka merged 7 commits intomainfrom
rw20-err-handling
Jul 12, 2024
Merged

[PRW 2.0] write_handler: Support for rc.2 spec & improved error handling for v2.#14427
bwplotka merged 7 commits intomainfrom
rw20-err-handling

Conversation

@bwplotka
Copy link
Copy Markdown
Member

@bwplotka bwplotka commented Jul 5, 2024

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.

@bwplotka bwplotka force-pushed the rw20-err-handling branch from b8beed1 to 634504d Compare July 5, 2024 15:15
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)
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What's dedupe logger? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hm, I see

func Dedupe(next log.Logger, repeat time.Duration) *Deduper {

Copy link
Copy Markdown
Member Author

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.

@bwplotka bwplotka marked this pull request as ready for review July 8, 2024 09:53
@bwplotka bwplotka requested a review from tomwilkie as a code owner July 8, 2024 09:53
@bwplotka bwplotka force-pushed the rw20-err-handling branch 2 times, most recently from a3c47c1 to e133aac Compare July 8, 2024 11:49
@bwplotka bwplotka requested a review from npazosmendez July 8, 2024 11:50
@bwplotka bwplotka force-pushed the rw20-err-handling branch from e133aac to baae06b Compare July 8, 2024 11:59
@bwplotka bwplotka force-pushed the rw20-err-handling branch from baae06b to 6ca09c0 Compare July 8, 2024 15:15
Signed-off-by: bwplotka <[email protected]>
bwplotka and others added 2 commits July 11, 2024 13:39
if len(badRequestErrs) == 0 {
return samplesWithoutMetadata, 0, nil
}
// TODO(bwplotka): Better concat formatting? Perhaps add size limit?
Copy link
Copy Markdown
Member Author

@bwplotka bwplotka Jul 11, 2024

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Updated!

bwplotka added a commit that referenced this pull request Jul 11, 2024
Chained on top of #14427
Fixes #14359

Signed-off-by: bwplotka <[email protected]>
bwplotka added a commit that referenced this pull request Jul 11, 2024
Chained on top of #14427
Fixes #14359

Signed-off-by: bwplotka <[email protected]>
bwplotka added a commit that referenced this pull request Jul 11, 2024
Chained on top of #14427
Fixes #14359

Signed-off-by: bwplotka <[email protected]>
bwplotka added a commit that referenced this pull request Jul 11, 2024
Chained on top of #14427
Fixes #14359

Signed-off-by: bwplotka <[email protected]>
@bwplotka bwplotka merged commit 0c87643 into main Jul 12, 2024
@bwplotka bwplotka deleted the rw20-err-handling branch July 12, 2024 07:11
bwplotka added a commit that referenced this pull request Jul 12, 2024
Chained on top of #14427
Fixes #14359

Signed-off-by: bwplotka <[email protected]>
bwplotka added a commit that referenced this pull request Jul 19, 2024
…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]>
kushalShukla-web pushed a commit to kushalShukla-web/prometheus that referenced this pull request Jul 23, 2024
…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]>
kushalShukla-web pushed a commit to kushalShukla-web/prometheus that referenced this pull request Jul 25, 2024
…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]>
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.

[PRW 2.0 spec] Sample Write Confirmation in Response

2 participants