mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-26 06:46:27 +00:00
improve the prometheus content type we return
This commit is contained in:
@ -180,12 +180,6 @@ pub async fn get_metrics(
|
|||||||
|
|
||||||
let response = String::from_utf8(buffer).expect("Failed to convert bytes to string");
|
let response = String::from_utf8(buffer).expect("Failed to convert bytes to string");
|
||||||
|
|
||||||
// We cannot specify the version with ContentType(TEXT_PLAIN_UTF_8) so we have to write everything by hand :(
|
let content_type = ("content-type", prometheus::TEXT_FORMAT);
|
||||||
// see the following for what should be returned: https://prometheus.io/docs/instrumenting/content_negotiation/#content-type-response
|
Ok(HttpResponse::Ok().insert_header(content_type).body(response))
|
||||||
let content_type = ("content-type", "text/plain; version=0.0.4; charset=utf-8");
|
|
||||||
|
|
||||||
Ok(HttpResponse::Ok()
|
|
||||||
// .insert_header(header::ContentType(mime::TEXT_PLAIN_UTF_8))
|
|
||||||
.insert_header(content_type)
|
|
||||||
.body(response))
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user