Skip to content

Commit 2dab68d

Browse files
authored
Fix error mark on http status for IBM liberty (#8822)
1 parent c5a98d6 commit 2dab68d

File tree

4 files changed

+2
-20
lines changed

4 files changed

+2
-20
lines changed

dd-java-agent/instrumentation/liberty-20/src/main/java/datadog/trace/instrumentation/liberty20/LibertyDecorator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public AgentSpan onResponseStatus(AgentSpan span, int status) {
100100
// we may have the status during response blocking, but in that case
101101
// the status code is not propagated to the servlet layer
102102
if (currentStatus == null || !span.isError()) {
103-
span.setHttpStatusCode(status);
103+
super.onResponseStatus(span, status);
104104
}
105105
return span;
106106
}

dd-java-agent/instrumentation/liberty-20/src/test/groovy/datadog/trace/instrumentation/liberty20/Liberty20Test.groovy

-9
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,6 @@ abstract class Liberty20Test extends HttpServerTest<Server> {
127127
true
128128
}
129129

130-
@Override
131-
String expectedResourceName(ServerEndpoint endpoint, String method, URI address) {
132-
if (endpoint.path == '/not-found') {
133-
'GET /testapp/not-found'
134-
} else {
135-
super.expectedResourceName(endpoint, method, address)
136-
}
137-
}
138-
139130
def 'test blocking on response with commit during the response'() {
140131
setup:
141132
assumeTrue(testBlockingOnResponse())

dd-java-agent/instrumentation/liberty-23/src/main/java/datadog/trace/instrumentation/liberty23/LibertyDecorator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public AgentSpan onResponseStatus(AgentSpan span, int status) {
100100
// we may have the status during response blocking, but in that case
101101
// the status code is not propagated to the servlet layer
102102
if (currentStatus == null || !span.isError()) {
103-
span.setHttpStatusCode(status);
103+
super.onResponseStatus(span, status);
104104
}
105105
return span;
106106
}

dd-java-agent/instrumentation/liberty-23/src/test/groovy/datadog/trace/instrumentation/liberty23/Liberty23Test.groovy

-9
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,6 @@ abstract class Liberty23Test extends HttpServerTest<Server> {
117117
true
118118
}
119119

120-
@Override
121-
String expectedResourceName(ServerEndpoint endpoint, String method, URI address) {
122-
if (endpoint.path == '/not-found') {
123-
'GET /testapp/not-found'
124-
} else {
125-
super.expectedResourceName(endpoint, method, address)
126-
}
127-
}
128-
129120
def 'test blocking on response with commit during the response'() {
130121
setup:
131122
assumeTrue(testBlockingOnResponse())

0 commit comments

Comments
 (0)