From 807b2263764aad233cb03cb4d953f17bbd309e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Tue, 4 Apr 2023 10:06:44 +0200 Subject: [PATCH] [Instrumentation.Hangfire] drop default parameter from registration method --- .../netstandard2.0/PublicAPI.Unshipped.txt | 3 ++- .../CHANGELOG.md | 2 ++ .../TracerProviderBuilderExtensions.cs | 15 ++++++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Hangfire/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Instrumentation.Hangfire/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index f5f2649209..61a9676a20 100644 --- a/src/OpenTelemetry.Instrumentation.Hangfire/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Instrumentation.Hangfire/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -5,4 +5,5 @@ OpenTelemetry.Trace.HangfireInstrumentationOptions.HangfireInstrumentationOption OpenTelemetry.Trace.HangfireInstrumentationOptions.RecordException.get -> bool OpenTelemetry.Trace.HangfireInstrumentationOptions.RecordException.set -> void OpenTelemetry.Trace.TracerProviderBuilderExtensions -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddHangfireInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configureHangfireInstrumentationOptions = null) -> OpenTelemetry.Trace.TracerProviderBuilder +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddHangfireInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddHangfireInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md index e8caed7660..989674df6b 100644 --- a/src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md @@ -4,6 +4,8 @@ * Update OTel API version to `1.4.0`. ([#1038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1038)) +* Removes `AddHangfireInstrumentation` method with default configure default parameter. + ([#1129](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1129)) ## 1.0.0-beta.4 diff --git a/src/OpenTelemetry.Instrumentation.Hangfire/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.Hangfire/TracerProviderBuilderExtensions.cs index e1d3a9d2e7..551edf445a 100644 --- a/src/OpenTelemetry.Instrumentation.Hangfire/TracerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.Hangfire/TracerProviderBuilderExtensions.cs @@ -29,16 +29,25 @@ public static class TracerProviderBuilderExtensions /// Adds Hangfire instrumentation to the tracer provider. /// /// being configured. - /// Callback action for configuring . + /// The instance of to chain the calls. + public static TracerProviderBuilder AddHangfireInstrumentation( + this TracerProviderBuilder builder) => + AddHangfireInstrumentation(builder, configure: null); + + /// + /// Adds Hangfire instrumentation to the tracer provider. + /// + /// being configured. + /// Callback action for configuring . /// The instance of to chain the calls. public static TracerProviderBuilder AddHangfireInstrumentation( this TracerProviderBuilder builder, - Action configureHangfireInstrumentationOptions = null) + Action configure) { Guard.ThrowIfNull(builder); var options = new HangfireInstrumentationOptions(); - configureHangfireInstrumentationOptions?.Invoke(options); + configure?.Invoke(options); Hangfire.GlobalJobFilters.Filters.Add(new HangfireInstrumentationJobFilterAttribute(options));