sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

High CPU usage because of a uuid4 call

Open debugger22 opened this issue 11 months ago • 1 comments

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.19.2

Steps to Reproduce

https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/tracing.py#L290

My APM is reporting high cou usage from the above line.

My sentry init -

sentry_sdk.init(
    dsn=config.SENTRY_URL,
    integrations=[DjangoIntegration(), CeleryIntegration()],
    send_default_pii=True,
    enable_tracing=False,
    environment=ENV,
    max_request_body_size="always",
    server_name=os.environ.get("CONTAINER_NAME", socket.getfqdn()),
)

Expected Result

The overhead should be very little.

Actual Result

Image

debugger22 avatar Jan 09 '25 11:01 debugger22

Hey @debugger22 thanks for writing in.

There was a PR that addressed a similar problem but it was not merged because we thought it was fixed with another PR.

So maybe it is time to reopen this PR.

antonpirker avatar Jan 13 '25 10:01 antonpirker