From 8f313267fdbbe31228069091a501fbe670cea79d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Thu, 5 Sep 2024 10:10:49 +0200 Subject: [PATCH 1/7] [repo] Remove .NET 7 target --- .github/workflows/Component.BuildTest.yml | 2 +- .../ci-Exporter.OneCollector-Integration.yml | 2 +- .github/workflows/ci.yml | 6 +- .github/workflows/integration.yml | 4 +- build/Common.nonprod.props | 2 +- build/docker-compose.net7.0.yml | 9 - .../Examples.InfluxDB.csproj | 2 +- .../Examples.Wcf.Client.DotNet.csproj | 2 +- opentelemetry-dotnet-contrib.sln | 1 - .../Metrics/GenevaMetricExporter.cs | 2 +- .../CHANGELOG.md | 5 + .../Internal/CallbackManager.cs | 2 +- .../Serialization/BatchSerializationResult.cs | 2 +- .../CommonSchemaJsonSerializationHelper.cs | 4 +- .../Transports/TransportSendRequest.cs | 4 +- ...OpenTelemetry.Exporter.OneCollector.csproj | 4 +- ...OpenTelemetry.Extensions.Enrichment.csproj | 2 +- src/OpenTelemetry.Extensions/CHANGELOG.md | 5 + ...elemetry.Instrumentation.AspNetCore.csproj | 2 +- ...enTelemetry.Exporter.InfluxDB.Tests.csproj | 2 +- ...ry.Exporter.OneCollector.Benchmarks.csproj | 4 +- ...ommonSchemaJsonSerializationHelperTests.cs | 2 +- ...lemetry.Exporter.OneCollector.Tests.csproj | 2 +- .../BasicTests.cs | 4 +- ...ry.Instrumentation.AspNetCore.Tests.csproj | 7 +- .../RouteTests/README.md | 1 - .../RouteTests/README.net7.0.md | 654 ------------------ .../TestApplication/TestApplicationFactory.cs | 2 +- .../Dockerfile | 6 +- ...mentation.EntityFrameworkCore.Tests.csproj | 4 - ...Instrumentation.GrpcNetClient.Tests.csproj | 2 +- ...elemetry.Instrumentation.Http.Tests.csproj | 2 +- ...try.Instrumentation.SqlClient.Tests.csproj | 2 +- .../TestApp.AspNetCore.csproj | 2 +- 34 files changed, 47 insertions(+), 711 deletions(-) delete mode 100644 build/docker-compose.net7.0.yml delete mode 100644 test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md diff --git a/.github/workflows/Component.BuildTest.yml b/.github/workflows/Component.BuildTest.yml index 71c537cfd0..cdfba7cd4c 100644 --- a/.github/workflows/Component.BuildTest.yml +++ b/.github/workflows/Component.BuildTest.yml @@ -18,7 +18,7 @@ on: required: false type: string tfm-list: - default: '[ "net462", "net6.0", "net7.0", "net8.0" ]' + default: '[ "net462", "net6.0", "net8.0" ]' required: false type: string diff --git a/.github/workflows/ci-Exporter.OneCollector-Integration.yml b/.github/workflows/ci-Exporter.OneCollector-Integration.yml index 25ffa9b3ee..4f1a2dd9d2 100644 --- a/.github/workflows/ci-Exporter.OneCollector-Integration.yml +++ b/.github/workflows/ci-Exporter.OneCollector-Integration.yml @@ -29,7 +29,7 @@ jobs: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: os: [ windows-latest, ubuntu-latest ] - version: [ net462, net6.0, net7.0, net8.0 ] + version: [ net462, net6.0, net8.0 ] exclude: - os: ubuntu-latest version: net462 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c547f0e902..1953b3bf47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,7 @@ jobs: with: project-name: OpenTelemetry.Instrumentation.AspNetCore code-cov-name: Instrumentation.AspNetCore - tfm-list: '[ "net6.0", "net7.0", "net8.0" ]' + tfm-list: '[ "net6.0", "net8.0" ]' build-test-instrumentation-aws: needs: detect-changes @@ -219,7 +219,7 @@ jobs: with: project-name: Component[OpenTelemetry.Instrumentation.AWSLambda] code-cov-name: Instrumentation.AWSLambda - tfm-list: '[ "net6.0", "net7.0", "net8.0" ]' + tfm-list: '[ "net6.0", "net8.0" ]' build-test-instrumentation-cassandra: needs: detect-changes @@ -285,7 +285,7 @@ jobs: with: project-name: OpenTelemetry.Instrumentation.EventCounters code-cov-name: Instrumentation.EventCounters - tfm-list: '[ "net6.0", "net7.0", "net8.0" ]' + tfm-list: '[ "net6.0", "net8.0" ]' build-test-instrumentation-grpccore: needs: detect-changes diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3a11ddde2e..53c25d07fd 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - version: [net6.0, net7.0, net8.0] + version: [net6.0, net8.0] steps: - uses: actions/checkout@v4 @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - version: [net6.0, net7.0, net8.0] + version: [net6.0, net8.0] steps: - uses: actions/checkout@v4 diff --git a/build/Common.nonprod.props b/build/Common.nonprod.props index b7cf1a447f..0c8d95fde2 100644 --- a/build/Common.nonprod.props +++ b/build/Common.nonprod.props @@ -25,7 +25,7 @@ [17.11.0,18.0) $(OpenTelemetryCoreLatestVersion) $(OpenTelemetryCoreLatestPrereleaseVersion) - net8.0;net7.0;net6.0 + net8.0;net6.0 [2.8.2,3.0) [2.9.0,3.0) [1.6.1,2.0) diff --git a/build/docker-compose.net7.0.yml b/build/docker-compose.net7.0.yml deleted file mode 100644 index 48a2589cda..0000000000 --- a/build/docker-compose.net7.0.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: '3.7' - -services: - tests: - build: - args: - PUBLISH_FRAMEWORK: net7.0 - TEST_SDK_VERSION: "7.0" - BUILD_SDK_VERSION: "8.0" diff --git a/examples/InfluxDB/Examples.InfluxDB/Examples.InfluxDB.csproj b/examples/InfluxDB/Examples.InfluxDB/Examples.InfluxDB.csproj index b4a514d60e..c39d5ecdbe 100644 --- a/examples/InfluxDB/Examples.InfluxDB/Examples.InfluxDB.csproj +++ b/examples/InfluxDB/Examples.InfluxDB/Examples.InfluxDB.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 Examples.InfluxDB diff --git a/examples/wcf/client-core/Examples.Wcf.Client.DotNet.csproj b/examples/wcf/client-core/Examples.Wcf.Client.DotNet.csproj index 1da3e3ade7..f87ebac82a 100644 --- a/examples/wcf/client-core/Examples.Wcf.Client.DotNet.csproj +++ b/examples/wcf/client-core/Examples.Wcf.Client.DotNet.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 diff --git a/opentelemetry-dotnet-contrib.sln b/opentelemetry-dotnet-contrib.sln index e86c0bd8ee..635826b25b 100644 --- a/opentelemetry-dotnet-contrib.sln +++ b/opentelemetry-dotnet-contrib.sln @@ -54,7 +54,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{824BD1DE build\Common.targets = build\Common.targets build\debug.snk = build\debug.snk build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml - build\docker-compose.net7.0.yml = build\docker-compose.net7.0.yml build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png build\OpenTelemetryContrib.prod.ruleset = build\OpenTelemetryContrib.prod.ruleset diff --git a/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs b/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs index b596e592ab..3b66acdf56 100644 --- a/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs +++ b/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs @@ -109,7 +109,7 @@ internal static void DisableOpenTelemetrySdkMetricNameValidation() GetOpenTelemetryInstrumentNameRegexProperty().SetValue(null, GetDisableRegexPattern()); } -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER [GeneratedRegex(DisableRegexPattern)] private static partial Regex GetDisableRegexPattern(); #else diff --git a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md index ec1167039a..9b68676c08 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +* Removes `net7.0` target as .NET 7.0 is out + of support. The package keeps `netstandard2.1` target, so it + can still be used with .NET7.0 apps. + ([#2038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2038)) + ## 1.9.2 Released 2024-Aug-12 diff --git a/src/OpenTelemetry.Exporter.OneCollector/Internal/CallbackManager.cs b/src/OpenTelemetry.Exporter.OneCollector/Internal/CallbackManager.cs index dd342b779f..513bcf83d5 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Internal/CallbackManager.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Internal/CallbackManager.cs @@ -20,7 +20,7 @@ public IDisposable Add(T callback) lock (this.lockObject) { -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER ObjectDisposedException.ThrowIf(this.disposed, nameof(CallbackManager)); #else if (this.disposed) diff --git a/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/BatchSerializationResult.cs b/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/BatchSerializationResult.cs index ed12e24f54..c3cc86222f 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/BatchSerializationResult.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/BatchSerializationResult.cs @@ -5,7 +5,7 @@ namespace OpenTelemetry.Exporter.OneCollector; internal readonly struct BatchSerializationResult { -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER public required int NumberOfItemsSerialized { get; init; } public required int NumberOfItemsDropped { get; init; } diff --git a/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/CommonSchemaJsonSerializationHelper.cs b/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/CommonSchemaJsonSerializationHelper.cs index ca30a223ba..db94e2d1fd 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/CommonSchemaJsonSerializationHelper.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/CommonSchemaJsonSerializationHelper.cs @@ -101,7 +101,7 @@ public static void SerializeValueToJson(object? value, Utf8JsonWriter writer) writer.WriteStringValue(v); return; -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER case DateOnly v: JsonMetadataServices.DateOnlyConverter.Write(writer, v, null!); return; @@ -111,7 +111,7 @@ public static void SerializeValueToJson(object? value, Utf8JsonWriter writer) JsonMetadataServices.TimeSpanConverter.Write(writer, v, null!); return; -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER case TimeOnly v: JsonMetadataServices.TimeOnlyConverter.Write(writer, v, null!); return; diff --git a/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/TransportSendRequest.cs b/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/TransportSendRequest.cs index 1656f21f6b..2c71d15b6d 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/TransportSendRequest.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/TransportSendRequest.cs @@ -13,14 +13,14 @@ internal readonly struct TransportSendRequest { public TransportSendRequest() { -#if !NET7_0_OR_GREATER +#if !NET8_0_OR_GREATER // Note: This is needed because < NET7 doesn't understand required. this.ItemType = string.Empty; this.ItemStream = default!; #endif } -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER public required string ItemType { get; init; } public required OneCollectorExporterSerializationFormatType ItemSerializationFormat { get; init; } diff --git a/src/OpenTelemetry.Exporter.OneCollector/OpenTelemetry.Exporter.OneCollector.csproj b/src/OpenTelemetry.Exporter.OneCollector/OpenTelemetry.Exporter.OneCollector.csproj index 54507931dc..375e361795 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/OpenTelemetry.Exporter.OneCollector.csproj +++ b/src/OpenTelemetry.Exporter.OneCollector/OpenTelemetry.Exporter.OneCollector.csproj @@ -4,7 +4,7 @@ true An OpenTelemetry .NET exporter that sends telemetry to Microsoft OneCollector OpenTelemetry Authors - net7.0;net6.0;netstandard2.1;netstandard2.0 + net6.0;netstandard2.1;netstandard2.0 $(TargetFrameworks);net462 Exporter.OneCollector- true @@ -24,7 +24,7 @@ - + diff --git a/src/OpenTelemetry.Extensions.Enrichment/OpenTelemetry.Extensions.Enrichment.csproj b/src/OpenTelemetry.Extensions.Enrichment/OpenTelemetry.Extensions.Enrichment.csproj index c92c7ad934..9ed6c4e87b 100644 --- a/src/OpenTelemetry.Extensions.Enrichment/OpenTelemetry.Extensions.Enrichment.csproj +++ b/src/OpenTelemetry.Extensions.Enrichment/OpenTelemetry.Extensions.Enrichment.csproj @@ -2,7 +2,7 @@ - net7.0;net6.0;$(NetStandardMinimumSupportedVersion) + net8.0;net6.0;$(NetStandardMinimumSupportedVersion) $(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion) OpenTelemetry .NET SDK telemetry enrichment. $(NoWarn),CS1591 diff --git a/src/OpenTelemetry.Extensions/CHANGELOG.md b/src/OpenTelemetry.Extensions/CHANGELOG.md index 508ec3a4ce..ab6786788a 100644 --- a/src/OpenTelemetry.Extensions/CHANGELOG.md +++ b/src/OpenTelemetry.Extensions/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +* Removes `net7.0` target as .NET 7.0 is out + of support. The package keeps `netstandard2.0` target, so it + can still be used with .NET7.0 apps. + ([#2038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2038)) + * Update BaggageActivityProcessor to require baggage key predicate. ([#1816](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1816)) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj b/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj index 301ce36d81..a95693ee5a 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj @@ -1,7 +1,7 @@ - net8.0;net7.0;net6.0;netstandard2.0 + net8.0;net6.0;netstandard2.0 ASP.NET Core instrumentation for OpenTelemetry .NET $(PackageTags);distributed-tracing;AspNetCore Instrumentation.AspNetCore- diff --git a/test/OpenTelemetry.Exporter.InfluxDB.Tests/OpenTelemetry.Exporter.InfluxDB.Tests.csproj b/test/OpenTelemetry.Exporter.InfluxDB.Tests/OpenTelemetry.Exporter.InfluxDB.Tests.csproj index fb3469a04b..155dd334f7 100644 --- a/test/OpenTelemetry.Exporter.InfluxDB.Tests/OpenTelemetry.Exporter.InfluxDB.Tests.csproj +++ b/test/OpenTelemetry.Exporter.InfluxDB.Tests/OpenTelemetry.Exporter.InfluxDB.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/OpenTelemetry.Exporter.OneCollector.Benchmarks/OpenTelemetry.Exporter.OneCollector.Benchmarks.csproj b/test/OpenTelemetry.Exporter.OneCollector.Benchmarks/OpenTelemetry.Exporter.OneCollector.Benchmarks.csproj index 953bd766ea..04afec7346 100644 --- a/test/OpenTelemetry.Exporter.OneCollector.Benchmarks/OpenTelemetry.Exporter.OneCollector.Benchmarks.csproj +++ b/test/OpenTelemetry.Exporter.OneCollector.Benchmarks/OpenTelemetry.Exporter.OneCollector.Benchmarks.csproj @@ -4,13 +4,13 @@ Exe Benchmark project for OpenTelemetry .NET OneCollectorExporter. - net7.0;net6.0 + $(SupportedNetTargets) $(TargetFrameworks);net48;net472;net471;net47;net462 - + diff --git a/test/OpenTelemetry.Exporter.OneCollector.Tests/CommonSchemaJsonSerializationHelperTests.cs b/test/OpenTelemetry.Exporter.OneCollector.Tests/CommonSchemaJsonSerializationHelperTests.cs index da78729fad..d23addc8d5 100644 --- a/test/OpenTelemetry.Exporter.OneCollector.Tests/CommonSchemaJsonSerializationHelperTests.cs +++ b/test/OpenTelemetry.Exporter.OneCollector.Tests/CommonSchemaJsonSerializationHelperTests.cs @@ -101,7 +101,7 @@ public void SerializeComplexValueToJsonTest() this.SerializeValueToJsonTest(typeWithISpanFormattableOverflow, "\"Overflow\""); #endif -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER var dateOnly = DateOnly.FromDateTime(dt); this.SerializeValueToJsonTest(dateOnly, $"\"{dateOnly:O}\""); diff --git a/test/OpenTelemetry.Exporter.OneCollector.Tests/OpenTelemetry.Exporter.OneCollector.Tests.csproj b/test/OpenTelemetry.Exporter.OneCollector.Tests/OpenTelemetry.Exporter.OneCollector.Tests.csproj index 16a46f7998..54c7e19491 100644 --- a/test/OpenTelemetry.Exporter.OneCollector.Tests/OpenTelemetry.Exporter.OneCollector.Tests.csproj +++ b/test/OpenTelemetry.Exporter.OneCollector.Tests/OpenTelemetry.Exporter.OneCollector.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs index 03cc160050..070a56bd84 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs @@ -738,7 +738,7 @@ public async Task ActivitiesStartedInMiddlewareBySettingHostActivityToNullShould Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", aspnetcoreframeworkactivity.OperationName); } -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER [Fact] public async Task UserRegisteredActivitySourceIsUsedForActivityCreationByAspNetCore() { @@ -1150,7 +1150,7 @@ private static void WaitForActivityExport(List exportedItems, int coun private static void ValidateAspNetCoreActivity(Activity activityToValidate, string expectedHttpPath) { Assert.Equal(ActivityKind.Server, activityToValidate.Kind); -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER Assert.Equal(HttpInListener.AspNetCoreActivitySourceName, activityToValidate.Source.Name); Assert.NotNull(activityToValidate.Source.Version); Assert.Empty(activityToValidate.Source.Version); diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj index 9a8eebc05e..004daa67a8 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj @@ -1,7 +1,7 @@ Unit test project for OpenTelemetry ASP.NET Core instrumentation - net8.0;net7.0;net6.0 + $(SupportedNetTargets) @@ -9,11 +9,6 @@ - - - - - diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.md index 38ae9f93fd..12ec54af8a 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.md +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.md @@ -22,7 +22,6 @@ each test case. These files are source-controlled, so if the behavior of the instrumentation changes, the README files will be updated to reflect the change. * [.NET 6](./README.net6.0.md) -* [.NET 7](./README.net7.0.md) * [.NET 8](./README.net8.0.md) For each test case a request is made to an ASP.NET Core application with a diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md deleted file mode 100644 index 49d8224155..0000000000 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md +++ /dev/null @@ -1,654 +0,0 @@ -# Test results for ASP.NET Core 7 - -| http.route | App | Test Name | -| - | - | - | -| :broken_heart: | ConventionalRouting | [Root path](#conventionalrouting-root-path) | -| :broken_heart: | ConventionalRouting | [Non-default action with route parameter and query string](#conventionalrouting-non-default-action-with-route-parameter-and-query-string) | -| :broken_heart: | ConventionalRouting | [Non-default action with query string](#conventionalrouting-non-default-action-with-query-string) | -| :green_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | -| :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | -| :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | -| :broken_heart: | ConventionalRouting | [Area using `area:exists`, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | -| :broken_heart: | ConventionalRouting | [Area using `area:exists`, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | -| :broken_heart: | ConventionalRouting | [Area w/o `area:exists`, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | -| :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | -| :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | -| :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | -| :green_heart: | AttributeRouting | [Action with parameter before action name in template](#attributerouting-action-with-parameter-before-action-name-in-template) | -| :green_heart: | AttributeRouting | [Action invoked resulting in 400 Bad Request](#attributerouting-action-invoked-resulting-in-400-bad-request) | -| :broken_heart: | RazorPages | [Root path](#razorpages-root-path) | -| :broken_heart: | RazorPages | [Index page](#razorpages-index-page) | -| :broken_heart: | RazorPages | [Throws exception](#razorpages-throws-exception) | -| :green_heart: | RazorPages | [Static content](#razorpages-static-content) | -| :green_heart: | MinimalApi | [Action without parameter](#minimalapi-action-without-parameter) | -| :green_heart: | MinimalApi | [Action with parameter](#minimalapi-action-with-parameter) | -| :green_heart: | MinimalApi | [Action without parameter (MapGroup)](#minimalapi-action-without-parameter-mapgroup) | -| :green_heart: | MinimalApi | [Action with parameter (MapGroup)](#minimalapi-action-with-parameter-mapgroup) | -| :green_heart: | ExceptionMiddleware | [Exception Handled by Exception Handler Middleware](#exceptionmiddleware-exception-handled-by-exception-handler-middleware) | - -## ConventionalRouting: Root path - -```json -{ - "IdealHttpRoute": "ConventionalRoute/Default/{id?}", - "ActivityDisplayName": "GET {controller=ConventionalRoute}/{action=Default}/{id?}", - "ActivityHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/", - "RoutePattern.RawText": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "controller": "ConventionalRoute", - "action": "Default" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": null, - "Parameters": [], - "ControllerActionDescriptor": { - "ControllerName": "ConventionalRoute", - "ActionName": "Default" - }, - "PageActionDescriptor": null - } - } -} -``` - -## ConventionalRouting: Non-default action with route parameter and query string - -```json -{ - "IdealHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", - "ActivityDisplayName": "GET {controller=ConventionalRoute}/{action=Default}/{id?}", - "ActivityHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/ConventionalRoute/ActionWithStringParameter/2?num=3", - "RoutePattern.RawText": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "controller": "ConventionalRoute", - "action": "ActionWithStringParameter", - "id": "2" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": null, - "Parameters": [ - "id", - "num" - ], - "ControllerActionDescriptor": { - "ControllerName": "ConventionalRoute", - "ActionName": "ActionWithStringParameter" - }, - "PageActionDescriptor": null - } - } -} -``` - -## ConventionalRouting: Non-default action with query string - -```json -{ - "IdealHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", - "ActivityDisplayName": "GET {controller=ConventionalRoute}/{action=Default}/{id?}", - "ActivityHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/ConventionalRoute/ActionWithStringParameter?num=3", - "RoutePattern.RawText": "{controller=ConventionalRoute}/{action=Default}/{id?}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "controller": "ConventionalRoute", - "action": "ActionWithStringParameter" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": null, - "Parameters": [ - "id", - "num" - ], - "ControllerActionDescriptor": { - "ControllerName": "ConventionalRoute", - "ActionName": "ActionWithStringParameter" - }, - "PageActionDescriptor": null - } - } -} -``` - -## ConventionalRouting: Not Found (404) - -```json -{ - "IdealHttpRoute": "", - "ActivityDisplayName": "GET", - "ActivityHttpRoute": "", - "MetricHttpRoute": "", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/ConventionalRoute/NotFound", - "RoutePattern.RawText": null, - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": {}, - "ActionDescriptor": null - } -} -``` - -## ConventionalRouting: Route template with parameter constraint - -```json -{ - "IdealHttpRoute": "SomePath/{id}/{num:int}", - "ActivityDisplayName": "GET SomePath/{id}/{num:int}", - "ActivityHttpRoute": "SomePath/{id}/{num:int}", - "MetricHttpRoute": "SomePath/{id}/{num:int}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/SomePath/SomeString/2", - "RoutePattern.RawText": "SomePath/{id}/{num:int}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "controller": "ConventionalRoute", - "action": "ActionWithStringParameter", - "id": "SomeString", - "num": "2" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": null, - "Parameters": [ - "id", - "num" - ], - "ControllerActionDescriptor": { - "ControllerName": "ConventionalRoute", - "ActionName": "ActionWithStringParameter" - }, - "PageActionDescriptor": null - } - } -} -``` - -## ConventionalRouting: Path that does not match parameter constraint - -```json -{ - "IdealHttpRoute": "", - "ActivityDisplayName": "GET", - "ActivityHttpRoute": "", - "MetricHttpRoute": "", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/SomePath/SomeString/NotAnInt", - "RoutePattern.RawText": null, - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": {}, - "ActionDescriptor": null - } -} -``` - -## ConventionalRouting: Area using `area:exists`, default controller/action - -```json -{ - "IdealHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}", - "ActivityDisplayName": "GET {area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", - "ActivityHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", - "MetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/MyArea", - "RoutePattern.RawText": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "controller": "ControllerForMyArea", - "action": "Default", - "area": "MyArea" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": null, - "Parameters": [], - "ControllerActionDescriptor": { - "ControllerName": "ControllerForMyArea", - "ActionName": "Default" - }, - "PageActionDescriptor": null - } - } -} -``` - -## ConventionalRouting: Area using `area:exists`, non-default action - -```json -{ - "IdealHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}", - "ActivityDisplayName": "GET {area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", - "ActivityHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", - "MetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/MyArea/ControllerForMyArea/NonDefault", - "RoutePattern.RawText": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "controller": "ControllerForMyArea", - "area": "MyArea", - "action": "NonDefault" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": null, - "Parameters": [], - "ControllerActionDescriptor": { - "ControllerName": "ControllerForMyArea", - "ActionName": "NonDefault" - }, - "PageActionDescriptor": null - } - } -} -``` - -## ConventionalRouting: Area w/o `area:exists`, default controller/action - -```json -{ - "IdealHttpRoute": "SomePrefix/AnotherArea/Index/{id?}", - "ActivityDisplayName": "GET SomePrefix/{controller=AnotherArea}/{action=Index}/{id?}", - "ActivityHttpRoute": "SomePrefix/{controller=AnotherArea}/{action=Index}/{id?}", - "MetricHttpRoute": "SomePrefix/{controller=AnotherArea}/{action=Index}/{id?}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/SomePrefix", - "RoutePattern.RawText": "SomePrefix/{controller=AnotherArea}/{action=Index}/{id?}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "area": "AnotherArea", - "controller": "AnotherArea", - "action": "Index" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": null, - "Parameters": [], - "ControllerActionDescriptor": { - "ControllerName": "AnotherArea", - "ActionName": "Index" - }, - "PageActionDescriptor": null - } - } -} -``` - -## AttributeRouting: Default action - -```json -{ - "IdealHttpRoute": "AttributeRoute", - "ActivityDisplayName": "GET AttributeRoute", - "ActivityHttpRoute": "AttributeRoute", - "MetricHttpRoute": "AttributeRoute", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/AttributeRoute", - "RoutePattern.RawText": "AttributeRoute", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "action": "Get", - "controller": "AttributeRoute" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": "AttributeRoute", - "Parameters": [], - "ControllerActionDescriptor": { - "ControllerName": "AttributeRoute", - "ActionName": "Get" - }, - "PageActionDescriptor": null - } - } -} -``` - -## AttributeRouting: Action without parameter - -```json -{ - "IdealHttpRoute": "AttributeRoute/Get", - "ActivityDisplayName": "GET AttributeRoute/Get", - "ActivityHttpRoute": "AttributeRoute/Get", - "MetricHttpRoute": "AttributeRoute/Get", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/AttributeRoute/Get", - "RoutePattern.RawText": "AttributeRoute/Get", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "action": "Get", - "controller": "AttributeRoute" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": "AttributeRoute/Get", - "Parameters": [], - "ControllerActionDescriptor": { - "ControllerName": "AttributeRoute", - "ActionName": "Get" - }, - "PageActionDescriptor": null - } - } -} -``` - -## AttributeRouting: Action with parameter - -```json -{ - "IdealHttpRoute": "AttributeRoute/Get/{id}", - "ActivityDisplayName": "GET AttributeRoute/Get/{id}", - "ActivityHttpRoute": "AttributeRoute/Get/{id}", - "MetricHttpRoute": "AttributeRoute/Get/{id}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/AttributeRoute/Get/12", - "RoutePattern.RawText": "AttributeRoute/Get/{id}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "action": "Get", - "controller": "AttributeRoute", - "id": "12" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": "AttributeRoute/Get/{id}", - "Parameters": [ - "id" - ], - "ControllerActionDescriptor": { - "ControllerName": "AttributeRoute", - "ActionName": "Get" - }, - "PageActionDescriptor": null - } - } -} -``` - -## AttributeRouting: Action with parameter before action name in template - -```json -{ - "IdealHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityDisplayName": "GET AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "MetricHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/AttributeRoute/12/GetWithActionNameInDifferentSpotInTemplate", - "RoutePattern.RawText": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "action": "GetWithActionNameInDifferentSpotInTemplate", - "controller": "AttributeRoute", - "id": "12" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "Parameters": [ - "id" - ], - "ControllerActionDescriptor": { - "ControllerName": "AttributeRoute", - "ActionName": "GetWithActionNameInDifferentSpotInTemplate" - }, - "PageActionDescriptor": null - } - } -} -``` - -## AttributeRouting: Action invoked resulting in 400 Bad Request - -```json -{ - "IdealHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityDisplayName": "GET AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "MetricHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/AttributeRoute/NotAnInt/GetWithActionNameInDifferentSpotInTemplate", - "RoutePattern.RawText": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "action": "GetWithActionNameInDifferentSpotInTemplate", - "controller": "AttributeRoute", - "id": "NotAnInt" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "Parameters": [ - "id" - ], - "ControllerActionDescriptor": { - "ControllerName": "AttributeRoute", - "ActionName": "GetWithActionNameInDifferentSpotInTemplate" - }, - "PageActionDescriptor": null - } - } -} -``` - -## RazorPages: Root path - -```json -{ - "IdealHttpRoute": "/Index", - "ActivityDisplayName": "GET", - "ActivityHttpRoute": "", - "MetricHttpRoute": "", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/", - "RoutePattern.RawText": "", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "page": "/Index" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": "", - "Parameters": [], - "ControllerActionDescriptor": null, - "PageActionDescriptor": { - "RelativePath": "/Pages/Index.cshtml", - "ViewEnginePath": "/Index" - } - } - } -} -``` - -## RazorPages: Index page - -```json -{ - "IdealHttpRoute": "/Index", - "ActivityDisplayName": "GET Index", - "ActivityHttpRoute": "Index", - "MetricHttpRoute": "Index", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/Index", - "RoutePattern.RawText": "Index", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "page": "/Index" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": "Index", - "Parameters": [], - "ControllerActionDescriptor": null, - "PageActionDescriptor": { - "RelativePath": "/Pages/Index.cshtml", - "ViewEnginePath": "/Index" - } - } - } -} -``` - -## RazorPages: Throws exception - -```json -{ - "IdealHttpRoute": "/PageThatThrowsException", - "ActivityDisplayName": "GET PageThatThrowsException", - "ActivityHttpRoute": "PageThatThrowsException", - "MetricHttpRoute": "PageThatThrowsException", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/PageThatThrowsException", - "RoutePattern.RawText": "PageThatThrowsException", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "page": "/PageThatThrowsException" - }, - "ActionDescriptor": { - "AttributeRouteInfo.Template": "PageThatThrowsException", - "Parameters": [], - "ControllerActionDescriptor": null, - "PageActionDescriptor": { - "RelativePath": "/Pages/PageThatThrowsException.cshtml", - "ViewEnginePath": "/PageThatThrowsException" - } - } - } -} -``` - -## RazorPages: Static content - -```json -{ - "IdealHttpRoute": "", - "ActivityDisplayName": "GET", - "ActivityHttpRoute": "", - "MetricHttpRoute": "", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/js/site.js", - "RoutePattern.RawText": null, - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": {}, - "ActionDescriptor": null - } -} -``` - -## MinimalApi: Action without parameter - -```json -{ - "IdealHttpRoute": "/MinimalApi", - "ActivityDisplayName": "GET /MinimalApi", - "ActivityHttpRoute": "/MinimalApi", - "MetricHttpRoute": "/MinimalApi", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/MinimalApi", - "RoutePattern.RawText": "/MinimalApi", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": {}, - "ActionDescriptor": null - } -} -``` - -## MinimalApi: Action with parameter - -```json -{ - "IdealHttpRoute": "/MinimalApi/{id}", - "ActivityDisplayName": "GET /MinimalApi/{id}", - "ActivityHttpRoute": "/MinimalApi/{id}", - "MetricHttpRoute": "/MinimalApi/{id}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/MinimalApi/123", - "RoutePattern.RawText": "/MinimalApi/{id}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "id": "123" - }, - "ActionDescriptor": null - } -} -``` - -## MinimalApi: Action without parameter (MapGroup) - -```json -{ - "IdealHttpRoute": "/MinimalApiUsingMapGroup/", - "ActivityDisplayName": "GET /MinimalApiUsingMapGroup/", - "ActivityHttpRoute": "/MinimalApiUsingMapGroup/", - "MetricHttpRoute": "/MinimalApiUsingMapGroup/", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/MinimalApiUsingMapGroup", - "RoutePattern.RawText": "/MinimalApiUsingMapGroup/", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": {}, - "ActionDescriptor": null - } -} -``` - -## MinimalApi: Action with parameter (MapGroup) - -```json -{ - "IdealHttpRoute": "/MinimalApiUsingMapGroup/{id}", - "ActivityDisplayName": "GET /MinimalApiUsingMapGroup/{id}", - "ActivityHttpRoute": "/MinimalApiUsingMapGroup/{id}", - "MetricHttpRoute": "/MinimalApiUsingMapGroup/{id}", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/MinimalApiUsingMapGroup/123", - "RoutePattern.RawText": "/MinimalApiUsingMapGroup/{id}", - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": { - "id": "123" - }, - "ActionDescriptor": null - } -} -``` - -## ExceptionMiddleware: Exception Handled by Exception Handler Middleware - -```json -{ - "IdealHttpRoute": "/Exception", - "ActivityDisplayName": "GET /Exception", - "ActivityHttpRoute": "/Exception", - "MetricHttpRoute": "/Exception", - "RouteInfo": { - "HttpMethod": "GET", - "Path": "/Exception", - "RoutePattern.RawText": null, - "IRouteDiagnosticsMetadata.Route": null, - "HttpContext.GetRouteData()": {}, - "ActionDescriptor": null - } -} -``` diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/TestApplication/TestApplicationFactory.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/TestApplication/TestApplicationFactory.cs index b030ab7f42..51cd4ef643 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/TestApplication/TestApplicationFactory.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/TestApplication/TestApplicationFactory.cs @@ -131,7 +131,7 @@ private static WebApplication CreateMinimalApiApplication() app.MapGet("/MinimalApi", () => Results.Ok()); app.MapGet("/MinimalApi/{id}", (int id) => Results.Ok()); -#if NET7_0_OR_GREATER +#if NET8_0_OR_GREATER var api = app.MapGroup("/MinimalApiUsingMapGroup"); api.MapGet("/", () => Results.Ok()); api.MapGet("/{id}", (int id) => Results.Ok()); diff --git a/test/OpenTelemetry.Instrumentation.Cassandra.Tests/Dockerfile b/test/OpenTelemetry.Instrumentation.Cassandra.Tests/Dockerfile index 3f06615552..206fa6b334 100644 --- a/test/OpenTelemetry.Instrumentation.Cassandra.Tests/Dockerfile +++ b/test/OpenTelemetry.Instrumentation.Cassandra.Tests/Dockerfile @@ -2,12 +2,12 @@ # This should be run from the root of the repo: # docker build --file test/OpenTelemetry.Instrumentation.Cassandra.Tests/Dockerfile . -ARG BUILD_SDK_VERSION=7.0 -ARG TEST_SDK_VERSION=7.0 +ARG BUILD_SDK_VERSION=8.0 +ARG TEST_SDK_VERSION=8.0 FROM mcr.microsoft.com/dotnet/sdk:${BUILD_SDK_VERSION} AS build ARG PUBLISH_CONFIGURATION=Release -ARG PUBLISH_FRAMEWORK=net7.0 +ARG PUBLISH_FRAMEWORK=net8.0 WORKDIR /repo COPY . ./ WORKDIR "/repo/test/OpenTelemetry.Instrumentation.Cassandra.Tests" diff --git a/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests.csproj b/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests.csproj index 0eea99c2ce..a33effea74 100644 --- a/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests.csproj @@ -9,10 +9,6 @@ - - - - diff --git a/test/OpenTelemetry.Instrumentation.GrpcNetClient.Tests/OpenTelemetry.Instrumentation.GrpcNetClient.Tests.csproj b/test/OpenTelemetry.Instrumentation.GrpcNetClient.Tests/OpenTelemetry.Instrumentation.GrpcNetClient.Tests.csproj index 2ce1d55199..79ca9d1a02 100644 --- a/test/OpenTelemetry.Instrumentation.GrpcNetClient.Tests/OpenTelemetry.Instrumentation.GrpcNetClient.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.GrpcNetClient.Tests/OpenTelemetry.Instrumentation.GrpcNetClient.Tests.csproj @@ -1,7 +1,7 @@ Unit test project for OpenTelemetry Grpc for .NET instrumentation - net8.0;net7.0;net6.0 + $(SupportedNetTargets) $(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion) $(NoWarn),CS8981 diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj b/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj index 3a3170cba1..8811a92001 100644 --- a/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj @@ -1,7 +1,7 @@ Unit test project for OpenTelemetry HTTP instrumentations - net8.0;net7.0;net6.0 + $(SupportedNetTargets) $(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion) diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj index 776634117a..2d871bb3ef 100644 --- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj @@ -1,7 +1,7 @@ Unit test project for OpenTelemetry SqlClient instrumentations - net8.0;net7.0;net6.0 + $(SupportedNetTargets) $(TargetFrameworks);net462 diff --git a/test/TestApp.AspNetCore/TestApp.AspNetCore.csproj b/test/TestApp.AspNetCore/TestApp.AspNetCore.csproj index 24e5a6ee1a..ae0043309a 100644 --- a/test/TestApp.AspNetCore/TestApp.AspNetCore.csproj +++ b/test/TestApp.AspNetCore/TestApp.AspNetCore.csproj @@ -1,7 +1,7 @@ - net8.0;net7.0;net6.0 + $(SupportedNetTargets) From ed0c4339bc04de34ae27949eba7a60a37fa72a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Thu, 5 Sep 2024 10:30:13 +0200 Subject: [PATCH 2/7] Fix OneCollector tests --- src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md | 1 + .../OneCollectorExporterValidationException.cs | 4 ++++ .../OpenTelemetry.Exporter.OneCollector.csproj | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md index 9b68676c08..b978fc6f05 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md @@ -5,6 +5,7 @@ * Removes `net7.0` target as .NET 7.0 is out of support. The package keeps `netstandard2.1` target, so it can still be used with .NET7.0 apps. + Adds `net8.0` target. ([#2038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2038)) ## 1.9.2 diff --git a/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterValidationException.cs b/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterValidationException.cs index 5e86e02cd5..c6aea54de2 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterValidationException.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterValidationException.cs @@ -1,7 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; +#endif namespace OpenTelemetry.Exporter.OneCollector; @@ -41,8 +43,10 @@ public OneCollectorExporterValidationException(string message, Exception? innerE { } +#if !NET8_0_OR_GREATER private OneCollectorExporterValidationException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { } +#endif } diff --git a/src/OpenTelemetry.Exporter.OneCollector/OpenTelemetry.Exporter.OneCollector.csproj b/src/OpenTelemetry.Exporter.OneCollector/OpenTelemetry.Exporter.OneCollector.csproj index 375e361795..3b3c96d5e3 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/OpenTelemetry.Exporter.OneCollector.csproj +++ b/src/OpenTelemetry.Exporter.OneCollector/OpenTelemetry.Exporter.OneCollector.csproj @@ -4,7 +4,7 @@ true An OpenTelemetry .NET exporter that sends telemetry to Microsoft OneCollector OpenTelemetry Authors - net6.0;netstandard2.1;netstandard2.0 + net8.0;net6.0;netstandard2.1;netstandard2.0 $(TargetFrameworks);net462 Exporter.OneCollector- true From 1fb7d4b2941b2cb17fc23ea31bc2a40661a33b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Thu, 5 Sep 2024 10:35:58 +0200 Subject: [PATCH 3/7] cleanup contributing --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b21e75363..f3a7eee404 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,7 +35,7 @@ You can contribute to this project from a Windows, macOS or Linux machine. On all platforms, the minimum requirements are: * Git client and command line tools. -* .NET 7.0+ +* .NET 8.0+ Please note that individual project requirements might vary. From cb73ba5ce09c7f6b449f0c64185442a0081b75ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Thu, 5 Sep 2024 10:36:11 +0200 Subject: [PATCH 4/7] Drop installation .NET7 in pipeline --- .github/workflows/Component.BuildTest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Component.BuildTest.yml b/.github/workflows/Component.BuildTest.yml index cdfba7cd4c..b4b916c293 100644 --- a/.github/workflows/Component.BuildTest.yml +++ b/.github/workflows/Component.BuildTest.yml @@ -78,7 +78,6 @@ jobs: with: dotnet-version: | 6.0.x - 7.0.x 8.0.x - name: dotnet restore ${{ steps.resolve-project.outputs.title }} From 9d519f09cbe0b8d168f44b78379bc184e11929d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Thu, 5 Sep 2024 10:46:10 +0200 Subject: [PATCH 5/7] OneCollector - Compatibility suppression --- .../CompatibilitySuppressions.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/OpenTelemetry.Exporter.OneCollector/CompatibilitySuppressions.xml diff --git a/src/OpenTelemetry.Exporter.OneCollector/CompatibilitySuppressions.xml b/src/OpenTelemetry.Exporter.OneCollector/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..c1b34f2891 --- /dev/null +++ b/src/OpenTelemetry.Exporter.OneCollector/CompatibilitySuppressions.xml @@ -0,0 +1,12 @@ + + + + + CP0008 + T:OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType + lib/net7.0/OpenTelemetry.Exporter.OneCollector.dll + lib/net6.0/OpenTelemetry.Exporter.OneCollector.dll + true + + From ee314c85a6721565a0af9c2e226527e48650606c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Fri, 6 Sep 2024 06:26:01 +0200 Subject: [PATCH 6/7] pr feedback - changelog wording --- src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md | 6 ++---- src/OpenTelemetry.Extensions/CHANGELOG.md | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md index b978fc6f05..9afbaf70ee 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md @@ -2,9 +2,7 @@ ## Unreleased -* Removes `net7.0` target as .NET 7.0 is out - of support. The package keeps `netstandard2.1` target, so it - can still be used with .NET7.0 apps. +* Dropped support for the `net7.0` target because .NET 7 is no longer supported. Adds `net8.0` target. ([#2038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2038)) @@ -71,7 +69,7 @@ Released 2023-Sep-20 * Update OpenTelemetry to 1.6.0 ([#1344](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1344)) -* Added support for receiving tranmission failures via the +* Added support for receiving transmission failures via the `RegisterPayloadTransmittedCallback` API. ([#1309](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1309)) diff --git a/src/OpenTelemetry.Extensions/CHANGELOG.md b/src/OpenTelemetry.Extensions/CHANGELOG.md index ab6786788a..fa8a23a1dc 100644 --- a/src/OpenTelemetry.Extensions/CHANGELOG.md +++ b/src/OpenTelemetry.Extensions/CHANGELOG.md @@ -2,9 +2,7 @@ ## Unreleased -* Removes `net7.0` target as .NET 7.0 is out - of support. The package keeps `netstandard2.0` target, so it - can still be used with .NET7.0 apps. +* Dropped support for the `net7.0` target because .NET 7 is no longer supported. ([#2038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2038)) * Update BaggageActivityProcessor to require baggage key predicate. From dd4c22f8f0f462711ac2abf9dc831fa3783f405f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Fri, 6 Sep 2024 18:35:40 +0200 Subject: [PATCH 7/7] Update src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md Co-authored-by: Mikel Blanchard --- src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md index 9afbaf70ee..72360c5e85 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md @@ -3,7 +3,7 @@ ## Unreleased * Dropped support for the `net7.0` target because .NET 7 is no longer supported. - Adds `net8.0` target. + Added a `net8.0` target. ([#2038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2038)) ## 1.9.2