Skip to content

Commit

Permalink
Fix capturing payloads for Wildfly (#283)
Browse files Browse the repository at this point in the history
* Fix capturing payloads for Wildfly

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Revert

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
  • Loading branch information
pavolloffay authored Mar 5, 2021
1 parent 00c651d commit 4d035c8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public Map<String, String> getProperties() {
OTEL_PROPAGATORS, toOtelPropagators(agentConfig.getPropagationFormatsList()));
// metrics are not reported
configProperties.put(OTEL_METRICS_EXPORTER, "none");

// disable undertow because it is finishing span before payloads are captured in our filter
// TODO remove once fixed
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/2499
configProperties.put("otel.instrumentation.undertow.enabled", "false");
return configProperties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package org.hypertrace.agent.smoketest
import okhttp3.MediaType
import okhttp3.RequestBody
import spock.lang.Ignore
import spock.lang.IgnoreIf

import static org.junit.Assume.assumeTrue

Expand Down Expand Up @@ -211,7 +212,13 @@ abstract class AppServerTest extends SmokeTest {
}

@Unroll
@IgnoreIf({ System.getProperty("os.name").contains("windows") })
def "#appServer test request for WEB-INF/web.xml on JDK #jdk"(String appServer, String jdk) {
// TODO https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/2499
if (getTargetImage(appServer, jdk).toLowerCase().contains("wildfly")) {
return
}

assumeTrue(testRequestWebInfWebXml())

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

@Unroll
def "#appServer test request outside deployed application JDK #jdk"(String appServer, String jdk) {
// TODO https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/2499
if (getTargetImage(appServer, jdk).toLowerCase().contains("wildfly")) {
return
}

String url = "http://localhost:${target.getMappedPort(8080)}/this-is-definitely-not-there-but-there-should-be-a-trace-nevertheless"
def request = new Request.Builder().url(url).get().build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class SmokeTest extends Specification {
private Backend backend = Backend.getInstance()

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

@Shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ class WildflySmokeTest extends AppServerTest {
return path
}

// TODO These re ignored in the superclass for Wildfly
// @Ignore
// @Unroll
// def "#appServer test request outside deployed application JDK #jdk"(String appServer, String jdk) {
// }
//
// @Ignore
// def "#appServer test request for WEB-INF/web.xml on JDK #jdk"(String appServer, String jdk) {
// }

@Unroll
def "JSP smoke test on WildFly"() {
String url = "http://localhost:${target.getMappedPort(8080)}/app/jsp"
Expand Down

0 comments on commit 4d035c8

Please sign in to comment.