You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rw2.0): reject remote write 2.0 based on content type (#10423)
* fix(rw2.0): reject remote write 2.0 based on content type
The current solution returns 2xx , but doesn't actually ingest the samples.
Prometheus does detect this
prometheus-1 | time=2025-01-13T13:01:35.028Z level=ERROR
source=queue_manager.go:1670 msg="non-recoverable error"
component=remote remote_name=150c10
url=http://mimir-1:8001/api/v1/push failedSampleCount=2000
failedHistogramCount=0 failedExemplarCount=0
err="sent v2 request with 2000 samples, 0 histograms and 0 exemplars;
got 2xx, but PRW 2.0 response header statistics indicate 0 samples,
0 histograms and 0 exemplars were accepted; assumining failure e.g.
the target only supports PRW 1.0 prometheus.WriteRequest, but does not
check the Content-Type header correctly"
But we can do better and also start working towards RW2.0 support.
* update changelog
* Copy integration test from POC
From #10432
Signed-off-by: György Krajcsovits <[email protected]>
returnfalse, fmt.Errorf("as per https://www.rfc-editor.org/rfc/rfc9110#parameter expected parameters to be key-values, got %v in %v content-type", p, contentType)
262
+
}
263
+
ifpair[0] =="proto" {
264
+
switchpair[1] {
265
+
case"prometheus.WriteRequest":
266
+
returnfalse, nil
267
+
case"io.prometheus.write.v2.Request":
268
+
returntrue, nil
269
+
default:
270
+
returnfalse, fmt.Errorf("got %v content type; expected prometheus.WriteRequest or io.prometheus.write.v2.Request", contentType)
0 commit comments