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

Extract library instrumentation for AWS SDK v1 #2525

Merged
merged 6 commits into from
Mar 10, 2021

Conversation

anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Mar 8, 2021

The tricky part of this was that our instrumentation also applied bytecode fixes to work around buggy behavior in the AWS SDK v1 itself related to exceptions, in particular making sure that we are able to close an active scope even with exceptions. This is not possible in library instrumentation, but we also don't really need to activate the scope in it because apache http client won't be automatically instrumented / need suppression. So I've basically split the request handler into two, agent one that delegates to library instrumentation but also creates a scope for use in the agent.

Fixes #2502

tracer().endExceptionally(scope.getContext(), throwable);
scope.closeScope();
}
if (throwable instanceof Exception) {
Copy link
Contributor Author

@anuraaga anuraaga Mar 8, 2021

Choose a reason for hiding this comment

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

There is a small regression in my desire to delegate the actual tracing to the library instrumentation - Error will result in unclosed traces (but not uncleaned threadlocal). I feel this should be rare enough to live with until we get a report of problems.

@iNikem iNikem requested a review from a user March 9, 2021 07:51
anuraaga and others added 3 commits March 9, 2021 21:00
@anuraaga anuraaga merged commit 71d3f09 into open-telemetry:main Mar 10, 2021
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.

Request for OTel support in AWS Java SDK v1.x
2 participants