From fc63a4faaf6b556823e774e11972c66d03d9f2bb Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 8 Mar 2026 16:39:26 -0500 Subject: [PATCH] fix: properly disable Plug.Telemetry logging for health checks Set conn.private.log to false to prevent Plug.Telemetry from logging health check requests in addition to phoenix_log and plug_skip_telemetry. --- lib/towerops_web/plugs/filter_noisy_logs.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/towerops_web/plugs/filter_noisy_logs.ex b/lib/towerops_web/plugs/filter_noisy_logs.ex index 39756aa3..090a7ca8 100644 --- a/lib/towerops_web/plugs/filter_noisy_logs.ex +++ b/lib/towerops_web/plugs/filter_noisy_logs.ex @@ -19,9 +19,11 @@ defmodule ToweropsWeb.Plugs.FilterNoisyLogs do def call(conn, _opts) do if should_filter?(conn) do # Setting phoenix_log to false prevents Phoenix.Logger from logging this request - # Also disable telemetry logging + # Setting log to false prevents Plug.Telemetry from logging + # Setting plug_skip_telemetry skips telemetry events entirely conn |> put_private(:phoenix_log, false) + |> put_private(:log, false) |> put_private(:plug_skip_telemetry, true) else conn