Skip to content

Commit

Permalink
[Instrumentation.Quartz] drop default parameter from registration met…
Browse files Browse the repository at this point in the history
…hod (#914)

Co-authored-by: Cijo Thomas <[email protected]>
  • Loading branch information
Kielek and cijothomas authored Jan 26, 2023
1 parent 840a313 commit 8047023
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ OpenTelemetry.Instrumentation.Quartz.QuartzInstrumentationOptions.RecordExceptio
OpenTelemetry.Instrumentation.Quartz.QuartzInstrumentationOptions.TracedOperations.get -> System.Collections.Generic.HashSet<string>
OpenTelemetry.Instrumentation.Quartz.QuartzInstrumentationOptions.TracedOperations.set -> void
OpenTelemetry.Trace.TraceProviderBuilderExtensions
static OpenTelemetry.Trace.TraceProviderBuilderExtensions.AddQuartzInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Instrumentation.Quartz.QuartzInstrumentationOptions> configureQuartzInstrumentationOptions = null) -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Trace.TraceProviderBuilderExtensions.AddQuartzInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Trace.TraceProviderBuilderExtensions.AddQuartzInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Instrumentation.Quartz.QuartzInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.Quartz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
([#917](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/917))
* Removes .NET Framework 4.7.2. It is distributed as .NET Standard 2.0.
([#911](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/911))
* Removes `AddQuartzInstrumentation` method with default configure default parameter.
([#914](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/914))

## 1.0.0-alpha.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,22 @@ public static class TraceProviderBuilderExtensions
/// Enables the Quartz.NET Job automatic data collection for Quartz.NET.
/// </summary>
/// <param name="builder"><see cref="TraceProviderBuilderExtensions"/> being configured.</param>
/// <param name="configureQuartzInstrumentationOptions">Quartz configuration options.</param>
/// <returns>The instance of <see cref="TraceProviderBuilderExtensions"/> to chain the calls.</returns>
public static TracerProviderBuilder AddQuartzInstrumentation(
this TracerProviderBuilder builder) => AddQuartzInstrumentation(builder, configure: null);

/// <summary>
/// Enables the Quartz.NET Job automatic data collection for Quartz.NET.
/// </summary>
/// <param name="builder"><see cref="TraceProviderBuilderExtensions"/> being configured.</param>
/// <param name="configure">Quartz configuration options.</param>
/// <returns>The instance of <see cref="TraceProviderBuilderExtensions"/> to chain the calls.</returns>
public static TracerProviderBuilder AddQuartzInstrumentation(
this TracerProviderBuilder builder,
Action<QuartzInstrumentationOptions> configureQuartzInstrumentationOptions = null)
Action<QuartzInstrumentationOptions> configure)
{
var options = new QuartzInstrumentationOptions();
configureQuartzInstrumentationOptions?.Invoke(options);
configure?.Invoke(options);

builder.AddInstrumentation(() => new QuartzJobInstrumentation(options));
builder.AddSource(QuartzDiagnosticListener.ActivitySourceName);
Expand Down

0 comments on commit 8047023

Please sign in to comment.