Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Handle case of empty metrics (#6050)

Adrian Gruntkowski533649c9d7d3
diff --git a/lib/plausible/prom_ex/striped_peep.ex b/lib/plausible/prom_ex/striped_peep.ex
index 7baae9b1a3..613c09ec0e 100644
--- a/lib/plausible/prom_ex/striped_peep.ex
+++ b/lib/plausible/prom_ex/striped_peep.ex
@@ -7,7 +7,7 @@ defmodule Plausible.PromEx.StripedPeep do
@impl true
def scrape(name) do
- Peep.get_all_metrics(name)
+ (Peep.get_all_metrics(name) || [])
|> Peep.Prometheus.export()
|> IO.iodata_to_binary()
end