Skip to content

Ensure remote write v2 headers cannot be returned on v1 requests#1927

Merged
bwplotka merged 1 commit intoprometheus:mainfrom
kgeckhart:kgeckhart/writeHandler-skip-stats-for-v1
Dec 12, 2025
Merged

Ensure remote write v2 headers cannot be returned on v1 requests#1927
bwplotka merged 1 commit intoprometheus:mainfrom
kgeckhart:kgeckhart/writeHandler-skip-stats-for-v1

Conversation

@kgeckhart
Copy link
Contributor

This PR prevents the remote_api WriteHandler from adding Remote Write v2 response headers when handling a v1 payload. This ensures a sender, like prometheus itself, cannot misinterpret the stats which are liable to always be zero for RWv1.

Related to: prometheus/prometheus#17659

Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
Copy link
Member

@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.

Thanks for helping!

LGTM

@bwplotka bwplotka merged commit 7ba246a into prometheus:main Dec 12, 2025
8 checks passed
kgeckhart added a commit to grafana/alloy that referenced this pull request Feb 12, 2026
### Brief description of Pull Request

Bump to prometheus patch release to pull in the fix for
prometheus/prometheus#17659 which would impact
`prometheus.receive_http` which uses the upstream
`remote.NewWriteHandler` which was impacted by
prometheus/client_golang#1927.

### Issue(s) fixed by this Pull Request

Resolves: #5471

### Notes to the Reviewer

I didn't add a test because it's a rather low level implementation
details about returning response stats vs not returning response stats.
I'm open to adding one though.
grafana-alloybot bot pushed a commit to grafana/alloy that referenced this pull request Feb 12, 2026
### Brief description of Pull Request

Bump to prometheus patch release to pull in the fix for
prometheus/prometheus#17659 which would impact
`prometheus.receive_http` which uses the upstream
`remote.NewWriteHandler` which was impacted by
prometheus/client_golang#1927.

### Issue(s) fixed by this Pull Request

Resolves: #5471

### Notes to the Reviewer

I didn't add a test because it's a rather low level implementation
details about returning response stats vs not returning response stats.
I'm open to adding one though.

(cherry picked from commit b7a1d05)
kgeckhart added a commit to grafana/alloy that referenced this pull request Feb 12, 2026
…ort] (#5516)

## Backport of #5505

This PR backports #5505 to release/v1.13.

### Original PR Author
@kgeckhart

### Description
### Brief description of Pull Request

Bump to prometheus patch release to pull in the fix for
prometheus/prometheus#17659 which would impact
`prometheus.receive_http` which uses the upstream
`remote.NewWriteHandler` which was impacted by
prometheus/client_golang#1927.

### Issue(s) fixed by this Pull Request

Resolves: #5471

### Notes to the Reviewer

I didn't add a test because it's a rather low level implementation
details about returning response stats vs not returning response stats.
I'm open to adding one though.

---
*This backport was created automatically.*

Co-authored-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
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