From f948856303c48a090a2a58709f342f889ca6b8bb Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Mon, 17 Nov 2025 10:48:00 +0100 Subject: [PATCH] fix(logs): Update sentry.origin --- sentry_sdk/integrations/logging.py | 2 +- sentry_sdk/integrations/loguru.py | 2 +- tests/integrations/logging/test_logging.py | 6 +++--- tests/integrations/loguru/test_loguru.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sentry_sdk/integrations/logging.py b/sentry_sdk/integrations/logging.py index 7e16943b28..9c68596be8 100644 --- a/sentry_sdk/integrations/logging.py +++ b/sentry_sdk/integrations/logging.py @@ -358,7 +358,7 @@ def _capture_log_from_record(self, client, record): project_root = client.options["project_root"] attrs = self._extra_from_record(record) # type: Any - attrs["sentry.origin"] = "auto.logger.log" + attrs["sentry.origin"] = "auto.log.stdlib" parameters_set = False if record.args is not None: diff --git a/sentry_sdk/integrations/loguru.py b/sentry_sdk/integrations/loguru.py index aedd393b6f..96d2b6a7ae 100644 --- a/sentry_sdk/integrations/loguru.py +++ b/sentry_sdk/integrations/loguru.py @@ -167,7 +167,7 @@ def loguru_sentry_logs_handler(message): record["level"].no, SEVERITY_TO_OTEL_SEVERITY ) - attrs = {"sentry.origin": "auto.logger.loguru"} # type: dict[str, Any] + attrs = {"sentry.origin": "auto.log.loguru"} # type: dict[str, Any] project_root = client.options["project_root"] if record.get("file"): diff --git a/tests/integrations/logging/test_logging.py b/tests/integrations/logging/test_logging.py index 121025bbb6..e7849253d6 100644 --- a/tests/integrations/logging/test_logging.py +++ b/tests/integrations/logging/test_logging.py @@ -320,7 +320,7 @@ def test_sentry_logs_warning(sentry_init, capture_envelopes): assert attrs["sentry.environment"] == "production" assert attrs["sentry.message.parameter.0"] == "1" assert attrs["sentry.message.parameter.1"] == "2" - assert attrs["sentry.origin"] == "auto.logger.log" + assert attrs["sentry.origin"] == "auto.log.stdlib" assert logs[0]["severity_number"] == 13 assert logs[0]["severity_text"] == "warn" @@ -488,7 +488,7 @@ def test_logger_with_all_attributes(sentry_init, capture_envelopes): "numeric": 42, "more_complex": "{'nested': 'data'}", "logger.name": "test-logger", - "sentry.origin": "auto.logger.log", + "sentry.origin": "auto.log.stdlib", "sentry.message.template": "log #%d", "sentry.message.parameter.0": 1, "sentry.environment": "production", @@ -538,7 +538,7 @@ def test_sentry_logs_named_parameters(sentry_init, capture_envelopes): # Check other standard attributes assert attrs["logger.name"] == "test-logger" - assert attrs["sentry.origin"] == "auto.logger.log" + assert attrs["sentry.origin"] == "auto.log.stdlib" assert logs[0]["severity_number"] == 9 # info level assert logs[0]["severity_text"] == "info" diff --git a/tests/integrations/loguru/test_loguru.py b/tests/integrations/loguru/test_loguru.py index 2414f57958..ed7650700f 100644 --- a/tests/integrations/loguru/test_loguru.py +++ b/tests/integrations/loguru/test_loguru.py @@ -154,7 +154,7 @@ def test_sentry_logs_warning( assert "code.line.number" in attrs assert attrs["logger.name"] == "tests.integrations.loguru.test_loguru" assert attrs["sentry.environment"] == "production" - assert attrs["sentry.origin"] == "auto.logger.loguru" + assert attrs["sentry.origin"] == "auto.log.loguru" assert logs[0]["severity_number"] == 13 assert logs[0]["severity_text"] == "warn" @@ -465,7 +465,7 @@ def test_logger_with_all_attributes( # Assert on the remaining non-dynamic attributes. assert attributes == { "logger.name": "tests.integrations.loguru.test_loguru", - "sentry.origin": "auto.logger.loguru", + "sentry.origin": "auto.log.loguru", "sentry.environment": "production", "sentry.sdk.version": VERSION, "sentry.severity_number": 13,