Skip to content

Commit 5909ac7

Browse files
author
nayeem-kamal
committed
added stacktraces on http requests
1 parent f7e62de commit 5909ac7

File tree

1 file changed

+4
-0
lines changed
  • dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/httpurlconnection

1 file changed

+4
-0
lines changed

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/httpurlconnection/HttpUrlState.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public void finishSpan(
4242
if (responseCode > 0) {
4343
// safe to access response data as 'responseCode' is set
4444
DECORATE.onResponse(span, connection);
45+
if (throwable != null && responseCode >= 400) {
46+
47+
DECORATE.onError(span, throwable);
48+
}
4549
} else {
4650
// Ignoring the throwable if we have response code
4751
// to have consistent behavior with other http clients.

0 commit comments

Comments
 (0)