-
Notifications
You must be signed in to change notification settings - Fork 554
Closed
Labels
Component: SDK CoreDealing with the core of the SDKDealing with the core of the SDK
Description
We want to lazily create UUIDs to decrease the number of CPU cycles we use.
There are two important places where UUIDs are created:
- Span/Transaction creation: https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/tracing.py#L145-L146
- When a propagation context is created: https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/scope.py#L225-L232
- When creating a Profile: https://github.com/getsentry/sentry-python/blob/sentry-sdk-2.0/sentry_sdk/profiler.py#L455
- When creating a Session: https://github.com/getsentry/sentry-python/blob/sentry-sdk-2.0/sentry_sdk/session.py#L49
Solution brainstorm
- There is a PR that already started the work: Make UUID generation lazy #2826
This already fixes point 1. from above. - For point 2. we need to create a class
PropagationContext
and create the uuid4 only when thetrace_id
or thespan_id
is read. - Implement similar to 1.
- Implement similar to 1.
Metadata
Metadata
Assignees
Labels
Component: SDK CoreDealing with the core of the SDKDealing with the core of the SDK