Skip to content

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

log failed request bodies on browserless failures (#5776)

RobertJoonas36ced7cbe0ff
diff --git a/extra/lib/plausible/installation_support/checks/detection.ex b/extra/lib/plausible/installation_support/checks/detection.ex
index 88ca02adaa..f76a89760e 100644
--- a/extra/lib/plausible/installation_support/checks/detection.ex
+++ b/extra/lib/plausible/installation_support/checks/detection.ex
@@ -121,9 +121,11 @@ defmodule Plausible.InstallationSupport.Checks.Detection do
end
end
- defp handle_browserless_response(state, _body, status) do
+ defp handle_browserless_response(state, body, status) do
error = "Unhandled browserless response with status: #{status}"
- Logger.warning(warning_message(error, state))
+
+ warning_message("#{error}; body: #{inspect(body)}", state)
+ |> Logger.warning()
put_diagnostics(state, service_error: error)
end
diff --git a/extra/lib/plausible/installation_support/checks/installation_v2.ex b/extra/lib/plausible/installation_support/checks/installation_v2.ex
index 5ef1509bc6..004e366895 100644
--- a/extra/lib/plausible/installation_support/checks/installation_v2.ex
+++ b/extra/lib/plausible/installation_support/checks/installation_v2.ex
@@ -146,9 +146,11 @@ defmodule Plausible.InstallationSupport.Checks.InstallationV2 do
end
end
- defp handle_browserless_response(state, _body, status) do
+ defp handle_browserless_response(state, body, status) do
error = "Unhandled browserless response with status: #{status}"
- Logger.warning(warning_message(error, state))
+
+ warning_message("#{error}; body: #{inspect(body)}", state)
+ |> Logger.warning()
put_diagnostics(state, service_error: error)
end