From 30a54c33c6d01da223dd7b0e01a70cb9a1c6ee16 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Mon, 1 Aug 2022 16:33:07 -0700 Subject: [PATCH 1/3] Rename options object for Runtime Instrumentation --- .../MeterProviderBuilderExtensions.cs | 4 ++-- ...nstrumentOptions.cs => RuntimeInstrumentationOptions.cs} | 4 ++-- src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs | 2 +- ...ptionsTests.cs => RuntimeInstrumentationOptionsTests.cs} | 6 ++---- 4 files changed, 7 insertions(+), 9 deletions(-) rename src/OpenTelemetry.Instrumentation.Runtime/{RuntimeInstrumentOptions.cs => RuntimeInstrumentationOptions.cs} (96%) rename test/OpenTelemetry.Instrumentation.Runtime.Tests/{RuntimeInstrumentOptionsTests.cs => RuntimeInstrumentationOptionsTests.cs} (96%) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs index f207bb5bc6..9963243e7a 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs @@ -33,11 +33,11 @@ public static class MeterProviderBuilderExtensions /// The instance of to chain the calls. public static MeterProviderBuilder AddRuntimeInstrumentation( this MeterProviderBuilder builder, - Action configure = null) + Action configure = null) { Guard.ThrowIfNull(builder); - var options = new RuntimeInstrumentOptions(); + var options = new RuntimeInstrumentationOptions(); configure?.Invoke(options); var instrumentation = new RuntimeMetrics(options); diff --git a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentOptions.cs b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentationOptions.cs similarity index 96% rename from src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentOptions.cs rename to src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentationOptions.cs index 38455545f0..3809444a4a 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentOptions.cs +++ b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentationOptions.cs @@ -1,4 +1,4 @@ -// +// // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +19,7 @@ namespace OpenTelemetry.Instrumentation.Runtime /// /// Options to define the runtime metrics. /// - public class RuntimeInstrumentOptions + public class RuntimeInstrumentationOptions { /* /// diff --git a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs index c373950e5f..feba138700 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs +++ b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs @@ -219,7 +219,7 @@ static RuntimeMetrics() /// Initializes a new instance of the class. /// /// The options to define the metrics. - public RuntimeMetrics(RuntimeInstrumentOptions options) + public RuntimeMetrics(RuntimeInstrumentationOptions options) { } diff --git a/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentOptionsTests.cs b/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs similarity index 96% rename from test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentOptionsTests.cs rename to test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs index 1f83d3ef30..63c47877a1 100644 --- a/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentOptionsTests.cs +++ b/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs @@ -1,4 +1,4 @@ -// +// // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,11 +14,9 @@ // limitations under the License. // -using Xunit; - namespace OpenTelemetry.Instrumentation.Runtime.Tests { - public class RuntimeInstrumentOptionsTests + public class RuntimeInstrumentationOptionsTests { /* [Fact] From 9862637cb0d861c74d6deaec4535afecefc437f1 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Mon, 1 Aug 2022 16:37:42 -0700 Subject: [PATCH 2/3] Update `CHANGELOG.md` --- src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md index 93c98d5ae5..878f819c97 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Rename `RuntimeInstrumentOptions` to `RuntimeInstrumentationOptions` + ([#556](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/556)) + ## 1.0.0-rc.3 Released 2022-Jul-25 From 51a65dde3eb2f69ae911f4c8226cb4bcef91d009 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Mon, 1 Aug 2022 16:47:26 -0700 Subject: [PATCH 3/3] Update code in comments --- .../RuntimeInstrumentationOptionsTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs b/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs index 63c47877a1..d419f0c921 100644 --- a/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs +++ b/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs @@ -22,7 +22,7 @@ public class RuntimeInstrumentationOptionsTests [Fact] public void Enable_All_If_Nothing_Was_Defined() { - var options = new RuntimeInstrumentOptions(); + var options = new RuntimeInstrumentationOptions(); Assert.True(options.IsGcEnabled); #if NET6_0_OR_GREATER @@ -38,7 +38,7 @@ public void Enable_All_If_Nothing_Was_Defined() [Fact] public void Enable_Gc_Only() { - var options = new RuntimeInstrumentOptions { GcEnabled = true }; + var options = new RuntimeInstrumentationOptions { GcEnabled = true }; Assert.True(options.IsGcEnabled); #if NET6_0_OR_GREATER @@ -55,7 +55,7 @@ public void Enable_Gc_Only() [Fact] public void Enable_Jit_Only() { - var options = new RuntimeInstrumentOptions { JitEnabled = true }; + var options = new RuntimeInstrumentationOptions { JitEnabled = true }; Assert.False(options.IsGcEnabled); Assert.True(options.IsJitEnabled); @@ -69,7 +69,7 @@ public void Enable_Jit_Only() [Fact] public void Enable_Threading_Only() { - var options = new RuntimeInstrumentOptions { ThreadingEnabled = true }; + var options = new RuntimeInstrumentationOptions { ThreadingEnabled = true }; Assert.False(options.IsGcEnabled); #if NET6_0_OR_GREATER @@ -84,7 +84,7 @@ public void Enable_Threading_Only() [Fact] public void Enable_Assemblies_Only() { - var options = new RuntimeInstrumentOptions { AssembliesEnabled = true }; + var options = new RuntimeInstrumentationOptions { AssembliesEnabled = true }; Assert.False(options.IsGcEnabled); #if NET6_0_OR_GREATER @@ -100,7 +100,7 @@ public void Enable_Assemblies_Only() [Fact] public void Enable_Multiple() { - var options = new RuntimeInstrumentOptions { GcEnabled = true, AssembliesEnabled = true }; + var options = new RuntimeInstrumentationOptions { GcEnabled = true, AssembliesEnabled = true }; Assert.True(options.IsGcEnabled); #if NET6_0_OR_GREATER