Skip to content

Commit

Permalink
Reverted changes to metrics and tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
cromefire committed Feb 24, 2023
1 parent 5c86fc1 commit c6dc65d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 60 deletions.
42 changes: 2 additions & 40 deletions src/OpenTelemetry.Extensions.Hosting/OpenTelemetryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,7 @@ public OpenTelemetryBuilder WithMetrics(Action<MeterProviderBuilder> configure)

var builder = new MeterProviderBuilderBase(this.Services);

builder.Configure(configure);

return this;
}

/// <summary>
/// Adds metric services into the builder.
/// </summary>
/// <remarks><inheritdoc cref="WithMetrics()" path="/remarks"/></remarks>
/// <param name="configure"><see cref="MeterProviderBuilder"/>
/// configuration callback.</param>
/// <returns>The supplied <see cref="OpenTelemetryBuilder"/> for chaining
/// calls.</returns>
public OpenTelemetryBuilder WithMetrics(Action<MeterProviderBuilder, IServiceProvider> configure)
{
Guard.ThrowIfNull(configure);

var builder = new MeterProviderBuilderBase(this.Services);

builder.Configure(configure);
configure(builder);

return this;
}
Expand Down Expand Up @@ -169,26 +150,7 @@ public OpenTelemetryBuilder WithTracing(Action<TracerProviderBuilder> configure)

var builder = new TracerProviderBuilderBase(this.Services);

builder.Configure(configure);

return this;
}

/// <summary>
/// Adds tracing services into the builder.
/// </summary>
/// <remarks><inheritdoc cref="WithTracing()" path="/remarks"/></remarks>
/// <param name="configure"><see cref="TracerProviderBuilder"/>
/// configuration callback.</param>
/// <returns>The supplied <see cref="OpenTelemetryBuilder"/> for chaining
/// calls.</returns>
public OpenTelemetryBuilder WithTracing(Action<TracerProviderBuilder, IServiceProvider> configure)
{
Guard.ThrowIfNull(configure);

var builder = new TracerProviderBuilderBase(this.Services);

builder.Configure(configure);
configure(builder);

return this;
}
Expand Down
10 changes: 0 additions & 10 deletions src/OpenTelemetry/Metrics/Builder/MeterProviderBuilderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,6 @@ MeterProviderBuilder IDeferredMeterProviderBuilder.Configure(Action<IServiceProv
internal MeterProvider InvokeBuild()
=> this.Build();

internal void Configure(Action<MeterProviderBuilder> configure)
{
this.ConfigureBuilderInternal((_, builder) => configure(builder));
}

internal void Configure(Action<MeterProviderBuilder, IServiceProvider> configure)
{
this.ConfigureBuilderInternal((sp, builder) => configure(builder, sp));
}

/// <summary>
/// Run the configured actions to initialize the <see cref="MeterProvider"/>.
/// </summary>
Expand Down
10 changes: 0 additions & 10 deletions src/OpenTelemetry/Trace/Builder/TracerProviderBuilderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ TracerProviderBuilder IDeferredTracerProviderBuilder.Configure(
internal TracerProvider InvokeBuild()
=> this.Build();

internal void Configure(Action<TracerProviderBuilder> configure)
{
this.ConfigureBuilderInternal((_, builder) => configure(builder));
}

internal void Configure(Action<TracerProviderBuilder, IServiceProvider> configure)
{
this.ConfigureBuilderInternal((sp, builder) => configure(builder, sp));
}

/// <summary>
/// Adds instrumentation to the provider.
/// </summary>d
Expand Down

0 comments on commit c6dc65d

Please sign in to comment.