Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run context customizers before span start instead of after #6634

Merged
merged 4 commits into from Oct 6, 2022

Conversation

trask
Copy link
Member

@trask trask commented Sep 16, 2022

...so that they can have access to the parent span context, and so that their additions to the context will be visible to span processors

@@ -196,7 +189,13 @@ private Context doStart(Context parentContext, REQUEST request, @Nullable Instan
}
Copy link
Member

Choose a reason for hiding this comment

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

The OperationListener need to get the context with the newly created span, so that they have the proper exemplars

Comment on lines 181 to 184
for (ContextCustomizer<? super REQUEST> contextCustomizer : contextCustomizers) {
context = contextCustomizer.onStart(context, request, attributes);
Copy link
Member

Choose a reason for hiding this comment

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

You should rename the first param of ContextCustomizer#onStart() to parentContext too

@trask trask changed the title Experiment Run context customizers before span start instead of after Sep 18, 2022
@trask trask marked this pull request as ready for review September 19, 2022 15:49
@trask trask requested a review from a team as a code owner September 19, 2022 15:49
Copy link
Member

@mateuszrzeszutek mateuszrzeszutek left a comment

Choose a reason for hiding this comment

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

I'm fine with this PR 👍
It is perhaps a little risky with the behavior change, but I believe it doesn't stray from the original intention behind the ContextCustomizer API.

@trask
Copy link
Member Author

trask commented Sep 21, 2022

I added to SIG agenda for tomorrow to get any last opinions

@trask
Copy link
Member Author

trask commented Oct 6, 2022

Going ahead and merging this for next week's release

@trask trask merged commit 586261d into open-telemetry:main Oct 6, 2022
@trask trask deleted the parent-context branch October 6, 2022 19:11
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Oct 23, 2022
…metry#6634)

...so that they can have access to the parent span context, and so that
their additions to the context will be visible to span processors
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Oct 31, 2022
…metry#6634)

...so that they can have access to the parent span context, and so that
their additions to the context will be visible to span processors
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Dec 4, 2022
…metry#6634)

...so that they can have access to the parent span context, and so that
their additions to the context will be visible to span processors
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.

None yet

3 participants