Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Instrumentation.Process] Cleanup public APIs. #973

Merged
merged 15 commits into from
Feb 8, 2023
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
OpenTelemetry.Instrumentation.Process.ProcessInstrumentationOptions
OpenTelemetry.Instrumentation.Process.ProcessInstrumentationOptions.ProcessInstrumentationOptions() -> void
OpenTelemetry.Metrics.MeterProviderBuilderExtensions
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!
6 changes: 6 additions & 0 deletions src/OpenTelemetry.Instrumentation.Process/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

* Removed `ProcessInstrumentationOptions` and
`AddProcessInstrumentation(this MeterProviderBuilder builder,`
`Action<ProcessInstrumentationOptions>? configure)`
from the public APIs.
([#973](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/973))

## 1.0.0-alpha.5

Released 2023-Feb-02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.
// </copyright>

using System;
using OpenTelemetry.Instrumentation.Process;
using OpenTelemetry.Internal;

Expand All @@ -26,29 +25,17 @@ namespace OpenTelemetry.Metrics;
public static class MeterProviderBuilderExtensions
{
/// <summary>
/// Enables runtime instrumentation.
/// Enables process 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) => AddProcessInstrumentation(builder, configure: null);

/// <summary>
/// Enables runtime instrumentation.
/// </summary>
/// <param name="builder"><see cref="MeterProviderBuilder"/> being configured.</param>
/// <param name="configure">Runtime metrics options.</param>
/// <returns>The instance of <see cref="MeterProviderBuilder"/> to chain the calls.</returns>
public static MeterProviderBuilder AddProcessInstrumentation(
this MeterProviderBuilder builder,
Action<ProcessInstrumentationOptions>? configure)
this MeterProviderBuilder builder)
{
Guard.ThrowIfNull(builder);

var options = new ProcessInstrumentationOptions();
configure?.Invoke(options);

builder.AddMeter(ProcessMetrics.MeterName);

return builder.AddInstrumentation(() => new ProcessMetrics(options));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ namespace OpenTelemetry.Instrumentation.Process;
/// <summary>
/// Options to define the process metrics.
/// </summary>
public class ProcessInstrumentationOptions
internal class ProcessInstrumentationOptions
{
}