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

Datadog Trace Span Issue with Apache HttpClient5 #7275

Open
abagavat opened this issue Jul 3, 2024 · 2 comments
Open

Datadog Trace Span Issue with Apache HttpClient5 #7275

abagavat opened this issue Jul 3, 2024 · 2 comments
Milestone

Comments

@abagavat
Copy link
Contributor

abagavat commented Jul 3, 2024

We observed an issue with the Datadog trace span for outbound http requests using Apache HttpClient5. This span is missing some of the url details info, mainly the host information. Upon closer inspection we were able to identify the specific aspect advice that was applied for this interaction.

In our specific case, the first parameter (host) in the method call is null. As per Apache HttpClient5 documentation this argument is allowed to be null. When it's null the implementation should derive the host information from the request itself.

https://hc.apache.org/httpcomponents-client-5.2.x/current/httpclient5/apidocs/org/apache/hc/client5/http/classic/HttpClient.html#executeOpen-org.apache.hc.core5.http.HttpHost-org.apache.hc.core5.http.ClassicHttpRequest-org.apache.hc.core5.http.protocol.HttpContext-

More specifically the below wrapper class which wraps HttpClient's BasicClassicHttpRequest should handle a null host value. The fix can either be in the constructor or by overriding the getUri method and fetch the uri from the actual request.

The impact of this issue (missing host info) is that, some of the widgets in the APM dashboard such as the dependency map are not showing the correct data.

@abagavat
Copy link
Contributor Author

abagavat commented Jul 3, 2024

Potential fix - #7276

@mcculls
Copy link
Contributor

mcculls commented Jul 8, 2024

#7276 has been merged and will be available in the next release, v1.38.0

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

No branches or pull requests

2 participants