From 5c6f83560d511295b948f38c7bff32923871fbc5 Mon Sep 17 00:00:00 2001 From: Niklas Johansson Date: Tue, 26 Nov 2024 19:11:29 +0100 Subject: [PATCH] fix: Add Content-Type to /metrics response When prometheus updates to v3, it is becoming stricter with the Content-Type of the response. https://prometheus.io/docs/prometheus/3.0/migration/#scrape-protocols ``` Prometheus v3 is more strict concerning the Content-Type header received when scraping. Prometheus v2 would default to the standard Prometheus text protocol if the target being scraped did not specify a Content-Type header or if the header was unparsable or unrecognised. This could lead to incorrect data being parsed in the scrape. Prometheus v3 will now fail the scrape in such cases. ``` The Content-Type is updated in dependency. So all we have to do is update the version. From the metrics/metrics-exporter-prometheus CHANGELOG.md: ``` - Update the `Content-Type` response header to `text/plain`, matching the Exposition format specification. ([#496](https://github.com/metrics-rs/metrics/pull/496)) ``` --- node/metrics/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/metrics/Cargo.toml b/node/metrics/Cargo.toml index a28273e589..54dbfc41b4 100644 --- a/node/metrics/Cargo.toml +++ b/node/metrics/Cargo.toml @@ -22,7 +22,7 @@ metrics = [ "snarkvm/metrics" ] serial = [ "snarkvm/metrics" ] [dependencies.metrics-exporter-prometheus] -version = "0.13" +version = "0.15" [dependencies.parking_lot] version = "0.12"