diff --git a/src/OpenTelemetry/SdkOptions.cs b/src/OpenTelemetry/SdkOptions.cs index ebe7202c2c1..9697d20f6b4 100644 --- a/src/OpenTelemetry/SdkOptions.cs +++ b/src/OpenTelemetry/SdkOptions.cs @@ -46,7 +46,7 @@ public ConfigureSdkOptions(IConfiguration configuration) { Debug.Assert(configuration != null, "configuration was null"); - this.configuration = configuration; + this.configuration = configuration!; } public void Configure(SdkOptions options) @@ -56,12 +56,12 @@ public void Configure(SdkOptions options) var globalDisableFlagValue = this.configuration.GetValue("OTEL_SDK_DISABLED", false); if (globalDisableFlagValue) { - options.TracingEnabled = false; + options!.TracingEnabled = false; options.MetricsEnabled = false; options.LoggingEnabled = false; } - globalConfigureCallbacks?.Invoke(options); + globalConfigureCallbacks?.Invoke(options!); } } }