Skip to content

Commit 04d2bea

Browse files
committed
Fix error mark on http status for IBM liberty
1 parent be63fb9 commit 04d2bea

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 11 deletions
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())
@@ -218,7 +209,7 @@ class Liberty20AsyncForkedTest extends Liberty20Test implements TestingGenericHt
218209
// instrumented while on the the global ignores list
219210
System.getProperty('java.vm.name') == 'IBM J9 VM' &&
220211
System.getProperty('java.specification.version') == '1.8' })
221-
class LibertyServletClassloaderNamingForkedTest extends Liberty20V0ForkedTest {
212+
class LibertyServletClassloaderNamingForkedTest extends Liberty20V0Test {
222213
@Override
223214
protected void configurePreAgent() {
224215
super.configurePreAgent()
@@ -232,7 +223,7 @@ class LibertyServletClassloaderNamingForkedTest extends Liberty20V0ForkedTest {
232223
// instrumented while on the the global ignores list
233224
System.getProperty('java.vm.name') == 'IBM J9 VM' &&
234225
System.getProperty('java.specification.version') == '1.8' })
235-
class Liberty20V0ForkedTest extends Liberty20Test implements TestingGenericHttpNamingConventions.ServerV0 {
226+
class Liberty20V0Test extends Liberty20Test implements TestingGenericHttpNamingConventions.ServerV0 {
236227
}
237228

238229
@IgnoreIf({

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 11 deletions
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())
@@ -160,7 +151,7 @@ abstract class Liberty23Test extends HttpServerTest<Server> {
160151
// instrumented while on the the global ignores list
161152
System.getProperty('java.vm.name') == 'IBM J9 VM' &&
162153
System.getProperty('java.specification.version') == '1.8' })
163-
class Liberty23V0ForkedTest extends Liberty23Test implements TestingGenericHttpNamingConventions.ServerV0 {
154+
class Liberty23V0Test extends Liberty23Test implements TestingGenericHttpNamingConventions.ServerV0 {
164155
}
165156

166157
@IgnoreIf({
@@ -176,7 +167,7 @@ class Liberty23V1ForkedTest extends Liberty23Test implements TestingGenericHttpN
176167
// instrumented while on the the global ignores list
177168
System.getProperty('java.vm.name') == 'IBM J9 VM' &&
178169
System.getProperty('java.specification.version') == '1.8' })
179-
class LibertyServletClassloaderNamingForkedTest extends Liberty23V0ForkedTest {
170+
class LibertyServletClassloaderNamingForkedTest extends Liberty23V0Test {
180171
@Override
181172
protected void configurePreAgent() {
182173
super.configurePreAgent()

0 commit comments

Comments
 (0)