From 964d98f074dbd3a397df2f89f3727b82f55795bc Mon Sep 17 00:00:00 2001 From: Ivan Nikalaichanka Date: Mon, 17 Aug 2026 11:39:40 +0200 Subject: [PATCH 1/2] do not propagate app insights metrics --- datareservoirio/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datareservoirio/client.py b/datareservoirio/client.py index 92dfda54..a690dca5 100644 --- a/datareservoirio/client.py +++ b/datareservoirio/client.py @@ -39,6 +39,10 @@ def metric() -> logging.Logger: if os.getenv(ENV_VAR_ENABLE_APP_INSIGHTS) is not None: enable_app_insights = os.environ[ENV_VAR_ENABLE_APP_INSIGHTS].lower() if enable_app_insights == "true" or enable_app_insights == "1": + # prevent messages to be passed directly to the ancestor logger handler + # as neither the level nor filters of the ancestor loggers are considered + # https://docs.python.org/3.12/library/logging.html#logging.Logger.propagate + logger.propagate = False logger.setLevel(logging.DEBUG) _ensure_azure_monitor_configured( connection_string=environment._application_insight_connectionstring, From e55b92fa0d01b99faf305f0c10e4d8bea7f6d601 Mon Sep 17 00:00:00 2001 From: Ivan Nikalaichanka <102808281+ivan-nikalaichanka-4ss@users.noreply.github.com> Date: Mon, 17 Aug 2026 13:47:09 +0200 Subject: [PATCH 2/2] Apply Copilot grammar suggestions Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- datareservoirio/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datareservoirio/client.py b/datareservoirio/client.py index a690dca5..079d37f7 100644 --- a/datareservoirio/client.py +++ b/datareservoirio/client.py @@ -39,8 +39,8 @@ def metric() -> logging.Logger: if os.getenv(ENV_VAR_ENABLE_APP_INSIGHTS) is not None: enable_app_insights = os.environ[ENV_VAR_ENABLE_APP_INSIGHTS].lower() if enable_app_insights == "true" or enable_app_insights == "1": - # prevent messages to be passed directly to the ancestor logger handler - # as neither the level nor filters of the ancestor loggers are considered + # Prevent messages from being passed directly to ancestor logger handlers, + # since ancestor logger levels and filters are not considered during propagation. # https://docs.python.org/3.12/library/logging.html#logging.Logger.propagate logger.propagate = False logger.setLevel(logging.DEBUG)