From 334211be87e48b2653f45919d51ef9aba716b8c6 Mon Sep 17 00:00:00 2001 From: Lucas Pimentel-Ordyna Date: Wed, 15 Jan 2020 11:01:35 -0500 Subject: [PATCH] run tests on .NET Core 3.1 (#601) --- .azure-pipelines/integration-tests.yml | 36 ++++++---- .azure-pipelines/packages.yml | 2 +- .azure-pipelines/unit-tests.yml | 28 +++++--- .env | 2 +- Datadog.Trace.sln | 69 +++++++++++-------- PackageVersionsComprehensive.g.props | 50 +++----------- PackageVersionsGeneratorDefinitions.json | 8 --- PackageVersionsLatestMinors.g.props | 21 +++--- Test.Common.props | 4 +- docker/build.sh | 14 ++-- docker/dotnet.dockerfile | 16 ++--- docs/README.md | 4 +- .../AspNetMvcCorePerformance.csproj | 2 +- .../Directory.Build.props | 12 ++-- .../DataDogThreadTest.csproj | 2 +- .../OrleansCrash/OrleansCrash.csproj | 2 +- ...change.Redis.StackOverflowException.csproj | 4 +- ...ceContext.InvalidOperationException.csproj | 2 +- samples/Directory.Build.props | 4 +- .../Samples.AspNetCoreMvc.Netcore3.csproj | 47 ------------- .../Views/_Layout.cshtml | 27 -------- .../Views/_ViewStart.cshtml | 3 - .../DistributedTracingApiController.cs | 51 -------------- .../DistributedTracingMvcController.cs | 51 -------------- .../Extensions/HeaderDictionaryExtensions.cs | 47 ------------- .../Samples.AspNetCoreMvc2.csproj | 27 -------- .../Views/Home/Delay.cshtml | 9 --- .../Views/Home/Index.cshtml | 59 ---------------- .../Views/_ViewImports.cshtml | 2 - .../Views/_ViewStart.cshtml | 3 - .../Controllers/ApiController.cs | 11 ++- .../Controllers/HomeController.cs | 4 +- .../Properties/launchSettings.json | 0 .../Samples.AspNetCoreMvc21.csproj | 16 +++++ .../Shared}/StackTraceHelper.cs | 4 +- .../Startup.cs | 21 +----- .../Views/Home/Delay.cshtml | 0 .../Views/Home/Index.cshtml | 0 .../Views/Shared}/_Layout.cshtml | 2 +- .../Views/_ViewImports.cshtml | 2 +- .../Views/_ViewStart.cshtml | 3 + .../appsettings.json | 0 .../Program.cs | 2 +- .../Properties/launchSettings.json | 10 +-- .../Samples.AspNetCoreMvc30.csproj | 19 +++++ .../Startup.cs | 6 +- .../appsettings.Development.json | 0 .../appsettings.json | 0 samples/Samples.AspNetCoreMvc31/Program.cs | 20 ++++++ .../Properties/launchSettings.json | 52 ++++++++++++++ .../Samples.AspNetCoreMvc31.csproj | 19 +++++ samples/Samples.AspNetCoreMvc31/Startup.cs | 50 ++++++++++++++ .../appsettings.Development.json | 9 +++ .../Samples.AspNetCoreMvc31/appsettings.json | 10 +++ .../Samples.GraphQL/Samples.GraphQL.csproj | 2 +- .../AspNetCore/AspNetCoreMvc21Tests.cs | 23 +++++++ .../AspNetCore/AspNetCoreMvc2Tests.cs | 24 ------- ...reMvc3Tests.cs => AspNetCoreMvc30Tests.cs} | 11 ++- .../AspNetCore/AspNetCoreMvc31Tests.cs | 24 +++++++ .../Helpers/TargetFrameworkVersionsFact.cs | 38 ++-------- .../Helpers/TargetFrameworkVersionsTheory.cs | 21 ++++++ ...adTests.cs => AspNetCoreMvc21LoadTests.cs} | 6 +- .../PackageVersions.g.cs | 4 -- .../PackageVersionsComprehensive.g.cs | 26 ++----- .../PackageVersionsLatestMinors.g.cs | 20 ++---- test/Directory.Build.props | 4 +- .../Datadog.Core.Tools.csproj | 4 +- .../Extensions/AssemblyExtensions.cs | 43 ++++++++++++ 68 files changed, 492 insertions(+), 626 deletions(-) delete mode 100644 samples/Samples.AspNetCoreMvc.Netcore3/Samples.AspNetCoreMvc.Netcore3.csproj delete mode 100644 samples/Samples.AspNetCoreMvc.Netcore3/Views/_Layout.cshtml delete mode 100644 samples/Samples.AspNetCoreMvc.Netcore3/Views/_ViewStart.cshtml delete mode 100644 samples/Samples.AspNetCoreMvc2/Controllers/DistributedTracingApiController.cs delete mode 100644 samples/Samples.AspNetCoreMvc2/Controllers/DistributedTracingMvcController.cs delete mode 100644 samples/Samples.AspNetCoreMvc2/Extensions/HeaderDictionaryExtensions.cs delete mode 100644 samples/Samples.AspNetCoreMvc2/Samples.AspNetCoreMvc2.csproj delete mode 100644 samples/Samples.AspNetCoreMvc2/Views/Home/Delay.cshtml delete mode 100644 samples/Samples.AspNetCoreMvc2/Views/Home/Index.cshtml delete mode 100644 samples/Samples.AspNetCoreMvc2/Views/_ViewImports.cshtml delete mode 100644 samples/Samples.AspNetCoreMvc2/Views/_ViewStart.cshtml rename samples/{Samples.AspNetCoreMvc2 => Samples.AspNetCoreMvc21}/Controllers/ApiController.cs (53%) rename samples/{Samples.AspNetCoreMvc2 => Samples.AspNetCoreMvc21}/Controllers/HomeController.cs (95%) rename samples/{Samples.AspNetCoreMvc2 => Samples.AspNetCoreMvc21}/Properties/launchSettings.json (100%) create mode 100644 samples/Samples.AspNetCoreMvc21/Samples.AspNetCoreMvc21.csproj rename samples/{Samples.AspNetCoreMvc2/Attributes => Samples.AspNetCoreMvc21/Shared}/StackTraceHelper.cs (77%) rename samples/{Samples.AspNetCoreMvc2 => Samples.AspNetCoreMvc21}/Startup.cs (68%) rename samples/{Samples.AspNetCoreMvc.Netcore3 => Samples.AspNetCoreMvc21}/Views/Home/Delay.cshtml (100%) rename samples/{Samples.AspNetCoreMvc.Netcore3 => Samples.AspNetCoreMvc21}/Views/Home/Index.cshtml (100%) rename samples/{Samples.AspNetCoreMvc2/Views => Samples.AspNetCoreMvc21/Views/Shared}/_Layout.cshtml (93%) rename samples/{Samples.AspNetCoreMvc.Netcore3 => Samples.AspNetCoreMvc21}/Views/_ViewImports.cshtml (61%) create mode 100644 samples/Samples.AspNetCoreMvc21/Views/_ViewStart.cshtml rename samples/{Samples.AspNetCoreMvc2 => Samples.AspNetCoreMvc21}/appsettings.json (100%) rename samples/{Samples.AspNetCoreMvc.Netcore3 => Samples.AspNetCoreMvc30}/Program.cs (92%) rename samples/{Samples.AspNetCoreMvc.Netcore3 => Samples.AspNetCoreMvc30}/Properties/launchSettings.json (92%) create mode 100644 samples/Samples.AspNetCoreMvc30/Samples.AspNetCoreMvc30.csproj rename samples/{Samples.AspNetCoreMvc.Netcore3 => Samples.AspNetCoreMvc30}/Startup.cs (84%) rename samples/{Samples.AspNetCoreMvc.Netcore3 => Samples.AspNetCoreMvc30}/appsettings.Development.json (100%) rename samples/{Samples.AspNetCoreMvc.Netcore3 => Samples.AspNetCoreMvc30}/appsettings.json (100%) create mode 100644 samples/Samples.AspNetCoreMvc31/Program.cs create mode 100644 samples/Samples.AspNetCoreMvc31/Properties/launchSettings.json create mode 100644 samples/Samples.AspNetCoreMvc31/Samples.AspNetCoreMvc31.csproj create mode 100644 samples/Samples.AspNetCoreMvc31/Startup.cs create mode 100644 samples/Samples.AspNetCoreMvc31/appsettings.Development.json create mode 100644 samples/Samples.AspNetCoreMvc31/appsettings.json create mode 100644 test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc21Tests.cs delete mode 100644 test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc2Tests.cs rename test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/{AspNetCoreMvc3Tests.cs => AspNetCoreMvc30Tests.cs} (61%) create mode 100644 test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc31Tests.cs create mode 100644 test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TargetFrameworkVersionsTheory.cs rename test/Datadog.Trace.ClrProfiler.IntegrationTests/LoadTests/{AspNetCoreMvc2LoadTests.cs => AspNetCoreMvc21LoadTests.cs} (95%) create mode 100644 tools/Datadog.Core.Tools/Extensions/AssemblyExtensions.cs diff --git a/.azure-pipelines/integration-tests.yml b/.azure-pipelines/integration-tests.yml index f46bf65c6fbd..a9767d5fa2ad 100644 --- a/.azure-pipelines/integration-tests.yml +++ b/.azure-pipelines/integration-tests.yml @@ -1,9 +1,8 @@ -trigger: - batch: 'true' +trigger: none +pr: branches: include: - master - - develop paths: exclude: - docs/* @@ -12,8 +11,6 @@ trigger: variables: buildConfiguration: Debug packageFeed: /ffc32c57-3e0e-4e8f-8633-a7ad01df2e45 - dotnetCoreSdkVersion: 3.0.x - dotnetCore21SdkVersion: 2.1.x publishOutput: $(Build.SourcesDirectory)/src/bin/managed-publish jobs: @@ -22,9 +19,14 @@ jobs: strategy: matrix: netcoreapp2_1: + dotnetCoreSdkVersion: 2.1.x publishTargetFramework: netcoreapp2.1 netcoreapp3_0: + dotnetCoreSdkVersion: 3.0.x publishTargetFramework: netcoreapp3.0 + netcoreapp3_1: + dotnetCoreSdkVersion: 3.1.x + publishTargetFramework: netcoreapp3.1 pool: vmImage: ubuntu-16.04 @@ -68,10 +70,22 @@ jobs: steps: - task: UseDotNet@2 - displayName: install dotnet core 2.1 sdk + displayName: install dotnet core sdk 2.1 inputs: packageType: sdk - version: $(dotnetCore21SdkVersion) + version: 2.1.x + + - task: UseDotNet@2 + displayName: install dotnet core sdk 3.0 + inputs: + packageType: sdk + version: 3.0.x + + - task: UseDotNet@2 + displayName: install dotnet core sdk 3.1 + inputs: + packageType: sdk + version: 3.1.x - task: DotNetCoreCLI@2 displayName: dotnet build src/**/*.csproj @@ -144,14 +158,6 @@ jobs: msbuildArguments: '/t:BuildFrameworkReproductions' maximumCpuCount: true - # Install the .NET Core 3.0 SDK and use it from here on out, since it is only - # the .NET Core sample apps that require the .NET Core 3.0 SDK - - task: UseDotNet@2 - displayName: install dotnet core 3.0 sdk - inputs: - packageType: sdk - version: $(dotnetCoreSdkVersion) - - task: DotNetCoreCLI@2 displayName: dotnet restore inputs: diff --git a/.azure-pipelines/packages.yml b/.azure-pipelines/packages.yml index 8e64f973b636..cb586755412b 100644 --- a/.azure-pipelines/packages.yml +++ b/.azure-pipelines/packages.yml @@ -7,7 +7,7 @@ pr: none variables: buildConfiguration: release packageFeed: /ffc32c57-3e0e-4e8f-8633-a7ad01df2e45 - dotnetCoreSdkVersion: 3.0.x + dotnetCoreSdkVersion: 3.1.x publishOutput: $(Build.SourcesDirectory)/src/bin/managed-publish jobs: diff --git a/.azure-pipelines/unit-tests.yml b/.azure-pipelines/unit-tests.yml index b5cf59560a39..34e4d830eb30 100644 --- a/.azure-pipelines/unit-tests.yml +++ b/.azure-pipelines/unit-tests.yml @@ -1,8 +1,9 @@ trigger: - batch: 'true' branches: include: - - refs/heads/* + - '*' + exclude: + - refs/pull/*/head paths: exclude: - docs/* @@ -11,8 +12,6 @@ trigger: variables: buildConfiguration: Debug packageFeed: /ffc32c57-3e0e-4e8f-8633-a7ad01df2e45 - dotnetCoreSdkVersion: 3.0.x - dotnetCore21SdkVersion: 2.1.x jobs: @@ -29,16 +28,22 @@ jobs: steps: - task: UseDotNet@2 - displayName: install dotnet core 2.1 sdk + displayName: install dotnet core runtime 2.1 inputs: - packageType: sdk - version: $(dotnetCore21SdkVersion) + packageType: runtime + version: 2.1.x + + - task: UseDotNet@2 + displayName: install dotnet core runtime 3.0 + inputs: + packageType: runtime + version: 3.0.x - task: UseDotNet@2 - displayName: install dotnet core 3.0 sdk + displayName: install dotnet core sdk 3.1 inputs: packageType: sdk - version: $(dotnetCoreSdkVersion) + version: 3.1.x - task: DotNetCoreCLI@2 displayName: dotnet restore @@ -77,11 +82,12 @@ jobs: vmImage: windows-2019 steps: + - task: UseDotNet@2 - displayName: install dotnet core 2.1 sdk + displayName: install dotnet core sdk 3.1 inputs: packageType: sdk - version: $(dotnetCore21SdkVersion) + version: 3.1.x - task: DotNetCoreCLI@2 displayName: dotnet build diff --git a/.env b/.env index ba3d4c4ec214..a2e6dbdf7c68 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ # default environment values used by docker-compose buildConfiguration=Debug -publishTargetFramework=netcoreapp2.1 \ No newline at end of file +publishTargetFramework=netcoreapp3.1 \ No newline at end of file diff --git a/Datadog.Trace.sln b/Datadog.Trace.sln index 9807c8f99a25..f2ac0265a801 100644 --- a/Datadog.Trace.sln +++ b/Datadog.Trace.sln @@ -70,11 +70,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.AspNetMvc5", "sampl {C0C8D381-D6B9-4C76-9428-F40F2FA93A9A} = {C0C8D381-D6B9-4C76-9428-F40F2FA93A9A} EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc2", "samples\Samples.AspNetCoreMvc2\Samples.AspNetCoreMvc2.csproj", "{9951A03A-AD1B-48D8-A96D-B85532BEDADD}" - ProjectSection(ProjectDependencies) = postProject - {85F35AAF-D102-4960-8B41-3BD9CBD0E77F} = {85F35AAF-D102-4960-8B41-3BD9CBD0E77F} - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "deploy", "deploy", "{C1B5EA8C-C190-4EAE-871B-A7E95B5EC482}" EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Datadog.Trace.ClrProfiler.WindowsInstaller", "deploy\Datadog.Trace.ClrProfiler.WindowsInstaller\Datadog.Trace.ClrProfiler.WindowsInstaller.wixproj", "{3054DE0E-F140-4758-B2DA-0B9470C6EDE1}" @@ -100,7 +95,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.Trace.ClrProfiler.I {2AD18622-9A02-41B4-915E-798BD64044D5} = {2AD18622-9A02-41B4-915E-798BD64044D5} {3C6DD42E-9214-4747-92BA-78DE29AACE59} = {3C6DD42E-9214-4747-92BA-78DE29AACE59} {43782238-E7BB-49D0-9541-1121DACA6EB5} = {43782238-E7BB-49D0-9541-1121DACA6EB5} - {9951A03A-AD1B-48D8-A96D-B85532BEDADD} = {9951A03A-AD1B-48D8-A96D-B85532BEDADD} {1A5E9F40-F3A5-4B59-9898-3DCD65C459C3} = {1A5E9F40-F3A5-4B59-9898-3DCD65C459C3} {3493346B-44F6-4F50-8FB4-51D0090DF544} = {3493346B-44F6-4F50-8FB4-51D0090DF544} {F47F206E-4CCA-4AD0-AEBA-FD9F491E05EC} = {F47F206E-4CCA-4AD0-AEBA-FD9F491E05EC} @@ -274,8 +268,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithLog4Net", "r EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.Core.Tools", "tools\Datadog.Core.Tools\Datadog.Core.Tools.csproj", "{3BEACB10-89FE-4F74-8022-1A52F223CE82}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc.Netcore3", "samples\Samples.AspNetCoreMvc.Netcore3\Samples.AspNetCoreMvc.Netcore3.csproj", "{64235C59-8EAB-401A-86B0-C41E513F0AE8}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "performance", "performance", "{CD9D9813-A195-464A-A0F1-59E02D16E181}" ProjectSection(SolutionItems) = preProject performance\Directory.Build.props = performance\Directory.Build.props @@ -293,6 +285,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.TracingWithoutLimit EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.RateLimiter", "samples\Samples.RateLimiter\Samples.RateLimiter.csproj", "{EF718502-7760-45B5-A563-5F1B22A6B840}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc30", "samples\Samples.AspNetCoreMvc30\Samples.AspNetCoreMvc30.csproj", "{8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc31", "samples\Samples.AspNetCoreMvc31\Samples.AspNetCoreMvc31.csproj", "{303F8E41-691F-4453-AB7D-88A0036C0465}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc21", "samples\Samples.AspNetCoreMvc21\Samples.AspNetCoreMvc21.csproj", "{D141BD06-DD95-4CAF-85CD-657116E0DAD4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -431,16 +429,6 @@ Global {3C6DD42E-9214-4747-92BA-78DE29AACE59}.Release|x64.Build.0 = Release|x64 {3C6DD42E-9214-4747-92BA-78DE29AACE59}.Release|x86.ActiveCfg = Release|x86 {3C6DD42E-9214-4747-92BA-78DE29AACE59}.Release|x86.Build.0 = Release|x86 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Debug|Any CPU.ActiveCfg = Debug|x86 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Debug|x64.ActiveCfg = Debug|x64 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Debug|x64.Build.0 = Debug|x64 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Debug|x86.ActiveCfg = Debug|x86 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Debug|x86.Build.0 = Debug|x86 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Release|Any CPU.ActiveCfg = Release|x64 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Release|x64.ActiveCfg = Release|x64 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Release|x64.Build.0 = Release|x64 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Release|x86.ActiveCfg = Release|x86 - {9951A03A-AD1B-48D8-A96D-B85532BEDADD}.Release|x86.Build.0 = Release|x86 {3054DE0E-F140-4758-B2DA-0B9470C6EDE1}.Debug|Any CPU.ActiveCfg = Debug|x86 {3054DE0E-F140-4758-B2DA-0B9470C6EDE1}.Debug|x64.ActiveCfg = Debug|x64 {3054DE0E-F140-4758-B2DA-0B9470C6EDE1}.Debug|x86.ActiveCfg = Debug|x86 @@ -921,16 +909,6 @@ Global {3BEACB10-89FE-4F74-8022-1A52F223CE82}.Release|x64.Build.0 = Release|Any CPU {3BEACB10-89FE-4F74-8022-1A52F223CE82}.Release|x86.ActiveCfg = Release|Any CPU {3BEACB10-89FE-4F74-8022-1A52F223CE82}.Release|x86.Build.0 = Release|Any CPU - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Debug|Any CPU.ActiveCfg = Debug|x86 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Debug|x64.ActiveCfg = Debug|x64 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Debug|x64.Build.0 = Debug|x64 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Debug|x86.ActiveCfg = Debug|x86 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Debug|x86.Build.0 = Debug|x86 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Release|Any CPU.ActiveCfg = Release|x86 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Release|x64.ActiveCfg = Release|x64 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Release|x64.Build.0 = Release|x64 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Release|x86.ActiveCfg = Release|x86 - {64235C59-8EAB-401A-86B0-C41E513F0AE8}.Release|x86.Build.0 = Release|x86 {EEA89ACD-CFBB-4F60-A150-74F0A84DF028}.Debug|Any CPU.ActiveCfg = Debug|x86 {EEA89ACD-CFBB-4F60-A150-74F0A84DF028}.Debug|x64.ActiveCfg = Debug|x64 {EEA89ACD-CFBB-4F60-A150-74F0A84DF028}.Debug|x64.Build.0 = Debug|x64 @@ -995,6 +973,36 @@ Global {EF718502-7760-45B5-A563-5F1B22A6B840}.Release|x64.Build.0 = Release|x64 {EF718502-7760-45B5-A563-5F1B22A6B840}.Release|x86.ActiveCfg = Release|x86 {EF718502-7760-45B5-A563-5F1B22A6B840}.Release|x86.Build.0 = Release|x86 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Debug|Any CPU.ActiveCfg = Debug|x86 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Debug|x64.ActiveCfg = Debug|x64 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Debug|x64.Build.0 = Debug|x64 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Debug|x86.ActiveCfg = Debug|x86 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Debug|x86.Build.0 = Debug|x86 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Release|Any CPU.ActiveCfg = Release|x86 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Release|x64.ActiveCfg = Release|x64 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Release|x64.Build.0 = Release|x64 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Release|x86.ActiveCfg = Release|x86 + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Release|x86.Build.0 = Release|x86 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Debug|Any CPU.ActiveCfg = Debug|x86 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Debug|x64.ActiveCfg = Debug|x64 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Debug|x64.Build.0 = Debug|x64 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Debug|x86.ActiveCfg = Debug|x86 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Debug|x86.Build.0 = Debug|x86 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Release|Any CPU.ActiveCfg = Release|x86 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Release|x64.ActiveCfg = Release|x64 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Release|x64.Build.0 = Release|x64 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Release|x86.ActiveCfg = Release|x86 + {303F8E41-691F-4453-AB7D-88A0036C0465}.Release|x86.Build.0 = Release|x86 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Debug|Any CPU.ActiveCfg = Debug|x86 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Debug|x64.ActiveCfg = Debug|x64 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Debug|x64.Build.0 = Debug|x64 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Debug|x86.ActiveCfg = Debug|x86 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Debug|x86.Build.0 = Debug|x86 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Release|Any CPU.ActiveCfg = Release|x86 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Release|x64.ActiveCfg = Release|x64 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Release|x64.Build.0 = Release|x64 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Release|x86.ActiveCfg = Release|x86 + {D141BD06-DD95-4CAF-85CD-657116E0DAD4}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1011,7 +1019,6 @@ Global {237A1C92-DE9E-4649-961B-BBB7CF0DFE01} = {8CEC2042-F11C-49F5-A674-2355793B600A} {85F35AAF-D102-4960-8B41-3BD9CBD0E77F} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB} {3C6DD42E-9214-4747-92BA-78DE29AACE59} = {65DF5743-B7B5-4BC8-8AB5-9DE596AF3FB8} - {9951A03A-AD1B-48D8-A96D-B85532BEDADD} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE} {3054DE0E-F140-4758-B2DA-0B9470C6EDE1} = {C1B5EA8C-C190-4EAE-871B-A7E95B5EC482} {5728056A-51AA-4FF5-AD0C-E86E44E36102} = {8CEC2042-F11C-49F5-A674-2355793B600A} {FDB5C8D0-018D-4FF9-9680-C6A5078F819B} = {FA03944C-2391-4C25-8979-2E078A8CE0DD} @@ -1059,13 +1066,15 @@ Global {35F581E9-3D7C-4E80-8DFF-D437B0D86710} = {550AE553-2BBB-4021-B55A-137EF31A6B1F} {1C34D970-6081-4EFA-8F2F-5AD2B146AC58} = {641C9C61-53FD-4504-B8D9-84008BDB89D1} {3BEACB10-89FE-4F74-8022-1A52F223CE82} = {5D8E1F81-B820-4736-B797-271B0FE787EE} - {64235C59-8EAB-401A-86B0-C41E513F0AE8} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE} {EEA89ACD-CFBB-4F60-A150-74F0A84DF028} = {550AE553-2BBB-4021-B55A-137EF31A6B1F} {E41C87E9-7339-4FC0-8791-D57752C5BC12} = {CD9D9813-A195-464A-A0F1-59E02D16E181} {D0424A27-4ED4-406E-80D5-2EFDCC53399B} = {65DF5743-B7B5-4BC8-8AB5-9DE596AF3FB8} {B34EDBC7-C5FB-409D-8472-BC7469D6F2BD} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB} {8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE} {EF718502-7760-45B5-A563-5F1B22A6B840} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE} + {8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE} + {303F8E41-691F-4453-AB7D-88A0036C0465} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE} + {D141BD06-DD95-4CAF-85CD-657116E0DAD4} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F} diff --git a/PackageVersionsComprehensive.g.props b/PackageVersionsComprehensive.g.props index c2ae472675b7..4831800a3643 100644 --- a/PackageVersionsComprehensive.g.props +++ b/PackageVersionsComprehensive.g.props @@ -102,6 +102,9 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely ApiVersion=2.9.3;RestoreRecursive=false;BuildProjectReferences=false + + ApiVersion=2.10.0;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=6.0.0;RestoreRecursive=false;BuildProjectReferences=false @@ -228,6 +231,9 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely ApiVersion=4.1.1;RestoreRecursive=false;BuildProjectReferences=false + + ApiVersion=4.1.2;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=4.1.0;RestoreRecursive=false;BuildProjectReferences=false @@ -264,6 +270,9 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely ApiVersion=4.7.0;RestoreRecursive=false;BuildProjectReferences=false + + ApiVersion=4.8.0;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=1.0.187;RestoreRecursive=false;BuildProjectReferences=false @@ -516,45 +525,8 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely ApiVersion=5.7.0;RestoreRecursive=false;BuildProjectReferences=false - - ApiVersion=2.0.0;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.0.1;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.0.2;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.0.3;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.0.4;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.1.0;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.1.1;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.1.2;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.1.3;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.2.0;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 + + ApiVersion=5.8.0;RestoreRecursive=false;BuildProjectReferences=false diff --git a/PackageVersionsGeneratorDefinitions.json b/PackageVersionsGeneratorDefinitions.json index cabd83793cf6..2f29bcc3ab99 100644 --- a/PackageVersionsGeneratorDefinitions.json +++ b/PackageVersionsGeneratorDefinitions.json @@ -47,13 +47,5 @@ "NugetPackageSearchName": "ServiceStack.Redis", "MinVersion": "4.0.48", "MaxVersionExclusive": "6.0.0" - }, - { - "IntegrationName": "AspNetCoreMvc2", - "SampleProjectName": "Samples.AspNetCoreMvc2", - "SampleTargetFramework": "netcoreapp2.1", - "NugetPackageSearchName": "Microsoft.AspNetCore.Mvc", - "MinVersion": "2.0.0", - "MaxVersionExclusive": "3.0.0" } ] \ No newline at end of file diff --git a/PackageVersionsLatestMinors.g.props b/PackageVersionsLatestMinors.g.props index 0812b423a43b..622af66f87b6 100644 --- a/PackageVersionsLatestMinors.g.props +++ b/PackageVersionsLatestMinors.g.props @@ -42,6 +42,9 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely ApiVersion=2.9.3;RestoreRecursive=false;BuildProjectReferences=false + + ApiVersion=2.10.0;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=6.0.2;RestoreRecursive=false;BuildProjectReferences=false @@ -85,7 +88,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely ApiVersion=4.0.10;RestoreRecursive=false;BuildProjectReferences=false - ApiVersion=4.1.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=4.1.2;RestoreRecursive=false;BuildProjectReferences=false ApiVersion=4.1.0;RestoreRecursive=false;BuildProjectReferences=false @@ -105,6 +108,9 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely ApiVersion=4.7.0;RestoreRecursive=false;BuildProjectReferences=false + + ApiVersion=4.8.0;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=1.0.488;RestoreRecursive=false;BuildProjectReferences=false @@ -141,17 +147,8 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely ApiVersion=5.7.0;RestoreRecursive=false;BuildProjectReferences=false - - ApiVersion=2.0.4;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.1.3;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 - - - ApiVersion=2.2.0;RestoreRecursive=false;BuildProjectReferences=false - netcoreapp2.1 + + ApiVersion=5.8.0;RestoreRecursive=false;BuildProjectReferences=false diff --git a/Test.Common.props b/Test.Common.props index a1a674aed901..7f8426289240 100644 --- a/Test.Common.props +++ b/Test.Common.props @@ -1,8 +1,8 @@ Exe - net452;net461;netcoreapp2.1;netcoreapp3.0 - netcoreapp2.1;netcoreapp3.0 + net452;net461;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 + netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 x64;x86 $(Platform) diff --git a/docker/build.sh b/docker/build.sh index 504d1b756721..61218402e877 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -16,16 +16,22 @@ done dotnet publish -f netstandard2.0 -c $buildConfiguration src/Datadog.Trace.ClrProfiler.Managed/Datadog.Trace.ClrProfiler.Managed.csproj -o "$PUBLISH_OUTPUT/netstandard2.0" -# Only build Samples.AspNetCoreMvc2 for netcoreapp2.1 +# Only build Samples.AspNetCoreMvc21 for netcoreapp2.1 if [ "$publishTargetFramework" == "netcoreapp2.1" ] then - dotnet publish -f $publishTargetFramework -c $buildConfiguration samples/Samples.AspNetCoreMvc2/Samples.AspNetCoreMvc2.csproj -p:Configuration=$buildConfiguration -p:ManagedProfilerOutputDirectory="$PUBLISH_OUTPUT" + dotnet publish -f $publishTargetFramework -c $buildConfiguration samples/Samples.AspNetCoreMvc21/Samples.AspNetCoreMvc21.csproj -p:Configuration=$buildConfiguration -p:ManagedProfilerOutputDirectory="$PUBLISH_OUTPUT" fi -# Only build Samples.AspNetCoreMvc2 for netcoreapp3.0 +# Only build Samples.AspNetCoreMvc30 for netcoreapp3.0 if [ "$publishTargetFramework" == "netcoreapp3.0" ] then - dotnet publish -f $publishTargetFramework -c $buildConfiguration samples/Samples.AspNetCoreMvc.Netcore3/Samples.AspNetCoreMvc.Netcore3.csproj -p:Configuration=$buildConfiguration -p:ManagedProfilerOutputDirectory="$PUBLISH_OUTPUT" + dotnet publish -f $publishTargetFramework -c $buildConfiguration samples/Samples.AspNetCoreMvc30/Samples.AspNetCoreMvc30.csproj -p:Configuration=$buildConfiguration -p:ManagedProfilerOutputDirectory="$PUBLISH_OUTPUT" +fi + +# Only build Samples.AspNetCoreMvc31 for netcoreapp3.1 +if [ "$publishTargetFramework" == "netcoreapp3.1" ] +then + dotnet publish -f $publishTargetFramework -c $buildConfiguration samples/Samples.AspNetCoreMvc31/Samples.AspNetCoreMvc31.csproj -p:Configuration=$buildConfiguration -p:ManagedProfilerOutputDirectory="$PUBLISH_OUTPUT" fi for sample in Samples.Elasticsearch Samples.Elasticsearch.V5 Samples.ServiceStack.Redis Samples.StackExchange.Redis Samples.SqlServer Samples.MongoDB Samples.HttpMessageHandler Samples.Npgsql Samples.MySql Samples.GraphQL ; do diff --git a/docker/dotnet.dockerfile b/docker/dotnet.dockerfile index cf71cf2371ba..0db74e567f3a 100644 --- a/docker/dotnet.dockerfile +++ b/docker/dotnet.dockerfile @@ -1,19 +1,19 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:2.1 +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 -RUN apt-get update - -# Instructions to install .NET Core 3.0 SDK from -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +# Instructions to install .NET Core runtimes from +# https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-debian10 RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg && \ mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ && \ - wget -q https://packages.microsoft.com/config/debian/9/prod.list && \ + wget -q https://packages.microsoft.com/config/debian/10/prod.list && \ mv prod.list /etc/apt/sources.list.d/microsoft-prod.list && \ chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg && \ chown root:root /etc/apt/sources.list.d/microsoft-prod.list -RUN apt-get install -y apt-transport-https && \ +RUN apt-get update && \ + apt-get install -y apt-transport-https && \ apt-get update && \ - apt-get install -y dotnet-sdk-3.0 + apt-get install -y aspnetcore-runtime-2.1 && \ + apt-get install -y aspnetcore-runtime-3.0 ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /bin/wait-for-it RUN chmod +x /bin/wait-for-it diff --git a/docs/README.md b/docs/README.md index c976e78bd541..4da7ad09bc36 100644 --- a/docs/README.md +++ b/docs/README.md @@ -39,7 +39,7 @@ Integration tests | [![Build Status](https://dev.azure.com/datadog-apm/dd-trace- - Optional: ASP.NET and web development (to build samples) - Individual components - .NET Framework 4.7 targeting pack -- [.NET Core 3.0 SDK](https://dotnet.microsoft.com/download/dotnet-core/3.0) +- [.NET Core 3.1 SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) - Optional: [.NET Core 2.1 Runtime](https://dotnet.microsoft.com/download/dotnet-core/2.1) to test in .NET Core 2.1 locally. - Optional: [.NET Core 2.2 Runtime](https://dotnet.microsoft.com/download/dotnet-core/2.2) to test in .NET Core 2.2 locally. - Optional: [nuget.exe CLI](https://www.nuget.org/downloads) v3.4.4 or newer @@ -86,7 +86,7 @@ msbuild Datadog.Trace.proj /t:msi /p:Configuration=Release;Platform=x86 ### Minimum requirements To build C# projects and NuGet packages only -- [.NET Core SDK 3.0](https://dotnet.microsoft.com/download/dotnet-core/3.0) +- [.NET Core SDK 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1) To build everything and run integration tests - [Docker Compose](https://docs.docker.com/compose/install/) diff --git a/reproductions/AspNetMvcCorePerformance/AspNetMvcCorePerformance.csproj b/reproductions/AspNetMvcCorePerformance/AspNetMvcCorePerformance.csproj index 30f520d08ff8..6acd11fe6e76 100644 --- a/reproductions/AspNetMvcCorePerformance/AspNetMvcCorePerformance.csproj +++ b/reproductions/AspNetMvcCorePerformance/AspNetMvcCorePerformance.csproj @@ -2,7 +2,7 @@ Exe - net461;netcoreapp2.1;netcoreapp3.0 + net461;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 x64;x86 $(Platform) false diff --git a/reproductions/AspNetMvcCorePerformance/Directory.Build.props b/reproductions/AspNetMvcCorePerformance/Directory.Build.props index 42e4007f7977..7fb48af8c92a 100644 --- a/reproductions/AspNetMvcCorePerformance/Directory.Build.props +++ b/reproductions/AspNetMvcCorePerformance/Directory.Build.props @@ -1,10 +1,6 @@ - - - x64;x86 - $(Platform) - false - false - - + \ No newline at end of file diff --git a/reproductions/DataDogThreadTest/DataDogThreadTest.csproj b/reproductions/DataDogThreadTest/DataDogThreadTest.csproj index ff2f0b405ee3..d07a5c21fffa 100644 --- a/reproductions/DataDogThreadTest/DataDogThreadTest.csproj +++ b/reproductions/DataDogThreadTest/DataDogThreadTest.csproj @@ -8,7 +8,7 @@ - + diff --git a/reproductions/OrleansCrash/OrleansCrash.csproj b/reproductions/OrleansCrash/OrleansCrash.csproj index 4b56825ab379..1efb22eb8d8e 100644 --- a/reproductions/OrleansCrash/OrleansCrash.csproj +++ b/reproductions/OrleansCrash/OrleansCrash.csproj @@ -2,7 +2,7 @@ false - net461;netcoreapp2.1;netcoreapp3.0 + net461;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 false true diff --git a/reproductions/StackExchange.Redis.StackOverflowException/StackExchange.Redis.StackOverflowException.csproj b/reproductions/StackExchange.Redis.StackOverflowException/StackExchange.Redis.StackOverflowException.csproj index 1dd6abb19223..f6feb1024191 100644 --- a/reproductions/StackExchange.Redis.StackOverflowException/StackExchange.Redis.StackOverflowException.csproj +++ b/reproductions/StackExchange.Redis.StackOverflowException/StackExchange.Redis.StackOverflowException.csproj @@ -1,13 +1,13 @@  - net461;netcoreapp2.1;netcoreapp3.0 + net461;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 true - + diff --git a/reproductions/TraceContext.InvalidOperationException/TraceContext.InvalidOperationException.csproj b/reproductions/TraceContext.InvalidOperationException/TraceContext.InvalidOperationException.csproj index fb9ee15032a6..41e9fc7a24f8 100644 --- a/reproductions/TraceContext.InvalidOperationException/TraceContext.InvalidOperationException.csproj +++ b/reproductions/TraceContext.InvalidOperationException/TraceContext.InvalidOperationException.csproj @@ -4,7 +4,7 @@ - + diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props index dc56715dc823..2f799802a742 100644 --- a/samples/Directory.Build.props +++ b/samples/Directory.Build.props @@ -1,7 +1,7 @@ - net452;net461;netcoreapp2.1;netcoreapp3.0 - netcoreapp2.1;netcoreapp3.0 + net452;net461;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 + netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Samples.AspNetCoreMvc.Netcore3.csproj b/samples/Samples.AspNetCoreMvc.Netcore3/Samples.AspNetCoreMvc.Netcore3.csproj deleted file mode 100644 index eb1eb8e84134..000000000000 --- a/samples/Samples.AspNetCoreMvc.Netcore3/Samples.AspNetCoreMvc.Netcore3.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - - netcoreapp3.0 - true - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - true - PreserveNewest - - - - diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Views/_Layout.cshtml b/samples/Samples.AspNetCoreMvc.Netcore3/Views/_Layout.cshtml deleted file mode 100644 index db4c555fb8f1..000000000000 --- a/samples/Samples.AspNetCoreMvc.Netcore3/Views/_Layout.cshtml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - @ViewData["Title"] - Samples.AspNetCoreMvc2 - - - - -
- @RenderBody() -
- @if (ViewBag.StackTrace != null) - { -

Stack trace:

-
-
-                @foreach (string entry in ViewBag.StackTrace)
-                {
-                    @(entry)
-                }
-            
-
- } - - diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Views/_ViewStart.cshtml b/samples/Samples.AspNetCoreMvc.Netcore3/Views/_ViewStart.cshtml deleted file mode 100644 index 935cd49e4d0c..000000000000 --- a/samples/Samples.AspNetCoreMvc.Netcore3/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout.cshtml"; -} diff --git a/samples/Samples.AspNetCoreMvc2/Controllers/DistributedTracingApiController.cs b/samples/Samples.AspNetCoreMvc2/Controllers/DistributedTracingApiController.cs deleted file mode 100644 index 6a880c499f6e..000000000000 --- a/samples/Samples.AspNetCoreMvc2/Controllers/DistributedTracingApiController.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Threading; -using Datadog.Trace; -using Datadog.Trace.ExtensionMethods; -using Microsoft.AspNetCore.Mvc; -using Samples.AspNetCoreMvc2.Extensions; -using Samples.Shared.Web; - -namespace Samples.AspNetCoreMvc2.Controllers -{ - /* - Core MVC - http://localhost:54566/distributed/ - - MVC - http://localhost:50449/distributed/ - - Web API - http://localhost:50449/api/distributed/ - - Core MVC (API) *this one* - http://localhost:54566/api/distributed/last/ - */ - - public class DistributedTracingApiController : ControllerBase - { - [Route("api/distributed/last")] - public IActionResult Distributed() - { - // don't return too fast so it's more visible in the UI - Thread.Sleep(100); - - var model = new DistributedTracingModel(); - - var span = Tracer.Instance.ActiveScope?.Span; - - if (span != null) - { - model.AddSpan( - $"{typeof(DistributedTracingApiController).FullName}.{nameof(Distributed)}", - span.ServiceName, - span.OperationName, - span.ResourceName, - span.TraceId, - span.SpanId); - } - - return Ok(model); - } - } -} diff --git a/samples/Samples.AspNetCoreMvc2/Controllers/DistributedTracingMvcController.cs b/samples/Samples.AspNetCoreMvc2/Controllers/DistributedTracingMvcController.cs deleted file mode 100644 index 60578c97cae0..000000000000 --- a/samples/Samples.AspNetCoreMvc2/Controllers/DistributedTracingMvcController.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Net.Http; -using System.Threading.Tasks; -using Datadog.Trace; -using Datadog.Trace.ExtensionMethods; -using Microsoft.AspNetCore.Mvc; -using Samples.Shared.Web; - -namespace Samples.AspNetCoreMvc2.Controllers -{ - /* - Core MVC *this one* - http://localhost:54566/distributed/ - - MVC *next one* - http://localhost:50449/distributed/ - - Web API - http://localhost:50449/api/distributed/ - - Core MVC (API) - http://localhost:54566/api/distributed/last/ - */ - - public class DistributedTracingMvcController : Controller - { - [Route("distributed")] - public async Task Distributed() - { - var span = Tracer.Instance.ActiveScope?.Span; - span?.SetTraceSamplingPriority(SamplingPriority.UserKeep); - - using (var client = new HttpClient()) - { - var model = await client.GetAsync("http://localhost:50449/distributed"); - - if (span != null) - { - model.AddSpan( - $"{typeof(DistributedTracingMvcController).FullName}.{nameof(Distributed)}", - span.ServiceName, - span.OperationName, - span.ResourceName, - span.TraceId, - span.SpanId); - } - - return Json(model); - } - } - } -} diff --git a/samples/Samples.AspNetCoreMvc2/Extensions/HeaderDictionaryExtensions.cs b/samples/Samples.AspNetCoreMvc2/Extensions/HeaderDictionaryExtensions.cs deleted file mode 100644 index a54dd043bd22..000000000000 --- a/samples/Samples.AspNetCoreMvc2/Extensions/HeaderDictionaryExtensions.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Globalization; -using System.Linq; -using Datadog.Trace; -using Microsoft.AspNetCore.Http; - -namespace Samples.AspNetCoreMvc2.Extensions -{ - public static class HeaderDictionaryExtensions - { - public static SpanContext Extract(this IHeaderDictionary headers) - { - if (headers == null) - { - throw new ArgumentNullException(nameof(headers)); - } - - ulong traceId = 0; - ulong parentId = 0; - SamplingPriority? samplingPriority = null; - - if (headers.TryGetValue(HttpHeaderNames.TraceId, out var traceIdHeaders)) - { - ulong.TryParse(traceIdHeaders.FirstOrDefault(), NumberStyles.Integer, CultureInfo.InvariantCulture, out traceId); - } - - if (traceId == 0) - { - // a valid traceId is required to use distributed tracing - return null; - } - - if (headers.TryGetValue(HttpHeaderNames.ParentId, out var parentIdHeaders)) - { - ulong.TryParse(parentIdHeaders.FirstOrDefault(), NumberStyles.Integer, CultureInfo.InvariantCulture, out parentId); - } - - if (headers.TryGetValue(HttpHeaderNames.SamplingPriority, out var samplingPriorityHeaders) && - int.TryParse(samplingPriorityHeaders.FirstOrDefault(), NumberStyles.Integer, CultureInfo.InvariantCulture, out var samplingPriorityValue)) - { - samplingPriority = (SamplingPriority?)samplingPriorityValue; - } - - return new SpanContext(traceId, parentId, samplingPriority); - } - } -} diff --git a/samples/Samples.AspNetCoreMvc2/Samples.AspNetCoreMvc2.csproj b/samples/Samples.AspNetCoreMvc2/Samples.AspNetCoreMvc2.csproj deleted file mode 100644 index 83ae4218d8f2..000000000000 --- a/samples/Samples.AspNetCoreMvc2/Samples.AspNetCoreMvc2.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - - net461;netcoreapp2.1 - 2.0.4 - true - - - false - - - - - - - - - - - - - - - - - diff --git a/samples/Samples.AspNetCoreMvc2/Views/Home/Delay.cshtml b/samples/Samples.AspNetCoreMvc2/Views/Home/Delay.cshtml deleted file mode 100644 index caedd555cdd0..000000000000 --- a/samples/Samples.AspNetCoreMvc2/Views/Home/Delay.cshtml +++ /dev/null @@ -1,9 +0,0 @@ -@model int - -@{ - ViewData["Title"] = "Delay"; - ViewData["Description"] = "This page has a built-in delay"; -} - -

Hello, world!

-

Delayed @Html.FormatValue(Model, "{0:N0}") seconds

\ No newline at end of file diff --git a/samples/Samples.AspNetCoreMvc2/Views/Home/Index.cshtml b/samples/Samples.AspNetCoreMvc2/Views/Home/Index.cshtml deleted file mode 100644 index 80b31a6183e6..000000000000 --- a/samples/Samples.AspNetCoreMvc2/Views/Home/Index.cshtml +++ /dev/null @@ -1,59 +0,0 @@ -@model List> - -@{ - ViewData["Title"] = "Home Page"; - ViewData["Description"] = "The home page of my website"; -} - -
- - - - - - - - - - - - - - - - - - - -
Application bitness@(Environment.Is64BitProcess ? "64-bit" : "32-bit")
Profiler attached@Datadog.Trace.ClrProfiler.Instrumentation.ProfilerAttached
Datadog.Trace.dll path@typeof(Datadog.Trace.Tracer).Assembly.Location
Datadog.Trace.ClrProfiler.Managed.dll@typeof(Datadog.Trace.ClrProfiler.Instrumentation).Assembly.Location
-
- -
-
Environment Variables:
- - - - - - - - - @if (Model.Any()) - { - foreach (var envVar in Model) - { - - - - - } - } - else - { - - - - } - -
NameValue
@envVar.Key@envVar.Value
(empty)
-
diff --git a/samples/Samples.AspNetCoreMvc2/Views/_ViewImports.cshtml b/samples/Samples.AspNetCoreMvc2/Views/_ViewImports.cshtml deleted file mode 100644 index 98dc2706bc2b..000000000000 --- a/samples/Samples.AspNetCoreMvc2/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using Samples.AspNetCoreMvc2 -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/samples/Samples.AspNetCoreMvc2/Views/_ViewStart.cshtml b/samples/Samples.AspNetCoreMvc2/Views/_ViewStart.cshtml deleted file mode 100644 index 935cd49e4d0c..000000000000 --- a/samples/Samples.AspNetCoreMvc2/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout.cshtml"; -} diff --git a/samples/Samples.AspNetCoreMvc2/Controllers/ApiController.cs b/samples/Samples.AspNetCoreMvc21/Controllers/ApiController.cs similarity index 53% rename from samples/Samples.AspNetCoreMvc2/Controllers/ApiController.cs rename to samples/Samples.AspNetCoreMvc21/Controllers/ApiController.cs index 49234873240a..8f6697366e9f 100644 --- a/samples/Samples.AspNetCoreMvc2/Controllers/ApiController.cs +++ b/samples/Samples.AspNetCoreMvc21/Controllers/ApiController.cs @@ -1,8 +1,9 @@ using System; using System.Threading; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -namespace Samples.AspNetCoreMvc2.Controllers +namespace Samples.AspNetCoreMvc.Controllers { [Route("api")] public class ApiController : ControllerBase @@ -14,5 +15,13 @@ public ActionResult Delay(int seconds) Thread.Sleep(TimeSpan.FromSeconds(seconds)); return Ok(seconds); } + + [HttpGet] + [Route("delay-async/{seconds}")] + public async Task DelayAsync(int seconds) + { + await Task.Delay(TimeSpan.FromSeconds(seconds)); + return Ok(seconds); + } } } diff --git a/samples/Samples.AspNetCoreMvc2/Controllers/HomeController.cs b/samples/Samples.AspNetCoreMvc21/Controllers/HomeController.cs similarity index 95% rename from samples/Samples.AspNetCoreMvc2/Controllers/HomeController.cs rename to samples/Samples.AspNetCoreMvc21/Controllers/HomeController.cs index b61e16294667..6ba822cfe9e7 100644 --- a/samples/Samples.AspNetCoreMvc2/Controllers/HomeController.cs +++ b/samples/Samples.AspNetCoreMvc21/Controllers/HomeController.cs @@ -5,9 +5,9 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using Samples.AspNetCoreMvc2.Attributes; +using Samples.AspNetCoreMvc.Shared; -namespace Samples.AspNetCoreMvc2.Controllers +namespace Samples.AspNetCoreMvc.Controllers { public class HomeController : Controller { diff --git a/samples/Samples.AspNetCoreMvc2/Properties/launchSettings.json b/samples/Samples.AspNetCoreMvc21/Properties/launchSettings.json similarity index 100% rename from samples/Samples.AspNetCoreMvc2/Properties/launchSettings.json rename to samples/Samples.AspNetCoreMvc21/Properties/launchSettings.json diff --git a/samples/Samples.AspNetCoreMvc21/Samples.AspNetCoreMvc21.csproj b/samples/Samples.AspNetCoreMvc21/Samples.AspNetCoreMvc21.csproj new file mode 100644 index 000000000000..1a36c454c6b1 --- /dev/null +++ b/samples/Samples.AspNetCoreMvc21/Samples.AspNetCoreMvc21.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp2.1 + Samples.AspNetCoreMvc + + + + + + + + + + + diff --git a/samples/Samples.AspNetCoreMvc2/Attributes/StackTraceHelper.cs b/samples/Samples.AspNetCoreMvc21/Shared/StackTraceHelper.cs similarity index 77% rename from samples/Samples.AspNetCoreMvc2/Attributes/StackTraceHelper.cs rename to samples/Samples.AspNetCoreMvc21/Shared/StackTraceHelper.cs index c8aae1a82ff3..a1d5240bbb71 100644 --- a/samples/Samples.AspNetCoreMvc2/Attributes/StackTraceHelper.cs +++ b/samples/Samples.AspNetCoreMvc21/Shared/StackTraceHelper.cs @@ -1,8 +1,8 @@ using System; -namespace Samples.AspNetCoreMvc2.Attributes +namespace Samples.AspNetCoreMvc.Shared { - public class StackTraceHelper + public static class StackTraceHelper { public static string[] GetUsefulStack() { diff --git a/samples/Samples.AspNetCoreMvc2/Startup.cs b/samples/Samples.AspNetCoreMvc21/Startup.cs similarity index 68% rename from samples/Samples.AspNetCoreMvc2/Startup.cs rename to samples/Samples.AspNetCoreMvc21/Startup.cs index 5d4366d6705e..85c5d8e72f78 100644 --- a/samples/Samples.AspNetCoreMvc2/Startup.cs +++ b/samples/Samples.AspNetCoreMvc21/Startup.cs @@ -1,5 +1,3 @@ -using System.IO; -using System.Reflection; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -7,7 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -namespace Samples.AspNetCoreMvc2 +namespace Samples.AspNetCoreMvc { public class Startup { @@ -23,7 +21,6 @@ public static void Main(string[] args) public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) - .UseContentRoot(DetermineContentRoot()) .UseStartup() .Build(); @@ -51,21 +48,5 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF template: "{controller=Home}/{action=Index}/{id?}"); }); } - - private static string DetermineContentRoot() - { - string executableDirectory = typeof(Startup).Assembly.Location; - - for (string searchPath = executableDirectory; !string.IsNullOrEmpty(searchPath); searchPath = Path.GetDirectoryName(searchPath)) - { - string candidatePath = Path.Combine(searchPath, "Views"); - if (Directory.Exists(candidatePath)) - { - return searchPath; - } - } - - return Path.GetDirectoryName(executableDirectory); - } } } diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Views/Home/Delay.cshtml b/samples/Samples.AspNetCoreMvc21/Views/Home/Delay.cshtml similarity index 100% rename from samples/Samples.AspNetCoreMvc.Netcore3/Views/Home/Delay.cshtml rename to samples/Samples.AspNetCoreMvc21/Views/Home/Delay.cshtml diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Views/Home/Index.cshtml b/samples/Samples.AspNetCoreMvc21/Views/Home/Index.cshtml similarity index 100% rename from samples/Samples.AspNetCoreMvc.Netcore3/Views/Home/Index.cshtml rename to samples/Samples.AspNetCoreMvc21/Views/Home/Index.cshtml diff --git a/samples/Samples.AspNetCoreMvc2/Views/_Layout.cshtml b/samples/Samples.AspNetCoreMvc21/Views/Shared/_Layout.cshtml similarity index 93% rename from samples/Samples.AspNetCoreMvc2/Views/_Layout.cshtml rename to samples/Samples.AspNetCoreMvc21/Views/Shared/_Layout.cshtml index db4c555fb8f1..b4481d2a1653 100644 --- a/samples/Samples.AspNetCoreMvc2/Views/_Layout.cshtml +++ b/samples/Samples.AspNetCoreMvc21/Views/Shared/_Layout.cshtml @@ -3,7 +3,7 @@ - @ViewData["Title"] - Samples.AspNetCoreMvc2 + @ViewData["Title"] - Samples.AspNetCoreMvc diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Views/_ViewImports.cshtml b/samples/Samples.AspNetCoreMvc21/Views/_ViewImports.cshtml similarity index 61% rename from samples/Samples.AspNetCoreMvc.Netcore3/Views/_ViewImports.cshtml rename to samples/Samples.AspNetCoreMvc21/Views/_ViewImports.cshtml index 98dc2706bc2b..ae67c43cad1f 100644 --- a/samples/Samples.AspNetCoreMvc.Netcore3/Views/_ViewImports.cshtml +++ b/samples/Samples.AspNetCoreMvc21/Views/_ViewImports.cshtml @@ -1,2 +1,2 @@ -@using Samples.AspNetCoreMvc2 +@using Samples.AspNetCoreMvc @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/samples/Samples.AspNetCoreMvc21/Views/_ViewStart.cshtml b/samples/Samples.AspNetCoreMvc21/Views/_ViewStart.cshtml new file mode 100644 index 000000000000..a5f10045db97 --- /dev/null +++ b/samples/Samples.AspNetCoreMvc21/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/samples/Samples.AspNetCoreMvc2/appsettings.json b/samples/Samples.AspNetCoreMvc21/appsettings.json similarity index 100% rename from samples/Samples.AspNetCoreMvc2/appsettings.json rename to samples/Samples.AspNetCoreMvc21/appsettings.json diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Program.cs b/samples/Samples.AspNetCoreMvc30/Program.cs similarity index 92% rename from samples/Samples.AspNetCoreMvc.Netcore3/Program.cs rename to samples/Samples.AspNetCoreMvc30/Program.cs index 3f077d81df42..f3211a498fc7 100644 --- a/samples/Samples.AspNetCoreMvc.Netcore3/Program.cs +++ b/samples/Samples.AspNetCoreMvc30/Program.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; -namespace Samples.AspNetCoreMvc.Netcore3 +namespace Samples.AspNetCoreMvc { public class Program { diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Properties/launchSettings.json b/samples/Samples.AspNetCoreMvc30/Properties/launchSettings.json similarity index 92% rename from samples/Samples.AspNetCoreMvc.Netcore3/Properties/launchSettings.json rename to samples/Samples.AspNetCoreMvc30/Properties/launchSettings.json index c68277a54206..38bb138b506b 100644 --- a/samples/Samples.AspNetCoreMvc.Netcore3/Properties/launchSettings.json +++ b/samples/Samples.AspNetCoreMvc30/Properties/launchSettings.json @@ -23,14 +23,12 @@ "CORECLR_PROFILER_PATH": "$(ProjectDir)$(OutputPath)profiler-lib\\Datadog.Trace.ClrProfiler.Native.dll", "DD_DOTNET_TRACER_HOME": "$(ProjectDir)$(OutputPath)profiler-lib", - "DD_INTEGRATIONS": "$(ProjectDir)$(OutputPath)profiler-lib\\integrations.json", - - "DD_TRACE_DEBUG": "false" + "DD_INTEGRATIONS": "$(ProjectDir)$(OutputPath)profiler-lib\\integrations.json" }, "use64Bit": true, "nativeDebugging": true }, - "Samples.AspNetCoreMvc.Netcore3": { + "Samples.AspNetCoreMvc30": { "commandName": "Project", "launchBrowser": false, "environmentVariables": { @@ -45,9 +43,7 @@ "CORECLR_PROFILER_PATH": "$(ProjectDir)$(OutputPath)profiler-lib\\Datadog.Trace.ClrProfiler.Native.dll", "DD_DOTNET_TRACER_HOME": "$(ProjectDir)$(OutputPath)profiler-lib", - "DD_INTEGRATIONS": "$(ProjectDir)$(OutputPath)profiler-lib\\integrations.json", - - "DD_TRACE_DEBUG": "false" + "DD_INTEGRATIONS": "$(ProjectDir)$(OutputPath)profiler-lib\\integrations.json" }, "applicationUrl": "http://localhost:54567/", "nativeDebugging": true diff --git a/samples/Samples.AspNetCoreMvc30/Samples.AspNetCoreMvc30.csproj b/samples/Samples.AspNetCoreMvc30/Samples.AspNetCoreMvc30.csproj new file mode 100644 index 000000000000..7f20cd6e5c85 --- /dev/null +++ b/samples/Samples.AspNetCoreMvc30/Samples.AspNetCoreMvc30.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp3.0 + Samples.AspNetCoreMvc + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/Startup.cs b/samples/Samples.AspNetCoreMvc30/Startup.cs similarity index 84% rename from samples/Samples.AspNetCoreMvc.Netcore3/Startup.cs rename to samples/Samples.AspNetCoreMvc30/Startup.cs index 6816786c0b06..2d759fce89f2 100644 --- a/samples/Samples.AspNetCoreMvc.Netcore3/Startup.cs +++ b/samples/Samples.AspNetCoreMvc30/Startup.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -namespace Samples.AspNetCoreMvc.Netcore3 +namespace Samples.AspNetCoreMvc { public class Startup { @@ -31,10 +31,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) else { app.UseExceptionHandler("/Home/Error"); - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. - app.UseHsts(); } - app.UseHttpsRedirection(); + app.UseStaticFiles(); app.UseRouting(); diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/appsettings.Development.json b/samples/Samples.AspNetCoreMvc30/appsettings.Development.json similarity index 100% rename from samples/Samples.AspNetCoreMvc.Netcore3/appsettings.Development.json rename to samples/Samples.AspNetCoreMvc30/appsettings.Development.json diff --git a/samples/Samples.AspNetCoreMvc.Netcore3/appsettings.json b/samples/Samples.AspNetCoreMvc30/appsettings.json similarity index 100% rename from samples/Samples.AspNetCoreMvc.Netcore3/appsettings.json rename to samples/Samples.AspNetCoreMvc30/appsettings.json diff --git a/samples/Samples.AspNetCoreMvc31/Program.cs b/samples/Samples.AspNetCoreMvc31/Program.cs new file mode 100644 index 000000000000..f3211a498fc7 --- /dev/null +++ b/samples/Samples.AspNetCoreMvc31/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Samples.AspNetCoreMvc +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/samples/Samples.AspNetCoreMvc31/Properties/launchSettings.json b/samples/Samples.AspNetCoreMvc31/Properties/launchSettings.json new file mode 100644 index 000000000000..0e269ff4f79f --- /dev/null +++ b/samples/Samples.AspNetCoreMvc31/Properties/launchSettings.json @@ -0,0 +1,52 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:54564", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": false, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + + "COR_ENABLE_PROFILING": "1", + "COR_PROFILER": "{846F5F1C-F9AE-4B07-969E-05C26BC060D8}", + "COR_PROFILER_PATH": "$(ProjectDir)$(OutputPath)profiler-lib\\Datadog.Trace.ClrProfiler.Native.dll", + + "CORECLR_ENABLE_PROFILING": "1", + "CORECLR_PROFILER": "{846F5F1C-F9AE-4B07-969E-05C26BC060D8}", + "CORECLR_PROFILER_PATH": "$(ProjectDir)$(OutputPath)profiler-lib\\Datadog.Trace.ClrProfiler.Native.dll", + + "DD_DOTNET_TRACER_HOME": "$(ProjectDir)$(OutputPath)profiler-lib", + "DD_INTEGRATIONS": "$(ProjectDir)$(OutputPath)profiler-lib\\integrations.json" + }, + "use64Bit": true, + "nativeDebugging": true + }, + "Samples.AspNetCoreMvc31": { + "commandName": "Project", + "launchBrowser": false, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + + "COR_ENABLE_PROFILING": "1", + "COR_PROFILER": "{846F5F1C-F9AE-4B07-969E-05C26BC060D8}", + "COR_PROFILER_PATH": "$(ProjectDir)$(OutputPath)profiler-lib\\Datadog.Trace.ClrProfiler.Native.dll", + + "CORECLR_ENABLE_PROFILING": "1", + "CORECLR_PROFILER": "{846F5F1C-F9AE-4B07-969E-05C26BC060D8}", + "CORECLR_PROFILER_PATH": "$(ProjectDir)$(OutputPath)profiler-lib\\Datadog.Trace.ClrProfiler.Native.dll", + + "DD_DOTNET_TRACER_HOME": "$(ProjectDir)$(OutputPath)profiler-lib", + "DD_INTEGRATIONS": "$(ProjectDir)$(OutputPath)profiler-lib\\integrations.json" + }, + "nativeDebugging": true, + "applicationUrl": "http://localhost:54568" + } + } +} \ No newline at end of file diff --git a/samples/Samples.AspNetCoreMvc31/Samples.AspNetCoreMvc31.csproj b/samples/Samples.AspNetCoreMvc31/Samples.AspNetCoreMvc31.csproj new file mode 100644 index 000000000000..7221aa0a5a2d --- /dev/null +++ b/samples/Samples.AspNetCoreMvc31/Samples.AspNetCoreMvc31.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp3.1 + Samples.AspNetCoreMvc + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/Samples.AspNetCoreMvc31/Startup.cs b/samples/Samples.AspNetCoreMvc31/Startup.cs new file mode 100644 index 000000000000..2d759fce89f2 --- /dev/null +++ b/samples/Samples.AspNetCoreMvc31/Startup.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace Samples.AspNetCoreMvc +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddControllersWithViews(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseExceptionHandler("/Home/Error"); + } + + app.UseStaticFiles(); + + app.UseRouting(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/samples/Samples.AspNetCoreMvc31/appsettings.Development.json b/samples/Samples.AspNetCoreMvc31/appsettings.Development.json new file mode 100644 index 000000000000..4f30a00f8301 --- /dev/null +++ b/samples/Samples.AspNetCoreMvc31/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git a/samples/Samples.AspNetCoreMvc31/appsettings.json b/samples/Samples.AspNetCoreMvc31/appsettings.json new file mode 100644 index 000000000000..d9d9a9bff6fd --- /dev/null +++ b/samples/Samples.AspNetCoreMvc31/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/Samples.GraphQL/Samples.GraphQL.csproj b/samples/Samples.GraphQL/Samples.GraphQL.csproj index a5ff19a3df52..2ceab16fadcf 100644 --- a/samples/Samples.GraphQL/Samples.GraphQL.csproj +++ b/samples/Samples.GraphQL/Samples.GraphQL.csproj @@ -2,7 +2,7 @@ - net461;netcoreapp2.1;netcoreapp3.0 + net461;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc21Tests.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc21Tests.cs new file mode 100644 index 000000000000..c85b4f860601 --- /dev/null +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc21Tests.cs @@ -0,0 +1,23 @@ +using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers; +using Xunit; +using Xunit.Abstractions; + +namespace Datadog.Trace.ClrProfiler.IntegrationTests.AspNetCore +{ + public class AspNetCoreMvc21Tests : AspNetCoreMvcTestBase + { + public AspNetCoreMvc21Tests(ITestOutputHelper output) + : base("AspNetCoreMvc21", output) + { + } + + [TargetFrameworkVersionsFact("netcoreapp2.1")] + [Trait("Category", "EndToEnd")] + [Trait("RunOnWindows", "True")] + public void MeetsAllAspNetCoreMvcExpectations() + { + // No package versions are relevant because this is built-in + RunTraceTestOnSelfHosted(string.Empty); + } + } +} diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc2Tests.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc2Tests.cs deleted file mode 100644 index 16809a30c946..000000000000 --- a/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc2Tests.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Xunit; -using Xunit.Abstractions; - -namespace Datadog.Trace.ClrProfiler.IntegrationTests.AspNetCore -{ - public class AspNetCoreMvc2Tests : AspNetCoreMvcTestBase - { - public AspNetCoreMvc2Tests(ITestOutputHelper output) - : base("AspNetCoreMvc2", output) - { - } - -#if NETCOREAPP2_1 - [Theory] - [Trait("Category", "EndToEnd")] - [Trait("RunOnWindows", "True")] - [MemberData(nameof(PackageVersions.AspNetCoreMvc2), MemberType = typeof(PackageVersions))] - public void MeetsAllAspNetCoreMvcExpectations(string packageVersion) - { - RunTraceTestOnSelfHosted(packageVersion); - } -#endif - } -} diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc3Tests.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc30Tests.cs similarity index 61% rename from test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc3Tests.cs rename to test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc30Tests.cs index aa70cb36e6b5..01e6416d8d10 100644 --- a/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc3Tests.cs +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc30Tests.cs @@ -1,18 +1,18 @@ +using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers; using Xunit; using Xunit.Abstractions; namespace Datadog.Trace.ClrProfiler.IntegrationTests.AspNetCore { - public class AspNetCoreMvc3Tests : AspNetCoreMvcTestBase + public class AspNetCoreMvc30Tests : AspNetCoreMvcTestBase { - public AspNetCoreMvc3Tests(ITestOutputHelper output) - : base("AspNetCoreMvc.Netcore3", output) + public AspNetCoreMvc30Tests(ITestOutputHelper output) + : base("AspNetCoreMvc30", output) { // EnableDebugMode(); } -#if NETCOREAPP3_0 - [Fact] + [TargetFrameworkVersionsFact("netcoreapp3.0")] [Trait("Category", "EndToEnd")] [Trait("RunOnWindows", "True")] public void MeetsAllAspNetCoreMvcExpectations() @@ -20,6 +20,5 @@ public void MeetsAllAspNetCoreMvcExpectations() // No package versions are relevant because this is built-in RunTraceTestOnSelfHosted(string.Empty); } -#endif } } diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc31Tests.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc31Tests.cs new file mode 100644 index 000000000000..9f2fd1ba803b --- /dev/null +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc31Tests.cs @@ -0,0 +1,24 @@ +using Datadog.Trace.ClrProfiler.IntegrationTests.Helpers; +using Xunit; +using Xunit.Abstractions; + +namespace Datadog.Trace.ClrProfiler.IntegrationTests.AspNetCore +{ + public class AspNetCoreMvc31Tests : AspNetCoreMvcTestBase + { + public AspNetCoreMvc31Tests(ITestOutputHelper output) + : base("AspNetCoreMvc31", output) + { + // EnableDebugMode(); + } + + [TargetFrameworkVersionsFact("netcoreapp3.1")] + [Trait("Category", "EndToEnd")] + [Trait("RunOnWindows", "True")] + public void MeetsAllAspNetCoreMvcExpectations() + { + // No package versions are relevant because this is built-in + RunTraceTestOnSelfHosted(string.Empty); + } + } +} diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TargetFrameworkVersionsFact.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TargetFrameworkVersionsFact.cs index 52489ca84ef7..f745eebff73a 100644 --- a/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TargetFrameworkVersionsFact.cs +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TargetFrameworkVersionsFact.cs @@ -1,47 +1,21 @@ using System; using System.Linq; using System.Reflection; -using System.Runtime.Versioning; +using Datadog.Core.Tools.Extensions; using Xunit; namespace Datadog.Trace.ClrProfiler.IntegrationTests.Helpers { public class TargetFrameworkVersionsFact : FactAttribute { - private const string DotNetFramework = ".NETFramework"; - private const string CoreFramework = ".NETCoreApp"; - - public TargetFrameworkVersionsFact(string targetFrameworkVersions) + public TargetFrameworkVersionsFact(string targetFrameworkMonikers) { - var targetFramework = Assembly.GetExecutingAssembly().GetCustomAttribute(); - var parts = targetFramework.FrameworkName.Split(','); - var runtime = parts[0]; - var isCoreClr = runtime.Equals(CoreFramework); - - var versionParts = parts[1].Replace("Version=v", string.Empty).Split('.'); - var major = int.Parse(versionParts[0]); - var minor = int.Parse(versionParts[1]); - string patch = null; - - if (versionParts.Length == 3) - { - patch = versionParts[2]; - } - - string compiledTargetFrameworkString; - if (isCoreClr) - { - compiledTargetFrameworkString = $"netcoreapp{major}.{minor}"; - } - else - { - compiledTargetFrameworkString = $"net{major}{minor}{patch ?? string.Empty}"; - } + var compiledTargetFrameworkString = Assembly.GetExecutingAssembly().GetTargetFrameworkMoniker(); - if (targetFrameworkVersions.Split(';').All(s => !s.Equals(compiledTargetFrameworkString, StringComparison.OrdinalIgnoreCase))) + if (targetFrameworkMonikers.Split(';').All(s => !s.Equals(compiledTargetFrameworkString, StringComparison.OrdinalIgnoreCase))) { - Skip = $"xUnit target framework does not match {targetFrameworkVersions}"; + Skip = $"xUnit target framework does not match {targetFrameworkMonikers}"; } } } -} \ No newline at end of file +} diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TargetFrameworkVersionsTheory.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TargetFrameworkVersionsTheory.cs new file mode 100644 index 000000000000..af9125311764 --- /dev/null +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TargetFrameworkVersionsTheory.cs @@ -0,0 +1,21 @@ +using System; +using System.Linq; +using System.Reflection; +using Datadog.Core.Tools.Extensions; +using Xunit; + +namespace Datadog.Trace.ClrProfiler.IntegrationTests.Helpers +{ + public class TargetFrameworkVersionsTheory : TheoryAttribute + { + public TargetFrameworkVersionsTheory(string targetFrameworkMonikers) + { + var compiledTargetFrameworkString = Assembly.GetExecutingAssembly().GetTargetFrameworkMoniker(); + + if (targetFrameworkMonikers.Split(';').All(s => !s.Equals(compiledTargetFrameworkString, StringComparison.OrdinalIgnoreCase))) + { + Skip = $"xUnit target framework does not match {targetFrameworkMonikers}"; + } + } + } +} diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/LoadTests/AspNetCoreMvc2LoadTests.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/LoadTests/AspNetCoreMvc21LoadTests.cs similarity index 95% rename from test/Datadog.Trace.ClrProfiler.IntegrationTests/LoadTests/AspNetCoreMvc2LoadTests.cs rename to test/Datadog.Trace.ClrProfiler.IntegrationTests/LoadTests/AspNetCoreMvc21LoadTests.cs index 83499d167808..95c2bac4f6f6 100644 --- a/test/Datadog.Trace.ClrProfiler.IntegrationTests/LoadTests/AspNetCoreMvc2LoadTests.cs +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/LoadTests/AspNetCoreMvc21LoadTests.cs @@ -5,17 +5,17 @@ namespace Datadog.Trace.ClrProfiler.IntegrationTests.LoadTests { - public class AspNetCoreMvc2LoadTests : LoadTestBase + public class AspNetCoreMvc21LoadTests : LoadTestBase { private static readonly string TopLevelOperationName = "aspnet-coremvc.request"; - private static readonly string CoreMvc = "Samples.AspNetCoreMvc2"; + private static readonly string CoreMvc = "Samples.AspNetCoreMvc21"; private static readonly string LoadTestConsole = "AspNetMvcCorePerformance"; private static readonly int Threads = 10; private static readonly int IterationsPerThread = 20; - public AspNetCoreMvc2LoadTests(ITestOutputHelper output) + public AspNetCoreMvc21LoadTests(ITestOutputHelper output) : base(output) { var aspNetCoreMvc2Port = TcpPortProvider.GetOpenPort(); diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersions.g.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersions.g.cs index 88db8216c3fe..20d9ec050490 100644 --- a/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersions.g.cs +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersions.g.cs @@ -38,9 +38,5 @@ public class PackageVersions public static IEnumerable StackExchangeRedis => IsComprehensive ? PackageVersionsComprehensive.StackExchangeRedis : PackageVersionsLatestMinors.StackExchangeRedis; public static IEnumerable ServiceStackRedis => IsComprehensive ? PackageVersionsComprehensive.ServiceStackRedis : PackageVersionsLatestMinors.ServiceStackRedis; - -#if NETCOREAPP2_1 - public static IEnumerable AspNetCoreMvc2 => IsComprehensive ? PackageVersionsComprehensive.AspNetCoreMvc2 : PackageVersionsLatestMinors.AspNetCoreMvc2; -#endif } } diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsComprehensive.g.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsComprehensive.g.cs index 7cbe2e804b96..6726e035a227 100644 --- a/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsComprehensive.g.cs +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsComprehensive.g.cs @@ -56,6 +56,7 @@ public class PackageVersionsComprehensive new object[] { "2.9.1" }, new object[] { "2.9.2" }, new object[] { "2.9.3" }, + new object[] { "2.10.0" }, #endif }; @@ -128,6 +129,7 @@ public class PackageVersionsComprehensive new object[] { "4.0.10" }, new object[] { "4.1.0" }, new object[] { "4.1.1" }, + new object[] { "4.1.2" }, #endif }; @@ -150,6 +152,7 @@ public class PackageVersionsComprehensive new object[] { "4.6.0" }, new object[] { "4.6.1" }, new object[] { "4.7.0" }, + new object[] { "4.8.0" }, #endif }; @@ -254,30 +257,9 @@ public class PackageVersionsComprehensive new object[] { "5.5.0" }, new object[] { "5.6.0" }, new object[] { "5.7.0" }, + new object[] { "5.8.0" }, #endif }; -#if NETCOREAPP2_1 - public static IEnumerable AspNetCoreMvc2 => - - new List - { -#if DEFAULT_SAMPLES - new object[] { string.Empty }, -#else - new object[] { "2.0.0" }, - new object[] { "2.0.1" }, - new object[] { "2.0.2" }, - new object[] { "2.0.3" }, - new object[] { "2.0.4" }, - new object[] { "2.1.0" }, - new object[] { "2.1.1" }, - new object[] { "2.1.2" }, - new object[] { "2.1.3" }, - new object[] { "2.2.0" }, -#endif - }; -#endif - } } diff --git a/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs b/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs index 26b0a462ef3e..0d33f1391a83 100644 --- a/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs +++ b/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs @@ -36,6 +36,7 @@ public class PackageVersionsLatestMinors new object[] { "2.7.3" }, new object[] { "2.8.1" }, new object[] { "2.9.3" }, + new object[] { "2.10.0" }, #endif }; @@ -80,7 +81,7 @@ public class PackageVersionsLatestMinors new object[] { string.Empty }, #else new object[] { "4.0.10" }, - new object[] { "4.1.1" }, + new object[] { "4.1.2" }, #endif }; @@ -97,6 +98,7 @@ public class PackageVersionsLatestMinors new object[] { "4.5.1" }, new object[] { "4.6.1" }, new object[] { "4.7.0" }, + new object[] { "4.8.0" }, #endif }; @@ -129,23 +131,9 @@ public class PackageVersionsLatestMinors new object[] { "5.5.0" }, new object[] { "5.6.0" }, new object[] { "5.7.0" }, + new object[] { "5.8.0" }, #endif }; -#if NETCOREAPP2_1 - public static IEnumerable AspNetCoreMvc2 => - - new List - { -#if DEFAULT_SAMPLES - new object[] { string.Empty }, -#else - new object[] { "2.0.4" }, - new object[] { "2.1.3" }, - new object[] { "2.2.0" }, -#endif - }; -#endif - } } diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 0a46b11d638e..b9e513aefaf3 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,8 +2,8 @@ - net452;net461;netcoreapp2.1;netcoreapp3.0 - netcoreapp2.1;netcoreapp3.0 + net452;net461;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 + netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 diff --git a/tools/Datadog.Core.Tools/Datadog.Core.Tools.csproj b/tools/Datadog.Core.Tools/Datadog.Core.Tools.csproj index 3afaa50e3e81..82aee1920626 100644 --- a/tools/Datadog.Core.Tools/Datadog.Core.Tools.csproj +++ b/tools/Datadog.Core.Tools/Datadog.Core.Tools.csproj @@ -1,8 +1,8 @@  - net452;net461;netcoreapp2.1;netcoreapp3.0 - netcoreapp2.1;netcoreapp3.0 + net452;net461;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 + netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 diff --git a/tools/Datadog.Core.Tools/Extensions/AssemblyExtensions.cs b/tools/Datadog.Core.Tools/Extensions/AssemblyExtensions.cs new file mode 100644 index 000000000000..00f10eceb18c --- /dev/null +++ b/tools/Datadog.Core.Tools/Extensions/AssemblyExtensions.cs @@ -0,0 +1,43 @@ +using System; +using System.Reflection; +using System.Runtime.Versioning; + +namespace Datadog.Core.Tools.Extensions +{ + public static class AssemblyExtensions + { + private const string DotNetFramework = ".NETFramework"; + private const string CoreFramework = ".NETCoreApp"; + + public static string GetTargetFrameworkMoniker(this Assembly assembly) + { + var targetFramework = assembly.GetCustomAttribute(); + var parts = targetFramework?.FrameworkName?.Split(','); + + if (parts?.Length > 1) + { + var runtime = parts[0]; + var versionParts = parts[1].Replace("Version=v", string.Empty).Split('.'); + + if (versionParts.Length > 1) + { + var major = int.Parse(versionParts[0]); + var minor = int.Parse(versionParts[1]); + + if (runtime.Equals(CoreFramework)) + { + return $"netcoreapp{major}.{minor}"; + } + + if (runtime.Equals(DotNetFramework)) + { + var patch = versionParts.Length > 2 ? versionParts[2] : null; + return $"net{major}{minor}{patch}"; + } + } + } + + return "unsupported"; + } + } +}