From 61ce601d1997de7d5668107ae928fa844020ba34 Mon Sep 17 00:00:00 2001 From: Lukas Juozas Janusaitis <74900682+LukoJy3D@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:02:09 +0700 Subject: [PATCH] docs(exposition): clarify required Content-type header for scrapes (#2772) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukas Juozas JanuĊĦaitis --- docs/instrumenting/exposition_formats.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/instrumenting/exposition_formats.md b/docs/instrumenting/exposition_formats.md index 2db8ae99..4084e574 100644 --- a/docs/instrumenting/exposition_formats.md +++ b/docs/instrumenting/exposition_formats.md @@ -167,6 +167,18 @@ When such features are enabled either by feature flag appropriate configuration option (`scrape_native_histograms: true`) then Protobuf will be favored over other exposition formats. +## HTTP Content-Type requirements + +Starting with Prometheus 3.0, scrape targets **must** return a valid `Content-Type` header for the metrics endpoint. If the `Content-Type` is missing, unparsable, or not a supported media type, **the scrape will fail**. See changes in [scrape protocols](https://prometheus.io/docs/prometheus/latest/migration/#scrape-protocols) in the migration guide for details. + +See each of the exposition format sections for the accurate HTTP content types. + +### ScrapeProtocols vs Content-Type + +Prometheus scrape config offers scrape protocol negotiation based on the content-type using the [`scrape_protocols`](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config) config. For the Prometheus user convenience the scrape protocols are referenced by a unique name that maps to the concrete content-type. See [Protocol Headers](./content_negotiation.md#protocol-headers) for details. + +However, the targets should expose metrics in the exposition format with the absolute, response content-type (e.g. `application/openmetrics-text;version=1.0.0`) and only one. + ## Historical versions For details on historical format versions, see the legacy