Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public Resteasy31InstrumentationModule() {
@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
return hasClassesNamed(
// added in javax.ws.rs:javax.ws.rs-api 2.0
// added in javax.ws.rs:javax.ws.rs-api 1.0, removed in 3.0
// (renamed to jakarta.ws.rs.Path)
"javax.ws.rs.Path",
// added in 3.1.0.Final (moved from core.interception)
"org.jboss.resteasy.core.interception.jaxrs.PostMatchContainerRequestContext");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import org.junit.jupiter.api.extension.RegisterExtension;

class ResteasyHttpServerTest extends JaxRsHttpServerTest<UndertowJaxrsServer> {
private static final boolean EXPERIMENTAL_ATTRIBUTES =
Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");

@RegisterExtension
static final InstrumentationExtension testing = HttpServerInstrumentationExtension.forAgent();

Expand Down Expand Up @@ -50,6 +53,6 @@ protected void configure(HttpServerTestOptions options) {

@Override
protected boolean testExperimental() {
return Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");
return EXPERIMENTAL_ATTRIBUTES;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import org.junit.jupiter.api.extension.RegisterExtension;

class ResteasyJettyHttpServerTest extends JaxRsJettyHttpServerTest {
private static final boolean EXPERIMENTAL_ATTRIBUTES =
Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");

@RegisterExtension
static final InstrumentationExtension testing = HttpServerInstrumentationExtension.forAgent();

Expand All @@ -24,6 +27,6 @@ protected void configure(HttpServerTestOptions options) {

@Override
protected boolean testExperimental() {
return Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");
return EXPERIMENTAL_ATTRIBUTES;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public void updateServerSpanName(Context context, @Nullable String name) {

@Override
@Nullable
public String get(Context context, String name) {
if (name.isEmpty()) {
public String get(Context context, @Nullable String name) {
if (name == null || name.isEmpty()) {
return null;
}
return ServletContextPath.prepend(context, JaxrsContextPath.prepend(context, name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ otelJava {
maxJavaVersionForTests.set(JavaVersion.VERSION_23)
}

tasks.withType<Test>().configureEach {
tasks.test {
// required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("--add-exports=java.base/sun.misc=ALL-UNNAMED")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ tasks {

// needed for java 11 to avoid org.jboss.modules.ModuleNotFoundException: java.se
jvmArgs("--add-modules=java.se")
// required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
// add offset to default port values
jvmArgs("-Djboss.socket.binding.port-offset=400")

Expand All @@ -62,10 +66,3 @@ tasks {
}.plus(files(layout.buildDirectory.file("tmp/logback-classic-modified.jar")))
}
}

tasks.withType<Test>().configureEach {
// required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
}

tasks {
withType<Test>().configureEach {
test {
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")

systemProperty("collectMetadata", otelProps.collectMetadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
import org.junit.jupiter.api.extension.RegisterExtension;

class JerseyHttpServerTest extends JaxRsHttpServerTest<Server> {
private static final boolean EXPERIMENTAL_ATTRIBUTES =
Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");

@RegisterExtension
static final InstrumentationExtension testing = HttpServerInstrumentationExtension.forAgent();

Expand Down Expand Up @@ -71,6 +74,6 @@ protected void configure(HttpServerTestOptions options) {

@Override
protected boolean testExperimental() {
return Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");
return EXPERIMENTAL_ATTRIBUTES;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import org.junit.jupiter.api.extension.RegisterExtension;

class JerseyJettyHttpServerTest extends JaxRsJettyHttpServerTest {
private static final boolean EXPERIMENTAL_ATTRIBUTES =
Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");

@RegisterExtension
static final InstrumentationExtension testing = HttpServerInstrumentationExtension.forAgent();

Expand All @@ -35,6 +38,6 @@ protected boolean testInterfaceMethodWithPath() {

@Override
protected boolean testExperimental() {
return Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");
return EXPERIMENTAL_ATTRIBUTES;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import org.junit.jupiter.api.extension.RegisterExtension;

class ResteasyHttpServerTest extends JaxRsHttpServerTest<UndertowJaxrsServer> {
private static final boolean EXPERIMENTAL_ATTRIBUTES =
Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");

@RegisterExtension
static final InstrumentationExtension testing = HttpServerInstrumentationExtension.forAgent();

Expand Down Expand Up @@ -50,6 +53,6 @@ protected void configure(HttpServerTestOptions options) {

@Override
protected boolean testExperimental() {
return Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");
return EXPERIMENTAL_ATTRIBUTES;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import org.junit.jupiter.api.extension.RegisterExtension;

class ResteasyJettyHttpServerTest extends JaxRsJettyHttpServerTest {
private static final boolean EXPERIMENTAL_ATTRIBUTES =
Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");

@RegisterExtension
static final InstrumentationExtension testing = HttpServerInstrumentationExtension.forAgent();

Expand All @@ -24,6 +27,6 @@ protected void configure(HttpServerTestOptions options) {

@Override
protected boolean testExperimental() {
return Boolean.getBoolean("otel.instrumentation.jaxrs.experimental-span-attributes");
return EXPERIMENTAL_ATTRIBUTES;
}
}
Loading