From a6df71eebb6fcb29460b510315048cea4cb32f07 Mon Sep 17 00:00:00 2001 From: Oneric Date: Sat, 3 Feb 2024 17:30:00 +0100 Subject: [PATCH] Don't add summary metrics to prometheus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The exporter doesn’t support them thus we don't lose anything by this, but it avoids a bunch of warnings each time the server starts up. --- lib/pleroma/web/telemetry.ex | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/telemetry.ex b/lib/pleroma/web/telemetry.ex index b03850600..eecaffe88 100644 --- a/lib/pleroma/web/telemetry.ex +++ b/lib/pleroma/web/telemetry.ex @@ -101,6 +101,7 @@ defp distribution_metrics do ] end + # Summary metrics are currently not (yet) supported by the prometheus exporter defp summary_metrics do [ # Phoenix Metrics @@ -121,7 +122,12 @@ defp summary_metrics do summary("vm.memory.total", unit: {:byte, :kilobyte}), summary("vm.total_run_queue_lengths.total"), summary("vm.total_run_queue_lengths.cpu"), - summary("vm.total_run_queue_lengths.io"), + summary("vm.total_run_queue_lengths.io") + ] + end + + defp common_metrics do + [ last_value("pleroma.local_users.total"), last_value("pleroma.domains.total"), last_value("pleroma.local_statuses.total"), @@ -129,8 +135,8 @@ defp summary_metrics do ] end - def prometheus_metrics, do: summary_metrics() ++ distribution_metrics() - def live_dashboard_metrics, do: summary_metrics() + def prometheus_metrics, do: common_metrics() ++ distribution_metrics() + def live_dashboard_metrics, do: common_metrics() ++ summary_metrics() defp periodic_measurements do [