Skip to content

Commit 80eae87

Browse files
committed
Merge remote-tracking branch 'upstream/main' into isin
2 parents efa2151 + f58fa79 commit 80eae87

29 files changed

Lines changed: 57 additions & 63 deletions

File tree

.github/agents/code-review-and-fix.agent.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ Auto-fix boundaries:
142142
lambdas where the lambda parameter is already an `AbstractAssert` (e.g.,
143143
`AbstractStringAssert`). Calls like `taskId.contains(jobName)` on the assert object are
144144
already valid AssertJ assertions; do not wrap them in `assertThat(...).isTrue()`
145+
- AssertJ `.as(...)` descriptions and `.withFailMessage(...)` in tests — remove them
146+
and prefer direct assertions whose failure output already exposes the unexpected values
145147
- deterministic semconv constant handling aligned with repository rules
146148
- missing test-task wiring patterns with clear canonical form
147149
- missing `testInstrumentation` cross-version references — when a javaagent module belongs

.github/agents/knowledge/testing-general-patterns.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
- JUnit 5, AssertJ assertions (not JUnit `assertEquals`/`assertTrue`).
1111
- Test classes and methods should be package-private (no `public`).
12+
- Do not use AssertJ `.as(...)` descriptions or `.withFailMessage(...)` in tests.
13+
Prefer direct assertions whose failure output shows the unexpected values.
1214

1315
## Test Resource Cleanup
1416

instrumentation/c3p0-0.9/testing/src/main/java/io/opentelemetry/instrumentation/c3p0/AbstractC3p0InstrumentationTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ void shouldReportMetrics() throws Exception {
8080
private void assertDataSourceMetrics(PooledDataSource dataSource) {
8181
String dataSourceName = dataSource.getDataSourceName();
8282

83-
assertThat(dataSourceName)
84-
.as("c3p0 generates a unique pool name if it's not explicitly provided")
85-
.isNotEmpty();
83+
assertThat(dataSourceName).isNotEmpty();
8684

8785
DbConnectionPoolMetricsAssertions.create(
8886
testing(), INSTRUMENTATION_NAME, dataSource.getDataSourceName())

instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/test/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyHttpClient9HttpCallTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,7 @@ void inputStreamListenerBodyIsDelivered() throws Exception {
101101
body = buf.toByteArray();
102102
}
103103

104-
assertThat(body)
105-
.as(
106-
"Response body must not be empty — if it is, the OTel proxy is missing "
107-
+ "DemandedContentListener and Jetty filters it out before delivering content")
108-
.isNotEmpty();
104+
assertThat(body).isNotEmpty();
109105
assertThat(new String(body, UTF_8)).isEqualTo(EXPECTED_BODY);
110106
}
111107
}

instrumentation/jodd-http-4.2/javaagent/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ muzzle {
66
pass {
77
group.set("org.jodd")
88
module.set("jodd-http")
9-
versions.set("[4.2.0,)")
9+
versions.set("[4.1.1,)")
10+
assertInverse.set(true)
1011
}
1112
}
1213

1314
dependencies {
14-
// 4.2 is the first version with java 8, follow-redirects and HttpRequest#headerOverwrite method
15-
library("org.jodd:jodd-http:4.2.0")
15+
// 4.1.1 is the first version with HttpBase#headerOverwrite used by header injection
16+
library("org.jodd:jodd-http:4.1.1")
1617

1718
testImplementation(project(":instrumentation:jodd-http-4.2:javaagent"))
1819
testImplementation(project(":instrumentation-api-incubator"))

instrumentation/jodd-http-4.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpSingletons.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import jodd.http.HttpRequest;
1111
import jodd.http.HttpResponse;
1212

13-
public final class JoddHttpSingletons {
13+
final class JoddHttpSingletons {
1414
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.jodd-http-4.2";
1515

1616
private static final Instrumenter<HttpRequest, HttpResponse> instrumenter;
@@ -21,7 +21,7 @@ public final class JoddHttpSingletons {
2121
INSTRUMENTATION_NAME, new JoddHttpHttpAttributesGetter(), new HttpHeaderSetter());
2222
}
2323

24-
public static Instrumenter<HttpRequest, HttpResponse> instrumenter() {
24+
static Instrumenter<HttpRequest, HttpResponse> instrumenter() {
2525
return instrumenter;
2626
}
2727

instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraInstrumentationModule.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ public MojarraInstrumentationModule() {
2424

2525
@Override
2626
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
27-
// javax.faces was renamed to jakarta.faces in JSF 3.0
28-
return hasClassesNamed("javax.faces.context.FacesContext");
27+
return hasClassesNamed(
28+
// removed in 3.0
29+
"javax.faces.context.FacesContext");
2930
}
3031

3132
@Override

instrumentation/jsf/jsf-mojarra-3.0/javaagent/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ otelJava {
1717
}
1818

1919
dependencies {
20-
// can't use library for now because 6.1.0-M1 is latest and its POM referes to a missing parent POM
20+
// can't use library for now because 6.1.0-M1 is latest and its POM refers to a missing parent POM
2121
// switch back to library when a new version is released
2222
// library("jakarta.el:jakarta.el-api:4.0.0")
2323
compileOnly("jakarta.el:jakarta.el-api:4.0.0")

instrumentation/jsf/jsf-mojarra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/v3_0/MojarraInstrumentationModule.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
import net.bytebuddy.matcher.ElementMatcher;
1717

1818
@AutoService(InstrumentationModule.class)
19-
public class MojarraInstrumentationModule extends InstrumentationModule
19+
public final class MojarraInstrumentationModule extends InstrumentationModule
2020
implements ExperimentalInstrumentationModule {
2121
public MojarraInstrumentationModule() {
2222
super("jsf-mojarra", "jsf-mojarra-3.0");
2323
}
2424

2525
@Override
2626
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
27-
// jakarta.faces was introduced in JSF 3.0, replacing javax.faces
28-
return hasClassesNamed("jakarta.faces.context.FacesContext");
27+
return hasClassesNamed(
28+
// added in 3.0
29+
"jakarta.faces.context.FacesContext");
2930
}
3031

3132
@Override

instrumentation/jsf/jsf-mojarra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/v3_0/MojarraSingletons.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import io.opentelemetry.javaagent.instrumentation.jsf.jakarta.JsfErrorCauseExtractor;
1212
import io.opentelemetry.javaagent.instrumentation.jsf.jakarta.JsfRequest;
1313

14-
public class MojarraSingletons {
14+
public final class MojarraSingletons {
1515
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.jsf-mojarra-3.0";
1616

1717
private static final Instrumenter<JsfRequest, Void> instrumenter;

0 commit comments

Comments
 (0)