Skip to content

Commit c3c8962

Browse files
committed
Merge branch 'main' into spring-kafka-end
2 parents 1da2cfa + c277182 commit c3c8962

File tree

14 files changed

+100
-69
lines changed

14 files changed

+100
-69
lines changed

.github/renovate.json5

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
matchManagers: [
1414
'github-actions',
1515
'dockerfile',
16-
'regex',
16+
'custom.regex',
1717
],
1818
extends: [
1919
'schedule:weekly',
@@ -146,7 +146,7 @@
146146
matchPackageNames: [
147147
'uk.org.webcompere:system-stubs-jupiter',
148148
],
149-
allowedVersions: '/^2\.0\./',
149+
allowedVersions: '/^2\\.0\\./',
150150
},
151151
{
152152
// wiremock 3+ requires Java 11+
@@ -217,7 +217,7 @@
217217
matchPackageNames: [
218218
'ch.qos.logback:**',
219219
],
220-
allowedVersions: '/^1\.2\./',
220+
allowedVersions: '/^1\\.2\\./',
221221
},
222222
{
223223
// intentionally using slf4j 1 in this smoke tests
@@ -277,7 +277,7 @@
277277
matchPackageNames: [
278278
'org.scala-lang:scala-library',
279279
],
280-
allowedVersions: '/^2\.11\./',
280+
allowedVersions: '/^2\\.11\\./',
281281
},
282282
{
283283
// intentionally testing against specific major Java versions
@@ -321,7 +321,7 @@
321321
matchPackageNames: [
322322
'ch.qos.logback:**',
323323
],
324-
allowedVersions: '/^1\.3\./',
324+
allowedVersions: '/^1\\.3\\./',
325325
},
326326
{
327327
// intentionally using Spring Boot 2 in dependency management (for Java 8 support)

benchmark-overhead/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies {
2323
testImplementation("org.testcontainers:testcontainers-postgresql")
2424
testImplementation("org.junit.jupiter:junit-jupiter-api")
2525
testImplementation("org.junit.jupiter:junit-jupiter-params")
26-
testImplementation("com.squareup.okhttp3:okhttp:5.3.1")
26+
testImplementation("com.squareup.okhttp3:okhttp:5.3.2")
2727
testImplementation("org.jooq:joox:2.0.1")
2828
testImplementation("com.jayway.jsonpath:json-path:2.10.0")
2929
testImplementation("org.slf4j:slf4j-simple:2.0.17")

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222

2323
buildscript {
2424
dependencies {
25-
classpath("com.squareup.okhttp3:okhttp:5.3.1")
25+
classpath("com.squareup.okhttp3:okhttp:5.3.2")
2626
}
2727
}
2828

examples/distro/instrumentation/servlet-3/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies {
2727
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
2828
}
2929

30-
testImplementation "com.squareup.okhttp3:okhttp:5.3.1"
30+
testImplementation "com.squareup.okhttp3:okhttp:5.3.2"
3131
testImplementation "javax.servlet:javax.servlet-api:3.0.1"
3232
testImplementation "org.eclipse.jetty:jetty-server:8.2.0.v20160908"
3333
testImplementation "org.eclipse.jetty:jetty-servlet:8.2.0.v20160908"

examples/distro/smoke-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies {
66
testImplementation("org.testcontainers:testcontainers:2.0.2")
77
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.20.1")
88
testImplementation("com.google.protobuf:protobuf-java-util:4.33.1")
9-
testImplementation("com.squareup.okhttp3:okhttp:5.3.1")
9+
testImplementation("com.squareup.okhttp3:okhttp:5.3.2")
1010
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.9.0-alpha")
1111
testImplementation("io.opentelemetry:opentelemetry-api")
1212

examples/extension/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ dependencies {
101101
testImplementation("org.testcontainers:testcontainers:2.0.2")
102102
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.20.1")
103103
testImplementation("com.google.protobuf:protobuf-java-util:4.33.1")
104-
testImplementation("com.squareup.okhttp3:okhttp:5.3.1")
104+
testImplementation("com.squareup.okhttp3:okhttp:5.3.2")
105105
testImplementation("io.opentelemetry:opentelemetry-api")
106106
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.9.0-alpha")
107107

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/parsers/EmittedMetricsParser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package io.opentelemetry.instrumentation.docs.parsers;
77

8+
import static io.opentelemetry.instrumentation.docs.parsers.TelemetryParser.normalizeWhenCondition;
9+
810
import com.fasterxml.jackson.core.JsonProcessingException;
911
import io.opentelemetry.instrumentation.docs.internal.EmittedMetrics;
1012
import io.opentelemetry.instrumentation.docs.utils.FileManager;
@@ -62,8 +64,7 @@ private static Map<String, List<EmittedMetrics.MetricsByScope>> parseAllMetricFi
6264
path -> {
6365
String content = FileManager.readFileToString(path.toString());
6466
if (content != null) {
65-
String when = content.substring(0, content.indexOf('\n'));
66-
String whenKey = when.replace("when: ", "");
67+
String whenKey = normalizeWhenCondition(content);
6768

6869
int metricsIndex = content.indexOf("metrics_by_scope:");
6970
if (metricsIndex != -1) {

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/parsers/EmittedSpanParser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package io.opentelemetry.instrumentation.docs.parsers;
77

8+
import static io.opentelemetry.instrumentation.docs.parsers.TelemetryParser.normalizeWhenCondition;
9+
810
import com.fasterxml.jackson.core.JsonProcessingException;
911
import io.opentelemetry.instrumentation.docs.internal.EmittedSpans;
1012
import io.opentelemetry.instrumentation.docs.internal.TelemetryAttribute;
@@ -49,8 +51,7 @@ public static Map<String, EmittedSpans> getSpansByScopeFromFiles(
4951
path -> {
5052
String content = FileManager.readFileToString(path.toString());
5153
if (content != null) {
52-
String when = content.substring(0, content.indexOf('\n'));
53-
String whenKey = when.replace("when: ", "");
54+
String whenKey = normalizeWhenCondition(content);
5455

5556
spansByScope.putIfAbsent(whenKey, new StringBuilder("spans_by_scope:\n"));
5657

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/parsers/TelemetryParser.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,25 @@ static boolean scopeIsValid(String telemetryScope, String moduleScope) {
7373
|| scopeAllowList.getOrDefault(moduleScope, emptySet()).contains(telemetryScope);
7474
}
7575

76+
/**
77+
* Normalizes the 'when' condition from the given content by stripping quotes and whitespace.
78+
*
79+
* @param content the content containing the 'when' condition
80+
* @return normalized when condition
81+
*/
82+
static String normalizeWhenCondition(String content) {
83+
if (content == null) {
84+
return "";
85+
}
86+
87+
String when = content.substring(0, content.indexOf('\n'));
88+
String whenCondition = when.replace("when: ", "").strip();
89+
// Remove surrounding quotes if present (to avoid double-quoting in output)
90+
if (whenCondition.startsWith("\"") && whenCondition.endsWith("\"")) {
91+
whenCondition = whenCondition.substring(1, whenCondition.length() - 1);
92+
}
93+
return whenCondition;
94+
}
95+
7696
private TelemetryParser() {}
7797
}

instrumentation-docs/src/test/java/io/opentelemetry/instrumentation/docs/parsers/EmittedMetricsParserTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.junit.jupiter.api.io.TempDir;
2222
import org.mockito.MockedStatic;
2323

24-
@SuppressWarnings("NullAway")
2524
class EmittedMetricsParserTest {
2625

2726
@Test

0 commit comments

Comments
 (0)