diff --git a/CHANGELOG.md b/CHANGELOG.md index e392f26a17..2591c70b06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,21 @@ All notable changes to this component are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This component adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/compare/v1.0.0-rc.1...HEAD) +## [Unreleased](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/compare/v1.0.0-rc.2...HEAD) + +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +### Security + +## [1.0.0-rc.2](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/v1.0.0-rc.2) ### Added @@ -14,7 +28,7 @@ This component adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.h - Added `BeforeConfigureTracerProvider`, `BeforeConfigureMeterProvider`, `TracerProviderInitialized` and `MeterProviderInitialized` for plugins. See [plugins documentation](/docs/plugins.md) for details. -- Added support for Azure SDK traces instrumentation. +- Added support for Azure SDK traces instrumentation on .NET. ### Changed @@ -23,16 +37,13 @@ This component adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.h See [plugins documentation](/docs/plugins.md) for details. - Minimal version of `Grpc.Net.Client` supported on .NET updated to `2.52.0`. -### Deprecated - -### Removed - ### Fixed - `OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES` works correctly when .NET CLR Profiler is not enabled. - -### Security +- Fixed manual tracing when instrumented project is referencing + `System.Diagnostics.DiagnosticSource` `7.0.2` + [#2780](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/2780). ## [1.0.0-rc.1](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/v1.0.0-rc.1) diff --git a/OpenTelemetry.DotNet.Auto.psm1 b/OpenTelemetry.DotNet.Auto.psm1 index 6ec024e8c5..bd4e6bcb16 100644 --- a/OpenTelemetry.DotNet.Auto.psm1 +++ b/OpenTelemetry.DotNet.Auto.psm1 @@ -222,7 +222,7 @@ function Install-OpenTelemetryCore() { [string]$LocalPath ) - $version = "v1.0.0-rc.1" + $version = "v1.0.0-rc.2" $installDir = Get-CLIInstallDir-From-InstallDir $InstallDir $archivePath = $null $deleteArchive = $true diff --git a/docs/README.md b/docs/README.md index 9b40cc98c7..5d34f08c43 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,8 +10,8 @@ to .NET applications without having to modify their source code. > **Warning** > The following documentation refers to the in-development version of OpenTelemetry .NET Automatic Instrumentation. Docs for the latest version -([1.0.0-rc.1](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest)) -can be found [here](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/v1.0.0-rc.1/docs/README.md). +([1.0.0-rc.2](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest)) +can be found [here](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/v1.0.0-rc.2/docs/README.md). --- @@ -167,7 +167,7 @@ Example usage: ```sh # Download the bash script -curl -sSfL https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet-instrumentation/v1.0.0-rc.1/otel-dotnet-auto-install.sh -O +curl -sSfL https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet-instrumentation/v1.0.0-rc.2/otel-dotnet-auto-install.sh -O # Install core files sh ./otel-dotnet-auto-install.sh @@ -190,7 +190,7 @@ uses environment variables as parameters: | `OTEL_DOTNET_AUTO_HOME` | Location where binaries are to be installed | No | `$HOME/.otel-dotnet-auto` | | `OS_TYPE` | Possible values: `linux-glibc`, `linux-musl`, `macos`, `windows` | No | *Calculated* | | `TMPDIR` | Temporary directory used when downloading the files | No | `$(mktemp -d)` | -| `VERSION` | Version to download | No | `1.0.0-rc.1` | +| `VERSION` | Version to download | No | `1.0.0-rc.2` | [instrument.sh](../instrument.sh) script uses environment variables as parameters: @@ -209,7 +209,7 @@ Example usage (run as administrator): ```powershell # Download the module -$module_url = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet-instrumentation/v1.0.0-rc.1/OpenTelemetry.DotNet.Auto.psm1" +$module_url = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet-instrumentation/v1.0.0-rc.2/OpenTelemetry.DotNet.Auto.psm1" $download_path = Join-Path $env:temp "OpenTelemetry.DotNet.Auto.psm1" Invoke-WebRequest -Uri $module_url -OutFile $download_path -UseBasicParsing diff --git a/docs/config.md b/docs/config.md index 952372b8a5..23cdd0f855 100644 --- a/docs/config.md +++ b/docs/config.md @@ -128,7 +128,7 @@ due to lack of stable semantic convention. |-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------| | `ASPNET` | ASP.NET (.NET Framework) MVC / WebApi \[1\] **Not supported on .NET** | * | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `ASPNETCORE` | ASP.NET Core **Not supported on .NET Framework** | * | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | -| `AZURE` | [Azure SDK](https://azure.github.io/azure-sdk/releases/latest/index.html) | \[2\] | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | +| `AZURE` | [Azure SDK](https://azure.github.io/azure-sdk/releases/latest/index.html) **Not supported on .NET Framework** | \[2\] | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `ELASTICSEARCH` | [Elastic.Clients.Elasticsearch](https://www.nuget.org/packages/Elastic.Clients.Elasticsearch) | ≥8.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `ENTITYFRAMEWORKCORE` | [Microsoft.EntityFrameworkCore](https://www.nuget.org/packages/) **Not supported on .NET Framework** | ≥6.0.12 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `GRAPHQL` | [GraphQL](https://www.nuget.org/packages/GraphQL) **Not supported on .NET Framework** | ≥7.5.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | diff --git a/otel-dotnet-auto-install.sh b/otel-dotnet-auto-install.sh index 23f849df16..6c56545e73 100755 --- a/otel-dotnet-auto-install.sh +++ b/otel-dotnet-auto-install.sh @@ -31,7 +31,7 @@ esac test -z "$OTEL_DOTNET_AUTO_HOME" && OTEL_DOTNET_AUTO_HOME="$HOME/.otel-dotnet-auto" test -z "$TMPDIR" && TMPDIR="$(mktemp -d)" -test -z "$VERSION" && VERSION="v1.0.0-rc.1" +test -z "$VERSION" && VERSION="v1.0.0-rc.2" RELEASES_URL="https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases" ARCHIVE="opentelemetry-dotnet-instrumentation-$OS_TYPE.zip" diff --git a/src/OpenTelemetry.AutoInstrumentation/Configurations/EnvironmentConfigurationTracerHelper.cs b/src/OpenTelemetry.AutoInstrumentation/Configurations/EnvironmentConfigurationTracerHelper.cs index 8677ec11d6..5e71965fcc 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Configurations/EnvironmentConfigurationTracerHelper.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Configurations/EnvironmentConfigurationTracerHelper.cs @@ -46,7 +46,6 @@ public static TracerProviderBuilder UseEnvironmentVariables( TracerInstrumentation.Quartz => Wrappers.AddQuartzInstrumentation(builder, pluginManager, lazyInstrumentationLoader), TracerInstrumentation.MongoDB => builder.AddSource("MongoDB.Driver.Core.Extensions.DiagnosticSources"), TracerInstrumentation.MySqlConnector => builder.AddSource("MySqlConnector"), - TracerInstrumentation.Azure => Wrappers.AddAzureInstrumentation(builder), #if NET6_0_OR_GREATER TracerInstrumentation.AspNetCore => Wrappers.AddAspNetCoreInstrumentation(builder, pluginManager, lazyInstrumentationLoader), TracerInstrumentation.MassTransit => builder.AddSource("MassTransit"), @@ -54,6 +53,7 @@ public static TracerProviderBuilder UseEnvironmentVariables( TracerInstrumentation.StackExchangeRedis => builder.AddSource("OpenTelemetry.Instrumentation.StackExchangeRedis"), TracerInstrumentation.EntityFrameworkCore => Wrappers.AddEntityFrameworkCoreInstrumentation(builder, pluginManager, lazyInstrumentationLoader), TracerInstrumentation.GraphQL => Wrappers.AddGraphQLInstrumentation(builder, pluginManager, lazyInstrumentationLoader, settings), + TracerInstrumentation.Azure => Wrappers.AddAzureInstrumentation(builder), #endif _ => null }; @@ -174,6 +174,13 @@ public static TracerProviderBuilder AddGraphQLInstrumentation(TracerProviderBuil return builder.AddSource("GraphQL"); } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static TracerProviderBuilder AddAzureInstrumentation(TracerProviderBuilder builder) + { + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", true); + return builder.AddSource("Azure.*"); + } #endif [MethodImpl(MethodImplOptions.NoInlining)] @@ -242,12 +249,5 @@ public static TracerProviderBuilder AddOtlpExporter(TracerProviderBuilder builde pluginManager.ConfigureTracesOptions(options); }); } - - [MethodImpl(MethodImplOptions.NoInlining)] - public static TracerProviderBuilder AddAzureInstrumentation(TracerProviderBuilder builder) - { - AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", true); - return builder.AddSource("Azure.*"); - } } } diff --git a/src/OpenTelemetry.AutoInstrumentation/Configurations/TracerInstrumentation.cs b/src/OpenTelemetry.AutoInstrumentation/Configurations/TracerInstrumentation.cs index c9a7f9b1c2..5b05e81ca7 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Configurations/TracerInstrumentation.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Configurations/TracerInstrumentation.cs @@ -123,8 +123,10 @@ internal enum TracerInstrumentation /// MySqlConnector = 17, +#if NET6_0_OR_GREATER /// /// Azure SDK instrumentation. /// Azure = 18 +#endif } diff --git a/src/OpenTelemetry.AutoInstrumentation/Instrumentation.cs b/src/OpenTelemetry.AutoInstrumentation/Instrumentation.cs index c1f60796d9..e0e7c715cf 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Instrumentation.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Instrumentation.cs @@ -303,6 +303,8 @@ private static void AddLazilyLoadedTraceInstrumentations(LazyInstrumentationLoad case TracerInstrumentation.GraphQL: DelayedInitialization.Traces.AddGraphQL(LazyInstrumentationLoader, pluginManager, tracerSettings); break; + case TracerInstrumentation.Azure: + break; #endif case TracerInstrumentation.MongoDB: break; @@ -314,8 +316,6 @@ private static void AddLazilyLoadedTraceInstrumentations(LazyInstrumentationLoad break; case TracerInstrumentation.MySqlConnector: break; - case TracerInstrumentation.Azure: - break; default: Logger.Warning($"Configured trace instrumentation type is not supported: {instrumentation}"); if (FailFastSettings.Value.FailFast) diff --git a/test/IntegrationTests/AzureCollection.cs b/test/IntegrationTests/AzureCollection.cs index 09eb0a0c75..141caa2a88 100644 --- a/test/IntegrationTests/AzureCollection.cs +++ b/test/IntegrationTests/AzureCollection.cs @@ -14,8 +14,9 @@ // limitations under the License. // +#if NET6_0_OR_GREATER + using DotNet.Testcontainers.Builders; -using DotNet.Testcontainers.Configurations; using DotNet.Testcontainers.Containers; using IntegrationTests.Helpers; using static IntegrationTests.Helpers.DockerFileHelper; @@ -74,3 +75,4 @@ private static async Task ShutdownAzureContainerAsync(IContainer container) await container.DisposeAsync(); } } +#endif diff --git a/test/IntegrationTests/AzureTests.cs b/test/IntegrationTests/AzureTests.cs index 2f094d82d1..66dc1e125a 100644 --- a/test/IntegrationTests/AzureTests.cs +++ b/test/IntegrationTests/AzureTests.cs @@ -14,6 +14,8 @@ // limitations under the License. // +#if NET6_0_OR_GREATER + using IntegrationTests.Helpers; using Xunit.Abstractions; @@ -57,3 +59,4 @@ public void SubmitsTraces(string packageVersion) collector.AssertExpectations(); } } +#endif diff --git a/test/OpenTelemetry.AutoInstrumentation.Tests/Configurations/SettingsTests.cs b/test/OpenTelemetry.AutoInstrumentation.Tests/Configurations/SettingsTests.cs index f724d60eee..d612f02e30 100644 --- a/test/OpenTelemetry.AutoInstrumentation.Tests/Configurations/SettingsTests.cs +++ b/test/OpenTelemetry.AutoInstrumentation.Tests/Configurations/SettingsTests.cs @@ -250,7 +250,9 @@ internal void Propagators_FailFast() [InlineData("WCFCLIENT", TracerInstrumentation.WcfClient)] #endif [InlineData("MYSQLCONNECTOR", TracerInstrumentation.MySqlConnector)] +#if NET6_0_OR_GREATER [InlineData("AZURE", TracerInstrumentation.Azure)] +#endif internal void TracerSettings_Instrumentations_SupportedValues(string tracerInstrumentation, TracerInstrumentation expectedTracerInstrumentation) { Environment.SetEnvironmentVariable(ConfigurationKeys.Traces.TracesInstrumentationEnabled, "false"); diff --git a/test/test-applications/integrations/TestApplication.Azure/Program.cs b/test/test-applications/integrations/TestApplication.Azure/Program.cs index 371456ae08..90823542a4 100644 --- a/test/test-applications/integrations/TestApplication.Azure/Program.cs +++ b/test/test-applications/integrations/TestApplication.Azure/Program.cs @@ -21,7 +21,6 @@ var port = GetBlobServicePortPort(args); -// connection string based on https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio#well-known-storage-account-and-key // connection string based on https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio#well-known-storage-account-and-key var developerConnectionString = $"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:{port}/devstoreaccount1;";