Skip to content

Commit

Permalink
PR feedback - avoid default parameter values
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek committed Jan 19, 2023
1 parent 0420e65 commit 2b41c6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
OpenTelemetry.Instrumentation.Process.ProcessInstrumentationOptions
OpenTelemetry.Instrumentation.Process.ProcessInstrumentationOptions.ProcessInstrumentationOptions() -> void
OpenTelemetry.Metrics.MeterProviderBuilderExtensions
static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddProcessInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Action<OpenTelemetry.Instrumentation.Process.ProcessInstrumentationOptions!>? configure = null) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddProcessInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder! builder) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddProcessInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Action<OpenTelemetry.Instrumentation.Process.ProcessInstrumentationOptions!>! configure) -> OpenTelemetry.Metrics.MeterProviderBuilder!
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ namespace OpenTelemetry.Metrics;
/// </summary>
public static class MeterProviderBuilderExtensions
{
/// <summary>
/// Enables runtime instrumentation.
/// </summary>
/// <param name="builder"><see cref="MeterProviderBuilder"/> being configured.</param>
/// <returns>The instance of <see cref="MeterProviderBuilder"/> to chain the calls.</returns>
public static MeterProviderBuilder AddProcessInstrumentation(this MeterProviderBuilder builder) => AddProcessInstrumentationImplementation(builder, configure: null);

/// <summary>
/// Enables runtime instrumentation.
/// </summary>
Expand All @@ -33,10 +40,11 @@ public static class MeterProviderBuilderExtensions
/// <returns>The instance of <see cref="MeterProviderBuilder"/> to chain the calls.</returns>
public static MeterProviderBuilder AddProcessInstrumentation(
this MeterProviderBuilder builder,
Action<ProcessInstrumentationOptions>? configure = null)
{
Guard.ThrowIfNull(builder);
Action<ProcessInstrumentationOptions> configure) =>
AddProcessInstrumentationImplementation(builder, configure);

private static MeterProviderBuilder AddProcessInstrumentationImplementation(MeterProviderBuilder builder, Action<ProcessInstrumentationOptions>? configure)
{
var options = new ProcessInstrumentationOptions();
configure?.Invoke(options);

Expand Down

0 comments on commit 2b41c6a

Please sign in to comment.