Skip to content

Support partial write on PRW2.0 - #7761

Open
SungJin1212 wants to merge 1 commit into
masterfrom
PRW2-support-partial-write
Open

Support partial write on PRW2.0#7761
SungJin1212 wants to merge 1 commit into
masterfrom
PRW2-support-partial-write

Conversation

@SungJin1212

@SungJin1212 SungJin1212 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Implements partial write for Prometheus Remote Write 2.0 requests, following the Prometheus receiver behavior.
Previously a single invalid series aborted the whole conversion, so the entire batch was rejected with a 400 and the X-Prometheus-Remote-Write-*-Written response headers were not set at all; now invalid series are skipped and reported together in the response, the valid ones are written, and the written stats headers are always set.

This also makes Cortex accept a v2 write request that contains an exemplar-only series.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

@dosubot dosubot Bot added go Pull requests that update Go code type/feature labels Aug 13, 2026
@SungJin1212 SungJin1212 changed the title Support partial write Support partial write on PRW2.0 Aug 13, 2026
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212
SungJin1212 force-pushed the PRW2-support-partial-write branch from af8e168 to b3a5222 Compare August 14, 2026 01:49
@yeya24

yeya24 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Previously a single invalid series aborted the whole conversion, so the entire batch was rejected with a 400 and the X-Prometheus-Remote-Write-*-Written response headers were not set at all; now invalid series are skipped and reported together in the response, the valid ones are written, and the written stats headers are always set.

Interesting, is this what Prometheus does today? If that's Prometheus' behavior I am ok with it. But it is a behavior change in Cortex regardless. Do you think we can put this behind a FF?

@SungJin1212

Copy link
Copy Markdown
Member Author

Interesting, is this what Prometheus does today?

Yes, Prometheus' v2 receiver has addressed the partial write since v2.54.0.

Do you think we can put this behind a FF?

I'd rather not add another flag here: the v2 path is already opt-in and experimental. Currently, Prometheus can send exemplar-only series (prometheus/prometheus#17857), and Cortex drops the whole request, so partial write is what makes exemplars usable over RW2.0 at all.
Or how about a flag that defaults to true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code size/L type/feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants