Skip to content

Commit 4d035c8

Browse files
authored
Fix capturing payloads for Wildfly (#283)
* Fix capturing payloads for Wildfly Signed-off-by: Pavol Loffay <[email protected]> * Revert Signed-off-by: Pavol Loffay <[email protected]>
1 parent 00c651d commit 4d035c8

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

otel-extensions/src/main/java/org/hypertrace/agent/otel/extensions/HypertraceAgentConfiguration.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ public Map<String, String> getProperties() {
6767
OTEL_PROPAGATORS, toOtelPropagators(agentConfig.getPropagationFormatsList()));
6868
// metrics are not reported
6969
configProperties.put(OTEL_METRICS_EXPORTER, "none");
70+
71+
// disable undertow because it is finishing span before payloads are captured in our filter
72+
// TODO remove once fixed
73+
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/2499
74+
configProperties.put("otel.instrumentation.undertow.enabled", "false");
7075
return configProperties;
7176
}
7277

smoke-tests/src/test/groovy/org/hypertrace/agent/smoketest/AppServerTest.groovy

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package org.hypertrace.agent.smoketest
88
import okhttp3.MediaType
99
import okhttp3.RequestBody
1010
import spock.lang.Ignore
11+
import spock.lang.IgnoreIf
1112

1213
import static org.junit.Assume.assumeTrue
1314

@@ -211,7 +212,13 @@ abstract class AppServerTest extends SmokeTest {
211212
}
212213

213214
@Unroll
215+
@IgnoreIf({ System.getProperty("os.name").contains("windows") })
214216
def "#appServer test request for WEB-INF/web.xml on JDK #jdk"(String appServer, String jdk) {
217+
// TODO https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/2499
218+
if (getTargetImage(appServer, jdk).toLowerCase().contains("wildfly")) {
219+
return
220+
}
221+
215222
assumeTrue(testRequestWebInfWebXml())
216223

217224
String url = "http://localhost:${target.getMappedPort(8080)}/app/WEB-INF/web.xml"
@@ -283,6 +290,11 @@ abstract class AppServerTest extends SmokeTest {
283290

284291
@Unroll
285292
def "#appServer test request outside deployed application JDK #jdk"(String appServer, String jdk) {
293+
// TODO https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/2499
294+
if (getTargetImage(appServer, jdk).toLowerCase().contains("wildfly")) {
295+
return
296+
}
297+
286298
String url = "http://localhost:${target.getMappedPort(8080)}/this-is-definitely-not-there-but-there-should-be-a-trace-nevertheless"
287299
def request = new Request.Builder().url(url).get().build()
288300

smoke-tests/src/test/groovy/org/hypertrace/agent/smoketest/SmokeTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ abstract class SmokeTest extends Specification {
4242
private Backend backend = Backend.getInstance()
4343

4444
@Shared
45-
// protected String agentPath = "/Users/ploffay/projects/hypertrace/javaagent/javaagent/build/libs/hypertrace-agent-0.10.4-SNAPSHOT-all.jar"// System.getProperty("smoketest.javaagent.path")
45+
// protected String agentPath = "/Users/ploffay/projects/hypertrace/javaagent/javaagent/build/libs/hypertrace-agent-0.11.1-SNAPSHOT-all.jar"// System.getProperty("smoketest.javaagent.path")
4646
protected String agentPath = System.getProperty("smoketest.javaagent.path")
4747

4848
@Shared

smoke-tests/src/test/groovy/org/hypertrace/agent/smoketest/WildflySmokeTest.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ class WildflySmokeTest extends AppServerTest {
3131
return path
3232
}
3333

34+
// TODO These re ignored in the superclass for Wildfly
35+
// @Ignore
36+
// @Unroll
37+
// def "#appServer test request outside deployed application JDK #jdk"(String appServer, String jdk) {
38+
// }
39+
//
40+
// @Ignore
41+
// def "#appServer test request for WEB-INF/web.xml on JDK #jdk"(String appServer, String jdk) {
42+
// }
43+
3444
@Unroll
3545
def "JSP smoke test on WildFly"() {
3646
String url = "http://localhost:${target.getMappedPort(8080)}/app/jsp"

0 commit comments

Comments
 (0)