Skip to content

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

Avoid crashing telemetry handler for persistor on recv Finch errors (#5815)

Adrian Gruntkowski80244e5dadd7
diff --git a/lib/plausible/ingestion/persistor/telemetry_handler.ex b/lib/plausible/ingestion/persistor/telemetry_handler.ex
index c0567f5fa8..7d95c34973 100644
--- a/lib/plausible/ingestion/persistor/telemetry_handler.ex
+++ b/lib/plausible/ingestion/persistor/telemetry_handler.ex
@@ -131,10 +131,12 @@ defmodule Plausible.Ingestion.Persistor.TelemetryHandler do
def handle_event(
@finch_receive_event,
%{duration: duration},
- %{request: request, status: status} = meta,
+ %{request: request} = meta,
config
) do
if request.host == config.remote_host do
+ status = meta[:status] || 0
+
:telemetry.execute(
@persistor_receive_event,
%{duration: duration},