Skip to content

Make UUID generation lazy#2826

Closed
sl0thentr0py wants to merge 1 commit into
masterfrom
neel/uuid-lazy
Closed

Make UUID generation lazy#2826
sl0thentr0py wants to merge 1 commit into
masterfrom
neel/uuid-lazy

Conversation

@sl0thentr0py

@sl0thentr0py sl0thentr0py commented Mar 15, 2024

Copy link
Copy Markdown
Member

same as #2131

for #2827

@sl0thentr0py

Copy link
Copy Markdown
Member Author

note that we also have uuid generation on scope.propagation_context now and to make that lazy we first need to encapsulate propagation_context in a class and not just a raw dict as currently implemented.

def _create_new_propagation_context(self):
# type: () -> Dict[str, Any]
return {
"trace_id": uuid.uuid4().hex,
"span_id": uuid.uuid4().hex[16:],
"parent_span_id": None,
"dynamic_sampling_context": None,
}

Without also making those lazy, this will not really have a performance impact but we can merge it anyway.

@anonrig

anonrig commented Apr 10, 2024

Copy link
Copy Markdown

Is there a reason to not land this pull request right now?

@sl0thentr0py

Copy link
Copy Markdown
Member Author

we can merge but without the prop context changes it won't have full impact, and that might conflict with the v2 refactor, I will let @sentrivana and @antonpirker decide

@antonpirker

Copy link
Copy Markdown
Contributor

I will refactor the propagation context first and then merge this change

@antonpirker

Copy link
Copy Markdown
Contributor

This has found its way into the codebase with the refactoring of the propagation context: #2970

@antonpirker antonpirker closed this Jun 6, 2024
@sl0thentr0py
sl0thentr0py deleted the neel/uuid-lazy branch August 26, 2024 12:39
@filips123

Copy link
Copy Markdown

UUIDs in tracing.py are still always generated, as #2970 only made the generation lazy for propagation contexts. Is this intentional?

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.

4 participants