In the recent version of Prometheus (since v2.54.0), write requests fail with a 415 HTTP status code (Unsupported Media Type) and the error message:
expected application/x-protobuf as the first (media) part, got application/vnd.google.protobuf content-type.
As observed in write_handler.go:81, the Content-Type header is validated against application/x-protobuf, which is different from the default header application/vnd.google.protobuf used in the prometheus-remote-write library.
Quick Fix:
Add the Content-Type header to the config object as follows:
Yeah, it seems like 'application/vnd.google.protobuf' is a legacy thing, even 1.0 older spec requires 'application/x-protobuf' content type. I am glad there no other changes needed...
In the recent version of Prometheus (since v2.54.0), write requests fail with a 415 HTTP status code (Unsupported Media Type) and the error message:
expected application/x-protobuf as the first (media) part, got application/vnd.google.protobuf content-type
.As observed in write_handler.go:81, the Content-Type header is validated against
application/x-protobuf
, which is different from the default headerapplication/vnd.google.protobuf
used in the prometheus-remote-write library.Quick Fix: Add the Content-Type header to the config object as follows:
Suggested Solution: Change the default content type in remote write requests to application/x-protobuf.