From 6b2aa1bbddda12eb9410f1509936236bb961b760 Mon Sep 17 00:00:00 2001 From: Ali Ahmad Date: Mon, 27 Jul 2026 12:03:18 +0200 Subject: [PATCH 1/4] Bug fix for sending telemetry to Application Insights --- datareservoirio/_logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datareservoirio/_logging.py b/datareservoirio/_logging.py index ac5fb023..9d59c608 100644 --- a/datareservoirio/_logging.py +++ b/datareservoirio/_logging.py @@ -37,7 +37,7 @@ def get_exceptions_logger() -> logging.Logger: if enable_app_insights == "true" or enable_app_insights == "1": _ensure_azure_monitor_configured( connection_string=environment._application_insight_connectionstring, - logger_name=__name__ + "_exceptions_logger", + logger_name=__name__ + "_exception_logger", ) exceptions_logger.setLevel("WARNING") From 974446a1db737bba27b5a531bf8ced758b8e181d Mon Sep 17 00:00:00 2001 From: Ali Ahmad Date: Mon, 27 Jul 2026 12:55:28 +0200 Subject: [PATCH 2/4] The azure monitor opentelemetry exporter add the argument in "extra" to custom dimentions automatically. There is no need to provide a dictionary with the keyword "customDimentions". --- datareservoirio/_logging.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/datareservoirio/_logging.py b/datareservoirio/_logging.py index 9d59c608..cc90fe2a 100644 --- a/datareservoirio/_logging.py +++ b/datareservoirio/_logging.py @@ -52,12 +52,10 @@ def wrapper(self, *args, **kwargs): return func(self, *args, **kwargs) except Exception as e: properties = { - "customDimensions": { - "drioPackage": f"python-datareservoirio/{drio.__version__}", - } + "drioPackage": f"python-datareservoirio/{drio.__version__}", } if os.getenv(ENV_VAR_ENGINE_ROOM_APP_ID) is not None: - properties["customDimensions"]["engineRoomAppId"] = os.getenv( + properties["engineRoomAppId"] = os.getenv( ENV_VAR_ENGINE_ROOM_APP_ID ) From b2bef2657195203d008eac39979f42f6037a4123 Mon Sep 17 00:00:00 2001 From: Ali Ahmad Date: Mon, 27 Jul 2026 12:57:31 +0200 Subject: [PATCH 3/4] Fixed unittests --- tests/test__logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test__logging.py b/tests/test__logging.py index 15e85ce1..e9abd58b 100644 --- a/tests/test__logging.py +++ b/tests/test__logging.py @@ -37,7 +37,7 @@ def change_logging(self, msg, *args, exc_info=True, **kwargs): if kwargs["extra"]: self.logging_as_exception = True if os.getenv("ENGINE_ROOM_APP_ID") is not None: - self.engine_room_app_id = kwargs["extra"]["customDimensions"][ + self.engine_room_app_id = kwargs["extra"][ "engineRoomAppId" ] else: From d5bd2f74e08d67876414b65fc20b215161085d35 Mon Sep 17 00:00:00 2001 From: Ali Ahmad Date: Tue, 28 Jul 2026 14:37:41 +0200 Subject: [PATCH 4/4] fixed code style --- tests/test__logging.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test__logging.py b/tests/test__logging.py index e9abd58b..2783f2dc 100644 --- a/tests/test__logging.py +++ b/tests/test__logging.py @@ -37,9 +37,7 @@ def change_logging(self, msg, *args, exc_info=True, **kwargs): if kwargs["extra"]: self.logging_as_exception = True if os.getenv("ENGINE_ROOM_APP_ID") is not None: - self.engine_room_app_id = kwargs["extra"][ - "engineRoomAppId" - ] + self.engine_room_app_id = kwargs["extra"]["engineRoomAppId"] else: raise ValueError("Missing extra parameters")