diff --git a/README.md b/README.md
index 87f967d4..aac8f550 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@ SkyAPM C#/.NET instrument agent
> MyGet feed URL https://www.myget.org/F/skyapm-dotnet/api/v3/index.json
# Supported
-- This project currently supports apps targeting netcoreapp2.0/netframework4.6.1 or higher.
+- This project currently supports apps targeting netcoreapp3.1、net5.0、net6.0 or higher.
- [Supported middlewares, frameworks and libraries.](docs/Supported-list.md)
# Features
diff --git a/appveyor.yml b/appveyor.yml
index 12582259..7eb963df 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,5 +1,5 @@
version: '{build}'
-os: Visual Studio 2019
+os: Visual Studio 2022
branches:
only:
- master
diff --git a/benchmark/SkyApm.Benchmark/SkyApm.Benchmark.csproj b/benchmark/SkyApm.Benchmark/SkyApm.Benchmark.csproj
index 37fbde9c..0fdf6457 100644
--- a/benchmark/SkyApm.Benchmark/SkyApm.Benchmark.csproj
+++ b/benchmark/SkyApm.Benchmark/SkyApm.Benchmark.csproj
@@ -2,7 +2,7 @@
Exe
- netcoreapp2.1
+ netcoreapp3.1;net5.0;net6.0
diff --git a/sample/SkyApm.Sample.AspNet/App_Start/RouteConfig.cs b/sample/SkyApm.Sample.AspNet/App_Start/RouteConfig.cs
deleted file mode 100644
index 7faa9a03..00000000
--- a/sample/SkyApm.Sample.AspNet/App_Start/RouteConfig.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Web.Mvc;
-using System.Web.Routing;
-
-namespace SkyApm.Sample.AspNet
-{
- public class RouteConfig
- {
- public static void RegisterRoutes(RouteCollection routes)
- {
- routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
-
- routes.MapRoute(
- "Default",
- "{controller}/{action}/{id}",
- new {controller = "Home", action = "Index", id = UrlParameter.Optional}
- );
- }
- }
-}
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.AspNet/App_Start/WebApiConfig.cs b/sample/SkyApm.Sample.AspNet/App_Start/WebApiConfig.cs
deleted file mode 100644
index 3995fc51..00000000
--- a/sample/SkyApm.Sample.AspNet/App_Start/WebApiConfig.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System.Web.Http;
-
-namespace SkyApm.Sample.AspNet
-{
- public static class WebApiConfig
- {
- public static void Register(HttpConfiguration config)
- {
- // Web API configuration and services
-
- // Web API routes
- config.MapHttpAttributeRoutes();
-
- config.Routes.MapHttpRoute(
- "DefaultApi",
- "api/{controller}/{id}",
- new {id = RouteParameter.Optional}
- );
- }
- }
-}
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.AspNet/Controllers/ValuesController.cs b/sample/SkyApm.Sample.AspNet/Controllers/ValuesController.cs
deleted file mode 100644
index 4c01c25e..00000000
--- a/sample/SkyApm.Sample.AspNet/Controllers/ValuesController.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Net.Http;
-using System.Threading.Tasks;
-using System.Web.Http;
-using SkyApm.Agent.AspNet;
-
-namespace SkyApm.Sample.AspNet.Controllers
-{
- [RoutePrefix("api/values")]
- public class ValuesController : ApiController
- {
- [HttpGet]
- public async Task Get()
- {
- var httpClient = new HttpClient(new HttpTracingHandler());
- var values = await httpClient.GetStringAsync("http://localhost:5001/api/values");
- return Json(values);
- }
-
- [HttpGet]
- [Route("{id:int}")]
- public async Task Get(int id)
- {
- var client = HttpClientFactory.Create(new HttpTracingHandler(null));
- Task.WhenAll(client.GetAsync("http://localhost:5002/api/delay/2000"),
- client.GetAsync("http://localhost:5002/api/values"),
- client.GetAsync("http://localhost:5002/api/delay/200"));
- return await client.GetStringAsync("http://localhost:5002/api/delay/100");
- }
- }
-}
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.AspNet/Global.asax b/sample/SkyApm.Sample.AspNet/Global.asax
deleted file mode 100644
index 0a1a3c9c..00000000
--- a/sample/SkyApm.Sample.AspNet/Global.asax
+++ /dev/null
@@ -1 +0,0 @@
-<%@ Application Inherits="SkyApm.Sample.AspNet.Global" %>
diff --git a/sample/SkyApm.Sample.AspNet/Global.asax.cs b/sample/SkyApm.Sample.AspNet/Global.asax.cs
deleted file mode 100644
index 574fa5a6..00000000
--- a/sample/SkyApm.Sample.AspNet/Global.asax.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Web;
-using System.Web.Mvc;
-using System.Web.Routing;
-using System.Web.Http;
-using SkyApm.Agent.AspNet;
-
-namespace SkyApm.Sample.AspNet
-{
- public class Global : HttpApplication
- {
- protected void Application_Start()
- {
- AreaRegistration.RegisterAllAreas();
- GlobalConfiguration.Configure(WebApiConfig.Register);
- RouteConfig.RegisterRoutes(RouteTable.Routes);
-
- InstrumentModuleFactory.ConfigServices(services =>
- {
- //register your components here
- });
- }
- }
-}
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.AspNet/Properties/AssemblyInfo.cs b/sample/SkyApm.Sample.AspNet/Properties/AssemblyInfo.cs
deleted file mode 100644
index 97f9d9df..00000000
--- a/sample/SkyApm.Sample.AspNet/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SkyApm.Sample.AspNet")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SkyApm.Sample.AspNet")]
-[assembly: AssemblyCopyright("Copyright © 2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("C3649845-E458-448D-B97D-C7E231E1D040")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.AspNet/SkyApm.Sample.AspNet.csproj b/sample/SkyApm.Sample.AspNet/SkyApm.Sample.AspNet.csproj
deleted file mode 100644
index d7f32869..00000000
--- a/sample/SkyApm.Sample.AspNet/SkyApm.Sample.AspNet.csproj
+++ /dev/null
@@ -1,252 +0,0 @@
-
-
-
-
- 10.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
-
-
- Debug
- AnyCPU
- {C3649845-E458-448D-B97D-C7E231E1D040}
- {349C5851-65DF-11DA-9384-00065B846F21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Library
- Properties
- SkyApm.Sample.AspNet
- SkyApm.Sample.AspNet
- v4.6.1
- 512
-
-
-
-
- 4.0
- true
-
-
-
-
-
-
-
-
- AnyCPU
- true
- full
- false
- bin\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\
- TRACE
- prompt
- 4
-
-
-
- ..\..\packages\Grpc.Core.2.37.0\lib\net45\Grpc.Core.dll
-
-
- ..\..\packages\Grpc.Core.Api.2.37.0\lib\net45\Grpc.Core.Api.dll
-
-
- ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll
-
-
-
- ..\..\packages\Microsoft.Extensions.Configuration.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll
-
-
- ..\..\packages\Microsoft.Extensions.Configuration.Abstractions.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll
-
-
- ..\..\packages\Microsoft.Extensions.Configuration.Binder.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll
-
-
- ..\..\packages\Microsoft.Extensions.Configuration.EnvironmentVariables.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll
-
-
- ..\..\packages\Microsoft.Extensions.Configuration.FileExtensions.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.FileExtensions.dll
-
-
- ..\..\packages\Microsoft.Extensions.Configuration.Json.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Json.dll
-
-
- ..\..\packages\Microsoft.Extensions.DependencyInjection.3.1.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll
-
-
- ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.3.1.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
-
-
- ..\..\packages\Microsoft.Extensions.FileProviders.Abstractions.3.1.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Abstractions.dll
-
-
- ..\..\packages\Microsoft.Extensions.FileProviders.Physical.3.1.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Physical.dll
-
-
- ..\..\packages\Microsoft.Extensions.FileSystemGlobbing.3.1.0\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll
-
-
- ..\..\packages\Microsoft.Extensions.Logging.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll
-
-
- ..\..\packages\Microsoft.Extensions.Logging.Abstractions.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll
-
-
- ..\..\packages\Microsoft.Extensions.Options.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll
-
-
- ..\..\packages\Microsoft.Extensions.Primitives.3.1.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll
-
-
- ../..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
-
-
- ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll
-
-
-
- ..\..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll
-
-
- ..\..\packages\System.ComponentModel.Annotations.4.7.0\lib\net461\System.ComponentModel.Annotations.dll
-
-
-
-
-
- ..\..\packages\System.Interactive.Async.4.0.0\lib\net461\System.Interactive.Async.dll
-
-
- ..\..\packages\System.Linq.Async.4.0.0\lib\net461\System.Linq.Async.dll
-
-
- ..\..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll
-
-
-
- ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll
-
-
-
- ..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
-
-
- ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.7.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\..\packages\System.Text.Encodings.Web.4.7.0\lib\netstandard2.0\System.Text.Encodings.Web.dll
-
-
- ..\..\packages\System.Text.Json.4.7.0\lib\net461\System.Text.Json.dll
-
-
- ..\..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll
-
-
- ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll
-
-
-
- ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll
-
-
- ..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll
-
-
- ..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll
-
-
- ..\..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll
-
-
- ..\..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll
-
-
-
-
-
-
-
- ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll
-
-
- ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll
-
-
- ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
-
-
-
-
-
-
-
- {3a454a8a-a1b7-4c6d-be08-52d956f95cc1}
- SkyApm.Agent.AspNet
-
-
-
-
-
-
-
-
-
-
-
-
- True
- True
- 0
- /
- http://localhost:59909/
- False
- False
-
-
- False
-
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.AspNet/Web.config b/sample/SkyApm.Sample.AspNet/Web.config
deleted file mode 100644
index 18189156..00000000
--- a/sample/SkyApm.Sample.AspNet/Web.config
+++ /dev/null
@@ -1,321 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sample/SkyApm.Sample.AspNet/favicon.ico b/sample/SkyApm.Sample.AspNet/favicon.ico
deleted file mode 100644
index cebaec50..00000000
Binary files a/sample/SkyApm.Sample.AspNet/favicon.ico and /dev/null differ
diff --git a/sample/SkyApm.Sample.AspNet/packages.config b/sample/SkyApm.Sample.AspNet/packages.config
deleted file mode 100644
index 7d6b17c9..00000000
--- a/sample/SkyApm.Sample.AspNet/packages.config
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.AspNet/skyapm.json b/sample/SkyApm.Sample.AspNet/skyapm.json
deleted file mode 100644
index d419a695..00000000
--- a/sample/SkyApm.Sample.AspNet/skyapm.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "SkyWalking": {
- "ServiceName": "asp-net-sample",
- "Namespace": "",
- "HeaderVersions": [
- "sw6"
- ],
- "Sampling": {
- "SamplePer3Secs": -1,
- "Percentage": -1.0
- },
- "Logging": {
- "Level": "Information",
- "FilePath": "logs/skyapm-{Date}.log"
- },
- "Transport": {
- "Interval": 3000,
- "ProtocolVersion": "v6",
- "QueueSize": 30000,
- "BatchSize": 3000,
- "gRPC": {
- "Servers": "localhost:11800",
- "Timeout": 10000,
- "ConnectTimeout": 10000,
- "ReportTimeout": 600000
- }
- }
- }
-}
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.Backend/SkyApm.Sample.Backend.csproj b/sample/SkyApm.Sample.Backend/SkyApm.Sample.Backend.csproj
index 5de42122..d3d914ce 100644
--- a/sample/SkyApm.Sample.Backend/SkyApm.Sample.Backend.csproj
+++ b/sample/SkyApm.Sample.Backend/SkyApm.Sample.Backend.csproj
@@ -1,25 +1,24 @@
- netcoreapp2.1;netcoreapp3.1
+ netcoreapp3.1;net5.0;net6.0
+
-
-
- 3.1.0
-
-
-
+
+
+
+
-
-
+
+
diff --git a/sample/SkyApm.Sample.Backend/Startup.cs b/sample/SkyApm.Sample.Backend/Startup.cs
index f1cac302..65a722f5 100644
--- a/sample/SkyApm.Sample.Backend/Startup.cs
+++ b/sample/SkyApm.Sample.Backend/Startup.cs
@@ -10,12 +10,6 @@
using SkyApm.Sample.GrpcServer;
using SkyApm.Tracing;
-#if NETCOREAPP2_1
-
-using IHostEnvironment = Microsoft.Extensions.Hosting.IHostingEnvironment;
-
-#endif
-
namespace SkyApm.Sample.Backend
{
public class Startup
diff --git a/sample/SkyApm.Sample.Frontend/SkyApm.Sample.Frontend.csproj b/sample/SkyApm.Sample.Frontend/SkyApm.Sample.Frontend.csproj
index c624656a..19bb0bae 100644
--- a/sample/SkyApm.Sample.Frontend/SkyApm.Sample.Frontend.csproj
+++ b/sample/SkyApm.Sample.Frontend/SkyApm.Sample.Frontend.csproj
@@ -1,20 +1,12 @@
- netcoreapp2.1;netcoreapp3.0;netcoreapp3.1
+ netcoreapp3.1;net5.0;net6.0
SkyApm.Sample.Backend
-
-
-
-
-
-
-
-
-
+
diff --git a/sample/SkyApm.Sample.GenericHost/Program.cs b/sample/SkyApm.Sample.GenericHost/Program.cs
index b54134e3..87509700 100644
--- a/sample/SkyApm.Sample.GenericHost/Program.cs
+++ b/sample/SkyApm.Sample.GenericHost/Program.cs
@@ -11,9 +11,9 @@ public static void Main(string[] args)
CreateHostBuilder(args).Build().Run();
}
- public static IHostBuilder CreateHostBuilder(string[] args) =>
+ static IHostBuilder CreateHostBuilder(string[] args) =>
new HostBuilder()
.ConfigureServices(services => services.AddHostedService())
- .AddSkyAPM();
+ .AddSkyAPM();
}
}
\ No newline at end of file
diff --git a/sample/SkyApm.Sample.GenericHost/SkyApm.Sample.GenericHost.csproj b/sample/SkyApm.Sample.GenericHost/SkyApm.Sample.GenericHost.csproj
index c083f92d..3026095f 100644
--- a/sample/SkyApm.Sample.GenericHost/SkyApm.Sample.GenericHost.csproj
+++ b/sample/SkyApm.Sample.GenericHost/SkyApm.Sample.GenericHost.csproj
@@ -1,7 +1,7 @@
- netcoreapp2.1;netcoreapp3.1
+ net6.0;netcoreapp3.1
Exe
@@ -18,8 +18,11 @@
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/sample/grpc/SkyApm.Sample.GrpcProto/SkyApm.Sample.GrpcProto.csproj b/sample/grpc/SkyApm.Sample.GrpcProto/SkyApm.Sample.GrpcProto.csproj
index f748e275..19debaed 100644
--- a/sample/grpc/SkyApm.Sample.GrpcProto/SkyApm.Sample.GrpcProto.csproj
+++ b/sample/grpc/SkyApm.Sample.GrpcProto/SkyApm.Sample.GrpcProto.csproj
@@ -12,7 +12,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/sample/grpc/SkyApm.Sample.GrpcServer/SkyApm.Sample.GrpcServer.csproj b/sample/grpc/SkyApm.Sample.GrpcServer/SkyApm.Sample.GrpcServer.csproj
index 4baac714..21268ace 100644
--- a/sample/grpc/SkyApm.Sample.GrpcServer/SkyApm.Sample.GrpcServer.csproj
+++ b/sample/grpc/SkyApm.Sample.GrpcServer/SkyApm.Sample.GrpcServer.csproj
@@ -1,24 +1,27 @@
-
- Exe
- netcoreapp2.1;netcoreapp3.1
-
+
+ Exe
+ netcoreapp3.1;net5.0;net6.0
+
-
-
- Always
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ Always
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/skyapm-dotnet.sln b/skyapm-dotnet.sln
index 4f71d120..94a51a2a 100644
--- a/skyapm-dotnet.sln
+++ b/skyapm-dotnet.sln
@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
NuGet.config = NuGet.config
+ README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{613F0980-91ED-4064-8E8C-168582EF4AD7}"
@@ -58,10 +59,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyApm.Diagnostics.EntityFr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyApm.Diagnostics.EntityFrameworkCore.Npgsql", "src\SkyApm.Diagnostics.EntityFrameworkCore.Npgsql\SkyApm.Diagnostics.EntityFrameworkCore.Npgsql.csproj", "{F8D96C30-369C-4FCB-B5B2-02EAA74199C9}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyApm.Agent.AspNet", "src\SkyApm.Agent.AspNet\SkyApm.Agent.AspNet.csproj", "{3A454A8A-A1B7-4C6D-BE08-52D956F95CC1}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyApm.Sample.AspNet", "sample\SkyApm.Sample.AspNet\SkyApm.Sample.AspNet.csproj", "{C3649845-E458-448D-B97D-C7E231E1D040}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyApm.Transport.Grpc", "src\SkyApm.Transport.Grpc\SkyApm.Transport.Grpc.csproj", "{FF2FC3FB-D112-45C1-AF34-1FE37D55F682}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyApm.Diagnostics.AspNetCore", "src\SkyApm.Diagnostics.AspNetCore\SkyApm.Diagnostics.AspNetCore.csproj", "{CFBB522D-495F-40F9-B68F-DA25E48D9F6A}"
@@ -150,14 +147,6 @@ Global
{F8D96C30-369C-4FCB-B5B2-02EAA74199C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8D96C30-369C-4FCB-B5B2-02EAA74199C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8D96C30-369C-4FCB-B5B2-02EAA74199C9}.Release|Any CPU.Build.0 = Release|Any CPU
- {3A454A8A-A1B7-4C6D-BE08-52D956F95CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3A454A8A-A1B7-4C6D-BE08-52D956F95CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3A454A8A-A1B7-4C6D-BE08-52D956F95CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3A454A8A-A1B7-4C6D-BE08-52D956F95CC1}.Release|Any CPU.Build.0 = Release|Any CPU
- {C3649845-E458-448D-B97D-C7E231E1D040}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C3649845-E458-448D-B97D-C7E231E1D040}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C3649845-E458-448D-B97D-C7E231E1D040}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C3649845-E458-448D-B97D-C7E231E1D040}.Release|Any CPU.Build.0 = Release|Any CPU
{FF2FC3FB-D112-45C1-AF34-1FE37D55F682}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF2FC3FB-D112-45C1-AF34-1FE37D55F682}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF2FC3FB-D112-45C1-AF34-1FE37D55F682}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -264,8 +253,6 @@ Global
{44DFFDF7-5935-475A-825F-2C0298464117} = {B5E677CF-2920-4B0A-A056-E73F6B2CF2BC}
{F5C529C9-23C4-46B7-84FF-E86C6D17EB3E} = {A4E67E09-3156-4D30-B451-F24F706E96C4}
{F8D96C30-369C-4FCB-B5B2-02EAA74199C9} = {A4E67E09-3156-4D30-B451-F24F706E96C4}
- {3A454A8A-A1B7-4C6D-BE08-52D956F95CC1} = {EF6194B2-9ACB-49B9-8049-DD6AFAEB0399}
- {C3649845-E458-448D-B97D-C7E231E1D040} = {844CEACD-4C85-4B15-9E2B-892B01FDA4BB}
{FF2FC3FB-D112-45C1-AF34-1FE37D55F682} = {CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}
{CFBB522D-495F-40F9-B68F-DA25E48D9F6A} = {B5E677CF-2920-4B0A-A056-E73F6B2CF2BC}
{0B87C4B8-3F4F-456A-B588-28D8E9E3395A} = {4BD917BC-D579-4C75-9939-41BF012A4EE2}
diff --git a/src/SkyApm.Agent.AspNet/AsyncContext.cs b/src/SkyApm.Agent.AspNet/AsyncContext.cs
deleted file mode 100644
index d456a2f9..00000000
--- a/src/SkyApm.Agent.AspNet/AsyncContext.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace SkyApm.Agent.AspNet
-{
- internal static class AsyncContext
- {
- public static void Run(Func task)
- {
- using (new ContextScope())
- {
- Task.Run(async () => await task()).GetAwaiter().GetResult();
- }
- }
-
- private class ContextScope : IDisposable
- {
- private readonly SynchronizationContext _current;
-
- public ContextScope()
- {
- _current = SynchronizationContext.Current;
- SynchronizationContext.SetSynchronizationContext(null);
- }
-
- public void Dispose()
- {
- SynchronizationContext.SetSynchronizationContext(_current);
- }
- }
- }
-}
diff --git a/src/SkyApm.Agent.AspNet/Configuration/ConfigurationFactory.cs b/src/SkyApm.Agent.AspNet/Configuration/ConfigurationFactory.cs
deleted file mode 100644
index 71b2dde4..00000000
--- a/src/SkyApm.Agent.AspNet/Configuration/ConfigurationFactory.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using SkyApm.Utilities.Configuration;
-using System.Collections.Generic;
-
-namespace SkyApm.Agent.AspNet.Configuration
-{
- public class ConfigurationFactory : SkyApm.Utilities.Configuration.ConfigurationFactory
- {
- public ConfigurationFactory(IEnvironmentProvider environmentProvider, IEnumerable additionalConfigurations) : base(environmentProvider, additionalConfigurations, null)
- {
- }
- }
-}
diff --git a/src/SkyApm.Agent.AspNet/Extensions/ServiceCollectionExtensions.cs b/src/SkyApm.Agent.AspNet/Extensions/ServiceCollectionExtensions.cs
deleted file mode 100644
index 3651c23d..00000000
--- a/src/SkyApm.Agent.AspNet/Extensions/ServiceCollectionExtensions.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using Microsoft.Extensions.DependencyInjection;
-using SkyApm.Config;
-using SkyApm.Diagnostics;
-using SkyApm.Logging;
-using SkyApm.Sampling;
-using SkyApm.Service;
-using SkyApm.Tracing;
-using SkyApm.Transport;
-using SkyApm.Transport.Grpc;
-using SkyApm.Utilities.Configuration;
-using SkyApm.Utilities.Logging;
-
-namespace SkyApm.Agent.AspNet.Extensions
-{
- internal static class ServiceCollectionExtensions
- {
- public static IServiceCollection AddSkyAPMCore(this IServiceCollection services)
- {
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton(RuntimeEnvironment.Instance);
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
-
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
-
- services.AddSingleton();
- services.AddSingleton(p => p.GetService());
- services.AddSingleton(p => p.GetService());
- services.AddSingleton();
- services.AddSingleton();
-
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
-
- services.AddSingleton();
- return services;
- }
- }
-}
\ No newline at end of file
diff --git a/src/SkyApm.Agent.AspNet/HostingEnvironmentProvider.cs b/src/SkyApm.Agent.AspNet/HostingEnvironmentProvider.cs
deleted file mode 100644
index 484583f3..00000000
--- a/src/SkyApm.Agent.AspNet/HostingEnvironmentProvider.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-
-namespace SkyApm.Agent.AspNet
-{
- internal class HostingEnvironmentProvider : IEnvironmentProvider
- {
- private const string ENVIRONMENT_KEY = "ASPNET__ENVIRONMENT";
-
- public string EnvironmentName { get; }
-
- public HostingEnvironmentProvider()
- {
- EnvironmentName = Environment.GetEnvironmentVariable(ENVIRONMENT_KEY) ?? "Production";
- }
- }
-}
\ No newline at end of file
diff --git a/src/SkyApm.Agent.AspNet/HttpRequestCarrierHeaderCollection.cs b/src/SkyApm.Agent.AspNet/HttpRequestCarrierHeaderCollection.cs
deleted file mode 100644
index ec297c43..00000000
--- a/src/SkyApm.Agent.AspNet/HttpRequestCarrierHeaderCollection.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System.Collections;
-using System.Collections.Generic;
-using System.Web;
-using SkyApm.Tracing;
-
-namespace SkyApm.Agent.AspNet
-{
- internal class HttpRequestCarrierHeaderCollection : ICarrierHeaderDictionary
- {
- private readonly Dictionary _headers;
-
- public HttpRequestCarrierHeaderCollection(HttpRequest httpRequest)
- {
- _headers = new Dictionary();
- foreach (var key in httpRequest.Headers.AllKeys)
- {
- _headers[key] = httpRequest.Headers[key];
- }
- }
-
- public IEnumerator> GetEnumerator()
- {
- return _headers.GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return _headers.GetEnumerator();
- }
-
- public void Add(string key, string value)
- {
- throw new System.NotImplementedException();
- }
-
- public string Get(string key)
- {
- if (_headers.TryGetValue(key, out var value))
- return value;
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/SkyApm.Agent.AspNet/HttpTracingHandler.cs b/src/SkyApm.Agent.AspNet/HttpTracingHandler.cs
deleted file mode 100644
index eb06b322..00000000
--- a/src/SkyApm.Agent.AspNet/HttpTracingHandler.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Threading;
-using System.Threading.Tasks;
-using CommonServiceLocator;
-using SkyApm.Tracing;
-using SkyApm.Tracing.Segments;
-
-namespace SkyApm.Agent.AspNet
-{
- public class HttpTracingHandler : DelegatingHandler
- {
- ///
- /// If you are passing this delegating handler to method, please pass a `null` in constructor as innerHandler.
- /// if you are passing it in constructor, just use it's non-parameter constructor.
- /// as follow:
- /// var httpClient = HttpClientFactory.Create(new HttpTracingHandler(null))
- /// or
- /// var httpClient = new HttpClient(new HttpTracingHandler())
- ///
- public HttpTracingHandler()
- : this(new HttpClientHandler())
- {
- }
-
- ///
- /// If you are passing this delegating handler to method, please pass a `null` in constructor as innerHandler.
- /// if you are passing it in constructor, just use it's non-parameter constructor.
- /// as follow:
- /// var httpClient = HttpClientFactory.Create(new HttpTracingHandler(null))
- /// or
- /// var httpClient = new HttpClient(new HttpTracingHandler())
- ///
- public HttpTracingHandler(HttpMessageHandler innerHandler)
- {
- if (innerHandler != null)
- {
- InnerHandler = innerHandler;
- }
- }
-
- protected override async Task SendAsync(HttpRequestMessage request,
- CancellationToken cancellationToken)
- {
- var tracingContext = ServiceLocator.Current.GetInstance();
- var operationName = request.RequestUri.ToString();
- var networkAddress = $"{request.RequestUri.Host}:{request.RequestUri.Port}";
- var context = tracingContext.CreateExitSegmentContext(operationName, networkAddress,
- new CarrierHeaderCollection(request.Headers));
- try
- {
- HttpResponseMessage response;
-
- context.Span.SpanLayer = SpanLayer.HTTP;
- context.Span.Component = Common.Components.HTTPCLIENT;
- context.Span.AddTag(Common.Tags.URL, request.RequestUri.ToString());
- context.Span.AddTag(Common.Tags.PATH, request.RequestUri.PathAndQuery);
- context.Span.AddTag(Common.Tags.HTTP_METHOD, request.Method.ToString());
-
- // With ConfigureAwait on next await call, current HttpContext will not be available for the rest of the method.
- // Because HttpContext is needed when we are using tracing context accessors, it must be stored in local variable.
- var currentHttpContext = System.Web.HttpContext.Current;
-
- // Prevents deadlock for synchronous calls to HttpClient methods.
- // More here: C#: Why you should use ConfigureAwait(false) in your library code
- // https://medium.com/bynder-tech/c-why-you-should-use-configureawait-false-in-your-library-code-d7837dce3d7f
- response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
-
- // Restoring HttpContext.
- System.Web.HttpContext.Current = currentHttpContext;
-
- var statusCode = (int)response.StatusCode;
- if (statusCode >= 400)
- {
- context.Span.ErrorOccurred();
- }
-
- context.Span.AddTag(Common.Tags.STATUS_CODE, statusCode);
- return response;
- }
- catch (Exception exception)
- {
- context.Span.ErrorOccurred(exception);
- throw;
- }
- finally
- {
- tracingContext.Release(context);
- }
- }
-
- private class CarrierHeaderCollection : ICarrierHeaderCollection
- {
- private readonly HttpRequestHeaders _headers;
-
- public CarrierHeaderCollection(HttpRequestHeaders headers)
- {
- _headers = headers;
- }
-
- public void Add(string key, string value)
- {
- _headers.Add(key, value);
- }
-
- public IEnumerator> GetEnumerator()
- {
- throw new NotImplementedException();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/SkyApm.Agent.AspNet/InstrumentModule.cs b/src/SkyApm.Agent.AspNet/InstrumentModule.cs
deleted file mode 100644
index ff7670f8..00000000
--- a/src/SkyApm.Agent.AspNet/InstrumentModule.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using CommonServiceLocator;
-using Microsoft.Extensions.DependencyInjection;
-using System.Web;
-using SkyApm.Agent.AspNet.Extensions;
-
-namespace SkyApm.Agent.AspNet
-{
- public class InstrumentModule : IHttpModule
- {
- public InstrumentModule()
- {
- var services = new ServiceCollection();
- services.AddSkyAPMCore();
- InstrumentModuleFactory.ServicesBuilder?.Invoke(services);
- var serviceProvider = services.BuildServiceProvider();
- var serviceLocatorProvider = new ServiceProviderLocator(serviceProvider);
- ServiceLocator.SetLocatorProvider(() => serviceLocatorProvider);
- }
-
- public void Init(HttpApplication application)
- {
- var startup = ServiceLocator.Current.GetInstance();
- AsyncContext.Run(() => startup.StartAsync());
- var requestCallback = ServiceLocator.Current.GetInstance();
- application.BeginRequest += requestCallback.ApplicationOnBeginRequest;
- application.EndRequest += requestCallback.ApplicationOnEndRequest;
- }
-
- public void Dispose()
- {
- var startup = ServiceLocator.Current.GetInstance();
- AsyncContext.Run(() => startup.StopAsync());
- }
- }
-}
\ No newline at end of file
diff --git a/src/SkyApm.Agent.AspNet/InstrumentModuleFactory.cs b/src/SkyApm.Agent.AspNet/InstrumentModuleFactory.cs
deleted file mode 100644
index 3b9d2b2e..00000000
--- a/src/SkyApm.Agent.AspNet/InstrumentModuleFactory.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using Microsoft.Web.Infrastructure.DynamicModuleHelper;
-using System.Web;
-using SkyApm.Agent.AspNet;
-using System;
-using Microsoft.Extensions.DependencyInjection;
-
-[assembly:PreApplicationStartMethod(typeof(InstrumentModuleFactory), nameof(InstrumentModuleFactory.Create))]
-
-namespace SkyApm.Agent.AspNet
-{
- public class InstrumentModuleFactory
- {
- internal static Action ServicesBuilder { get; private set; }
-
- public static void Create()
- {
- DynamicModuleUtility.RegisterModule(typeof(InstrumentModule));
- }
-
- ///
- /// Entrance to register or override services
- ///
- ///
- public static void ConfigServices(Action servicesBuilder)
- {
- ServicesBuilder = servicesBuilder;
- }
- }
-}
\ No newline at end of file
diff --git a/src/SkyApm.Agent.AspNet/InstrumentRequestCallback.cs b/src/SkyApm.Agent.AspNet/InstrumentRequestCallback.cs
deleted file mode 100644
index 0bf3d911..00000000
--- a/src/SkyApm.Agent.AspNet/InstrumentRequestCallback.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System;
-using System.Web;
-using SkyApm.Common;
-using SkyApm.Config;
-using SkyApm.Tracing;
-using SkyApm.Tracing.Segments;
-using SpanLayer = SkyApm.Tracing.Segments.SpanLayer;
-
-namespace SkyApm.Agent.AspNet
-{
- internal class InstrumentRequestCallback
- {
- private readonly InstrumentConfig _config;
- private readonly ITracingContext _tracingContext;
- private readonly IEntrySegmentContextAccessor _contextAccessor;
- private readonly TracingConfig _tracingConfig;
-
- public InstrumentRequestCallback(IConfigAccessor configAccessor, ITracingContext tracingContext,
- IEntrySegmentContextAccessor contextAccessor)
- {
- _config = configAccessor.Get();
- _tracingConfig = configAccessor.Get();
- _tracingContext = tracingContext;
- _contextAccessor = contextAccessor;
- }
-
- public void ApplicationOnBeginRequest(object sender, EventArgs e)
- {
- var httpApplication = sender as HttpApplication;
- var httpContext = httpApplication.Context;
-
- if (httpContext.Request.HttpMethod == "OPTIONS")
- {
- //asp.net Exclude OPTIONS request
- return;
- }
- var context = _tracingContext.CreateEntrySegmentContext(httpContext.Request.Path,
- new HttpRequestCarrierHeaderCollection(httpContext.Request));
- context.Span.SpanLayer = SpanLayer.HTTP;
- context.Span.Peer = new StringOrIntValue(httpContext.Request.UserHostAddress);
- context.Span.Component = Common.Components.ASPNET;
- context.Span.AddTag(Tags.URL, httpContext.Request.Url.OriginalString);
- context.Span.AddTag(Tags.PATH, httpContext.Request.Path);
- context.Span.AddTag(Tags.HTTP_METHOD, httpContext.Request.HttpMethod);
- context.Span.AddLog(LogEvent.Event("AspNet BeginRequest"),
- LogEvent.Message(
- $"Request starting {httpContext.Request.Url.Scheme} {httpContext.Request.HttpMethod} {httpContext.Request.Url.OriginalString}"));
- }
-
- public void ApplicationOnEndRequest(object sender, EventArgs e)
- {
- var context = _contextAccessor.Context;
- if (context == null)
- {
- return;
- }
-
- var httpApplication = sender as HttpApplication;
- var httpContext = httpApplication.Context;
- if (httpContext.Request.HttpMethod == "OPTIONS")
- {
- //asp.net Exclude OPTIONS request
- return;
- }
-
- var statusCode = httpContext.Response.StatusCode;
- if (statusCode >= 400)
- {
- context.Span.ErrorOccurred();
- }
-
- var exception = httpContext.Error;
- if (exception != null)
- {
- context.Span.ErrorOccurred(exception, _tracingConfig);
- }
-
- context.Span.AddLog(LogEvent.Event("AspNet EndRequest"),
- LogEvent.Message(
- $"Request finished {httpContext.Response.StatusCode} {httpContext.Response.ContentType}"));
-
- _tracingContext.Release(context);
- }
- }
-}
\ No newline at end of file
diff --git a/src/SkyApm.Agent.AspNet/ServiceProviderLocator.cs b/src/SkyApm.Agent.AspNet/ServiceProviderLocator.cs
deleted file mode 100644
index 827f86aa..00000000
--- a/src/SkyApm.Agent.AspNet/ServiceProviderLocator.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the SkyAPM under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The SkyAPM licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using CommonServiceLocator;
-using System;
-using System.Collections.Generic;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace SkyApm.Agent.AspNet
-{
- internal class ServiceProviderLocator : IServiceLocator
- {
- private readonly IServiceProvider _serviceProvider;
-
- public ServiceProviderLocator(IServiceProvider serviceProvider)
- {
- _serviceProvider = serviceProvider;
- }
-
- public object GetService(Type serviceType) => _serviceProvider.GetService(serviceType);
-
- public object GetInstance(Type serviceType) => _serviceProvider.GetService(serviceType);
-
- public object GetInstance(Type serviceType, string key) => GetInstance(serviceType);
-
- public IEnumerable
\ No newline at end of file
diff --git a/src/SkyApm.Diagnostics.CAP/SkyApm.Diagnostics.CAP.csproj b/src/SkyApm.Diagnostics.CAP/SkyApm.Diagnostics.CAP.csproj
index 3a244d3a..30c10f36 100644
--- a/src/SkyApm.Diagnostics.CAP/SkyApm.Diagnostics.CAP.csproj
+++ b/src/SkyApm.Diagnostics.CAP/SkyApm.Diagnostics.CAP.csproj
@@ -3,7 +3,7 @@
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql.csproj b/src/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql.csproj
index b48f98e3..af6da8b7 100644
--- a/src/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql.csproj
+++ b/src/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Diagnostics.EntityFrameworkCore.Npgsql
diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj b/src/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj
index 58868360..3ae02bea 100644
--- a/src/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj
+++ b/src/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Diagnostics.EntityFrameworkCore.Pomelo.MySql
diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite.csproj b/src/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite.csproj
index 3605d409..127aefbb 100644
--- a/src/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite.csproj
+++ b/src/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Diagnostics.EntityFrameworkCore.Sqlite
diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore/SkyApm.Diagnostics.EntityFrameworkCore.csproj b/src/SkyApm.Diagnostics.EntityFrameworkCore/SkyApm.Diagnostics.EntityFrameworkCore.csproj
index 817a0f6f..a710f04d 100644
--- a/src/SkyApm.Diagnostics.EntityFrameworkCore/SkyApm.Diagnostics.EntityFrameworkCore.csproj
+++ b/src/SkyApm.Diagnostics.EntityFrameworkCore/SkyApm.Diagnostics.EntityFrameworkCore.csproj
@@ -1,23 +1,31 @@
-
-
- netstandard2.0
-
-
- $(PackagePrefix).Diagnostics.EntityFrameworkCore
- $(PackagePrefix).Diagnostics.EntityFrameworkCore
- $(PackagePrefix).Diagnostics.EntityFrameworkCore
- $(PackagePrefix);APM;EntityFrameworkCore;EF
- SkyApm.Diagnostics.EntityFrameworkCore notifies of EF requests.
- SkyApm.Diagnostics.EntityFrameworkCore
-
-
-
-
-
-
-
-
-
-
+
+
+ netcoreapp3.1;net5.0;net6.0
+
+
+ $(PackagePrefix).Diagnostics.EntityFrameworkCore
+ $(PackagePrefix).Diagnostics.EntityFrameworkCore
+ $(PackagePrefix).Diagnostics.EntityFrameworkCore
+ $(PackagePrefix);APM;EntityFrameworkCore;EF
+ SkyApm.Diagnostics.EntityFrameworkCore notifies of EF requests.
+ SkyApm.Diagnostics.EntityFrameworkCore
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/SkyApm.Diagnostics.Grpc.Net.Client/SkyApm.Diagnostics.Grpc.Net.Client.csproj b/src/SkyApm.Diagnostics.Grpc.Net.Client/SkyApm.Diagnostics.Grpc.Net.Client.csproj
index 7ac4a4e1..9d1d5b6c 100644
--- a/src/SkyApm.Diagnostics.Grpc.Net.Client/SkyApm.Diagnostics.Grpc.Net.Client.csproj
+++ b/src/SkyApm.Diagnostics.Grpc.Net.Client/SkyApm.Diagnostics.Grpc.Net.Client.csproj
@@ -1,16 +1,16 @@
-
- netstandard2.0
-
+
+ netcoreapp3.1;net5.0;net6.0
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/src/SkyApm.Diagnostics.Grpc/SkyApm.Diagnostics.Grpc.csproj b/src/SkyApm.Diagnostics.Grpc/SkyApm.Diagnostics.Grpc.csproj
index 565feda9..447dae22 100644
--- a/src/SkyApm.Diagnostics.Grpc/SkyApm.Diagnostics.Grpc.csproj
+++ b/src/SkyApm.Diagnostics.Grpc/SkyApm.Diagnostics.Grpc.csproj
@@ -1,8 +1,7 @@
- netstandard2.0
-
+ netcoreapp3.1;net5.0;net6.0
diff --git a/src/SkyApm.Diagnostics.HttpClient/SkyApm.Diagnostics.HttpClient.csproj b/src/SkyApm.Diagnostics.HttpClient/SkyApm.Diagnostics.HttpClient.csproj
index c36905b1..0fce5b03 100644
--- a/src/SkyApm.Diagnostics.HttpClient/SkyApm.Diagnostics.HttpClient.csproj
+++ b/src/SkyApm.Diagnostics.HttpClient/SkyApm.Diagnostics.HttpClient.csproj
@@ -5,7 +5,7 @@
$(PackagePrefix).Diagnostics.HttpClient notifies outgoing Http requests.
$(PackagePrefix).Diagnostics.HttpClient
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Diagnostics.HttpClient
$(PackagePrefix).Diagnostics.HttpClient
SkyWalking;APM;Diagnostics;HttpClient
diff --git a/src/SkyApm.Diagnostics.MongoDB/SkyApm.Diagnostics.MongoDB.csproj b/src/SkyApm.Diagnostics.MongoDB/SkyApm.Diagnostics.MongoDB.csproj
index 97a403bf..3cbf819f 100644
--- a/src/SkyApm.Diagnostics.MongoDB/SkyApm.Diagnostics.MongoDB.csproj
+++ b/src/SkyApm.Diagnostics.MongoDB/SkyApm.Diagnostics.MongoDB.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
diff --git a/src/SkyApm.Diagnostics.SmartSql/SkyApm.Diagnostics.SmartSql.csproj b/src/SkyApm.Diagnostics.SmartSql/SkyApm.Diagnostics.SmartSql.csproj
index a92db888..23bd1531 100644
--- a/src/SkyApm.Diagnostics.SmartSql/SkyApm.Diagnostics.SmartSql.csproj
+++ b/src/SkyApm.Diagnostics.SmartSql/SkyApm.Diagnostics.SmartSql.csproj
@@ -2,7 +2,7 @@
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Diagnostics.SmartSql
$(PackagePrefix).Diagnostics.SmartSql
$(PackagePrefix).Diagnostics.SmartSql
diff --git a/src/SkyApm.Diagnostics.SqlClient/SkyApm.Diagnostics.SqlClient.csproj b/src/SkyApm.Diagnostics.SqlClient/SkyApm.Diagnostics.SqlClient.csproj
index be294e5b..3db26757 100644
--- a/src/SkyApm.Diagnostics.SqlClient/SkyApm.Diagnostics.SqlClient.csproj
+++ b/src/SkyApm.Diagnostics.SqlClient/SkyApm.Diagnostics.SqlClient.csproj
@@ -3,7 +3,7 @@
$(PackagePrefix).Diagnostics.SqlClient notifies outgoing SqlClient requests.
$(PackagePrefix).Diagnostics.SqlClient
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Diagnostics.SqlClient
$(PackagePrefix).Diagnostics.SqlClient
SkyWalking;APM;Diagnostics;SqlClient
diff --git a/src/SkyApm.DotNet.CLI/SkyApm.DotNet.CLI.csproj b/src/SkyApm.DotNet.CLI/SkyApm.DotNet.CLI.csproj
index ec2d27d5..48e4ae2c 100644
--- a/src/SkyApm.DotNet.CLI/SkyApm.DotNet.CLI.csproj
+++ b/src/SkyApm.DotNet.CLI/SkyApm.DotNet.CLI.csproj
@@ -14,13 +14,24 @@
true
true
dotnet-skyapm
- netcoreapp3.1
+ netcoreapp3.1;net5.0;net6.0
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/SkyApm.Transport.Grpc.Protocol/SkyApm.Transport.Grpc.Protocol.csproj b/src/SkyApm.Transport.Grpc.Protocol/SkyApm.Transport.Grpc.Protocol.csproj
index 887f6598..0eec5564 100644
--- a/src/SkyApm.Transport.Grpc.Protocol/SkyApm.Transport.Grpc.Protocol.csproj
+++ b/src/SkyApm.Transport.Grpc.Protocol/SkyApm.Transport.Grpc.Protocol.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/src/SkyApm.Utilities.Configuration/SkyApm.Utilities.Configuration.csproj b/src/SkyApm.Utilities.Configuration/SkyApm.Utilities.Configuration.csproj
index 95c0cf5c..4609d997 100644
--- a/src/SkyApm.Utilities.Configuration/SkyApm.Utilities.Configuration.csproj
+++ b/src/SkyApm.Utilities.Configuration/SkyApm.Utilities.Configuration.csproj
@@ -1,10 +1,10 @@
-
+
$(Product) configuration extensions.
$(PackagePrefix).Utilities.Configuration
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Utilities.Configuration
$(PackagePrefix).Utilities.Configuration
SkyWalking;APM;Diagnostics
@@ -13,14 +13,25 @@
SkyApm.Utilities.Configuration
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
diff --git a/src/SkyApm.Utilities.DependencyInjection/SkyApm.Utilities.DependencyInjection.csproj b/src/SkyApm.Utilities.DependencyInjection/SkyApm.Utilities.DependencyInjection.csproj
index 39bf2a8e..d05aef52 100644
--- a/src/SkyApm.Utilities.DependencyInjection/SkyApm.Utilities.DependencyInjection.csproj
+++ b/src/SkyApm.Utilities.DependencyInjection/SkyApm.Utilities.DependencyInjection.csproj
@@ -3,7 +3,7 @@
Microsoft.Utilities.DependencyInjection (IServiceCollection) support for $(Product).
$(PackagePrefix).Utilities.DependencyInjection
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Utilities.DependencyInjection
$(PackagePrefix).Utilities.DependencyInjection
SkyWalking;APM;Diagnostics
@@ -14,7 +14,13 @@
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/SkyApm.Utilities.Logging/SkyApm.Utilities.Logging.csproj b/src/SkyApm.Utilities.Logging/SkyApm.Utilities.Logging.csproj
index 287378a8..eddb8c2b 100644
--- a/src/SkyApm.Utilities.Logging/SkyApm.Utilities.Logging.csproj
+++ b/src/SkyApm.Utilities.Logging/SkyApm.Utilities.Logging.csproj
@@ -4,7 +4,7 @@
Microsoft.Utilities.Logging support for $(Product).
$(PackagePrefix).Utilities.Logging
- netstandard2.0
+ netcoreapp3.1;net5.0;net6.0
$(PackagePrefix).Utilities.Logging
$(PackagePrefix).Utilities.Logging
SkyWalking;APM;Diagnostics
@@ -14,11 +14,18 @@
-
-
+
+
+
+
+
+
+
+
+
diff --git a/test/SkyApm.Core.Tests/SkyApm.Core.Tests.csproj b/test/SkyApm.Core.Tests/SkyApm.Core.Tests.csproj
index 899d16f2..3cefe65e 100644
--- a/test/SkyApm.Core.Tests/SkyApm.Core.Tests.csproj
+++ b/test/SkyApm.Core.Tests/SkyApm.Core.Tests.csproj
@@ -1,7 +1,7 @@
- netcoreapp2.0;netcoreapp2.1
+ netcoreapp3.1;net5.0;net6.0
false