Skip to content

Commit 4bc7282

Browse files
authored
Fix nullaway convention plugin (#14811)
1 parent d78c242 commit 4bc7282

File tree

2 files changed

+9
-40
lines changed

2 files changed

+9
-40
lines changed

conventions/src/main/kotlin/otel.nullaway-conventions.gradle.kts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@ nullaway {
1818

1919
tasks {
2020
withType<JavaCompile>().configureEach {
21-
if (name.contains("test", ignoreCase = true)) {
22-
options.errorprone.nullaway {
23-
enabled = false
24-
}
25-
} else {
26-
options.errorprone.nullaway {
27-
severity.set(CheckSeverity.ERROR)
28-
}
29-
}
3021
options.errorprone.nullaway {
22+
if (name.contains("test", ignoreCase = true)) {
23+
disable()
24+
} else {
25+
error()
26+
}
3127
customInitializerAnnotations.add("org.openjdk.jmh.annotations.Setup")
3228
excludedFieldAnnotations.add("org.mockito.Mock")
3329
excludedFieldAnnotations.add("org.mockito.InjectMocks")
3430
}
3531
}
3632
}
33+

instrumentation-docs/src/test/java/io/opentelemetry/instrumentation/docs/ManualTelemetryTest.java

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

66
package io.opentelemetry.instrumentation.docs;
77

8+
import static java.util.Collections.emptyList;
89
import static org.assertj.core.api.Assertions.assertThat;
910

1011
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -142,40 +143,11 @@ void testEmptyAdditionalTelemetry() throws JsonProcessingException {
142143

143144
InstrumentationMetadata actualMetadata = YamlHelper.metaDataParser(yamlContent);
144145

145-
ManualTelemetryEntry defaultEntry =
146-
new ManualTelemetryEntry(
147-
"default",
148-
List.of(
149-
new ManualTelemetryEntry.ManualMetric(
150-
"system.disk.io",
151-
"System disk IO",
152-
"LONG_SUM",
153-
"By",
154-
List.of(
155-
new TelemetryAttribute("device", "STRING"),
156-
new TelemetryAttribute("direction", "STRING")))),
157-
List.of(
158-
new ManualTelemetryEntry.ManualSpan(
159-
"CLIENT", List.of(new TelemetryAttribute("custom.operation", "STRING")))));
160-
161-
ManualTelemetryEntry experimentalEntry =
162-
new ManualTelemetryEntry(
163-
"experimental",
164-
List.of(
165-
new ManualTelemetryEntry.ManualMetric(
166-
"experimental.feature.usage",
167-
"Usage of experimental features",
168-
"HISTOGRAM",
169-
"s",
170-
List.of(new TelemetryAttribute("feature.name", "STRING")))),
171-
List.of());
172-
173146
InstrumentationMetadata expectedMetadata =
174147
new InstrumentationMetadata.Builder()
175-
.description("Example instrumentation with manual telemetry documentation")
176-
.libraryLink("https://example.com/library")
148+
.description("Example without manual telemetry")
177149
.semanticConventions(List.of(SemanticConvention.HTTP_CLIENT_SPANS))
178-
.additionalTelemetry(List.of(defaultEntry, experimentalEntry))
150+
.additionalTelemetry(emptyList())
179151
.overrideTelemetry(false)
180152
.build();
181153

0 commit comments

Comments
 (0)