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

Update net/http instrumentation span annotation #907

Merged
merged 7 commits into from
Jan 10, 2020

Conversation

ericmustin
Copy link
Contributor

@ericmustin ericmustin commented Jan 7, 2020

Summary

This PR addresses Issue-888 . Currently, when a request raises an exception from a timeout(or otherwise), we don't annotate the span with any of the request or response details, since the span_annotation! method is called after the request is made and an exception would get raised.

This PR splits the annotate_span! method into request and response specific annotation methods so that the span can be annotated with at least minimal tags in the case of an exception being raised by the request.

Per the Contribution Guidelines I've also added a test for this use case.

Notes / Comments

Let me know what you think, happy to make any changes y'all feel would be appropriate here.

@ericmustin ericmustin requested a review from a team January 7, 2020 16:28
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

It's a good start, but I think we need to address exception tagging itself too. Couple of other minor suggestions for changes as well.

spec/ddtrace/contrib/http/request_spec.rb Outdated Show resolved Hide resolved
lib/ddtrace/contrib/http/instrumentation.rb Outdated Show resolved Hide resolved
lib/ddtrace/contrib/http/instrumentation.rb Outdated Show resolved Hide resolved
@marcotc marcotc added community Was opened by a community member integrations Involves tracing integrations labels Jan 7, 2020
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Couple of other suggestions related to tests, but I think the rest of the changes look good.

spec/ddtrace/contrib/http/request_spec.rb Outdated Show resolved Hide resolved
spec/ddtrace/contrib/http/request_spec.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Looks good; thanks @ericmustin! 👍

@delner delner merged commit 0a2bb4a into DataDog:master Jan 10, 2020
@marcotc marcotc added this to the 0.32.0 milestone Jan 22, 2020
@ericmustin ericmustin deleted the 888_split_request_annotation branch August 10, 2020 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Was opened by a community member integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants