Skip to content

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Aug 6, 2025

Removing some papercuts:

  • don't guess ASGI version everytime the middleware is initialized if we already know
  • remove debug logs (they're bad in async code)
  • use .copy() instead of copying stuff via constructor (e.g. dict(old_old))
  • make UUID generation lazier

Ref #4660
Closes #3908

Copy link

codecov bot commented Aug 6, 2025

⚠️ Unsupported file format

Upload processing failed due to unsupported file format. Please review the parser error message:
Error parsing JUnit XML in /__w/sentry-python/sentry-python/.junitxml at 1:1128

Caused by:
RuntimeError: Error parsing XML

Caused by:
    0: ill-formed document: close tag `</skipped>` does not match any open tag
    1: close tag `&lt;/skipped&gt;` does not match any open tag</code></pre>

For more help, visit our troubleshooting guide.

@sentrivana sentrivana force-pushed the ivana/random-perf-improvements branch from 443ce19 to 24cddf2 Compare August 11, 2025 12:53
@@ -1858,6 +1858,7 @@ def is_module_patched(mod_name):
return False


@lru_cache(maxsize=1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

til, didn't know you could do this :)

antonpirker and others added 6 commits August 12, 2025 09:11
Update the `@trace` decorator and make it more powerful. It accepts now
the following parameters: `op`, `name`, `attributes`.

Example usage:
```python
import sentry_sdk
from sentry_sdk.consts import OP

# Simple usage (like before)
@sentry_sdk.trace
def process_data():
    # Function implementation
    pass

# With custom parameters
@sentry_sdk.trace(
    op=OP.DB_QUERY,
    name="Get user data",
    attributes={"postgres": True}
)
def make_db_query(sql):
    # Function implementation
    pass
```

This creates better DX for our users.

---------

Co-authored-by: Daniel Szoke <[email protected]>
Explicitly list the `send_data` parameters in the wrapped function. The
parameters are coming from
[here](https://github.com/mymarilyn/clickhouse-driver/blob/8a4e7c5b99b532df2b015651d893a6f36288a22c/clickhouse_driver/client.py#L634).
Continue also providing `*args` and `**kwargs`, but only for
forwards-compatibility.

<!-- Describe your PR here -->

---

Thank you for contributing to `sentry-python`! Please add tests to
validate your changes, and lint your code using `tox -e linters`.

Running the test suite on your PR might require maintainer approval.
Currently, the Clickhouse integration consumes any data passed as a
generator when reading it for insertion as `db_params`. Instead, since
generators cannot be cloned, we need to wrap the generator to add the
params as we iterate over it.

Fixes #4657

<!-- Describe your PR here -->

---

Thank you for contributing to `sentry-python`! Please add tests to
validate your changes, and lint your code using `tox -e linters`.

Running the test suite on your PR might require maintainer approval.
…stead of `ai.*` (#4674)

Update `AnthropicIntegration` to support Otel and Sentry AI Agents
module compatible span attributes of `gen_ai.*` family.

Closes
https://linear.app/getsentry/issue/TET-996/improve-integration-for-anthropic-sdk

---------

Co-authored-by: Anton Pirker <[email protected]>
A debug message to see what check-ins are send including the
`monitor_slug` and the check-in `status`.

---------

Co-authored-by: Daniel Szoke <[email protected]>
@sentrivana sentrivana force-pushed the ivana/random-perf-improvements branch from ef10912 to dd323d6 Compare August 12, 2025 07:12
@sentrivana sentrivana changed the title Improve ASGI performance Remove performance papercuts Aug 12, 2025
@sentrivana sentrivana marked this pull request as ready for review August 12, 2025 11:46
@sentrivana sentrivana requested a review from a team as a code owner August 12, 2025 11:46
cursor[bot]

This comment was marked as outdated.

@sentrivana sentrivana enabled auto-merge (squash) August 12, 2025 14:36
cursor[bot]

This comment was marked as outdated.

@sentrivana sentrivana disabled auto-merge August 12, 2025 14:42
@sentrivana sentrivana enabled auto-merge (squash) August 12, 2025 14:44
@sentrivana sentrivana merged commit 46eb82c into master Aug 12, 2025
138 checks passed
@sentrivana sentrivana deleted the ivana/random-perf-improvements branch August 12, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

High CPU usage because of a uuid4 call
5 participants