PRW2: return 415 when prw2 is disabled#7238
Merged
yeya24 merged 5 commits intocortexproject:masterfrom Feb 1, 2026
Merged
Conversation
45e3122 to
01fa2c9
Compare
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
01fa2c9 to
dcbeb30
Compare
yeya24
requested changes
Jan 31, 2026
CHANGELOG.md
Outdated
| * [FEATURE] Distributor: Add a per-tenant flag `-distributor.enable-type-and-unit-labels` that enables adding `__unit__` and `__type__` labels for remote write v2 and OTLP requests. This is a breaking change; the `-distributor.otlp.enable-type-and-unit-labels` flag is now deprecated, operates as a no-op, and has been consolidated into this new flag. #7077 | ||
| * [FEATURE] Querier: Add experimental projection pushdown support in Parquet Queryable. #7152 | ||
| * [FEATURE] Ingester: Add experimental active series queried metric. #7173 | ||
| * [ENHANCEMENT] Distributor: If remote write v2 is disabled, explicitly return HTTP 415 (Unsupported Media Type) for Remote Write V2 requests instead of attempting to parse them as V1. #7238 |
pkg/util/push/push.go
Outdated
| handlePRW1() | ||
| case remote.WriteV2MessageType: | ||
| if !remoteWrite2Enabled { | ||
| http.Error(w, "Remote Write V2 is disabled", http.StatusUnsupportedMediaType) |
Contributor
There was a problem hiding this comment.
Can we have a better error message? Remote write v2 disabled seems not a good message and expose server side details.
https://github.com/prometheus/client_golang/blob/main/exp/api/remote/remote_api.go#L593
Can we follow similar error message here
Member
Author
|
@yeya24 |
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
13da9fb to
8e67879
Compare
|
Related Documentation No published documentation to review for changes on this repository. |
afhassan
pushed a commit
to afhassan/cortex
that referenced
this pull request
Feb 4, 2026
* return 415 when prw2 is disabled Signed-off-by: SungJin1212 <tjdwls1201@gmail.com> * go fmt Signed-off-by: SungJin1212 <tjdwls1201@gmail.com> * fix test Signed-off-by: SungJin1212 <tjdwls1201@gmail.com> * move changelog to bugfix Signed-off-by: SungJin1212 <tjdwls1201@gmail.com> * fix error message Signed-off-by: SungJin1212 <tjdwls1201@gmail.com> --------- Signed-off-by: SungJin1212 <tjdwls1201@gmail.com> Signed-off-by: Ahmed Hassan <afayekhassan@gmail.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes push handler behavior.
If remote write v2 is disabled, explicitly return HTTP 415 (Unsupported Media Type) for Remote Write V2 requests instead of attempting to parse them as V1.
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]