Skip to content

Commit

Permalink
Merge branch 'master' into openai
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-sentry committed Mar 7, 2024
2 parents 39cc004 + 1b0e932 commit d9a6557
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 12 deletions.
52 changes: 52 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,57 @@
# Changelog

## 1.41.0

### Various fixes & improvements

- Add recursive scrubbing to `EventScrubber` (#2755) by @Cheapshot003

By default, the `EventScrubber` will not search your events for potential
PII recursively. With this release, you can enable this behavior with:

```python
import sentry_sdk
from sentry_sdk.scrubber import EventScrubber

sentry_sdk.init(
# ...your usual settings...
event_scrubber=EventScrubber(recursive=True),
)
```

- Expose `socket_options` (#2786) by @sentrivana

If the SDK is experiencing connection issues (connection resets, server
closing connection without response, etc.) while sending events to Sentry,
tweaking the default `urllib3` socket options to the following can help:

```python
import socket
from urllib3.connection import HTTPConnection
import sentry_sdk

sentry_sdk.init(
# ...your usual settings...
socket_options=HTTPConnection.default_socket_options + [
(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
# note: skip the following line if you're on MacOS since TCP_KEEPIDLE doesn't exist there
(socket.SOL_TCP, socket.TCP_KEEPIDLE, 45),
(socket.SOL_TCP, socket.TCP_KEEPINTVL, 10),
(socket.SOL_TCP, socket.TCP_KEEPCNT, 6),
],
)
```

- Allow to configure merge target for releases (#2777) by @sentrivana
- Allow empty character in metric tags values (#2775) by @viglia
- Replace invalid tag values with an empty string instead of _ (#2773) by @markushi
- Add documentation comment to `scrub_list` (#2769) by @szokeasaurusrex
- Fixed regex to parse version in lambda package file (#2767) by @antonpirker
- xfail broken AWS Lambda tests for now (#2794) by @sentrivana
- Removed print statements because it messes with the tests (#2789) by @antonpirker
- Bump `types-protobuf` from 4.24.0.20240129 to 4.24.0.20240302 (#2782) by @dependabot
- Bump `checkouts/data-schemas` from `eb941c2` to `ed078ed` (#2781) by @dependabot

## 1.40.6

### Various fixes & improvements
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -30,7 +30,7 @@
copyright = "2019-{}, Sentry Team and Contributors".format(datetime.now().year)
author = "Sentry Team and Contributors"

release = "1.40.6"
release = "1.41.0"
version = ".".join(release.split(".")[:2]) # The short X.Y version.


Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/consts.py
Expand Up @@ -320,4 +320,4 @@ def _get_default_options():
del _get_default_options


VERSION = "1.40.6"
VERSION = "1.41.0"
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -21,7 +21,7 @@ def get_file_text(file_name):

setup(
name="sentry-sdk",
version="1.40.6",
version="1.41.0",
author="Sentry Team and Contributors",
author_email="hello@sentry.io",
url="https://github.com/getsentry/sentry-python",
Expand Down
12 changes: 3 additions & 9 deletions tests/integrations/aws_lambda/client.py
Expand Up @@ -240,7 +240,7 @@ def run_lambda_function(
FunctionName=full_fn_name,
)
print(
f"Lambda function {full_fn_name} in AWS already existing, taking it (and do not create a local one)"
"Lambda function in AWS already existing, taking it (and do not create a local one)"
)
except client.exceptions.ResourceNotFoundException:
function_exists_in_aws = False
Expand All @@ -251,14 +251,9 @@ def run_lambda_function(
dir_already_existing = os.path.isdir(base_dir)

if dir_already_existing:
print(
f"Local Lambda function directory ({base_dir}) already exists, skipping creation"
)
print("Local Lambda function directory already exists, skipping creation")

if not dir_already_existing:
print(
f"Creating Lambda function package ({full_fn_name}) locally in directory {base_dir}"
)
os.mkdir(base_dir)
_create_lambda_package(
base_dir, code, initial_handler, layer, syntax_check, subprocess_kwargs
Expand Down Expand Up @@ -321,10 +316,9 @@ def clean_up():

waiter = client.get_waiter("function_active_v2")
waiter.wait(FunctionName=full_fn_name)
print(f"Created Lambda function in AWS: {full_fn_name}")
except client.exceptions.ResourceConflictException:
print(
f"Lambda function ({full_fn_name}) already existing in AWS, this is fine, we will just invoke it."
"Lambda function already exists, this is fine, we will just invoke it."
)

response = client.invoke(
Expand Down
9 changes: 9 additions & 0 deletions tests/integrations/aws_lambda/test_aws.py
Expand Up @@ -661,6 +661,9 @@ def test_handler(event, context):
assert response["Payload"]["AssertionError raised"] is False


@pytest.mark.xfail(
reason="The limited log output we depend on is being clogged by a new warning"
)
def test_serverless_no_code_instrumentation(run_lambda_function):
"""
Test that ensures that just by adding a lambda layer containing the
Expand Down Expand Up @@ -705,6 +708,9 @@ def test_handler(event, context):
assert "sentry_handler" in response["LogResult"][3].decode("utf-8")


@pytest.mark.xfail(
reason="The limited log output we depend on is being clogged by a new warning"
)
def test_error_has_new_trace_context_performance_enabled(run_lambda_function):
envelopes, _, _ = run_lambda_function(
LAMBDA_PRELUDE
Expand Down Expand Up @@ -767,6 +773,9 @@ def test_handler(event, context):
)


@pytest.mark.xfail(
reason="The limited log output we depend on is being clogged by a new warning"
)
def test_error_has_existing_trace_context_performance_enabled(run_lambda_function):
trace_id = "471a43a4192642f0b136d5159a501701"
parent_span_id = "6e8f22c393e68f19"
Expand Down

0 comments on commit d9a6557

Please sign in to comment.