Skip to content

Commit 3935366

Browse files
authored
End Prometheus stats with a new line separator (#826)
End prometheus stats with a new line separator According to the [OpenMetrics specification](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#overall-structure), each line MUST end with `\n`. Previously, the last line was not ending with `\n`, so that strict parsers had issues reading the Prometheus stats.
1 parent b575935 commit 3935366

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/prometheus.rs

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ async fn prometheus_stats(
309309
push_pool_stats(&mut lines);
310310
push_server_stats(&mut lines);
311311
push_database_stats(&mut lines);
312+
lines.push("".to_string()); // Ensure to end the stats with a line terminator as required by the specification.
312313

313314
Response::builder()
314315
.header("content-type", "text/plain; version=0.0.4")

0 commit comments

Comments
 (0)