From 9c87e4418d1ea1ee4775b96a0c60497742248a9b Mon Sep 17 00:00:00 2001
From: Alan West <3676547+alanwest@users.noreply.github.com>
Date: Wed, 3 Aug 2022 15:55:12 -0700
Subject: [PATCH 1/3] Restore the net7.0 branch
This reverts commit 25df7e85b0c7f286d319292a65c7121c0a570bc5.
---
.github/workflows/apicompatibility.yml | 7 ++-
.github/workflows/code-coverage.yml | 10 +++-
.github/workflows/docfx.yml | 4 +-
.github/workflows/dotnet-format-md.yml | 2 +-
.github/workflows/dotnet-format.yml | 10 +++-
.github/workflows/integration-md.yml | 8 +--
.github/workflows/integration.yml | 10 ++--
.github/workflows/linux-ci-md.yml | 4 +-
.github/workflows/linux-ci.yml | 16 ++++--
.github/workflows/markdownlint.yml | 4 +-
.github/workflows/sanitycheck.yml | 4 +-
.github/workflows/windows-ci-md.yml | 4 +-
.github/workflows/windows-ci.yml | 14 +++--
OpenTelemetry.sln | 7 ---
build/Common.props | 2 +-
docs/Directory.Build.props | 2 +-
global.json | 3 +-
.../PublicAPI.Shipped.txt | 0
.../PublicAPI.Unshipped.txt | 0
...etry.Exporter.Prometheus.AspNetCore.csproj | 2 +-
.../.publicApi/net7.0/PublicAPI.Shipped.txt | 0
.../.publicApi/net7.0/PublicAPI.Unshipped.txt | 14 +++++
.../Implementation/HttpInListener.cs | 12 +++++
...elemetry.Instrumentation.AspNetCore.csproj | 7 ++-
.../TracerProviderBuilderExtensions.cs | 34 +++++++++++--
.../HttpClientInstrumentation.cs | 19 ++++++-
.../HttpHandlerDiagnosticListener.cs | 47 +++++++++++++++--
.../TracerProviderBuilderExtensions.cs | 12 ++++-
test/Benchmarks/Benchmarks.csproj | 2 +-
...OpenTelemetry.Exporter.Jaeger.Tests.csproj | 2 +-
...xporter.OpenTelemetryProtocol.Tests.csproj | 2 +-
...xporter.Prometheus.AspNetCore.Tests.csproj | 6 +--
...OpenTelemetry.Exporter.ZPages.Tests.csproj | 2 +-
...OpenTelemetry.Exporter.Zipkin.Tests.csproj | 2 +-
...emetry.Extensions.EventSource.Tests.csproj | 2 +-
...nTelemetry.Extensions.Hosting.Tests.csproj | 2 +-
...emetry.Extensions.Propagators.Tests.csproj | 2 +-
...nTelemetry.Extensions.Serilog.Tests.csproj | 2 +-
.../BasicTests.cs | 51 ++++++++++++++++++-
.../DependencyInjectionConfigTests.cs | 3 ++
...stsCollectionsIsAccordingToTheSpecTests.cs | 3 ++
.../MetricTests.cs | 3 ++
...ry.Instrumentation.AspNetCore.Tests.csproj | 7 ++-
...elemetry.Instrumentation.Grpc.Tests.csproj | 2 +-
...elemetry.Instrumentation.Http.Tests.csproj | 2 +-
...try.Instrumentation.SqlClient.Tests.csproj | 2 +-
.../Dockerfile | 6 +--
.../InProcessServer.cs | 3 ++
...strumentation.W3cTraceContext.Tests.csproj | 6 +--
...enTelemetry.Shims.OpenTracing.Tests.csproj | 2 +-
.../OpenTelemetry.Tests.Stress.Logs.csproj | 2 +-
.../OpenTelemetry.Tests.Stress.Metrics.csproj | 2 +-
.../OpenTelemetry.Tests.Stress.csproj | 2 +-
.../OpenTelemetry.Tests.csproj | 2 +-
test/TestApp.AspNetCore.3.1/README.md | 13 -----
.../ActivityMiddleware.cs | 2 +-
.../AssemblyInfo.cs | 2 +-
.../CallbackMiddleware.cs | 5 +-
.../Controllers/ChildActivityController.cs | 4 +-
.../Controllers/ForwardController.cs | 5 +-
.../Controllers/ValuesController.cs | 4 +-
.../Program.cs | 4 +-
.../Startup.cs | 4 +-
.../TestApp.AspNetCore.7.0.csproj} | 8 +--
.../appsettings.Development.json | 0
.../appsettings.json | 0
66 files changed, 323 insertions(+), 108 deletions(-)
rename src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/{netcoreapp3.1 => net6.0}/PublicAPI.Shipped.txt (100%)
rename src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/{netcoreapp3.1 => net6.0}/PublicAPI.Unshipped.txt (100%)
create mode 100644 src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/net7.0/PublicAPI.Shipped.txt
create mode 100644 src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/net7.0/PublicAPI.Unshipped.txt
delete mode 100644 test/TestApp.AspNetCore.3.1/README.md
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/ActivityMiddleware.cs (98%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/AssemblyInfo.cs (95%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/CallbackMiddleware.cs (88%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/Controllers/ChildActivityController.cs (89%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/Controllers/ForwardController.cs (91%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/Controllers/ValuesController.cs (88%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/Program.cs (84%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/Startup.cs (92%)
rename test/{TestApp.AspNetCore.3.1/TestApp.AspNetCore.3.1.csproj => TestApp.AspNetCore.7.0/TestApp.AspNetCore.7.0.csproj} (78%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/appsettings.Development.json (100%)
rename test/{TestApp.AspNetCore.3.1 => TestApp.AspNetCore.7.0}/appsettings.json (100%)
diff --git a/.github/workflows/apicompatibility.yml b/.github/workflows/apicompatibility.yml
index 14b382c2135..1077523a668 100644
--- a/.github/workflows/apicompatibility.yml
+++ b/.github/workflows/apicompatibility.yml
@@ -2,7 +2,7 @@ name: API Compatibility
on:
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
@@ -11,10 +11,15 @@ jobs:
runs-on: windows-latest
env:
CheckAPICompatibility: true
+ # https://github.com/actions/setup-dotnet/issues/122
+ DOTNET_MULTILEVEL_LOOKUP: 1
steps:
- uses: actions/checkout@v3
+ - uses: actions/setup-dotnet@v1
with:
fetch-depth: 0 # fetching all
+ dotnet-version: '7.0.x'
+ include-prerelease: true
- name: Install dependencies
run: dotnet restore
diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml
index 772d8e45a0b..deedcf1f843 100644
--- a/.github/workflows/code-coverage.yml
+++ b/.github/workflows/code-coverage.yml
@@ -2,11 +2,11 @@ name: Code Coverage
on:
push:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
@@ -20,11 +20,17 @@ jobs:
os: [windows-latest]
env:
OS: ${{ matrix.os }}
+ # https://github.com/actions/setup-dotnet/issues/122
+ DOTNET_MULTILEVEL_LOOKUP: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetching all
+ - uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '7.0.x'
+ include-prerelease: true
- name: Install dependencies
run: dotnet restore
diff --git a/.github/workflows/docfx.yml b/.github/workflows/docfx.yml
index b183f85311c..9de27064fe2 100644
--- a/.github/workflows/docfx.yml
+++ b/.github/workflows/docfx.yml
@@ -2,9 +2,9 @@ name: docfx
on:
push:
- branches: [ main ]
+ branches: [ main, net7.0 ]
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
jobs:
build:
diff --git a/.github/workflows/dotnet-format-md.yml b/.github/workflows/dotnet-format-md.yml
index 5453ddca941..6a093eb64a9 100644
--- a/.github/workflows/dotnet-format-md.yml
+++ b/.github/workflows/dotnet-format-md.yml
@@ -9,7 +9,7 @@ name: dotnet format
on:
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths:
- '**.md'
diff --git a/.github/workflows/dotnet-format.yml b/.github/workflows/dotnet-format.yml
index 472fc5f6865..f88e0613d80 100644
--- a/.github/workflows/dotnet-format.yml
+++ b/.github/workflows/dotnet-format.yml
@@ -2,12 +2,12 @@ name: dotnet format
on:
push:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths:
- '**.cs'
- '.editorconfig'
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths:
- '**.cs'
- '.editorconfig'
@@ -25,6 +25,12 @@ jobs:
with:
dotnet-version: 6.0.x
+ - name: Setup .NET Core 7.0
+ - uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '7.0.x'
+ include-prerelease: true
+
- name: Install format tool
run: dotnet tool install -g dotnet-format
diff --git a/.github/workflows/integration-md.yml b/.github/workflows/integration-md.yml
index aec19d81972..f346041b00d 100644
--- a/.github/workflows/integration-md.yml
+++ b/.github/workflows/integration-md.yml
@@ -9,7 +9,7 @@ name: Integration Tests
on:
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths:
- '**.md'
@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- version: [netcoreapp3.1,net6.0]
+ version: [net6.0]
steps:
- run: 'echo "No build required"'
@@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- version: [netcoreapp3.1,net6.0]
+ version: [net6.0]
steps:
- run: 'echo "No build required"'
@@ -34,6 +34,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- version: [netcoreapp3.1,net6.0]
+ version: [net6.0]
steps:
- run: 'echo "No build required"'
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index b3d53770e77..052e12fffa7 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -2,11 +2,11 @@ name: Integration Tests
on:
push:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
@@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- version: [netcoreapp3.1,net6.0]
+ version: [net6.0]
steps:
- uses: actions/checkout@v3
@@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- version: [netcoreapp3.1,net6.0]
+ version: [net6.0]
steps:
- uses: actions/checkout@v3
@@ -40,7 +40,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- version: [netcoreapp3.1,net6.0]
+ version: [net6.0]
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/linux-ci-md.yml b/.github/workflows/linux-ci-md.yml
index cec69098ece..43975cfaf5d 100644
--- a/.github/workflows/linux-ci-md.yml
+++ b/.github/workflows/linux-ci-md.yml
@@ -9,7 +9,7 @@ name: Linux
on:
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths:
- '**.md'
@@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
- version: [netcoreapp3.1,net6.0]
+ version: [net6.0]
steps:
- run: 'echo "No build required"'
diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml
index c79296a9576..a8a9213fb36 100644
--- a/.github/workflows/linux-ci.yml
+++ b/.github/workflows/linux-ci.yml
@@ -2,11 +2,11 @@ name: Linux
on:
push:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
@@ -16,13 +16,23 @@ jobs:
strategy:
matrix:
- version: [netcoreapp3.1,net6.0]
+ version: [net6.0, net7.0]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetching all
+ - uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '6.0.x'
+
+ - uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '7.0.x'
+ include-prerelease: true
+
+
- name: Install dependencies
run: dotnet restore
diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml
index 97f85f9e2b4..1fbb52e9f99 100644
--- a/.github/workflows/markdownlint.yml
+++ b/.github/workflows/markdownlint.yml
@@ -2,11 +2,11 @@ name: markdownlint
on:
push:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths:
- '**.md'
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths:
- '**.md'
diff --git a/.github/workflows/sanitycheck.yml b/.github/workflows/sanitycheck.yml
index a52563198e4..ef2e5cd140b 100644
--- a/.github/workflows/sanitycheck.yml
+++ b/.github/workflows/sanitycheck.yml
@@ -2,9 +2,9 @@ name: sanitycheck
on:
push:
- branches: [ main ]
+ branches: [ main, net7.0 ]
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
jobs:
misspell:
diff --git a/.github/workflows/windows-ci-md.yml b/.github/workflows/windows-ci-md.yml
index 2e2bfd561a4..1b409793afc 100644
--- a/.github/workflows/windows-ci-md.yml
+++ b/.github/workflows/windows-ci-md.yml
@@ -9,7 +9,7 @@ name: Windows
on:
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths:
- '**.md'
@@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
- version: [net462,netcoreapp3.1,net6.0]
+ version: [net462,net6.0]
steps:
- run: 'echo "No build required"'
diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml
index 4a48a7e5b19..72729d83af4 100644
--- a/.github/workflows/windows-ci.yml
+++ b/.github/workflows/windows-ci.yml
@@ -2,27 +2,35 @@ name: Windows
on:
push:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
pull_request:
- branches: [ main ]
+ branches: [ main, net7.0 ]
paths-ignore:
- '**.md'
jobs:
build-test:
runs-on: windows-latest
+ env:
+ # https://github.com/actions/setup-dotnet/issues/122
+ DOTNET_MULTILEVEL_LOOKUP: 1
strategy:
matrix:
- version: [net462,netcoreapp3.1,net6.0]
+ version: [net462,net6.0,net7.0]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetching all
+ - uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '7.0.x'
+ include-prerelease: true
+
- name: Install dependencies
run: dotnet restore
diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln
index a16555d39ce..4430f261cf2 100644
--- a/OpenTelemetry.sln
+++ b/OpenTelemetry.sln
@@ -51,8 +51,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentati
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testdata", "testdata", "{77C7929A-2EED-4AA6-8705-B5C443C8AA0F}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp.AspNetCore.3.1", "test\TestApp.AspNetCore.3.1\TestApp.AspNetCore.3.1.csproj", "{F2F81E76-6A0E-466B-B673-EBBF1A9ED075}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{E359BB2B-9AEC-497D-B321-7DF2450C3B8E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Jaeger", "src\OpenTelemetry.Exporter.Jaeger\OpenTelemetry.Exporter.Jaeger.csproj", "{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}"
@@ -273,10 +271,6 @@ Global
{2A47F6A8-63E5-4237-8046-94CAF321E797}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A47F6A8-63E5-4237-8046-94CAF321E797}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A47F6A8-63E5-4237-8046-94CAF321E797}.Release|Any CPU.Build.0 = Release|Any CPU
- {F2F81E76-6A0E-466B-B673-EBBF1A9ED075}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F2F81E76-6A0E-466B-B673-EBBF1A9ED075}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F2F81E76-6A0E-466B-B673-EBBF1A9ED075}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F2F81E76-6A0E-466B-B673-EBBF1A9ED075}.Release|Any CPU.Build.0 = Release|Any CPU
{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -510,7 +504,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {F2F81E76-6A0E-466B-B673-EBBF1A9ED075} = {77C7929A-2EED-4AA6-8705-B5C443C8AA0F}
{A533C800-3DC3-4D04-90A7-0CE7A1E6BDB3} = {F1D0972B-38CF-49C2-9F4B-4C5DE02FB71D}
{E69578EB-B456-4062-A645-877CD964528B} = {F1D0972B-38CF-49C2-9F4B-4C5DE02FB71D}
{C1542297-8763-4DF4-957C-489ED771C21D} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD}
diff --git a/build/Common.props b/build/Common.props
index 510b4ab356f..46569eea8fe 100644
--- a/build/Common.props
+++ b/build/Common.props
@@ -43,7 +43,7 @@
[2.8.0,3.0)
[1.2.0-beta.354,2.0)
1.4.0
- 6.0.0
+ 7.0.0-preview.4.22229.4
4.7.0
4.7.0
4.5.3
diff --git a/docs/Directory.Build.props b/docs/Directory.Build.props
index 66de939828d..9d8626a31cc 100644
--- a/docs/Directory.Build.props
+++ b/docs/Directory.Build.props
@@ -5,7 +5,7 @@
Exe
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462;net47;net471;net472;net48
diff --git a/global.json b/global.json
index 69fd3584271..31ef0653858 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,7 @@
{
"sdk": {
"rollForward": "latestFeature",
- "version": "6.0.100"
+ "version": "6.0.100",
+ "allowPrerelease": "true"
}
}
diff --git a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/netcoreapp3.1/PublicAPI.Shipped.txt b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/net6.0/PublicAPI.Shipped.txt
similarity index 100%
rename from src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/netcoreapp3.1/PublicAPI.Shipped.txt
rename to src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/net6.0/PublicAPI.Shipped.txt
diff --git a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/netcoreapp3.1/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/net6.0/PublicAPI.Unshipped.txt
similarity index 100%
rename from src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/netcoreapp3.1/PublicAPI.Unshipped.txt
rename to src/OpenTelemetry.Exporter.Prometheus.AspNetCore/.publicApi/net6.0/PublicAPI.Unshipped.txt
diff --git a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj
index 27c0377af01..6fcd3effcf7 100644
--- a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj
+++ b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj
@@ -2,7 +2,7 @@
- netcoreapp3.1
+ net6.0
ASP.NET Core middleware for hosting OpenTelemetry .NET Prometheus Exporter
$(PackageTags);prometheus;metrics
core-
diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/net7.0/PublicAPI.Shipped.txt b/src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/net7.0/PublicAPI.Shipped.txt
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/net7.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/net7.0/PublicAPI.Unshipped.txt
new file mode 100644
index 00000000000..87d29939cca
--- /dev/null
+++ b/src/OpenTelemetry.Instrumentation.AspNetCore/.publicApi/net7.0/PublicAPI.Unshipped.txt
@@ -0,0 +1,14 @@
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.AspNetCoreInstrumentationOptions() -> void
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.EnableGrpcAspNetCoreSupport.get -> bool
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.EnableGrpcAspNetCoreSupport.set -> void
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.Enrich.get -> System.Action
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.Enrich.set -> void
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.Filter.get -> System.Func
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.Filter.set -> void
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.RecordException.get -> bool
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreInstrumentationOptions.RecordException.set -> void
+OpenTelemetry.Metrics.MeterProviderBuilderExtensions
+OpenTelemetry.Trace.TracerProviderBuilderExtensions
+static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddAspNetCoreInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder builder) -> OpenTelemetry.Metrics.MeterProviderBuilder
+static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAspNetCoreInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configureAspNetCoreInstrumentationOptions = null) -> OpenTelemetry.Trace.TracerProviderBuilder
\ No newline at end of file
diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs
index a37863ad8b9..75ada899103 100644
--- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs
+++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs
@@ -35,6 +35,10 @@ namespace OpenTelemetry.Instrumentation.AspNetCore.Implementation
internal class HttpInListener : ListenerHandler
{
internal const string ActivityOperationName = "Microsoft.AspNetCore.Hosting.HttpRequestIn";
+#if NET7_0_OR_GREATER
+ // https://github.com/dotnet/aspnetcore/blob/8d6554e655b64da75b71e0e20d6db54a3ba8d2fb/src/Hosting/Hosting/src/GenericHost/GenericWebHostBuilder.cs#L85
+ internal static readonly string AspNetCoreActivitySourceName = "Microsoft.AspNetCore";
+#endif
internal static readonly AssemblyName AssemblyName = typeof(HttpInListener).Assembly.GetName();
internal static readonly string ActivitySourceName = AssemblyName.Name;
internal static readonly Version Version = AssemblyName.Version;
@@ -96,8 +100,14 @@ public override void OnStartActivity(Activity activity, object payload)
// Create a new activity with its parent set from the extracted context.
// This makes the new activity as a "sibling" of the activity created by
// Asp.Net Core.
+#if NET7_0_OR_GREATER
+ // For NET7.0 onwards activity is created using ActivitySource so,
+ // we will use the source of the activity to create the new one.
+ Activity newOne = activity.Source.CreateActivity(ActivityOperationName, ActivityKind.Server, ctx.ActivityContext);
+#else
Activity newOne = new Activity(ActivityOperationName);
newOne.SetParentId(ctx.ActivityContext.TraceId, ctx.ActivityContext.SpanId, ctx.ActivityContext.TraceFlags);
+#endif
newOne.TraceStateString = ctx.ActivityContext.TraceState;
newOne.SetTag("IsCreatedByInstrumentation", bool.TrueString);
@@ -135,8 +145,10 @@ public override void OnStartActivity(Activity activity, object payload)
return;
}
+#if !NET7_0_OR_GREATER
ActivityInstrumentationHelper.SetActivitySourceProperty(activity, ActivitySource);
ActivityInstrumentationHelper.SetKindProperty(activity, ActivityKind.Server);
+#endif
var path = (request.PathBase.HasValue || request.Path.HasValue) ? (request.PathBase + request.Path).ToString() : "/";
activity.DisplayName = path;
diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj b/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj
index 82732cdb581..39a74753890 100644
--- a/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj
+++ b/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj
@@ -1,7 +1,7 @@
- net6.0;netcoreapp3.1;netstandard2.1;netstandard2.0
+ net7.0;net6.0;netstandard2.1;netstandard2.0
ASP.NET Core instrumentation for OpenTelemetry .NET
$(PackageTags);distributed-tracing;AspNetCore
true
@@ -28,12 +28,11 @@
-
+
-
-
+
diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs
index 8ff58d22c73..2e2e4dfc253 100644
--- a/src/OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs
+++ b/src/OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs
@@ -15,6 +15,10 @@
//
using System;
+#if NET7_0_OR_GREATER
+using System.Diagnostics;
+using Microsoft.Extensions.DependencyInjection;
+#endif
using OpenTelemetry.Instrumentation.AspNetCore;
using OpenTelemetry.Instrumentation.AspNetCore.Implementation;
using OpenTelemetry.Internal;
@@ -42,7 +46,7 @@ public static TracerProviderBuilder AddAspNetCoreInstrumentation(
{
return deferredTracerProviderBuilder.Configure((sp, builder) =>
{
- AddAspNetCoreInstrumentation(builder, sp.GetOptions(), configureAspNetCoreInstrumentationOptions);
+ AddAspNetCoreInstrumentation(builder, sp.GetOptions(), configureAspNetCoreInstrumentationOptions, sp);
});
}
@@ -51,22 +55,44 @@ public static TracerProviderBuilder AddAspNetCoreInstrumentation(
internal static TracerProviderBuilder AddAspNetCoreInstrumentation(
this TracerProviderBuilder builder,
- AspNetCoreInstrumentation instrumentation)
+ AspNetCoreInstrumentation instrumentation,
+ IServiceProvider serviceProvider = null)
{
+ // For .NET7.0 onwards activity will be created using activitySource.
+ // https://github.com/dotnet/aspnetcore/blob/bf3352f2422bf16fa3ca49021f0e31961ce525eb/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs#L327
+ // For .NET6.0 and below, we will continue to use legacy way.
+#if NET7_0_OR_GREATER
+ // TODO: Check with .NET team to see if this can be prevented
+ // as this allows user to override the ActivitySource.
+ var activitySourceService = serviceProvider?.GetService();
+ if (activitySourceService != null)
+ {
+ builder.AddSource(activitySourceService.Name);
+ }
+ else
+ {
+ // For users not using hosting package?
+ builder.AddSource(HttpInListener.AspNetCoreActivitySourceName);
+ }
+#else
builder.AddSource(HttpInListener.ActivitySourceName);
builder.AddLegacySource(HttpInListener.ActivityOperationName); // for the activities created by AspNetCore
+#endif
+
return builder.AddInstrumentation(() => instrumentation);
}
private static TracerProviderBuilder AddAspNetCoreInstrumentation(
TracerProviderBuilder builder,
AspNetCoreInstrumentationOptions options,
- Action configure = null)
+ Action configure = null,
+ IServiceProvider serviceProvider = null)
{
configure?.Invoke(options);
return AddAspNetCoreInstrumentation(
builder,
- new AspNetCoreInstrumentation(new HttpInListener(options)));
+ new AspNetCoreInstrumentation(new HttpInListener(options)),
+ serviceProvider);
}
}
}
diff --git a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs
index 3eff73b71e5..09fc1f3c0ae 100644
--- a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs
+++ b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs
@@ -25,13 +25,30 @@ internal class HttpClientInstrumentation : IDisposable
{
private readonly DiagnosticSourceSubscriber diagnosticSourceSubscriber;
+ private readonly Func isEnabled = (activityName, obj1, obj2)
+ => !activityName.Equals("System.Net.Http.HttpRequestOut");
+
///
/// Initializes a new instance of the class.
///
/// Configuration options for HTTP client instrumentation.
public HttpClientInstrumentation(HttpClientInstrumentationOptions options)
{
- this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options), null);
+ // For .NET7.0 activity will be created using activitySource.
+ // https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs
+ // However, in case when activity creation returns null (due to sampling)
+ // the framework will fall back to creating activity anyways due to active diagnostic source listener
+ // To prevent this, isEnabled is implemented which will return false always
+ // so that the sampler's decision is respected.
+ if (HttpHandlerDiagnosticListener.IsNet7OrGreater)
+ {
+ this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options), this.isEnabled);
+ }
+ else
+ {
+ this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options), null);
+ }
+
this.diagnosticSourceSubscriber.Subscribe();
}
diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs
index 549537080f9..9f42f7a5440 100644
--- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs
+++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs
@@ -28,6 +28,10 @@ namespace OpenTelemetry.Instrumentation.Http.Implementation
internal sealed class HttpHandlerDiagnosticListener : ListenerHandler
{
internal static readonly AssemblyName AssemblyName = typeof(HttpHandlerDiagnosticListener).Assembly.GetName();
+ internal static readonly bool IsNet7OrGreater;
+
+ // https://github.com/dotnet/runtime/blob/7d034ddbbbe1f2f40c264b323b3ed3d6b3d45e9a/src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs#L19
+ internal static readonly string HttpClientActivitySourceName = "System.Net.Http";
internal static readonly string ActivitySourceName = AssemblyName.Name;
internal static readonly Version Version = AssemblyName.Version;
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, Version.ToString());
@@ -40,6 +44,18 @@ internal sealed class HttpHandlerDiagnosticListener : ListenerHandler
private readonly PropertyFetcher stopRequestStatusFetcher = new("RequestTaskStatus");
private readonly HttpClientInstrumentationOptions options;
+ static HttpHandlerDiagnosticListener()
+ {
+ try
+ {
+ IsNet7OrGreater = typeof(HttpClient).Assembly.GetName().Version.Major >= 7;
+ }
+ catch (Exception)
+ {
+ IsNet7OrGreater = false;
+ }
+ }
+
public HttpHandlerDiagnosticListener(HttpClientInstrumentationOptions options)
: base("HttpHandlerDiagnosticListener")
{
@@ -58,7 +74,11 @@ public override void OnStartActivity(Activity activity, object payload)
// By this time, samplers have already run and
// activity.IsAllDataRequested populated accordingly.
- if (Sdk.SuppressInstrumentation)
+ // For .NET7.0 or higher versions, activity is created using activity source
+ // However, the framework will fallback to creating activity if the sampler's decision is to drop and there is a active diagnostic listener.
+ // To prevent processing such activities we first check the source name to confirm if it was created using
+ // activity source or not.
+ if (Sdk.SuppressInstrumentation || (IsNet7OrGreater && string.IsNullOrEmpty(activity.Source.Name)))
{
return;
}
@@ -108,8 +128,11 @@ public override void OnStartActivity(Activity activity, object payload)
activity.DisplayName = HttpTagHelper.GetOperationNameForHttpMethod(request.Method);
- ActivityInstrumentationHelper.SetActivitySourceProperty(activity, ActivitySource);
- ActivityInstrumentationHelper.SetKindProperty(activity, ActivityKind.Client);
+ if (!IsNet7OrGreater)
+ {
+ ActivityInstrumentationHelper.SetActivitySourceProperty(activity, ActivitySource);
+ ActivityInstrumentationHelper.SetKindProperty(activity, ActivityKind.Client);
+ }
activity.SetTag(SemanticConventions.AttributeHttpScheme, request.RequestUri.Scheme);
activity.SetTag(SemanticConventions.AttributeHttpMethod, HttpTagHelper.GetNameForHttpMethod(request.Method));
@@ -130,6 +153,15 @@ public override void OnStartActivity(Activity activity, object payload)
public override void OnStopActivity(Activity activity, object payload)
{
+ // For .NET7.0 or higher versions, activity is created using activity source
+ // However, the framework will fallback to creating activity if the sampler's decision is to drop and there is a active diagnostic listener.
+ // To prevent processing such activities we first check the source name to confirm if it was created using
+ // activity source or not.
+ if (IsNet7OrGreater && string.IsNullOrEmpty(activity.Source.Name))
+ {
+ return;
+ }
+
if (activity.IsAllDataRequested)
{
// https://github.com/dotnet/runtime/blob/master/src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs
@@ -179,6 +211,15 @@ public override void OnStopActivity(Activity activity, object payload)
public override void OnException(Activity activity, object payload)
{
+ // For .NET7.0 or higher versions, activity is created using activity source
+ // However, the framework will fallback to creating activity if the sampler's decision is to drop and there is a active diagnostic listener.
+ // To prevent processing such activities we first check the source name to confirm if it was created using
+ // activity source or not.
+ if (IsNet7OrGreater && string.IsNullOrEmpty(activity.Source.Name))
+ {
+ return;
+ }
+
if (activity.IsAllDataRequested)
{
if (!this.stopExceptionFetcher.TryFetch(payload, out Exception exc) || exc == null)
diff --git a/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs
index 78461551aeb..a71912a99ae 100644
--- a/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs
+++ b/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs
@@ -78,8 +78,16 @@ internal static TracerProviderBuilder AddHttpClientInstrumentation(
this TracerProviderBuilder builder,
HttpClientInstrumentation instrumentation)
{
- builder.AddSource(HttpHandlerDiagnosticListener.ActivitySourceName);
- builder.AddLegacySource("System.Net.Http.HttpRequestOut");
+ if (HttpHandlerDiagnosticListener.IsNet7OrGreater)
+ {
+ builder.AddSource(HttpHandlerDiagnosticListener.HttpClientActivitySourceName);
+ }
+ else
+ {
+ builder.AddSource(HttpHandlerDiagnosticListener.ActivitySourceName);
+ builder.AddLegacySource("System.Net.Http.HttpRequestOut");
+ }
+
return builder.AddInstrumentation(() => instrumentation);
}
diff --git a/test/Benchmarks/Benchmarks.csproj b/test/Benchmarks/Benchmarks.csproj
index 20ee4fb7456..6cb7f6277f2 100644
--- a/test/Benchmarks/Benchmarks.csproj
+++ b/test/Benchmarks/Benchmarks.csproj
@@ -3,7 +3,7 @@
Exe
- net6.0;netcoreapp3.1;net462
+ net6.0;net462
diff --git a/test/OpenTelemetry.Exporter.Jaeger.Tests/OpenTelemetry.Exporter.Jaeger.Tests.csproj b/test/OpenTelemetry.Exporter.Jaeger.Tests/OpenTelemetry.Exporter.Jaeger.Tests.csproj
index ae59a07b7cc..5531e9421a6 100644
--- a/test/OpenTelemetry.Exporter.Jaeger.Tests/OpenTelemetry.Exporter.Jaeger.Tests.csproj
+++ b/test/OpenTelemetry.Exporter.Jaeger.Tests/OpenTelemetry.Exporter.Jaeger.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for Jaeger Exporter for OpenTelemetry
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj
index 271f7649e84..3bc3fee04b1 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj
@@ -2,7 +2,7 @@
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
$(TARGET_FRAMEWORK)
diff --git a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj
index d0940145313..bf33cabbc40 100644
--- a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj
+++ b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for Prometheus Exporter AspNetCore for OpenTelemetry
- netcoreapp3.1
+ net6.0
false
@@ -24,8 +24,8 @@
-
-
+
+
diff --git a/test/OpenTelemetry.Exporter.ZPages.Tests/OpenTelemetry.Exporter.ZPages.Tests.csproj b/test/OpenTelemetry.Exporter.ZPages.Tests/OpenTelemetry.Exporter.ZPages.Tests.csproj
index a99f6d789dd..dca1ff0d21e 100644
--- a/test/OpenTelemetry.Exporter.ZPages.Tests/OpenTelemetry.Exporter.ZPages.Tests.csproj
+++ b/test/OpenTelemetry.Exporter.ZPages.Tests/OpenTelemetry.Exporter.ZPages.Tests.csproj
@@ -2,7 +2,7 @@
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
diff --git a/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj b/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj
index eb61dda0a1c..7649dc09d3c 100644
--- a/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj
+++ b/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for Zipkin Exporter for OpenTelemetry
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
diff --git a/test/OpenTelemetry.Extensions.EventSource.Tests/OpenTelemetry.Extensions.EventSource.Tests.csproj b/test/OpenTelemetry.Extensions.EventSource.Tests/OpenTelemetry.Extensions.EventSource.Tests.csproj
index 72af555428c..855502dd5b3 100644
--- a/test/OpenTelemetry.Extensions.EventSource.Tests/OpenTelemetry.Extensions.EventSource.Tests.csproj
+++ b/test/OpenTelemetry.Extensions.EventSource.Tests/OpenTelemetry.Extensions.EventSource.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry EventSource extensions
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
enable
AllEnabledByDefault
diff --git a/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj b/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj
index 44bfda2ee95..c56dfc18e8f 100644
--- a/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj
+++ b/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry .NET Core hosting library
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
diff --git a/test/OpenTelemetry.Extensions.Propagators.Tests/OpenTelemetry.Extensions.Propagators.Tests.csproj b/test/OpenTelemetry.Extensions.Propagators.Tests/OpenTelemetry.Extensions.Propagators.Tests.csproj
index 9186da7a943..485184b256a 100644
--- a/test/OpenTelemetry.Extensions.Propagators.Tests/OpenTelemetry.Extensions.Propagators.Tests.csproj
+++ b/test/OpenTelemetry.Extensions.Propagators.Tests/OpenTelemetry.Extensions.Propagators.Tests.csproj
@@ -2,7 +2,7 @@
- net6.0;netcoreapp3.1;net462
+ net6.0;net462
$(TARGET_FRAMEWORK)
diff --git a/test/OpenTelemetry.Extensions.Serilog.Tests/OpenTelemetry.Extensions.Serilog.Tests.csproj b/test/OpenTelemetry.Extensions.Serilog.Tests/OpenTelemetry.Extensions.Serilog.Tests.csproj
index 2a5954ade3e..daa1bc3dfeb 100644
--- a/test/OpenTelemetry.Extensions.Serilog.Tests/OpenTelemetry.Extensions.Serilog.Tests.csproj
+++ b/test/OpenTelemetry.Extensions.Serilog.Tests/OpenTelemetry.Extensions.Serilog.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry Serilog extensions
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
enable
AllEnabledByDefault
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
index f7eaf9bd213..3ec92d2ce08 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
@@ -38,6 +38,9 @@
#if NET6_0
using TestApp.AspNetCore._6._0;
#endif
+#if NET7_0
+using TestApp.AspNetCore._7._0;
+#endif
using Xunit;
namespace OpenTelemetry.Instrumentation.AspNetCore.Tests
@@ -345,7 +348,7 @@ public async Task ExtractContextIrrespectiveOfSamplingDecision(SamplingDecision
var expectedTraceId = ActivityTraceId.CreateRandom();
var expectedParentSpanId = ActivitySpanId.CreateRandom();
var expectedTraceState = "rojo=1,congo=2";
- var activityContext = new ActivityContext(expectedTraceId, expectedParentSpanId, ActivityTraceFlags.Recorded, expectedTraceState);
+ var activityContext = new ActivityContext(expectedTraceId, expectedParentSpanId, ActivityTraceFlags.Recorded, expectedTraceState, true);
var expectedBaggage = Baggage.SetBaggage("key1", "value1").SetBaggage("key2", "value2");
Sdk.SetDefaultTextMapPropagator(new ExtractOnlyPropagator(activityContext, expectedBaggage));
@@ -583,6 +586,47 @@ public async Task ActivitiesStartedInMiddlewareShouldNotBeUpdatedByInstrumentati
Assert.Equal(activityName, middlewareActivity.DisplayName);
}
+#if NET7_0_OR_GREATER
+ [Fact]
+ public async Task UserRegisteredActivitySourceIsUsedForActivityCreationByAspNetCore()
+ {
+ var exportedItems = new List();
+ void ConfigureTestServices(IServiceCollection services)
+ {
+ services.AddOpenTelemetryTracing(options =>
+ {
+ options.AddAspNetCoreInstrumentation()
+ .AddInMemoryExporter(exportedItems);
+ });
+
+ // Register ActivitySource here so that it will be used
+ // by ASP.NET Core to create activities
+ // https://github.com/dotnet/aspnetcore/blob/0e5cbf447d329a1e7d69932c3decd1c70a00fbba/src/Hosting/Hosting/src/Internal/WebHost.cs#L152
+ services.AddSingleton(sp => new ActivitySource("UserRegisteredActivitySource"));
+ }
+
+ // Arrange
+ using (var client = this.factory
+ .WithWebHostBuilder(builder =>
+ builder.ConfigureTestServices(ConfigureTestServices))
+ .CreateClient())
+ {
+ // Act
+ var response = await client.GetAsync("/api/values");
+
+ // Assert
+ response.EnsureSuccessStatusCode(); // Status Code 200-299
+
+ WaitForActivityExport(exportedItems, 1);
+ }
+
+ Assert.Single(exportedItems);
+ var activity = exportedItems[0];
+
+ Assert.Equal("UserRegisteredActivitySource", activity.Source.Name);
+ }
+#endif
+
public void Dispose()
{
this.tracerProvider?.Dispose();
@@ -605,8 +649,13 @@ 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
+ Assert.Equal(HttpInListener.AspNetCoreActivitySourceName, activityToValidate.Source.Name);
+ Assert.Empty(activityToValidate.Source.Version);
+#else
Assert.Equal(HttpInListener.ActivitySourceName, activityToValidate.Source.Name);
Assert.Equal(HttpInListener.Version.ToString(), activityToValidate.Source.Version);
+#endif
Assert.Equal(expectedHttpPath, activityToValidate.GetTagValue(SemanticConventions.AttributeHttpTarget) as string);
}
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/DependencyInjectionConfigTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/DependencyInjectionConfigTests.cs
index 7706854e730..eabe0e600f8 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/DependencyInjectionConfigTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/DependencyInjectionConfigTests.cs
@@ -24,6 +24,9 @@
#if NET6_0
using TestApp.AspNetCore._6._0;
#endif
+#if NET7_0
+using TestApp.AspNetCore._7._0;
+#endif
using Xunit;
namespace OpenTelemetry.Instrumentation.AspNetCore.Tests
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs
index 156a2be27d1..80f09a9a972 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs
@@ -31,6 +31,9 @@
#if NET6_0
using TestApp.AspNetCore._6._0;
#endif
+#if NET7_0
+using TestApp.AspNetCore._7._0;
+#endif
using Xunit;
namespace OpenTelemetry.Instrumentation.AspNetCore.Tests
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs
index 53bac48facc..4d93ba9a7b5 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs
@@ -27,6 +27,9 @@
#if NET6_0
using TestApp.AspNetCore._6._0;
#endif
+#if NET7_0
+using TestApp.AspNetCore._7._0;
+#endif
using Xunit;
namespace OpenTelemetry.Instrumentation.AspNetCore.Tests
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 003cf214a9e..9d76e241ab3 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry ASP.NET Core instrumentation
- net6.0;netcoreapp3.1
+ net7.0;net6.0
@@ -27,6 +27,11 @@
+
+
+
+
+
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/OpenTelemetry.Instrumentation.Grpc.Tests.csproj b/test/OpenTelemetry.Instrumentation.Grpc.Tests/OpenTelemetry.Instrumentation.Grpc.Tests.csproj
index 119c38e2887..f780997f340 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/OpenTelemetry.Instrumentation.Grpc.Tests.csproj
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/OpenTelemetry.Instrumentation.Grpc.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry Grpc for .NET instrumentation
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
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 35f23f1ba4b..c6636eae611 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry HTTP instrumentations
- net6.0;netcoreapp3.1
+ net7.0;net6.0
$(TargetFrameworks);net462
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 8a9353c97c4..7f3f224f3ef 100644
--- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj
+++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry SqlClient instrumentations
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
$(TARGET_FRAMEWORK)
diff --git a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile
index cacdd48cc03..5698ff7556a 100644
--- a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile
+++ b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile
@@ -2,16 +2,16 @@
# This should be run from the root of the repo:
# docker build --file test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile .
-ARG SDK_VERSION=6.0
+ARG SDK_VERSION=7.0
FROM ubuntu AS w3c
#Install git
WORKDIR /w3c
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/w3c/trace-context.git
-FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
+FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
ARG PUBLISH_CONFIGURATION=Release
-ARG PUBLISH_FRAMEWORK=net6.0
+ARG PUBLISH_FRAMEWORK=net7.0
WORKDIR /repo
COPY . ./
WORKDIR "/repo/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests"
diff --git a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/InProcessServer.cs b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/InProcessServer.cs
index 708bab2cdd0..31010ff2f9c 100644
--- a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/InProcessServer.cs
+++ b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/InProcessServer.cs
@@ -26,6 +26,9 @@
#if NET6_0
using TestApp.AspNetCore._6._0;
#endif
+#if NET7_0
+using TestApp.AspNetCore._7._0;
+#endif
using Xunit.Abstractions;
namespace OpenTelemetry.Instrumentation.W3cTraceContext.Tests
diff --git a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj
index de4eeeff83e..7fdd6109d44 100644
--- a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj
+++ b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj
@@ -3,7 +3,7 @@
Unit test project for OpenTelemetry ASP.NET Core instrumentation for W3C Trace Context Trace
- net6.0;netcoreapp3.1
+ net7.0;net6.0
$(TARGET_FRAMEWORK)
@@ -33,8 +33,8 @@
-
-
+
+
diff --git a/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj b/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj
index 478fc22c730..3367474dbf4 100644
--- a/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj
+++ b/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry.Shims.OpenTracing
- net6.0;netcoreapp3.1
+ net6.0
diff --git a/test/OpenTelemetry.Tests.Stress.Logs/OpenTelemetry.Tests.Stress.Logs.csproj b/test/OpenTelemetry.Tests.Stress.Logs/OpenTelemetry.Tests.Stress.Logs.csproj
index 45c21139ba3..b586488162c 100644
--- a/test/OpenTelemetry.Tests.Stress.Logs/OpenTelemetry.Tests.Stress.Logs.csproj
+++ b/test/OpenTelemetry.Tests.Stress.Logs/OpenTelemetry.Tests.Stress.Logs.csproj
@@ -3,7 +3,7 @@
Exe
- net6.0;netcoreapp3.1;net462
+ net6.0;net462
diff --git a/test/OpenTelemetry.Tests.Stress.Metrics/OpenTelemetry.Tests.Stress.Metrics.csproj b/test/OpenTelemetry.Tests.Stress.Metrics/OpenTelemetry.Tests.Stress.Metrics.csproj
index 49134943927..71e5735570e 100644
--- a/test/OpenTelemetry.Tests.Stress.Metrics/OpenTelemetry.Tests.Stress.Metrics.csproj
+++ b/test/OpenTelemetry.Tests.Stress.Metrics/OpenTelemetry.Tests.Stress.Metrics.csproj
@@ -3,7 +3,7 @@
Exe
- net6.0;netcoreapp3.1;net462
+ net6.0;net462
diff --git a/test/OpenTelemetry.Tests.Stress/OpenTelemetry.Tests.Stress.csproj b/test/OpenTelemetry.Tests.Stress/OpenTelemetry.Tests.Stress.csproj
index 73b65c17227..1c06ae6076c 100644
--- a/test/OpenTelemetry.Tests.Stress/OpenTelemetry.Tests.Stress.csproj
+++ b/test/OpenTelemetry.Tests.Stress/OpenTelemetry.Tests.Stress.csproj
@@ -2,7 +2,7 @@
Exe
- net6.0;netcoreapp3.1;net462
+ net6.0;net462
diff --git a/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj b/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj
index 8d1c69f4f50..199db4b6e4b 100644
--- a/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj
+++ b/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj
@@ -2,7 +2,7 @@
Unit test project for OpenTelemetry
- net6.0;netcoreapp3.1
+ net6.0
$(TargetFrameworks);net462
$(NoWarn),CS0618
diff --git a/test/TestApp.AspNetCore.3.1/README.md b/test/TestApp.AspNetCore.3.1/README.md
deleted file mode 100644
index db05b30cc29..00000000000
--- a/test/TestApp.AspNetCore.3.1/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# ASP.NET Core Integration Test
-
-This test app is used for ASP.NET Core integration testing by unit tests. You
-could also manually run W3C test suite.
-
-## Run W3C test suite
-
-The detailed instruction for the test tool available
-[here](https://github.com/w3c/trace-context/tree/master/test).
-
-* Follow it to install prerequisites and get the test code
-* Start this test app with Visual Studio (or `dotnet run`)
-* Run test per instruction using `http://localhost:63741/api/forward` endpoint
diff --git a/test/TestApp.AspNetCore.3.1/ActivityMiddleware.cs b/test/TestApp.AspNetCore.7.0/ActivityMiddleware.cs
similarity index 98%
rename from test/TestApp.AspNetCore.3.1/ActivityMiddleware.cs
rename to test/TestApp.AspNetCore.7.0/ActivityMiddleware.cs
index 44c1eff7d14..70a28e214bc 100644
--- a/test/TestApp.AspNetCore.3.1/ActivityMiddleware.cs
+++ b/test/TestApp.AspNetCore.7.0/ActivityMiddleware.cs
@@ -17,7 +17,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
-namespace TestApp.AspNetCore._3._1
+namespace TestApp.AspNetCore._7._0
{
public class ActivityMiddleware
{
diff --git a/test/TestApp.AspNetCore.3.1/AssemblyInfo.cs b/test/TestApp.AspNetCore.7.0/AssemblyInfo.cs
similarity index 95%
rename from test/TestApp.AspNetCore.3.1/AssemblyInfo.cs
rename to test/TestApp.AspNetCore.7.0/AssemblyInfo.cs
index a7d6eb86a61..e78e70ff5b9 100644
--- a/test/TestApp.AspNetCore.3.1/AssemblyInfo.cs
+++ b/test/TestApp.AspNetCore.7.0/AssemblyInfo.cs
@@ -21,4 +21,4 @@
"SA1300",
Justification = "Reviewed.",
Scope = "namespaceanddescendants",
- Target = "TestApp.AspNetCore._3._1")]
+ Target = "TestApp.AspNetCore._7._0")]
diff --git a/test/TestApp.AspNetCore.3.1/CallbackMiddleware.cs b/test/TestApp.AspNetCore.7.0/CallbackMiddleware.cs
similarity index 88%
rename from test/TestApp.AspNetCore.3.1/CallbackMiddleware.cs
rename to test/TestApp.AspNetCore.7.0/CallbackMiddleware.cs
index 97023ac6ce3..a6609b39346 100644
--- a/test/TestApp.AspNetCore.3.1/CallbackMiddleware.cs
+++ b/test/TestApp.AspNetCore.7.0/CallbackMiddleware.cs
@@ -13,10 +13,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
+
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
-namespace TestApp.AspNetCore._3._1
+#pragma warning disable SA1300 // Element should begin with upper-case letter
+namespace TestApp.AspNetCore._7._0
+#pragma warning restore SA1300 // Element should begin with upper-case letter
{
public class CallbackMiddleware
{
diff --git a/test/TestApp.AspNetCore.3.1/Controllers/ChildActivityController.cs b/test/TestApp.AspNetCore.7.0/Controllers/ChildActivityController.cs
similarity index 89%
rename from test/TestApp.AspNetCore.3.1/Controllers/ChildActivityController.cs
rename to test/TestApp.AspNetCore.7.0/Controllers/ChildActivityController.cs
index 911f9bae6a3..a31e42a86e3 100644
--- a/test/TestApp.AspNetCore.3.1/Controllers/ChildActivityController.cs
+++ b/test/TestApp.AspNetCore.7.0/Controllers/ChildActivityController.cs
@@ -19,7 +19,9 @@
using Microsoft.AspNetCore.Mvc;
using OpenTelemetry;
-namespace TestApp.AspNetCore._3._1.Controllers
+#pragma warning disable SA1300 // Element should begin with upper-case letter
+namespace TestApp.AspNetCore._7._0.Controllers
+#pragma warning restore SA1300 // Element should begin with upper-case letter
{
public class ChildActivityController : Controller
{
diff --git a/test/TestApp.AspNetCore.3.1/Controllers/ForwardController.cs b/test/TestApp.AspNetCore.7.0/Controllers/ForwardController.cs
similarity index 91%
rename from test/TestApp.AspNetCore.3.1/Controllers/ForwardController.cs
rename to test/TestApp.AspNetCore.7.0/Controllers/ForwardController.cs
index 5b532d3af0e..37822411636 100644
--- a/test/TestApp.AspNetCore.3.1/Controllers/ForwardController.cs
+++ b/test/TestApp.AspNetCore.7.0/Controllers/ForwardController.cs
@@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
+
using System.Net.Http;
using System.Text;
using System.Text.Json;
@@ -20,7 +21,9 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
-namespace TestApp.AspNetCore._3._1.Controllers
+#pragma warning disable SA1300 // Element should begin with upper-case letter
+namespace TestApp.AspNetCore._7._0.Controllers
+#pragma warning restore SA1300 // Element should begin with upper-case letter
{
[Route("api/[controller]")]
public class ForwardController : Controller
diff --git a/test/TestApp.AspNetCore.3.1/Controllers/ValuesController.cs b/test/TestApp.AspNetCore.7.0/Controllers/ValuesController.cs
similarity index 88%
rename from test/TestApp.AspNetCore.3.1/Controllers/ValuesController.cs
rename to test/TestApp.AspNetCore.7.0/Controllers/ValuesController.cs
index c7143faecf8..0183988b6f3 100644
--- a/test/TestApp.AspNetCore.3.1/Controllers/ValuesController.cs
+++ b/test/TestApp.AspNetCore.7.0/Controllers/ValuesController.cs
@@ -16,7 +16,9 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
-namespace TestApp.AspNetCore._3._1.Controllers
+#pragma warning disable SA1300 // Element should begin with upper-case letter
+namespace TestApp.AspNetCore._7._0.Controllers
+#pragma warning restore SA1300 // Element should begin with upper-case letter
{
[Route("api/[controller]")]
public class ValuesController : Controller
diff --git a/test/TestApp.AspNetCore.3.1/Program.cs b/test/TestApp.AspNetCore.7.0/Program.cs
similarity index 84%
rename from test/TestApp.AspNetCore.3.1/Program.cs
rename to test/TestApp.AspNetCore.7.0/Program.cs
index 44e9398c023..bdf1d8b7204 100644
--- a/test/TestApp.AspNetCore.3.1/Program.cs
+++ b/test/TestApp.AspNetCore.7.0/Program.cs
@@ -17,7 +17,9 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
-namespace TestApp.AspNetCore._3._1
+#pragma warning disable SA1300 // Element should begin with upper-case letter
+namespace TestApp.AspNetCore._7._0
+#pragma warning restore SA1300 // Element should begin with upper-case letter
{
public class Program
{
diff --git a/test/TestApp.AspNetCore.3.1/Startup.cs b/test/TestApp.AspNetCore.7.0/Startup.cs
similarity index 92%
rename from test/TestApp.AspNetCore.3.1/Startup.cs
rename to test/TestApp.AspNetCore.7.0/Startup.cs
index b8d84242aa1..d9bbe701b6f 100644
--- a/test/TestApp.AspNetCore.3.1/Startup.cs
+++ b/test/TestApp.AspNetCore.7.0/Startup.cs
@@ -21,7 +21,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
-namespace TestApp.AspNetCore._3._1
+#pragma warning disable SA1300 // Element should begin with upper-case letter
+namespace TestApp.AspNetCore._7._0
+#pragma warning restore SA1300 // Element should begin with upper-case letter
{
public class Startup
{
diff --git a/test/TestApp.AspNetCore.3.1/TestApp.AspNetCore.3.1.csproj b/test/TestApp.AspNetCore.7.0/TestApp.AspNetCore.7.0.csproj
similarity index 78%
rename from test/TestApp.AspNetCore.3.1/TestApp.AspNetCore.3.1.csproj
rename to test/TestApp.AspNetCore.7.0/TestApp.AspNetCore.7.0.csproj
index 6dae1f7c31a..ef7445dd18e 100644
--- a/test/TestApp.AspNetCore.3.1/TestApp.AspNetCore.3.1.csproj
+++ b/test/TestApp.AspNetCore.7.0/TestApp.AspNetCore.7.0.csproj
@@ -1,6 +1,7 @@
-
+
+
- netcoreapp3.1
+ net7.0
@@ -11,7 +12,7 @@
-
+
@@ -20,4 +21,5 @@
+
diff --git a/test/TestApp.AspNetCore.3.1/appsettings.Development.json b/test/TestApp.AspNetCore.7.0/appsettings.Development.json
similarity index 100%
rename from test/TestApp.AspNetCore.3.1/appsettings.Development.json
rename to test/TestApp.AspNetCore.7.0/appsettings.Development.json
diff --git a/test/TestApp.AspNetCore.3.1/appsettings.json b/test/TestApp.AspNetCore.7.0/appsettings.json
similarity index 100%
rename from test/TestApp.AspNetCore.3.1/appsettings.json
rename to test/TestApp.AspNetCore.7.0/appsettings.json
From 2024b18adc21e0f823028cef23e0a51eafe9d436 Mon Sep 17 00:00:00 2001
From: Alan West <3676547+alanwest@users.noreply.github.com>
Date: Thu, 4 Aug 2022 09:37:35 -0700
Subject: [PATCH 2/3] Remove netcoreapp3.1 from
OpenTelemetry.Tests.Stress.Traces.csproj
---
.../OpenTelemetry.Tests.Stress.Traces.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/OpenTelemetry.Tests.Stress.Traces/OpenTelemetry.Tests.Stress.Traces.csproj b/test/OpenTelemetry.Tests.Stress.Traces/OpenTelemetry.Tests.Stress.Traces.csproj
index 1e1cfe3a1c6..674392dddad 100644
--- a/test/OpenTelemetry.Tests.Stress.Traces/OpenTelemetry.Tests.Stress.Traces.csproj
+++ b/test/OpenTelemetry.Tests.Stress.Traces/OpenTelemetry.Tests.Stress.Traces.csproj
@@ -3,7 +3,7 @@
Exe
- net6.0;netcoreapp3.1;net462
+ net6.0;net462
From a243a4ec9e9e11f0a9c22580ea0a39f1cfb3b6b5 Mon Sep 17 00:00:00 2001
From: Alan West <3676547+alanwest@users.noreply.github.com>
Date: Thu, 4 Aug 2022 09:49:05 -0700
Subject: [PATCH 3/3] Fix apicompatibility.yml
---
.github/workflows/apicompatibility.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/apicompatibility.yml b/.github/workflows/apicompatibility.yml
index 1077523a668..7795d85232c 100644
--- a/.github/workflows/apicompatibility.yml
+++ b/.github/workflows/apicompatibility.yml
@@ -15,9 +15,10 @@ jobs:
DOTNET_MULTILEVEL_LOOKUP: 1
steps:
- uses: actions/checkout@v3
- - uses: actions/setup-dotnet@v1
with:
fetch-depth: 0 # fetching all
+ - uses: actions/setup-dotnet@v1
+ with:
dotnet-version: '7.0.x'
include-prerelease: true