From 76523febc5d7f08b8d3a56a4bc5c8a8a220bbe4f Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 10 May 2024 13:04:04 -0700 Subject: [PATCH 1/5] Promote OTEL1002 to stable. --- OpenTelemetry.sln | 1 - .../diagnostics/experimental-apis/OTEL1002.md | 30 ------------------- docs/diagnostics/experimental-apis/README.md | 14 ++++----- .../Builder/MeterProviderBuilderExtensions.cs | 12 +------- .../Metrics/Exemplar/Exemplar.cs | 15 +--------- .../Metrics/Exemplar/ExemplarFilterType.cs | 15 +--------- .../Exemplar/ReadOnlyExemplarCollection.cs | 15 +--------- src/OpenTelemetry/Metrics/MetricPoint.cs | 15 +--------- .../ReadOnlyFilteredTagCollection.cs | 14 +-------- src/Shared/DiagnosticDefinitions.cs | 5 +++- 10 files changed, 17 insertions(+), 119 deletions(-) delete mode 100644 docs/diagnostics/experimental-apis/OTEL1002.md diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln index 203a7d12a3a..5d9d00363cf 100644 --- a/OpenTelemetry.sln +++ b/OpenTelemetry.sln @@ -310,7 +310,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "experimental-apis", "experi ProjectSection(SolutionItems) = preProject docs\diagnostics\experimental-apis\OTEL1000.md = docs\diagnostics\experimental-apis\OTEL1000.md docs\diagnostics\experimental-apis\OTEL1001.md = docs\diagnostics\experimental-apis\OTEL1001.md - docs\diagnostics\experimental-apis\OTEL1002.md = docs\diagnostics\experimental-apis\OTEL1002.md docs\diagnostics\experimental-apis\OTEL1003.md = docs\diagnostics\experimental-apis\OTEL1003.md docs\diagnostics\experimental-apis\OTEL1004.md = docs\diagnostics\experimental-apis\OTEL1004.md docs\diagnostics\experimental-apis\README.md = docs\diagnostics\experimental-apis\README.md diff --git a/docs/diagnostics/experimental-apis/OTEL1002.md b/docs/diagnostics/experimental-apis/OTEL1002.md deleted file mode 100644 index f6cf0ca0a65..00000000000 --- a/docs/diagnostics/experimental-apis/OTEL1002.md +++ /dev/null @@ -1,30 +0,0 @@ -# OpenTelemetry .NET Diagnostic: OTEL1002 - -## Overview - -This is an Experimental API diagnostic covering the following APIs: - -* `Exemplar` -* `ExemplarFilterType` -* `MeterProviderBuilder.SetExemplarFilter` extension method -* `ReadOnlyExemplarCollection` -* `ReadOnlyFilteredTagCollection` -* `MetricPoint.TryGetExemplars` - -Experimental APIs may be changed or removed in the future. - -## Details - -The OpenTelemetry Specification defines an [Exemplar -API](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#exemplar) -in the Metrics SDK. - -From the specification: - -> Exemplars are example data points for aggregated data. They provide specific -> context to otherwise general aggregations. Exemplars allow correlation between -> aggregated metric data and the original API calls where measurements are -> recorded. - -We are exposing these APIs experimentally until the specification declares them -stable. diff --git a/docs/diagnostics/experimental-apis/README.md b/docs/diagnostics/experimental-apis/README.md index 69b3eda837c..6c581030b4c 100644 --- a/docs/diagnostics/experimental-apis/README.md +++ b/docs/diagnostics/experimental-apis/README.md @@ -27,12 +27,6 @@ Description: Logs Bridge API Details: [OTEL1001](./OTEL1001.md) -### OTEL1002 - -Description: Metrics Exemplar Support - -Details: [OTEL1002](./OTEL1002.md) - ### OTEL1003 Description: MetricStreamConfiguration CardinalityLimit Support @@ -57,4 +51,10 @@ Experimental APIs which have been released stable or removed: removed add details for alternative solution or reasoning. --> -None +### OTEL1002 + +Description: Metrics Exemplar Support + +Details: [OTEL1002](https://github.com/open-telemetry/opentelemetry-dotnet/blob/b8ea807bae1a5d9b0f3d6d23b1e1e10f5e096a25/docs/diagnostics/experimental-apis/OTEL1002.md) + +Released stable: `1.9.0` diff --git a/src/OpenTelemetry/Metrics/Builder/MeterProviderBuilderExtensions.cs b/src/OpenTelemetry/Metrics/Builder/MeterProviderBuilderExtensions.cs index 4f638923c8b..4eea35b59c5 100644 --- a/src/OpenTelemetry/Metrics/Builder/MeterProviderBuilderExtensions.cs +++ b/src/OpenTelemetry/Metrics/Builder/MeterProviderBuilderExtensions.cs @@ -317,13 +317,10 @@ public static MeterProvider Build(this MeterProviderBuilder meterProviderBuilder throw new NotSupportedException($"Build is not supported on '{meterProviderBuilder?.GetType().FullName ?? "null"}' instances."); } -#if EXPOSE_EXPERIMENTAL_FEATURES /// /// Sets the default for the provider. /// /// - /// /// Notes: /// /// The configured controls how @@ -353,14 +350,7 @@ public static MeterProvider Build(this MeterProviderBuilder meterProviderBuilder /// use. /// The supplied for /// chaining. -#if NET8_0_OR_GREATER - [Experimental(DiagnosticDefinitions.ExemplarExperimentalApi, UrlFormat = DiagnosticDefinitions.ExperimentalApiUrlFormat)] -#endif - public -#else - internal -#endif - static MeterProviderBuilder SetExemplarFilter( + public static MeterProviderBuilder SetExemplarFilter( this MeterProviderBuilder meterProviderBuilder, ExemplarFilterType exemplarFilter) { diff --git a/src/OpenTelemetry/Metrics/Exemplar/Exemplar.cs b/src/OpenTelemetry/Metrics/Exemplar/Exemplar.cs index 0f4b0f59e93..c53a7abf8b4 100644 --- a/src/OpenTelemetry/Metrics/Exemplar/Exemplar.cs +++ b/src/OpenTelemetry/Metrics/Exemplar/Exemplar.cs @@ -5,30 +5,17 @@ using System.Collections.Frozen; #endif using System.Diagnostics; -#if EXPOSE_EXPERIMENTAL_FEATURES && NET8_0_OR_GREATER -using System.Diagnostics.CodeAnalysis; -using OpenTelemetry.Internal; -#endif namespace OpenTelemetry.Metrics; -#if EXPOSE_EXPERIMENTAL_FEATURES /// /// Exemplar implementation. /// /// -/// WARNING: This is an experimental API which might change or be removed in the future. Use at your own risk. /// Specification: . /// -#if NET8_0_OR_GREATER -[Experimental(DiagnosticDefinitions.ExemplarExperimentalApi, UrlFormat = DiagnosticDefinitions.ExperimentalApiUrlFormat)] -#endif -public -#else -internal -#endif - struct Exemplar +public struct Exemplar { #if NET8_0_OR_GREATER internal FrozenSet? ViewDefinedTagKeys; diff --git a/src/OpenTelemetry/Metrics/Exemplar/ExemplarFilterType.cs b/src/OpenTelemetry/Metrics/Exemplar/ExemplarFilterType.cs index 959d1f8e42f..efe08dc77e5 100644 --- a/src/OpenTelemetry/Metrics/Exemplar/ExemplarFilterType.cs +++ b/src/OpenTelemetry/Metrics/Exemplar/ExemplarFilterType.cs @@ -2,30 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 using System.Diagnostics; -#if EXPOSE_EXPERIMENTAL_FEATURES && NET8_0_OR_GREATER -using System.Diagnostics.CodeAnalysis; -using OpenTelemetry.Internal; -#endif namespace OpenTelemetry.Metrics; -#if EXPOSE_EXPERIMENTAL_FEATURES /// /// Defines the supported exemplar filters. /// /// -/// /// Specification: . /// -#if NET8_0_OR_GREATER -[Experimental(DiagnosticDefinitions.ExemplarExperimentalApi, UrlFormat = DiagnosticDefinitions.ExperimentalApiUrlFormat)] -#endif -public -#else -internal -#endif - enum ExemplarFilterType +public enum ExemplarFilterType { /// /// An exemplar filter which makes no measurements eligible for becoming an diff --git a/src/OpenTelemetry/Metrics/Exemplar/ReadOnlyExemplarCollection.cs b/src/OpenTelemetry/Metrics/Exemplar/ReadOnlyExemplarCollection.cs index 4a43bf3ebc6..1ebf2a3e365 100644 --- a/src/OpenTelemetry/Metrics/Exemplar/ReadOnlyExemplarCollection.cs +++ b/src/OpenTelemetry/Metrics/Exemplar/ReadOnlyExemplarCollection.cs @@ -2,26 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 using System.Diagnostics; -#if EXPOSE_EXPERIMENTAL_FEATURES && NET8_0_OR_GREATER -using System.Diagnostics.CodeAnalysis; -using OpenTelemetry.Internal; -#endif namespace OpenTelemetry.Metrics; -#if EXPOSE_EXPERIMENTAL_FEATURES /// /// A read-only collection of s. /// -/// -#if NET8_0_OR_GREATER -[Experimental(DiagnosticDefinitions.ExemplarExperimentalApi, UrlFormat = DiagnosticDefinitions.ExperimentalApiUrlFormat)] -#endif -public -#else -internal -#endif - readonly struct ReadOnlyExemplarCollection +public readonly struct ReadOnlyExemplarCollection { internal static readonly ReadOnlyExemplarCollection Empty = new(Array.Empty()); private readonly Exemplar[] exemplars; diff --git a/src/OpenTelemetry/Metrics/MetricPoint.cs b/src/OpenTelemetry/Metrics/MetricPoint.cs index adf0136d3c4..2e3e400a9e2 100644 --- a/src/OpenTelemetry/Metrics/MetricPoint.cs +++ b/src/OpenTelemetry/Metrics/MetricPoint.cs @@ -2,9 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 using System.Diagnostics; -#if EXPOSE_EXPERIMENTAL_FEATURES && NET8_0_OR_GREATER -using System.Diagnostics.CodeAnalysis; -#endif using System.Runtime.CompilerServices; using OpenTelemetry.Internal; @@ -365,23 +362,13 @@ public readonly bool TryGetHistogramMinMaxValues(out double min, out double max) return false; } -#if EXPOSE_EXPERIMENTAL_FEATURES /// /// Gets the exemplars associated with the metric point. /// - /// /// . /// if exemplars exist; otherwise. [MethodImpl(MethodImplOptions.AggressiveInlining)] -#if NET8_0_OR_GREATER - [Experimental(DiagnosticDefinitions.ExemplarExperimentalApi, UrlFormat = DiagnosticDefinitions.ExperimentalApiUrlFormat)] -#endif - public -#else - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal -#endif - readonly bool TryGetExemplars(out ReadOnlyExemplarCollection exemplars) + public readonly bool TryGetExemplars(out ReadOnlyExemplarCollection exemplars) { exemplars = this.mpComponents?.Exemplars ?? ReadOnlyExemplarCollection.Empty; return exemplars.MaximumCount > 0; diff --git a/src/OpenTelemetry/ReadOnlyFilteredTagCollection.cs b/src/OpenTelemetry/ReadOnlyFilteredTagCollection.cs index 2c41020c767..8b8d7d12b3d 100644 --- a/src/OpenTelemetry/ReadOnlyFilteredTagCollection.cs +++ b/src/OpenTelemetry/ReadOnlyFilteredTagCollection.cs @@ -5,28 +5,16 @@ using System.Collections.Frozen; #endif using System.Diagnostics; -#if EXPOSE_EXPERIMENTAL_FEATURES && NET8_0_OR_GREATER -using System.Diagnostics.CodeAnalysis; -using OpenTelemetry.Internal; -#endif namespace OpenTelemetry; -#if EXPOSE_EXPERIMENTAL_FEATURES /// /// A read-only collection of tag key/value pairs which returns a filtered /// subset of tags when enumerated. /// // Note: Does not implement IReadOnlyCollection<> or IEnumerable<> to // prevent accidental boxing. -#if NET8_0_OR_GREATER -[Experimental(DiagnosticDefinitions.ExemplarExperimentalApi, UrlFormat = DiagnosticDefinitions.ExperimentalApiUrlFormat)] -#endif -public -#else -internal -#endif - readonly struct ReadOnlyFilteredTagCollection +public readonly struct ReadOnlyFilteredTagCollection { #if NET8_0_OR_GREATER private readonly FrozenSet? excludedKeys; diff --git a/src/Shared/DiagnosticDefinitions.cs b/src/Shared/DiagnosticDefinitions.cs index e758d26700b..94bf1c5f52d 100644 --- a/src/Shared/DiagnosticDefinitions.cs +++ b/src/Shared/DiagnosticDefinitions.cs @@ -11,7 +11,10 @@ internal static class DiagnosticDefinitions public const string LoggerProviderExperimentalApi = "OTEL1000"; public const string LogsBridgeExperimentalApi = "OTEL1001"; - public const string ExemplarExperimentalApi = "OTEL1002"; public const string CardinalityLimitExperimentalApi = "OTEL1003"; public const string ExemplarReservoirExperimentalApi = "OTEL1004"; + + /* Definitions which have been released stable: + public const string ExemplarExperimentalApi = "OTEL1002"; + */ } From 41788a47546b93eb3953f90e3ceb2d7418e02bbd Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 10 May 2024 13:06:56 -0700 Subject: [PATCH 2/5] Update public api files. --- .../Experimental/PublicAPI.Unshipped.txt | 28 ------------------- .../.publicApi/Stable/PublicAPI.Unshipped.txt | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/OpenTelemetry/.publicApi/Experimental/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/Experimental/PublicAPI.Unshipped.txt index 00031ea690d..22a73f5d6bb 100644 --- a/src/OpenTelemetry/.publicApi/Experimental/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/Experimental/PublicAPI.Unshipped.txt @@ -8,18 +8,6 @@ OpenTelemetry.Logs.LogRecord.Severity.get -> OpenTelemetry.Logs.LogRecordSeverit OpenTelemetry.Logs.LogRecord.Severity.set -> void OpenTelemetry.Logs.LogRecord.SeverityText.get -> string? OpenTelemetry.Logs.LogRecord.SeverityText.set -> void -OpenTelemetry.Metrics.Exemplar -OpenTelemetry.Metrics.Exemplar.DoubleValue.get -> double -OpenTelemetry.Metrics.Exemplar.Exemplar() -> void -OpenTelemetry.Metrics.Exemplar.FilteredTags.get -> OpenTelemetry.ReadOnlyFilteredTagCollection -OpenTelemetry.Metrics.Exemplar.LongValue.get -> long -OpenTelemetry.Metrics.Exemplar.SpanId.get -> System.Diagnostics.ActivitySpanId -OpenTelemetry.Metrics.Exemplar.Timestamp.get -> System.DateTimeOffset -OpenTelemetry.Metrics.Exemplar.TraceId.get -> System.Diagnostics.ActivityTraceId -OpenTelemetry.Metrics.ExemplarFilterType -OpenTelemetry.Metrics.ExemplarFilterType.AlwaysOff = 0 -> OpenTelemetry.Metrics.ExemplarFilterType -OpenTelemetry.Metrics.ExemplarFilterType.AlwaysOn = 1 -> OpenTelemetry.Metrics.ExemplarFilterType -OpenTelemetry.Metrics.ExemplarFilterType.TraceBased = 2 -> OpenTelemetry.Metrics.ExemplarFilterType OpenTelemetry.Metrics.ExemplarMeasurement OpenTelemetry.Metrics.ExemplarMeasurement.ExemplarMeasurement() -> void OpenTelemetry.Metrics.ExemplarMeasurement.Tags.get -> System.ReadOnlySpan> @@ -31,25 +19,10 @@ OpenTelemetry.Metrics.FixedSizeExemplarReservoir.Capacity.get -> int OpenTelemetry.Metrics.FixedSizeExemplarReservoir.FixedSizeExemplarReservoir(int capacity) -> void OpenTelemetry.Metrics.FixedSizeExemplarReservoir.UpdateExemplar(int exemplarIndex, in OpenTelemetry.Metrics.ExemplarMeasurement measurement) -> void OpenTelemetry.Metrics.FixedSizeExemplarReservoir.UpdateExemplar(int exemplarIndex, in OpenTelemetry.Metrics.ExemplarMeasurement measurement) -> void -OpenTelemetry.Metrics.MetricPoint.TryGetExemplars(out OpenTelemetry.Metrics.ReadOnlyExemplarCollection exemplars) -> bool OpenTelemetry.Metrics.MetricStreamConfiguration.CardinalityLimit.get -> int? OpenTelemetry.Metrics.MetricStreamConfiguration.CardinalityLimit.set -> void OpenTelemetry.Metrics.MetricStreamConfiguration.ExemplarReservoirFactory.get -> System.Func? OpenTelemetry.Metrics.MetricStreamConfiguration.ExemplarReservoirFactory.set -> void -OpenTelemetry.Metrics.ReadOnlyExemplarCollection -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.Current.get -> OpenTelemetry.Metrics.Exemplar -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.Enumerator() -> void -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.MoveNext() -> bool -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.GetEnumerator() -> OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.ReadOnlyExemplarCollection() -> void -OpenTelemetry.ReadOnlyFilteredTagCollection -OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator -OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Current.get -> System.Collections.Generic.KeyValuePair -OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Enumerator() -> void -OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.MoveNext() -> bool -OpenTelemetry.ReadOnlyFilteredTagCollection.GetEnumerator() -> OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator -OpenTelemetry.ReadOnlyFilteredTagCollection.ReadOnlyFilteredTagCollection() -> void override sealed OpenTelemetry.Metrics.FixedSizeExemplarReservoir.Collect() -> OpenTelemetry.Metrics.ReadOnlyExemplarCollection static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, OpenTelemetry.BaseProcessor! processor) -> OpenTelemetry.Logs.LoggerProviderBuilder! static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Func!>! implementationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! @@ -60,7 +33,6 @@ static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.SetResourceBuilder(thi static OpenTelemetry.Logs.LoggerProviderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProvider! provider, OpenTelemetry.BaseProcessor! processor) -> OpenTelemetry.Logs.LoggerProvider! static OpenTelemetry.Logs.LoggerProviderExtensions.ForceFlush(this OpenTelemetry.Logs.LoggerProvider! provider, int timeoutMilliseconds = -1) -> bool static OpenTelemetry.Logs.LoggerProviderExtensions.Shutdown(this OpenTelemetry.Logs.LoggerProvider! provider, int timeoutMilliseconds = -1) -> bool -static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.SetExemplarFilter(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, OpenTelemetry.Metrics.ExemplarFilterType exemplarFilter) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action! configure) -> OpenTelemetry.IOpenTelemetryBuilder! static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action? configureBuilder, System.Action? configureOptions) -> OpenTelemetry.IOpenTelemetryBuilder! diff --git a/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt index e69de29bb2d..a9a6c031d7a 100644 --- a/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -0,0 +1,28 @@ +OpenTelemetry.Metrics.Exemplar +OpenTelemetry.Metrics.Exemplar.DoubleValue.get -> double +OpenTelemetry.Metrics.Exemplar.Exemplar() -> void +OpenTelemetry.Metrics.Exemplar.FilteredTags.get -> OpenTelemetry.ReadOnlyFilteredTagCollection +OpenTelemetry.Metrics.Exemplar.LongValue.get -> long +OpenTelemetry.Metrics.Exemplar.SpanId.get -> System.Diagnostics.ActivitySpanId +OpenTelemetry.Metrics.Exemplar.Timestamp.get -> System.DateTimeOffset +OpenTelemetry.Metrics.Exemplar.TraceId.get -> System.Diagnostics.ActivityTraceId +OpenTelemetry.Metrics.ExemplarFilterType +OpenTelemetry.Metrics.ExemplarFilterType.AlwaysOff = 0 -> OpenTelemetry.Metrics.ExemplarFilterType +OpenTelemetry.Metrics.ExemplarFilterType.AlwaysOn = 1 -> OpenTelemetry.Metrics.ExemplarFilterType +OpenTelemetry.Metrics.ExemplarFilterType.TraceBased = 2 -> OpenTelemetry.Metrics.ExemplarFilterType +OpenTelemetry.Metrics.MetricPoint.TryGetExemplars(out OpenTelemetry.Metrics.ReadOnlyExemplarCollection exemplars) -> bool +OpenTelemetry.Metrics.ReadOnlyExemplarCollection +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.Current.get -> OpenTelemetry.Metrics.Exemplar +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.Enumerator() -> void +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.MoveNext() -> bool +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.GetEnumerator() -> OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.ReadOnlyExemplarCollection() -> void +OpenTelemetry.ReadOnlyFilteredTagCollection +OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator +OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Current.get -> System.Collections.Generic.KeyValuePair +OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Enumerator() -> void +OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.MoveNext() -> bool +OpenTelemetry.ReadOnlyFilteredTagCollection.GetEnumerator() -> OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator +OpenTelemetry.ReadOnlyFilteredTagCollection.ReadOnlyFilteredTagCollection() -> void +static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.SetExemplarFilter(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, OpenTelemetry.Metrics.ExemplarFilterType exemplarFilter) -> OpenTelemetry.Metrics.MeterProviderBuilder! From b8dce1414be8cc19a197ba1aa32a73143538c974 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 10 May 2024 13:10:11 -0700 Subject: [PATCH 3/5] CHANGELOG stub. --- src/OpenTelemetry/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/OpenTelemetry/CHANGELOG.md b/src/OpenTelemetry/CHANGELOG.md index 17b69e13e6c..068aa1b8f79 100644 --- a/src/OpenTelemetry/CHANGELOG.md +++ b/src/OpenTelemetry/CHANGELOG.md @@ -18,6 +18,13 @@ `ExemplarReservoirFactory` property on the View API. ([#5558](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5558)) +* The experimental APIs previously covered by `OTEL1002` (`Exemplar`, + `ExemplarFilterType`, `MeterProviderBuilder.SetExemplarFilter`, + `ReadOnlyExemplarCollection`, `ReadOnlyFilteredTagCollection`, & + `MetricPoint.TryGetExemplars`) will now be part of the public API and + supported in stable builds. + ([#XXXX](https://github.com/open-telemetry/opentelemetry-dotnet/pull/XXXX)) + ## 1.8.1 Released 2024-Apr-17 From b6a144802c151fedbe9ece47bc22aeb1b256d82b Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 10 May 2024 13:16:41 -0700 Subject: [PATCH 4/5] CHANGELOG patch. --- src/OpenTelemetry/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry/CHANGELOG.md b/src/OpenTelemetry/CHANGELOG.md index 068aa1b8f79..bbcbbcdd6a8 100644 --- a/src/OpenTelemetry/CHANGELOG.md +++ b/src/OpenTelemetry/CHANGELOG.md @@ -23,7 +23,7 @@ `ReadOnlyExemplarCollection`, `ReadOnlyFilteredTagCollection`, & `MetricPoint.TryGetExemplars`) will now be part of the public API and supported in stable builds. - ([#XXXX](https://github.com/open-telemetry/opentelemetry-dotnet/pull/XXXX)) + ([#5607](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5607)) ## 1.8.1 From c43f137c07c8678b52761c2d7a875a7164214ac1 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 10 May 2024 22:18:22 -0700 Subject: [PATCH 5/5] Test fixes. --- src/OpenTelemetry/Metrics/MeterProviderSdk.cs | 8 -------- test/OpenTelemetry.Tests/Metrics/MetricExemplarTests.cs | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/OpenTelemetry/Metrics/MeterProviderSdk.cs b/src/OpenTelemetry/Metrics/MeterProviderSdk.cs index 1feb24a0036..595fd54e77d 100644 --- a/src/OpenTelemetry/Metrics/MeterProviderSdk.cs +++ b/src/OpenTelemetry/Metrics/MeterProviderSdk.cs @@ -490,7 +490,6 @@ private void ApplySpecificationConfigurationKeys(IConfiguration configuration) OpenTelemetrySdkEventSource.Log.MeterProviderSdkEvent("Reclaim unused metric point feature enabled via configuration."); } -#if EXPOSE_EXPERIMENTAL_FEATURES if (configuration.TryGetStringValue(ExemplarFilterConfigKey, out var configValue)) { if (this.ExemplarFilter.HasValue) @@ -523,12 +522,5 @@ private void ApplySpecificationConfigurationKeys(IConfiguration configuration) OpenTelemetrySdkEventSource.Log.MeterProviderSdkEvent($"Exemplar filter set to '{exemplarFilter}' from configuration."); } -#else - if (configuration.TryGetStringValue(ExemplarFilterConfigKey, out var configValue)) - { - OpenTelemetrySdkEventSource.Log.MeterProviderSdkEvent( - $"Exemplar filter configuration value '{configValue}' has been ignored because exemplars are an experimental feature not available in stable builds."); - } -#endif } } diff --git a/test/OpenTelemetry.Tests/Metrics/MetricExemplarTests.cs b/test/OpenTelemetry.Tests/Metrics/MetricExemplarTests.cs index 2499c825b6a..0e5058ba1bc 100644 --- a/test/OpenTelemetry.Tests/Metrics/MetricExemplarTests.cs +++ b/test/OpenTelemetry.Tests/Metrics/MetricExemplarTests.cs @@ -15,9 +15,8 @@ namespace OpenTelemetry.Metrics.Tests; public class MetricExemplarTests : MetricTestsBase { private const int MaxTimeToAllowForFlush = 10000; - private static readonly Func IsExemplarApiExposed = () => typeof(ExemplarFilterType).IsVisible; - [SkipUnlessTrueTheory(typeof(MetricExemplarTests), nameof(IsExemplarApiExposed), "ExemplarFilter config tests skipped for stable builds")] + [Theory] [InlineData(null, null, null)] [InlineData(null, "always_off", (int)ExemplarFilterType.AlwaysOff)] [InlineData(null, "ALWays_ON", (int)ExemplarFilterType.AlwaysOn)]