From ecef81d551275507708bccd9406f0066ef7bb556 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 8 Dec 2023 15:00:50 -0800 Subject: [PATCH] [api-extensions-logs] ExperimentalAttribute decoration for experimental APIs (#5148) --- ...tryDependencyInjectionLoggerProviderBuilderExtensions.cs | 3 +++ ...DependencyInjectionLoggingServiceCollectionExtensions.cs | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/OpenTelemetry.Api.ProviderBuilderExtensions/Logs/OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.cs b/src/OpenTelemetry.Api.ProviderBuilderExtensions/Logs/OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.cs index 72b3f21de77..257b7332bec 100644 --- a/src/OpenTelemetry.Api.ProviderBuilderExtensions/Logs/OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Api.ProviderBuilderExtensions/Logs/OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.cs @@ -14,6 +14,9 @@ namespace OpenTelemetry.Logs; /// Contains extension methods for the class. /// #if EXPOSE_EXPERIMENTAL_FEATURES +#if NET8_0_OR_GREATER +[Experimental(DiagnosticDefinitions.LoggerProviderExperimentalApi, UrlFormat = DiagnosticDefinitions.ExperimentalApiUrlFormat)] +#endif public #else internal diff --git a/src/OpenTelemetry.Api.ProviderBuilderExtensions/Logs/OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions.cs b/src/OpenTelemetry.Api.ProviderBuilderExtensions/Logs/OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions.cs index b30085b5744..8e6f899b24e 100644 --- a/src/OpenTelemetry.Api.ProviderBuilderExtensions/Logs/OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions.cs +++ b/src/OpenTelemetry.Api.ProviderBuilderExtensions/Logs/OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions.cs @@ -1,6 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#if EXPOSE_EXPERIMENTAL_FEATURES && NET8_0_OR_GREATER +using System.Diagnostics.CodeAnalysis; +#endif using Microsoft.Extensions.DependencyInjection; using OpenTelemetry.Internal; @@ -10,6 +13,9 @@ namespace OpenTelemetry.Logs; /// Extension methods for setting up OpenTelemetry logging services in an . /// #if EXPOSE_EXPERIMENTAL_FEATURES +#if NET8_0_OR_GREATER +[Experimental(DiagnosticDefinitions.LoggerProviderExperimentalApi, UrlFormat = DiagnosticDefinitions.ExperimentalApiUrlFormat)] +#endif public #else internal