From babe8fb98cc44ce51919738ee0c047b2bc95ee11 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 13 May 2025 11:21:47 +0200 Subject: [PATCH 1/8] fix(typing): Add before_send_log to Experiments --- sentry_sdk/consts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index 2ceec2738b..02b918d232 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -1,5 +1,4 @@ import itertools - from enum import Enum from typing import TYPE_CHECKING @@ -79,6 +78,7 @@ class CompressionAlgo(Enum): ], "metric_code_locations": Optional[bool], "enable_logs": Optional[bool], + "before_send_log": Optional[Callable], }, total=False, ) From 4fb2320fdf8e3e13b184addead6c3d10afb28e87 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 13 May 2025 11:25:22 +0200 Subject: [PATCH 2/8] add arg types --- sentry_sdk/consts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index 02b918d232..3b547e319f 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -2,6 +2,8 @@ from enum import Enum from typing import TYPE_CHECKING +from sentry_sdk._types import Log + # up top to prevent circular import due to integration import DEFAULT_MAX_VALUE_LENGTH = 1024 @@ -78,7 +80,7 @@ class CompressionAlgo(Enum): ], "metric_code_locations": Optional[bool], "enable_logs": Optional[bool], - "before_send_log": Optional[Callable], + "before_send_log": Optional[Callable[[Log], Optional[Log]]], }, total=False, ) From eee2189b12432d386d49078927df6ffb196abe1f Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 13 May 2025 11:28:12 +0200 Subject: [PATCH 3/8] circ import --- sentry_sdk/consts.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index 3b547e319f..68fc44040e 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -2,8 +2,6 @@ from enum import Enum from typing import TYPE_CHECKING -from sentry_sdk._types import Log - # up top to prevent circular import due to integration import DEFAULT_MAX_VALUE_LENGTH = 1024 @@ -48,6 +46,7 @@ class CompressionAlgo(Enum): Event, EventProcessor, Hint, + Log, MeasurementUnit, ProfilerMode, TracesSampler, From f0315f46d789a5bb383b1ed8531b96691f7f6fdf Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 13 May 2025 13:12:02 +0200 Subject: [PATCH 4/8] Update sentry_sdk/consts.py Co-authored-by: Lorenzo Cian --- sentry_sdk/consts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index 68fc44040e..344142a105 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -79,7 +79,7 @@ class CompressionAlgo(Enum): ], "metric_code_locations": Optional[bool], "enable_logs": Optional[bool], - "before_send_log": Optional[Callable[[Log], Optional[Log]]], + "before_send_log": Optional[Callable[[Log, Hint], Optional[Log]]] }, total=False, ) From d9645d55551593ff13e7dffc50f1ff7d360e35ac Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 13 May 2025 14:04:29 +0200 Subject: [PATCH 5/8] add trailing comma --- sentry_sdk/consts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index 344142a105..30461b4524 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -79,7 +79,7 @@ class CompressionAlgo(Enum): ], "metric_code_locations": Optional[bool], "enable_logs": Optional[bool], - "before_send_log": Optional[Callable[[Log, Hint], Optional[Log]]] + "before_send_log": Optional[Callable[[Log, Hint], Optional[Log]]], }, total=False, ) From b410480c057220a3e1777f46d9c54956a1857016 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 13 May 2025 14:17:51 +0200 Subject: [PATCH 6/8] playing around --- tests/integrations/aws_lambda/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrations/aws_lambda/utils.py b/tests/integrations/aws_lambda/utils.py index d20c9352e7..9c95bcb55a 100644 --- a/tests/integrations/aws_lambda/utils.py +++ b/tests/integrations/aws_lambda/utils.py @@ -239,7 +239,7 @@ class SentryServerForTesting: A simple Sentry.io style server that accepts envelopes and stores them in a list. """ - def __init__(self, host="0.0.0.0", port=9999, log_level="warning"): + def __init__(self, host="127.0.0.1", port=9999, log_level="warning"): self.envelopes = [] self.host = host self.port = port From f6573995ba0de94839124b3cd22f1a9b6d6db37b Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 13 May 2025 14:18:07 +0200 Subject: [PATCH 7/8] Revert "playing around" This reverts commit b410480c057220a3e1777f46d9c54956a1857016. --- tests/integrations/aws_lambda/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrations/aws_lambda/utils.py b/tests/integrations/aws_lambda/utils.py index 9c95bcb55a..d20c9352e7 100644 --- a/tests/integrations/aws_lambda/utils.py +++ b/tests/integrations/aws_lambda/utils.py @@ -239,7 +239,7 @@ class SentryServerForTesting: A simple Sentry.io style server that accepts envelopes and stores them in a list. """ - def __init__(self, host="127.0.0.1", port=9999, log_level="warning"): + def __init__(self, host="0.0.0.0", port=9999, log_level="warning"): self.envelopes = [] self.host = host self.port = port From eb1f6260ad40ecb938d2c66a0ec44f08f0c3e996 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Thu, 15 May 2025 11:33:02 +0200 Subject: [PATCH 8/8] .