From fdcbbeaf7809a65f2f4cc4305f1e9f1971fb22b2 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 2 Sep 2024 17:34:34 +0200 Subject: [PATCH] add @Nullable --- .../internal/DefaultHttpServerInstrumenterBuilder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/builder/internal/DefaultHttpServerInstrumenterBuilder.java b/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/builder/internal/DefaultHttpServerInstrumenterBuilder.java index 293be6ec860f..0085f8c09a13 100644 --- a/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/builder/internal/DefaultHttpServerInstrumenterBuilder.java +++ b/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/builder/internal/DefaultHttpServerInstrumenterBuilder.java @@ -32,6 +32,7 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; +import javax.annotation.Nullable; /** * This class is internal and is hence not for public use. Its APIs are unstable and can change at @@ -52,7 +53,7 @@ public final class DefaultHttpServerInstrumenterBuilder { httpAttributesExtractorBuilder; private final HttpSpanNameExtractorBuilder httpSpanNameExtractorBuilder; - private final TextMapGetter headerGetter; + @Nullable private final TextMapGetter headerGetter; private Function, ? extends SpanNameExtractor> spanNameExtractorTransformer = Function.identity(); private final HttpServerRouteBuilder httpServerRouteBuilder; @@ -64,7 +65,7 @@ public DefaultHttpServerInstrumenterBuilder( String instrumentationName, OpenTelemetry openTelemetry, HttpServerAttributesGetter attributesGetter, - TextMapGetter headerGetter) { + @Nullable TextMapGetter headerGetter) { this.instrumentationName = instrumentationName; this.openTelemetry = openTelemetry; httpAttributesExtractorBuilder = HttpServerAttributesExtractor.builder(attributesGetter);