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

Propagate context #572

Merged
merged 7 commits into from
Jun 26, 2020
Merged

Propagate context #572

merged 7 commits into from
Jun 26, 2020

Conversation

iNikem
Copy link
Contributor

@iNikem iNikem commented Jun 24, 2020

Partially addresses #507 .

First cut on propagating full Context instead of just Span. Two major things are not done yet:

  • io.opentelemetry.auto.bootstrap.instrumentation.decorator.HttpServerTracer#attachSpanToRequest should be redone to something like propagateContext. But as new context is not created inside startSpan method, that propagateContext should be moved, made public etc...
  • io.opentelemetry.auto.bootstrap.instrumentation.decorator.HttpServerDecorator#SPAN_ATTRIBUTE. I have a temptation to live it be. The whole HttpServerDecorator is deprecated and is to be replaced by HttpServerTracer anyway.

Probably something else is missing

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

this change looks really good

a couple suggestions below

Comment on lines +39 to +40
// TODO I think all this should happen on exit, not on enter.
// After response was handled by user provided handler.
Copy link
Member

Choose a reason for hiding this comment

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

i think it makes sense to end the span here, at the beginning of onCompleted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My line of thought was the following: in comes a request, when a response is ready AsyncCompletionHandler will be called. I think we want to end the request processing span after that handler has completed its job. So that if it fails or takes long time, that would be recorded in the captured span. No?

Copy link
Member

Choose a reason for hiding this comment

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

i think the CLIENT span timing and success are supposed to match the HTTP timing / success as closely as possible

i don't see this called out in the spec, but there's some related discussion here: open-telemetry/opentelemetry-specification#591 (comment)

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Approach LGTM, definitely nicer to propagate context than span

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

💯

@iNikem iNikem merged commit fc2d679 into open-telemetry:master Jun 26, 2020
@iNikem iNikem deleted the propagate-context branch June 26, 2020 05:18
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.

3 participants