Skip to content

storage/remote: count failed exemplar inputs across fanout - #19941

Closed
aknuds1 wants to merge 5 commits into
prometheus:bwplotka/rw_receiver_appender_v2from
aknuds1:arve/bwplotka/rw_receiver_appender_v2-exemplars
Closed

aknuds1 wants to merge 5 commits into
prometheus:bwplotka/rw_receiver_appender_v2from
aknuds1:arve/bwplotka/rw_receiver_appender_v2-exemplars

Conversation

@aknuds1

@aknuds1 aknuds1 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Custom fanout configurations can report several backend errors for one input exemplar. Subtracting the error count from the input count therefore undercounts the Remote Write 2.0 written-exemplar header.

Make AppendPartialError.ExemplarErrors match the input exemplar slice: nil entries indicate no reported failure, and non-nil entries retain the causes for that input. Allocate the slice on the first failure, merge fanout errors by position, and count each failed input once. Remove the separate index slice and legacy fallback.

Preserve input positions across future-timestamp filtering without modifying caller or backend slices. Validate failure-slice lengths at consumer boundaries, normalize empty partial errors, and update Remote Write, OTLP, scrape, Head, Agent, and test appenders to the same contract.

Regression coverage uses named subtests for overlapping and disjoint fanout failures, sparse failures, ignored duplicates, filtering, malformed lengths, slice ownership, and receiver response counts. Benchmarks cover error creation, aggregation, counting, and filtering with 1 and 1,000 inputs; no performance improvement is claimed.

This accounting correction applies to custom fanout configurations through the Go API. Metadata changes remain in #19912.

Which issue(s) does the PR fix:

Follow-up to #19812, targeting its feature branch. Exemplar changes split from #19912.

Release notes for end users (ALL commits must be considered).

Reviewers should verify clarity and quality.

NONE

@aknuds1
aknuds1 force-pushed the arve/bwplotka/rw_receiver_appender_v2-exemplars branch from e72f6c0 to 4ac2a90 Compare October 6, 2026 20:27
@bwplotka
bwplotka force-pushed the bwplotka/rw_receiver_appender_v2 branch from b321643 to fa51d00 Compare October 13, 2026 16:02
}

// FailedExemplarCount returns the number of input exemplars with reported failures.
func (e *AppendPartialError) FailedExemplarCount() int {

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.

I agree with @krajorama - wonder if ExemplarError{err, int (index)} would simplify this code

@bwplotka
bwplotka deleted the branch prometheus:bwplotka/rw_receiver_appender_v2 October 14, 2026 11:37
@bwplotka bwplotka closed this Oct 14, 2026
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