Debug: append linebreak to metrics output, hardcode type

This commit is contained in:
Riordan Panayides 2022-10-06 02:48:07 +01:00
parent 4bd976df1b
commit a63e651863
1 changed files with 2 additions and 2 deletions

View File

@ -88,9 +88,9 @@ async fn handle_metrics(metrics: Metrics) -> Result<impl Reply, Rejection> {
let lines: Vec<String> = metrics
.get_registry_vec()
.iter()
.map(|(name, value)| format!("{}{{{}}} {}", name, label_strings_vec.join(","), value))
.map(|(name, value)| format!("# TYPE {} counter\n{}{{{}}} {}", name, name, label_strings_vec.join(","), value))
.collect();
Ok(lines.join("\n"))
Ok(format!("{}\n", lines.join("\n")))
}
pub fn with_metrics(