-
Notifications
You must be signed in to change notification settings - Fork 292
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
Add data streams monitoring instrumentation for HTTP #4266
Conversation
.../main/java/datadog/trace/instrumentation/netty41/client/HttpClientRequestTracingHandler.java
Outdated
Show resolved
Hide resolved
...rap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpClientDecorator.java
Outdated
Show resolved
Hide resolved
...rap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java
Outdated
Show resolved
Hide resolved
...rap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment: it's unfortunate that injecting the pathway context couldn't have been made part of the existing propagate().inject(...)
call because that would have meant fewer changes to the codebase.
Even a method that did both such as propagate().injectWithPathway(span, request, SETTER, pathwayTags)
would avoid having all these extra method calls per-request.
dd-java-agent/instrumentation/netty-4.1/src/test/groovy/ReactorNettyTest.groovy
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok, given the limitations of the current pathway context API
(there appears to be a lot of opportunity in that code to revisit the API and reduce overhead)
What Does This Do
This change adds data streams monitoring instrumentation for HTTP client and server libraries.
For HTTP server libraries, we are able to make the change directly in a single location: in
HttpServerDecorator
, where the trace contextextract()
call is made today. To avoid changing the method signature ofextract()
, we make our call instartSpan
instead.For HTTP client libraries, we add an additional
injectPathwayContext()
call wherever we make aninject()
call today.Motivation
Support HTTP for Data Streams Monitoring.
Additional Notes
This change was tested manually with demo apps using Apache HTTP client and Java Servlet deployed via Tomcat. Unit tests were added via
HttpClientTest
andHttpServerTest
, which are used as the base tests for the HTTP libraries that the Java tracer supports.