diff --git a/src/OpenTelemetry.Instrumentation.AspNet/.publicApi/net462/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Instrumentation.AspNet/.publicApi/net462/PublicAPI.Unshipped.txt index a9ba7f916d..9b53ae2ee5 100644 --- a/src/OpenTelemetry.Instrumentation.AspNet/.publicApi/net462/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Instrumentation.AspNet/.publicApi/net462/PublicAPI.Unshipped.txt @@ -9,4 +9,5 @@ OpenTelemetry.Instrumentation.AspNet.AspNetInstrumentationOptions.RecordExceptio OpenTelemetry.Metrics.MeterProviderBuilderExtensions OpenTelemetry.Trace.TracerProviderBuilderExtensions static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddAspNetInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder builder) -> OpenTelemetry.Metrics.MeterProviderBuilder -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAspNetInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configureAspNetInstrumentationOptions = null) -> OpenTelemetry.Trace.TracerProviderBuilder +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAspNetInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAspNetInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Instrumentation.AspNet/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNet/CHANGELOG.md index 2e146bf12e..ed61c7622a 100644 --- a/src/OpenTelemetry.Instrumentation.AspNet/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNet/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Removes `AddAspNetInstrumentation` method with default configure parameter. + ([#942](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/942)) + ## 1.0.0-rc9.7 Released 2022-Nov-28 diff --git a/src/OpenTelemetry.Instrumentation.AspNet/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.AspNet/TracerProviderBuilderExtensions.cs index e5cbbc5d2f..eec9f981cf 100644 --- a/src/OpenTelemetry.Instrumentation.AspNet/TracerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet/TracerProviderBuilderExtensions.cs @@ -29,16 +29,24 @@ public static class TracerProviderBuilderExtensions /// Enables the incoming requests automatic data collection for ASP.NET. /// /// being configured. - /// ASP.NET Request configuration options. + /// The instance of to chain the calls. + public static TracerProviderBuilder AddAspNetInstrumentation(this TracerProviderBuilder builder) => + AddAspNetInstrumentation(builder, configure: null); + + /// + /// Enables the incoming requests automatic data collection for ASP.NET. + /// + /// being configured. + /// ASP.NET Request configuration options. /// The instance of to chain the calls. public static TracerProviderBuilder AddAspNetInstrumentation( this TracerProviderBuilder builder, - Action configureAspNetInstrumentationOptions = null) + Action configure) { Guard.ThrowIfNull(builder); var aspnetOptions = new AspNetInstrumentationOptions(); - configureAspNetInstrumentationOptions?.Invoke(aspnetOptions); + configure?.Invoke(aspnetOptions); builder.AddInstrumentation(() => new AspNetInstrumentation(aspnetOptions)); builder.AddSource(TelemetryHttpModule.AspNetSourceName);