Skip to content

Conversation

@SungJin1212
Copy link
Member

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

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@dosubot dosubot bot added the type/bug label Jan 30, 2026
@SungJin1212 SungJin1212 force-pushed the return-415-when-prw2-disabled branch from 45e3122 to 01fa2c9 Compare January 30, 2026 08:01
@SungJin1212 SungJin1212 changed the title PRW2: return 415 when prw2 is didsabled PRW2: return 415 when prw2 is disabled Jan 30, 2026
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212 SungJin1212 force-pushed the return-415-when-prw2-disabled branch from 01fa2c9 to dcbeb30 Compare January 30, 2026 09:28
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
* [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
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be bugfix?

handlePRW1()
case remote.WriteV2MessageType:
if !remoteWrite2Enabled {
http.Error(w, "Remote Write V2 is disabled", http.StatusUnsupportedMediaType)
Copy link
Contributor

Choose a reason for hiding this comment

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

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants