mirror of
https://github.com/XRPLF/clio.git
synced 2026-07-27 17:10:30 +00:00
Add compression and histogram metric type for Prometheus (#987)
Fixes #932 Also fixes #966 Decided not to add Summary type because it has the same functionality as Histogram but makes more calculations on client side (Clio side). See https://prometheus.io/docs/practices/histograms for detailed comparison.
This commit is contained in:
@@ -54,8 +54,14 @@ handlePrometheusRequest(http::request<http::string_body> const& req, bool const
|
||||
}
|
||||
|
||||
auto response = http::response<http::string_body>(http::status::ok, req.version());
|
||||
|
||||
response.set(http::field::content_type, "text/plain; version=0.0.4");
|
||||
response.body() = PrometheusService::collectMetrics(); // TODO(#932): add gzip compression
|
||||
|
||||
response.body() = PrometheusService::collectMetrics();
|
||||
|
||||
if (PrometheusService::compressReplyEnabled())
|
||||
response.set(http::field::content_encoding, "gzip");
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user