Browse Source

Merge pull request #1156 from colinin/distributed-tracking

Distributed tracking
pull/1162/head
yx lin 10 months ago
committed by GitHub
parent
commit
41bfbc625d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      Directory.Packages.props
  2. 38
      aspnet-core/LINGYUN.MicroService.All.sln
  3. 7
      aspnet-core/LINGYUN.MicroService.TaskManagement.sln
  4. 10
      aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln
  5. 7
      aspnet-core/LINGYUN.MicroService.WechatManagement.sln
  6. 7
      aspnet-core/LINGYUN.MicroService.Workflow.sln
  7. 3
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.APM/FodyWeavers.xml
  8. 24
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.APM/LINGYUN.Abp.Telemetry.APM.csproj
  9. 12
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.APM/LINGYUNG/Abp/Telemetry/APM/AbpTelemetryAPMModule.cs
  10. 3
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/FodyWeavers.xml
  11. 30
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/FodyWeavers.xsd
  12. 32
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/LINGYUN.Abp.Telemetry.OpenTelemetry.csproj
  13. 106
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/LINGYUN/Abp/Telemetry/OpenTelemetry/AbpTelemetryOpenTelemetryModule.cs
  14. 3
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/FodyWeavers.xml
  15. 30
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/FodyWeavers.xsd
  16. 26
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/LINGYUN.Abp.Telemetry.SkyWalking.csproj
  17. 44
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/LINGYUN/Abp/Telemetry/SkyWalking/AbpTelemetrySkyWalkingModule.cs
  18. 14
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/LINGYUN/Abp/Telemetry/SkyWalking/Hosting/HostingEnvironmentProvider.cs
  19. 26
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/LINGYUN/Abp/Telemetry/SkyWalking/Hosting/InstrumentationHostedService.cs
  20. 118
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/Microsoft/Extensions/DependencyInjection/SkyWalkingServiceCollectionExtensions.cs
  21. 53
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/README.md
  22. 71
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.Configure.cs
  23. 9
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.cs
  24. 10
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj
  25. 3
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/appsettings.json
  26. 123
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs
  27. 8
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs
  28. 10
      aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj
  29. 3
      aspnet-core/services/LY.MicroService.AuthServer/appsettings.json
  30. BIN
      aspnet-core/services/LY.MicroService.AuthServer/openiddict.pfx
  31. 50
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.Configure.cs
  32. 4
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.cs
  33. 12
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/LY.MicroService.BackendAdmin.HttpApi.Host.csproj
  34. 3
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/appsettings.json
  35. 50
      aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/IdentityServerHttpApiHostModule.Configure.cs
  36. 5
      aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs
  37. 9
      aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/LY.MicroService.identityServer.HttpApi.Host.csproj
  38. 3
      aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/appsettings.json
  39. 50
      aspnet-core/services/LY.MicroService.IdentityServer/IdentityServerModule.Configure.cs
  40. 3
      aspnet-core/services/LY.MicroService.IdentityServer/IdentityServerModule.cs
  41. 9
      aspnet-core/services/LY.MicroService.IdentityServer/LY.MicroService.IdentityServer.csproj
  42. 3
      aspnet-core/services/LY.MicroService.IdentityServer/appsettings.json
  43. 9
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj
  44. 51
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.Configure.cs
  45. 3
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs
  46. 3
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json
  47. 10
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj
  48. 84
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.Configure.cs
  49. 9
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs
  50. 3
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json
  51. 9
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj
  52. 50
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.Configure.cs
  53. 3
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs
  54. 3
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json
  55. 9
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/LY.MicroService.TaskManagement.HttpApi.Host.csproj
  56. 50
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs
  57. 3
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.cs
  58. 3
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/appsettings.json
  59. 9
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/LY.MicroService.WebhooksManagement.HttpApi.Host.csproj
  60. 50
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.Configure.cs
  61. 3
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.cs
  62. 3
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/appsettings.json
  63. 9
      aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/LY.MicroService.WechatManagement.HttpApi.Host.csproj
  64. 50
      aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/WechatManagementHttpApiHostModule.Configure.cs
  65. 3
      aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/WechatManagementHttpApiHostModule.cs
  66. 3
      aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/appsettings.json
  67. 13
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj
  68. 51
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.Configure.cs
  69. 4
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs
  70. 3
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json

12
Directory.Packages.props

@ -248,11 +248,20 @@
<PackageVersion Include="ConfigureAwait.Fody" Version="3.3.2" />
<PackageVersion Include="Fody" Version="6.8.0" />
</ItemGroup>
<!-- DataBase -->
<ItemGroup>
<PackageVersion Include="MySqlConnector" Version="2.3.5" />
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="23.6.1" />
<PackageVersion Include="Npgsql" Version="9.0.2" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.6" />
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="9.0.0" />
</ItemGroup>
<!-- Other -->
<ItemGroup>
<PackageVersion Include="aliyun-net-sdk-core" Version="1.5.10" />
<PackageVersion Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
<PackageVersion Include="AgileConfig.Client" Version="1.6.9" />
<PackageVersion Include="Elastic.Apm.NetCoreAll" Version="1.31.0" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.5.0" />
<PackageVersion Include="Dapr.Client" Version="1.14.0" />
<PackageVersion Include="Dapr.Actors" Version="1.14.0" />
@ -287,6 +296,9 @@
<PackageVersion Include="RulesEngine" Version="5.0.5" />
<PackageVersion Include="Scriban" Version="5.10.0" />
<PackageVersion Include="Senparc.Weixin.MP" Version="16.18.9" />
<PackageVersion Include="SkyApm.Agent.Hosting" Version="2.2.0" />
<PackageVersion Include="SkyApm.Diagnostics.AspNetCore" Version="2.2.0" />
<PackageVersion Include="SkyAPM.Diagnostics.CAP" Version="2.2.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.16" />

38
aspnet-core/LINGYUN.MicroService.All.sln

@ -817,6 +817,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Auditing.HttpAp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Work.AspNetCore", "framework\wechat\LINGYUN.Abp.WeChat.Work.AspNetCore\LINGYUN.Abp.WeChat.Work.AspNetCore.csproj", "{A54344EB-05A7-A405-5368-4A9C0A60B078}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Identity.QrCode", "modules\identity\LINGYUN.Abp.Identity.QrCode\LINGYUN.Abp.Identity.QrCode.csproj", "{7A8A4C74-4B5F-F352-7AC3-54F54AFC3FD6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Identity.AspNetCore.QrCode", "modules\identity\LINGYUN.Abp.Identity.AspNetCore.QrCode\LINGYUN.Abp.Identity.AspNetCore.QrCode.csproj", "{C9266D5D-3860-09C3-F566-489BBB57A534}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tracking", "tracking", "{21542881-C560-4CBB-8AB1-CF757071A057}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Telemetry.APM", "framework\telemetry\LINGYUN.Abp.Telemetry.APM\LINGYUN.Abp.Telemetry.APM.csproj", "{F3DF1C3E-7319-48B1-81AB-0284853BB567}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Telemetry.OpenTelemetry", "framework\telemetry\LINGYUN.Abp.Telemetry.OpenTelemetry\LINGYUN.Abp.Telemetry.OpenTelemetry.csproj", "{7D7561CB-5059-4F5F-B736-B97195B46A91}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Telemetry.SkyWalking", "framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj", "{5B9CA129-16CE-4BEF-B22D-C084B38B4EDA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -2111,6 +2123,26 @@ Global
{A54344EB-05A7-A405-5368-4A9C0A60B078}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A54344EB-05A7-A405-5368-4A9C0A60B078}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A54344EB-05A7-A405-5368-4A9C0A60B078}.Release|Any CPU.Build.0 = Release|Any CPU
{7A8A4C74-4B5F-F352-7AC3-54F54AFC3FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A8A4C74-4B5F-F352-7AC3-54F54AFC3FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A8A4C74-4B5F-F352-7AC3-54F54AFC3FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A8A4C74-4B5F-F352-7AC3-54F54AFC3FD6}.Release|Any CPU.Build.0 = Release|Any CPU
{C9266D5D-3860-09C3-F566-489BBB57A534}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9266D5D-3860-09C3-F566-489BBB57A534}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9266D5D-3860-09C3-F566-489BBB57A534}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9266D5D-3860-09C3-F566-489BBB57A534}.Release|Any CPU.Build.0 = Release|Any CPU
{F3DF1C3E-7319-48B1-81AB-0284853BB567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3DF1C3E-7319-48B1-81AB-0284853BB567}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3DF1C3E-7319-48B1-81AB-0284853BB567}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3DF1C3E-7319-48B1-81AB-0284853BB567}.Release|Any CPU.Build.0 = Release|Any CPU
{7D7561CB-5059-4F5F-B736-B97195B46A91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D7561CB-5059-4F5F-B736-B97195B46A91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D7561CB-5059-4F5F-B736-B97195B46A91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D7561CB-5059-4F5F-B736-B97195B46A91}.Release|Any CPU.Build.0 = Release|Any CPU
{5B9CA129-16CE-4BEF-B22D-C084B38B4EDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B9CA129-16CE-4BEF-B22D-C084B38B4EDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B9CA129-16CE-4BEF-B22D-C084B38B4EDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B9CA129-16CE-4BEF-B22D-C084B38B4EDA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -2507,6 +2539,12 @@ Global
{B7B63E08-8F62-34F6-FEA5-063267F1FC85} = {A4633711-7FB6-411A-8D08-BB9A0A778046}
{7C48C1CA-7E53-4261-A477-454DD3A8402C} = {67DAB2A0-D407-4CAB-8414-AE3D0AC52FC4}
{A54344EB-05A7-A405-5368-4A9C0A60B078} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21}
{7A8A4C74-4B5F-F352-7AC3-54F54AFC3FD6} = {52B5D4F7-237B-4E0A-A167-68442164F70A}
{C9266D5D-3860-09C3-F566-489BBB57A534} = {52B5D4F7-237B-4E0A-A167-68442164F70A}
{21542881-C560-4CBB-8AB1-CF757071A057} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{F3DF1C3E-7319-48B1-81AB-0284853BB567} = {21542881-C560-4CBB-8AB1-CF757071A057}
{7D7561CB-5059-4F5F-B736-B97195B46A91} = {21542881-C560-4CBB-8AB1-CF757071A057}
{5B9CA129-16CE-4BEF-B22D-C084B38B4EDA} = {21542881-C560-4CBB-8AB1-CF757071A057}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

7
aspnet-core/LINGYUN.MicroService.TaskManagement.sln

@ -168,6 +168,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Emailing.Platfo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Sms.Platform", "modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj", "{8298C4A6-5275-D7A2-9A5C-99B5F2D0E7A0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Telemetry.SkyWalking", "framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj", "{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -430,6 +432,10 @@ Global
{8298C4A6-5275-D7A2-9A5C-99B5F2D0E7A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8298C4A6-5275-D7A2-9A5C-99B5F2D0E7A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8298C4A6-5275-D7A2-9A5C-99B5F2D0E7A0}.Release|Any CPU.Build.0 = Release|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -499,6 +505,7 @@ Global
{0EA7605E-3364-6EDC-3AC1-F21A9A984B9B} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{8BAB6A91-865C-A599-BE2A-7C487129D83A} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{8298C4A6-5275-D7A2-9A5C-99B5F2D0E7A0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE} = {5A41C31A-B966-418B-B446-5BA1D7E61A62}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E1FD1F4C-D344-408B-97CF-B6F1F6D7D293}

10
aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln

@ -163,6 +163,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Sms.Platform",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Emailing.Platform", "modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj", "{8BAB6A91-865C-A599-BE2A-7C487129D83A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Telemetry.SkyWalking", "framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj", "{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "telemetry", "telemetry", "{CE07B9F4-54E8-4E74-BE14-8E5C1FB7AFC8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -421,6 +425,10 @@ Global
{8BAB6A91-865C-A599-BE2A-7C487129D83A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BAB6A91-865C-A599-BE2A-7C487129D83A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BAB6A91-865C-A599-BE2A-7C487129D83A}.Release|Any CPU.Build.0 = Release|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -502,6 +510,8 @@ Global
{0EA7605E-3364-6EDC-3AC1-F21A9A984B9B} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{8298C4A6-5275-D7A2-9A5C-99B5F2D0E7A0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{8BAB6A91-865C-A599-BE2A-7C487129D83A} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE} = {CE07B9F4-54E8-4E74-BE14-8E5C1FB7AFC8}
{CE07B9F4-54E8-4E74-BE14-8E5C1FB7AFC8} = {03B4B0AA-83CE-4E4B-9CE2-47369BF88B97}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {80ED12A5-C899-459F-A181-ADCC9D680DE5}

7
aspnet-core/LINGYUN.MicroService.WechatManagement.sln

@ -109,6 +109,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.LocalizationMan
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session", "modules\identity\LINGYUN.Abp.Identity.Session\LINGYUN.Abp.Identity.Session.csproj", "{80EBBECC-EF11-4E5E-91DA-EEECED832F21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Telemetry.SkyWalking", "framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj", "{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -275,6 +277,10 @@ Global
{80EBBECC-EF11-4E5E-91DA-EEECED832F21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80EBBECC-EF11-4E5E-91DA-EEECED832F21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80EBBECC-EF11-4E5E-91DA-EEECED832F21}.Release|Any CPU.Build.0 = Release|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -330,6 +336,7 @@ Global
{37454EB7-9CE9-4250-92E4-7316F16B5328} = {52701ECE-3EBD-45EC-AD2C-0AAB15322311}
{CC8DDC8C-CC0C-4534-8D9F-2C345E065869} = {52701ECE-3EBD-45EC-AD2C-0AAB15322311}
{80EBBECC-EF11-4E5E-91DA-EEECED832F21} = {73ED64BB-7C39-42EA-B821-3DD697B9C36A}
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE} = {FFACB4F0-33E0-4F8B-A97E-8FFFA10C12E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EC9D01C1-EA3C-48C7-A279-4D35C8AD312E}

7
aspnet-core/LINGYUN.MicroService.Workflow.sln

@ -187,6 +187,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.x", "3.x", "{9CD04B74-AA1
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.WorkflowManagement.Next.HttpApi.Host", "services\LY.MicroService.WorkflowManagement.Next.HttpApi.Host\LY.MicroService.WorkflowManagement.Next.HttpApi.Host.csproj", "{09CDA563-DE16-41F6-B61C-56102E7D9B2E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Telemetry.SkyWalking", "framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj", "{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -489,6 +491,10 @@ Global
{09CDA563-DE16-41F6-B61C-56102E7D9B2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09CDA563-DE16-41F6-B61C-56102E7D9B2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09CDA563-DE16-41F6-B61C-56102E7D9B2E}.Release|Any CPU.Build.0 = Release|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -574,6 +580,7 @@ Global
{55400168-8E20-4D10-A3F0-FC591271E71F} = {6CB521FC-AC40-49A6-B9A5-91399CAA59AB}
{9CD04B74-AA10-4253-BEEC-4837D48AD3EB} = {6CB521FC-AC40-49A6-B9A5-91399CAA59AB}
{09CDA563-DE16-41F6-B61C-56102E7D9B2E} = {9CD04B74-AA10-4253-BEEC-4837D48AD3EB}
{7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F}

3
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.APM/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

24
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.APM/LINGYUN.Abp.Telemetry.APM.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.Telemetry.APM</AssemblyName>
<PackageId>LINGYUN.Abp.Telemetry.APM</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Elastic.Apm.NetCoreAll" />
</ItemGroup>
</Project>

12
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.APM/LINGYUNG/Abp/Telemetry/APM/AbpTelemetryAPMModule.cs

@ -0,0 +1,12 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Telemetry.APM;
public class AbpTelemetryAPMModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAllElasticApm();
}
}

3
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

32
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/LINGYUN.Abp.Telemetry.OpenTelemetry.csproj

@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.Telemetry.OpenTelemetry</AssemblyName>
<PackageId>LINGYUN.Abp.Telemetry.OpenTelemetry</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.Console" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
</ItemGroup>
</Project>

106
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/LINGYUN/Abp/Telemetry/OpenTelemetry/AbpTelemetryOpenTelemetryModule.cs

@ -0,0 +1,106 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using System;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Telemetry.OpenTelemetry;
public class AbpTelemetryOpenTelemetryModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
var applicationName = context.Services.GetApplicationName();
var openTelmetrySetup = context.Services.GetPreConfigureActions<OpenTelemetryBuilder>();
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
var openTelmetryBuilder = context.Services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(applicationName);
})
.WithTracing(tracing =>
{
tracing.AddSource(applicationName);
ConfigureTracing(tracing, configuration);
})
.WithMetrics(metrics =>
{
ConfigureMetrics(metrics, configuration);
});
openTelmetrySetup.Configure(openTelmetryBuilder);
}
}
private static void ConfigureTracing(TracerProviderBuilder tracing, IConfiguration configuration)
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation(efcore =>
{
efcore.SetDbStatementForText = configuration.GetValue(
"OpenTelemetry:EntityFrameworkCore:SetDbStatementForText",
efcore.SetDbStatementForText);
efcore.SetDbStatementForStoredProcedure = configuration.GetValue(
"OpenTelemetry:EntityFrameworkCore:SetDbStatementForStoredProcedure",
efcore.SetDbStatementForStoredProcedure);
});
if (configuration.GetValue("OpenTelemetry:Console:IsEnabled", false))
{
tracing.AddConsoleExporter();
}
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
}
private static void ConfigureMetrics(MeterProviderBuilder metrics, IConfiguration configuration)
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
if (configuration.GetValue("OpenTelemetry:Console:IsEnabled", false))
{
metrics.AddConsoleExporter();
}
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
metrics.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
}
}

3
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

26
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/LINGYUN.Abp.Telemetry.SkyWalking.csproj

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.Telemetry.SkyWalking</AssemblyName>
<PackageId>LINGYUN.Abp.Telemetry.SkyWalking</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SkyAPM.Agent.Hosting" />
<PackageReference Include="SkyAPM.Diagnostics.AspNetCore" />
<PackageReference Include="SkyAPM.Diagnostics.CAP" />
</ItemGroup>
</Project>

44
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/LINGYUN/Abp/Telemetry/SkyWalking/AbpTelemetrySkyWalkingModule.cs

@ -0,0 +1,44 @@
using Microsoft.Extensions.DependencyInjection;
using SkyApm.AspNetCore.Diagnostics;
using SkyApm.Diagnostics.CAP;
using SkyApm.Utilities.DependencyInjection;
using System;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Telemetry.SkyWalking;
public class AbpTelemetrySkyWalkingModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
var isSkywalkingEnabled = configuration["SkyWalking:Enable"];
if (isSkywalkingEnabled.IsNullOrWhiteSpace() || "false".Equals(isSkywalkingEnabled.ToLower()))
{
return;
}
var applicationName = configuration["SkyWalking:ServiceName"];
if (applicationName.IsNullOrWhiteSpace())
{
applicationName = context.Services.GetApplicationName();
}
if (applicationName.IsNullOrWhiteSpace())
{
return;
}
Environment.SetEnvironmentVariable("SKYWALKING__SERVICENAME", applicationName);
var skywalkingSetup = context.Services.GetPreConfigureActions<SkyApmExtensions>();
context.Services.AddSkyWalking(setup =>
{
setup.AddAspNetCoreHosting();
setup.AddCap();
skywalkingSetup.Configure(setup);
});
}
}

14
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/LINGYUN/Abp/Telemetry/SkyWalking/Hosting/HostingEnvironmentProvider.cs

@ -0,0 +1,14 @@
using Microsoft.Extensions.Hosting;
using SkyApm;
namespace LINGYUN.Abp.Telemetry.SkyWalking.Hosting;
internal class HostingEnvironmentProvider : IEnvironmentProvider
{
public string EnvironmentName { get; }
public HostingEnvironmentProvider(IHostEnvironment hostingEnvironment)
{
EnvironmentName = hostingEnvironment.EnvironmentName;
}
}

26
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/LINGYUN/Abp/Telemetry/SkyWalking/Hosting/InstrumentationHostedService.cs

@ -0,0 +1,26 @@
using Microsoft.Extensions.Hosting;
using SkyApm;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.Telemetry.SkyWalking.Hosting;
internal class InstrumentationHostedService : IHostedService
{
private readonly IInstrumentStartup _startup;
public InstrumentationHostedService(IInstrumentStartup startup)
{
_startup = startup;
}
public Task StartAsync(CancellationToken cancellationToken)
{
return _startup.StartAsync(cancellationToken);
}
public Task StopAsync(CancellationToken cancellationToken)
{
return _startup.StopAsync(cancellationToken);
}
}

118
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/Microsoft/Extensions/DependencyInjection/SkyWalkingServiceCollectionExtensions.cs

@ -0,0 +1,118 @@
using LINGYUN.Abp.Telemetry.SkyWalking.Hosting;
using Microsoft.Extensions.Hosting;
using SkyApm;
using SkyApm.Config;
using SkyApm.Diagnostics;
using SkyApm.Diagnostics.EntityFrameworkCore;
using SkyApm.Diagnostics.Grpc;
using SkyApm.Diagnostics.Grpc.Net.Client;
using SkyApm.Diagnostics.HttpClient;
using SkyApm.Diagnostics.MSLogging;
using SkyApm.Diagnostics.SqlClient;
using SkyApm.Logging;
using SkyApm.PeerFormatters.MySqlConnector;
using SkyApm.PeerFormatters.SqlClient;
using SkyApm.Sampling;
using SkyApm.Service;
using SkyApm.Tracing;
using SkyApm.Transport;
using SkyApm.Transport.Grpc;
using SkyApm.Utilities.Configuration;
using SkyApm.Utilities.DependencyInjection;
using SkyApm.Utilities.Logging;
using System;
using Volo.Abp;
namespace Microsoft.Extensions.DependencyInjection;
internal static class SkyWalkingServiceCollectionExtensions
{
public static IServiceCollection AddSkyWalking(this IServiceCollection services, Action<SkyApmExtensions> extensionsSetup = null)
{
Check.NotNull(extensionsSetup, nameof(extensionsSetup));
services.AddSingleton<ISegmentDispatcher, AsyncQueueSegmentDispatcher>();
services.AddSingleton<IExecutionService, RegisterService>();
services.AddSingleton<IExecutionService, LogReportService>();
services.AddSingleton<IExecutionService, PingService>();
services.AddSingleton<IExecutionService, SegmentReportService>();
services.AddSingleton<IExecutionService, CLRStatsService>();
services.AddSingleton<IInstrumentStartup, InstrumentStartup>();
services.AddSingleton(RuntimeEnvironment.Instance);
services.AddSingleton<TracingDiagnosticProcessorObserver>();
services.AddSingleton<IConfigAccessor, ConfigAccessor>();
services.AddSingleton<IConfigurationFactory, ConfigurationFactory>();
services.AddSingleton<IHostedService, InstrumentationHostedService>();
services.AddSingleton<IEnvironmentProvider, HostingEnvironmentProvider>();
services.AddSingleton<ISkyApmLogDispatcher, AsyncQueueSkyApmLogDispatcher>();
services.AddSingleton<IPeerFormatter, PeerFormatter>();
services.AddTracing()
.AddSampling()
.AddGrpcTransport()
.AddSkyApmLogging();
var skyWalking = services
.AddSkyApmExtensions()
.AddHttpClient()
.AddGrpcClient()
.AddSqlClient()
.AddGrpc()
.AddEntityFrameworkCore(delegate (DatabaseProviderBuilder c)
{
c.AddPomeloMysql().AddNpgsql().AddSqlite();
})
.AddMSLogging()
.AddSqlClientPeerFormatter()
.AddMySqlConnectorPeerFormatter();
extensionsSetup?.Invoke(skyWalking);
return services;
}
private static IServiceCollection AddTracing(this IServiceCollection services)
{
services.AddSingleton<ITracingContext, TracingContext>();
services.AddSingleton<ICarrierPropagator, CarrierPropagator>();
services.AddSingleton<ICarrierFormatter, Sw8CarrierFormatter>();
services.AddSingleton<ISegmentContextFactory, SegmentContextFactory>();
services.AddSingleton<IEntrySegmentContextAccessor, EntrySegmentContextAccessor>();
services.AddSingleton<ILocalSegmentContextAccessor, LocalSegmentContextAccessor>();
services.AddSingleton<IExitSegmentContextAccessor, ExitSegmentContextAccessor>();
services.AddSingleton<ISegmentContextAccessor, SegmentContextAccessor>();
services.AddSingleton<ISamplerChainBuilder, SamplerChainBuilder>();
services.AddSingleton<IUniqueIdGenerator, UniqueIdGenerator>();
services.AddSingleton<ISegmentContextMapper, SegmentContextMapper>();
services.AddSingleton<IBase64Formatter, Base64Formatter>();
return services;
}
private static IServiceCollection AddSampling(this IServiceCollection services)
{
services.AddSingleton<SimpleCountSamplingInterceptor>();
services.AddSingleton((Func<IServiceProvider, ISamplingInterceptor>)((IServiceProvider p) => p.GetService<SimpleCountSamplingInterceptor>()));
services.AddSingleton((Func<IServiceProvider, IExecutionService>)((IServiceProvider p) => p.GetService<SimpleCountSamplingInterceptor>()));
services.AddSingleton<ISamplingInterceptor, RandomSamplingInterceptor>();
services.AddSingleton<ISamplingInterceptor, IgnorePathSamplingInterceptor>();
return services;
}
private static IServiceCollection AddGrpcTransport(this IServiceCollection services)
{
services.AddSingleton<ISegmentReporter, SegmentReporter>();
services.AddSingleton<ILogReporter, LogReporter>();
services.AddSingleton<ICLRStatsReporter, CLRStatsReporter>();
services.AddSingleton<ConnectionManager>();
services.AddSingleton<IPingCaller, PingCaller>();
services.AddSingleton<IServiceRegister, ServiceRegister>();
services.AddSingleton<IExecutionService, ConnectService>();
return services;
}
private static IServiceCollection AddSkyApmLogging(this IServiceCollection services)
{
services.AddSingleton<ILoggerFactory, DefaultLoggerFactory>();
return services;
}
}

53
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/README.md

@ -0,0 +1,53 @@
# LINGYUN.Abp.Telemetry.SkyWalking
分布式追踪系统 `SkyWalking` 集成
## 功能特性
## 模块引用
```csharp
[DependsOn(typeof(AbpTelemetrySkyWalkingModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## 配置项
```shell
# 切换到主程序目录
cd my-host-project-path
# 安装 skyapm 命令行工具
dotnet tool install -g SkyAPM.DotNet.CLI
# 生成 SkyWalking 配置文件, localhost:11800 为你运行的SkyWalking实例暴露的Grpc端口
dotnet skyapm config auth_server localhost:11800
```
```csharp
public class YouProjectModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<SkyApmExtensions>(skyapm =>
{
skyapm.AddCap();
// other...
});
}
}
```
## 更多文档
* [SkyWalking](https://skywalking.apache.org/)
* [SkyWalking .NET](https://github.com/SkyAPM/SkyAPM-dotnet)

71
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.Configure.cs

@ -1,4 +1,5 @@
using DotNetCore.CAP;
using LINGYUN.Abp.BlobStoring.OssManagement;
using LINGYUN.Abp.ExceptionHandling;
using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.Identity.Session;
@ -21,9 +22,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.Linq;
@ -33,6 +31,7 @@ using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.BlobStoring;
using Volo.Abp.Caching;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities.Events.Distributed;
@ -56,7 +55,6 @@ namespace LY.MicroService.AuthServer;
public partial class AuthServerHttpApiHostModule
{
public static string ApplicationName { get; set; } = "AuthService";
protected const string DefaultCorsPolicyName = "Default";
private readonly static OneTimeRunner OneTimeRunner = new OneTimeRunner();
@ -115,6 +113,22 @@ public partial class AuthServerHttpApiHostModule
});
}
private void ConfigureBlobStoring(IConfiguration configuration)
{
Configure<AbpBlobStoringOptions>(options =>
{
// all container use oss management
options.Containers.ConfigureAll((containerName, containerConfiguration) =>
{
// use oss management
containerConfiguration.UseOssManagement(config =>
{
config.Bucket = configuration[OssManagementBlobProviderConfigurationNames.Bucket];
});
});
});
}
private void ConfigureDbContext()
{
// 配置Ef
@ -259,53 +273,6 @@ public partial class AuthServerHttpApiHostModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureTiming(IConfiguration configuration)
{
Configure<AbpClockOptions>(options =>
@ -458,7 +425,7 @@ public partial class AuthServerHttpApiHostModule
{
services.AddCors(options =>
{
options.AddPolicy(DefaultCorsPolicyName, builder =>
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(

9
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.cs

@ -4,6 +4,7 @@ using LINGYUN.Abp.AspNetCore.Mvc.Localization;
using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BlobStoring.OssManagement;
using LINGYUN.Abp.Claims.Mapping;
using LINGYUN.Abp.Emailing.Platform;
using LINGYUN.Abp.EventBus.CAP;
@ -22,6 +23,7 @@ using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.Telemetry.SkyWalking;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
@ -69,6 +71,7 @@ namespace LY.MicroService.AuthServer;
typeof(AbpAuthorizationOrganizationUnitsModule),
typeof(AbpAuditLoggingElasticsearchModule),
typeof(AbpEmailingExceptionHandlingModule),
typeof(AbpBlobStoringOssManagementModule),
typeof(AbpCAPEventBusModule),
typeof(AbpHttpClientModule),
typeof(AbpSmsPlatformModule),
@ -79,6 +82,7 @@ namespace LY.MicroService.AuthServer;
typeof(AbpIdentitySessionAspNetCoreModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpExporterMiniExcelModule),
typeof(AbpClaimsMappingModule),
typeof(AbpAutofacModule)
@ -110,6 +114,7 @@ public partial class AuthServerHttpApiHostModule : AbpModule
ConfigureVirtualFileSystem();
ConfigureFeatureManagement();
ConfigurePermissionManagement();
ConfigureBlobStoring(configuration);
ConfigureUrls(configuration);
ConfigureCaching(configuration);
ConfigureTiming(configuration);
@ -119,7 +124,6 @@ public partial class AuthServerHttpApiHostModule : AbpModule
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
}
@ -137,10 +141,9 @@ public partial class AuthServerHttpApiHostModule : AbpModule
// 路由
app.UseRouting();
// 跨域
app.UseCors(DefaultCorsPolicyName);
app.UseCors();
// 认证
app.UseAuthentication();
app.UseJwtTokenMiddleware();
// 多租户
app.UseMultiTenancy();
// 会话

10
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj

@ -14,7 +14,6 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
@ -23,13 +22,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
<PackageReference Include="Serilog.Enrichers.Assembly" />
@ -69,6 +61,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
</ItemGroup>
<ItemGroup>
@ -85,6 +78,7 @@
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.EntityFrameworkCore\LINGYUN.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.HttpApi\LINGYUN.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.BlobStoring.OssManagement\LINGYUN.Abp.BlobStoring.OssManagement.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />

3
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/appsettings.json

@ -20,6 +20,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

123
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs

@ -18,7 +18,6 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Caching.StackExchangeRedis;
@ -27,15 +26,9 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.IdentityModel.Logging;
using OpenIddict.Validation.AspNetCore;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp.Account.Localization;
@ -129,72 +122,27 @@ public partial class AuthServerModule
private void PreConfigureCertificate(IConfiguration configuration, IWebHostEnvironment environment)
{
var cerConfig = configuration.GetSection("Certificates");
if (environment.IsProduction() &&
cerConfig.Exists())
{
// 开发环境下存在证书配置
// 且证书文件存在则使用自定义的证书文件来启动Ids服务器
var cerPath = Path.Combine(environment.ContentRootPath, cerConfig["CerPath"]);
if (File.Exists(cerPath))
{
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
{
//https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html
options.AddDevelopmentEncryptionAndSigningCertificate = false;
});
var cer = new X509Certificate2(cerPath, cerConfig["Password"]);
PreConfigure<OpenIddictServerBuilder>(builder =>
{
//https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html
builder.AddSigningCertificate(cer);
builder.AddEncryptionCertificate(cer);
// builder.UseDataProtection();
});
}
}
else
if (!environment.IsDevelopment())
{
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
{
//https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html
options.AddDevelopmentEncryptionAndSigningCertificate = false;
});
PreConfigure<OpenIddictServerBuilder>(builder =>
{
//https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html
using (var algorithm = RSA.Create(keySizeInBits: 2048))
{
var subject = new X500DistinguishedName("CN=Fabrikam Encryption Certificate");
var request = new CertificateRequest(subject, algorithm, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature, critical: true));
var certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(2));
builder.AddSigningCertificate(certificate);
}
using (var algorithm = RSA.Create(keySizeInBits: 2048))
{
var subject = new X500DistinguishedName("CN=Fabrikam Signing Certificate");
var request = new CertificateRequest(subject, algorithm, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.KeyEncipherment, critical: true));
var certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(2));
builder.AddEncryptionCertificate(certificate);
}
// builder.UseDataProtection();
// 禁用https
builder.UseAspNetCore()
.DisableTransportSecurityRequirement();
builder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", "e1c48393-0c43-11f0-9582-4aecacda42db");
});
}
PreConfigure<OpenIddictServerBuilder>(builder =>
{
// builder.UseDataProtection();
// 禁用https
builder.UseAspNetCore()
.DisableTransportSecurityRequirement();
});
}
private void ConfigureMvc(IServiceCollection services, IConfiguration configuration)
@ -264,53 +212,6 @@ public partial class AuthServerModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureCaching(IConfiguration configuration)
{
Configure<AbpDistributedCacheOptions>(options =>
@ -480,7 +381,7 @@ public partial class AuthServerModule
{
services.AddCors(options =>
{
options.AddPolicy(DefaultCorsPolicyName, builder =>
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(

8
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs

@ -24,6 +24,7 @@ using LINGYUN.Abp.OpenIddict.WeChat.Work;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LINGYUN.Abp.WeChat.Work.AspNetCore;
using LY.MicroService.AuthServer.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
@ -72,6 +73,7 @@ namespace LY.MicroService.AuthServer;
typeof(AbpLocalizationCultureMapModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpExporterMiniExcelModule),
typeof(AbpEmailingPlatformModule),
typeof(AbpSmsPlatformModule),
@ -79,8 +81,6 @@ namespace LY.MicroService.AuthServer;
)]
public partial class AuthServerModule : AbpModule
{
private const string DefaultCorsPolicyName = "Default";
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
@ -113,7 +113,6 @@ public partial class AuthServerModule : AbpModule
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
@ -140,11 +139,12 @@ public partial class AuthServerModule : AbpModule
app.UseCorrelationId();
app.MapAbpStaticAssets();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseCors();
app.UseAuthentication();
app.UseAbpOpenIddictValidation();
app.UseMultiTenancy();
app.UseAbpSession();
app.UseUnitOfWork();
app.UseDynamicClaims();
app.UseAuthorization();
app.UseAuditing();

10
aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj

@ -18,17 +18,9 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="OpenIddict.Validation.DataProtection" />
<PackageReference Include="OpenIddict.Server.DataProtection" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Assembly" />
<PackageReference Include="Serilog.Enrichers.Environment" />
@ -65,6 +57,8 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<!--<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.OpenTelemetry\LINGYUN.Abp.Telemetry.OpenTelemetry.csproj" />-->
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
<ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.WeChat.Work.AspNetCore\LINGYUN.Abp.WeChat.Work.AspNetCore.csproj" />
</ItemGroup>

3
aspnet-core/services/LY.MicroService.AuthServer/appsettings.json

@ -16,6 +16,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",

BIN
aspnet-core/services/LY.MicroService.AuthServer/openiddict.pfx

Binary file not shown.

50
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.Configure.cs

@ -21,9 +21,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
@ -244,53 +241,6 @@ public partial class BackendAdminHttpApiHostModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureMvc(IServiceCollection services, IConfiguration configuration)
{
Configure<AbpAspNetCoreMvcOptions>(options =>

4
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.cs

@ -29,6 +29,7 @@ using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.SettingManagement;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LINGYUN.Abp.Tencent.SettingManagement;
using LINGYUN.Abp.TextTemplating;
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
@ -86,6 +87,7 @@ namespace LY.MicroService.BackendAdmin;
typeof(AbpAuditingHttpApiModule),
typeof(AbpSaasApplicationModule),
typeof(AbpSaasHttpApiModule),
typeof(AbpSaasDbCheckerModule),
typeof(AbpTextTemplatingApplicationModule),
typeof(AbpTextTemplatingHttpApiModule),
typeof(AbpCachingManagementApplicationModule),
@ -112,6 +114,7 @@ namespace LY.MicroService.BackendAdmin;
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEmailingExceptionHandlingModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpHttpClientModule),
typeof(AbpSmsPlatformModule),
typeof(AbpEmailingPlatformModule),
@ -157,7 +160,6 @@ public partial class BackendAdminHttpApiHostModule : AbpModule
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

12
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/LY.MicroService.BackendAdmin.HttpApi.Host.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\common.secrets.props" />
@ -18,20 +18,12 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<!--<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
<PackageReference Include="Serilog.Enrichers.Assembly" />
@ -76,6 +68,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
<!--<ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.WeChat.SettingManagement\LINGYUN.Abp.WeChat.SettingManagement.csproj" />-->
<ProjectReference Include="..\..\framework\wx-pusher\LINGYUN.Abp.WxPusher.SettingManagement\LINGYUN.Abp.WxPusher.SettingManagement.csproj" />
</ItemGroup>
@ -102,6 +95,7 @@
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.Application\LINGYUN.Abp.Saas.Application.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.DbChecker\LINGYUN.Abp.Saas.DbChecker.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.HttpApi\LINGYUN.Abp.Saas.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\settings\LINGYUN.Abp.SettingManagement.Application\LINGYUN.Abp.SettingManagement.Application.csproj" />

3
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/appsettings.json

@ -20,6 +20,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",

50
aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/IdentityServerHttpApiHostModule.Configure.cs

@ -20,9 +20,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
@ -250,53 +247,6 @@ public partial class IdentityServerHttpApiHostModule
});
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureDistributedLocking(IServiceCollection services, IConfiguration configuration)
{
var distributedLockEnabled = configuration["DistributedLock:IsEnabled"];

5
aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs

@ -8,9 +8,9 @@ using LINGYUN.Abp.Emailing.Platform;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.Exporter.MiniExcel;
using LINGYUN.Abp.Gdpr;
using LINGYUN.Abp.Gdpr.EntityFrameworkCore;
using LINGYUN.Abp.Gdpr.Identity;
using LINGYUN.Abp.Gdpr;
using LINGYUN.Abp.Identity.Session.AspNetCore;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
@ -18,6 +18,7 @@ using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.Telemetry.SkyWalking;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
@ -74,6 +75,7 @@ namespace LY.MicroService.IdentityServer;
typeof(AbpLocalizationCultureMapModule),
typeof(AbpIdentitySessionAspNetCoreModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpExporterMiniExcelModule),
typeof(AbpClaimsMappingModule),
typeof(AbpAutofacModule)
@ -114,7 +116,6 @@ public partial class IdentityServerHttpApiHostModule : AbpModule
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
}

9
aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/LY.MicroService.identityServer.HttpApi.Host.csproj

@ -22,7 +22,6 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" VersionOverride="9.0.0.0" />
@ -30,13 +29,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
<PackageReference Include="Serilog.Enrichers.Assembly" />
@ -76,6 +68,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
</ItemGroup>
<ItemGroup>

3
aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/appsettings.json

@ -20,6 +20,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

50
aspnet-core/services/LY.MicroService.IdentityServer/IdentityServerModule.Configure.cs

@ -23,9 +23,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.IdentityModel.Logging;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
@ -203,53 +200,6 @@ public partial class IdentityServerModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureCaching(IConfiguration configuration)
{
Configure<AbpDistributedCacheOptions>(options =>

3
aspnet-core/services/LY.MicroService.IdentityServer/IdentityServerModule.cs

@ -23,6 +23,7 @@ using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LY.MicroService.IdentityServer.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -69,6 +70,7 @@ namespace LY.MicroService.IdentityServer;
typeof(AbpLocalizationCultureMapModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpExporterMiniExcelModule),
typeof(AbpEmailingPlatformModule),
typeof(AbpSmsPlatformModule),
@ -108,7 +110,6 @@ public partial class IdentityServerModule : AbpModule
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

9
aspnet-core/services/LY.MicroService.IdentityServer/LY.MicroService.IdentityServer.csproj

@ -18,7 +18,6 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Serilog.Enrichers.Assembly" />
@ -33,13 +32,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" />
@ -63,6 +55,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
<ProjectReference Include="..\..\migrations\LY.MicroService.IdentityServer.EntityFrameworkCore\LY.MicroService.IdentityServer.EntityFrameworkCore.csproj" />
</ItemGroup>

3
aspnet-core/services/LY.MicroService.IdentityServer/appsettings.json

@ -16,6 +16,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",

9
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj

@ -14,20 +14,12 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<!--<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
<PackageReference Include="Serilog.Enrichers.Assembly" />
@ -61,6 +53,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
</ItemGroup>
<ItemGroup>

51
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.Configure.cs

@ -18,9 +18,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.Linq;
@ -170,54 +167,6 @@ public partial class LocalizationManagementHttpApiHostModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureTiming(IConfiguration configuration)
{
Configure<AbpClockOptions>(options =>

3
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs

@ -14,6 +14,7 @@ using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LY.MicroService.LocalizationManagement.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
@ -54,6 +55,7 @@ namespace LY.MicroService.LocalizationManagement;
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpLocalizationCultureMapModule),
typeof(AbpIdentitySessionAspNetCoreModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpHttpClientModule),
typeof(AbpSmsPlatformModule),
typeof(AbpEmailingPlatformModule),
@ -93,7 +95,6 @@ public partial class LocalizationManagementHttpApiHostModule : AbpModule
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

3
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json

@ -21,6 +21,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

10
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj

@ -14,20 +14,12 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<!--<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
<PackageReference Include="Serilog.Enrichers.Assembly" />
@ -69,6 +61,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
</ItemGroup>
<ItemGroup>
@ -79,6 +72,7 @@
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.OssManagement.FileSystem\LINGYUN.Abp.OssManagement.FileSystem.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.OssManagement.HttpApi\LINGYUN.Abp.OssManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.OssManagement.Imaging\LINGYUN.Abp.OssManagement.Imaging.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.OssManagement.Minio\LINGYUN.Abp.OssManagement.Minio.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.OssManagement.SettingManagement\LINGYUN.Abp.OssManagement.SettingManagement.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.UI.Navigation.VueVbenAdmin\LINGYUN.Abp.UI.Navigation.VueVbenAdmin.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Platform.Application\LINGYUN.Platform.Application.csproj" />

84
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.Configure.cs

@ -22,9 +22,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.IO;
@ -37,6 +34,7 @@ using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing;
using Volo.Abp.BlobStoring;
using Volo.Abp.BlobStoring.FileSystem;
using Volo.Abp.BlobStoring.Minio;
using Volo.Abp.Caching;
using Volo.Abp.FeatureManagement;
using Volo.Abp.GlobalFeatures;
@ -142,18 +140,39 @@ public partial class PlatformManagementHttpApiHostModule
});
}
private void ConfigureBlobStoring()
private void ConfigureOssManagement(IServiceCollection services, IConfiguration configuration)
{
Configure<AbpBlobStoringOptions>(options =>
var useMinio = configuration.GetValue<bool>("OssManagement:UseMinio");
if (useMinio)
{
options.Containers.ConfigureAll((containerName, containerConfiguration) =>
Configure<AbpBlobStoringOptions>(options =>
{
containerConfiguration.UseFileSystem(fileSystem =>
options.Containers.ConfigureAll((containerName, containerConfiguration) =>
{
fileSystem.BasePath = Path.Combine(Directory.GetCurrentDirectory(), "blobs");
containerConfiguration.UseMinio(minio =>
{
configuration.GetSection("Minio").Bind(minio);
});
});
});
});
services.AddMinioContainer();
}
else
{
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureAll((containerName, containerConfiguration) =>
{
containerConfiguration.UseFileSystem(fileSystem =>
{
fileSystem.BasePath = Path.Combine(
Directory.GetCurrentDirectory(),
configuration["OssManagement:Bucket"] ?? "blobs");
});
});
});
services.AddFileSystemContainer();
}
}
private void ConfigureExceptionHandling()
@ -211,53 +230,6 @@ public partial class PlatformManagementHttpApiHostModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureTiming(IConfiguration configuration)
{
Configure<AbpClockOptions>(options =>

9
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs

@ -15,11 +15,13 @@ using LINGYUN.Abp.Notifications;
using LINGYUN.Abp.OssManagement;
using LINGYUN.Abp.OssManagement.FileSystem;
using LINGYUN.Abp.OssManagement.Imaging;
using LINGYUN.Abp.OssManagement.Minio;
using LINGYUN.Abp.OssManagement.SettingManagement;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Aliyun;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LINGYUN.Abp.UI.Navigation.VueVbenAdmin;
using LINGYUN.Platform;
using LINGYUN.Platform.EntityFrameworkCore;
@ -64,8 +66,9 @@ namespace LY.MicroService.PlatformManagement;
typeof(AbpUINavigationVueVbenAdminModule),
typeof(PlatformThemeVueVbenAdminModule),
// typeof(AbpOssManagementAliyunModule),
typeof(AbpOssManagementMinioModule), // Minio存储提供者模块
typeof(AbpOssManagementFileSystemModule), // 本地文件系统提供者模块
typeof(AbpOssManagementImagingModule), // 本地文件系统图形处理模块
typeof(AbpOssManagementImagingModule), // 对象存储图形处理模块
typeof(AbpOssManagementApplicationModule),
typeof(AbpOssManagementHttpApiModule),
typeof(AbpOssManagementSettingManagementModule),
@ -93,6 +96,7 @@ namespace LY.MicroService.PlatformManagement;
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpLocalizationCultureMapModule),
typeof(AbpIdentitySessionAspNetCoreModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpHttpClientModule),
typeof(AbpMailKitModule),
typeof(AbpAliyunSmsModule),
@ -120,7 +124,6 @@ public partial class PlatformManagementHttpApiHostModule : AbpModule
var configuration = context.Services.GetConfiguration();
ConfigureWrapper();
ConfigureBlobStoring();
ConfigureLocalization();
ConfigureKestrelServer();
ConfigureExceptionHandling();
@ -135,7 +138,7 @@ public partial class PlatformManagementHttpApiHostModule : AbpModule
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureOssManagement(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

3
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json

@ -18,6 +18,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",

9
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj

@ -18,7 +18,6 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<!--<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
@ -26,13 +25,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Quartz.Serialization.Json" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
@ -69,6 +61,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
<ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.Identity.WeChat.Work\LINGYUN.Abp.Identity.WeChat.Work.csproj" />
<ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.Identity.WeChat\LINGYUN.Abp.Identity.WeChat.csproj" />
<ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.WeChat.Official.Handlers\LINGYUN.Abp.WeChat.Official.Handlers.csproj" />

50
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.Configure.cs

@ -23,9 +23,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using Quartz;
using StackExchange.Redis;
using System;
@ -232,53 +229,6 @@ public partial class RealtimeMessageHttpApiHostModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureCaching(IConfiguration configuration)
{
Configure<AbpDistributedCacheOptions>(options =>

3
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs

@ -38,6 +38,7 @@ using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
using LINGYUN.Abp.TextTemplating.Scriban;
using LINGYUN.Abp.WeChat.Official.Handlers;
@ -120,6 +121,7 @@ namespace LY.MicroService.RealtimeMessage;
typeof(AbpSmsPlatformModule),
typeof(AbpHttpClientModule),
typeof(AbpClaimsMappingModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpAutofacModule)
@ -163,7 +165,6 @@ public partial class RealtimeMessageHttpApiHostModule : AbpModule
ConfigureSwagger(context.Services);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

3
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json

@ -21,6 +21,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

9
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/LY.MicroService.TaskManagement.HttpApi.Host.csproj

@ -12,16 +12,8 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Quartz.Serialization.Json" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
@ -59,6 +51,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
<ProjectReference Include="..\..\framework\tenants\LINGYUN.Abp.MultiTenancy.Editions\LINGYUN.Abp.MultiTenancy.Editions.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
</ItemGroup>

50
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs

@ -19,9 +19,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using Quartz;
using StackExchange.Redis;
using System;
@ -158,53 +155,6 @@ public partial class TaskManagementHttpApiHostModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式

3
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.cs

@ -22,6 +22,7 @@ using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.TaskManagement;
using LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LY.MicroService.TaskManagement.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -80,6 +81,7 @@ namespace LY.MicroService.TaskManagement;
typeof(AbpLocalizationCultureMapModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpClaimsMappingModule),
typeof(AbpCAPEventBusModule),
typeof(AbpAutofacModule)
@ -118,7 +120,6 @@ public partial class TaskManagementHttpApiHostModule : AbpModule
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
}

3
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/appsettings.json

@ -20,6 +20,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"AllowedHosts": "*",
"Serilog": {
"MinimumLevel": {

9
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/LY.MicroService.WebhooksManagement.HttpApi.Host.csproj

@ -12,16 +12,8 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Quartz.Serialization.Json" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
@ -60,6 +52,7 @@
<ProjectReference Include="..\..\framework\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\framework\localization\LINGYUN.Abp.AspNetCore.Mvc.Localization\LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
</ItemGroup>
<ItemGroup>

50
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.Configure.cs

@ -22,9 +22,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using Quartz;
using StackExchange.Redis;
using System;
@ -192,53 +189,6 @@ public partial class WebhooksManagementHttpApiHostModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureExceptionHandling()
{
// 自定义需要处理的异常

3
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.cs

@ -19,6 +19,7 @@ using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LINGYUN.Abp.Webhooks.EventBus;
using LINGYUN.Abp.Webhooks.Identity;
using LINGYUN.Abp.Webhooks.Saas;
@ -81,6 +82,7 @@ namespace LY.MicroService.WebhooksManagement;
typeof(AbpClaimsMappingModule),
typeof(AbpEmailingPlatformModule),
typeof(AbpSmsPlatformModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpIdentitySessionAspNetCoreModule),
@ -121,7 +123,6 @@ public partial class WebhooksManagementHttpApiHostModule : AbpModule
ConfigureWebhooks(context.Services);
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration);
ConfigureBackgroundTasks(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

3
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/appsettings.json

@ -17,6 +17,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"AllowedHosts": "*",
"Serilog": {
"MinimumLevel": {

9
aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/LY.MicroService.WechatManagement.HttpApi.Host.csproj

@ -12,16 +12,8 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Quartz.Serialization.Json" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
@ -60,6 +52,7 @@
<ProjectReference Include="..\..\framework\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\framework\localization\LINGYUN.Abp.AspNetCore.Mvc.Localization\LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
<ProjectReference Include="..\..\framework\tenants\LINGYUN.Abp.MultiTenancy.Editions\LINGYUN.Abp.MultiTenancy.Editions.csproj" />
<ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj" />
<ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.WeChat.Official.Application\LINGYUN.Abp.WeChat.Official.Application.csproj" />

50
aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/WechatManagementHttpApiHostModule.Configure.cs

@ -17,9 +17,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
@ -140,53 +137,6 @@ public partial class WechatManagementHttpApiHostModule
}
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureExceptionHandling()
{
// 自定义需要处理的异常

3
aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/WechatManagementHttpApiHostModule.cs

@ -12,6 +12,7 @@ using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Telemetry.SkyWalking;
using LINGYUN.Abp.WeChat.MiniProgram;
using LINGYUN.Abp.WeChat.Official;
using LINGYUN.Abp.WeChat.SettingManagement;
@ -67,6 +68,7 @@ namespace LY.MicroService.WechatManagement;
typeof(AbpHttpClientWrapperModule),
typeof(AbpMailKitModule),
typeof(AbpClaimsMappingModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpIdentitySessionAspNetCoreModule),
@ -106,7 +108,6 @@ public partial class WechatManagementHttpApiHostModule : AbpModule
ConfigureSwagger(context.Services);
ConfigureJsonSerializer(configuration);
ConfigureMvc(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
}

3
aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/appsettings.json

@ -17,6 +17,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"AllowedHosts": "*",
"Serilog": {
"MinimumLevel": {

13
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj

@ -12,7 +12,6 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="Elsa.Activities.Email" />
<PackageReference Include="Elsa.Activities.Http" />
<PackageReference Include="Elsa.Activities.UserTask" />
@ -22,13 +21,6 @@
<PackageReference Include="Elsa.Webhooks.Api" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Quartz.Serialization.Json" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
@ -68,6 +60,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\framework\telemetry\LINGYUN.Abp.Telemetry.SkyWalking\LINGYUN.Abp.Telemetry.SkyWalking.csproj" />
</ItemGroup>
<ItemGroup>
@ -87,8 +80,4 @@
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Logs\" />
</ItemGroup>
</Project>

51
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.Configure.cs

@ -4,7 +4,6 @@ using Elsa.Options;
using Elsa.Rebus.RabbitMq;
using LINGYUN.Abp.BackgroundTasks;
using LINGYUN.Abp.BlobStoring.OssManagement;
using LINGYUN.Abp.Elsa.Localization;
using LINGYUN.Abp.ExceptionHandling;
using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.Localization.CultureMap;
@ -24,9 +23,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using Quartz;
using StackExchange.Redis;
using System;
@ -136,53 +132,6 @@ public partial class WorkflowManagementHttpApiHostModule
});
}
private void ConfigureOpenTelemetry(IServiceCollection services, IConfiguration configuration)
{
var openTelemetryEnabled = configuration["OpenTelemetry:IsEnabled"];
if (openTelemetryEnabled.IsNullOrEmpty() || bool.Parse(openTelemetryEnabled))
{
services.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(ApplicationName);
})
.WithTracing(tracing =>
{
tracing.AddHttpClientInstrumentation();
tracing.AddAspNetCoreInstrumentation();
tracing.AddCapInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddSource(ApplicationName);
var tracingOtlpEndpoint = configuration["OpenTelemetry:Otlp:Endpoint"];
if (!tracingOtlpEndpoint.IsNullOrWhiteSpace())
{
tracing.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri(tracingOtlpEndpoint);
});
return;
}
var zipkinEndpoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
if (!zipkinEndpoint.IsNullOrWhiteSpace())
{
tracing.AddZipkinExporter(zipKinOptions =>
{
zipKinOptions.Endpoint = new Uri(zipkinEndpoint);
});
return;
}
})
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddAspNetCoreInstrumentation();
});
}
}
private void ConfigureBackgroundTasks(IConfiguration configuration)
{
Configure<AbpBackgroundTasksOptions>(options =>

4
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs

@ -24,9 +24,9 @@ using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
using LINGYUN.Abp.Telemetry.SkyWalking;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Volo.Abp;
@ -87,6 +87,7 @@ namespace LY.MicroService.WorkflowManagement;
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpMailKitModule),
typeof(AbpClaimsMappingModule),
typeof(AbpTelemetrySkyWalkingModule),
typeof(AbpAspNetCoreMvcNewtonsoftModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpIdentitySessionAspNetCoreModule),
@ -126,7 +127,6 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration);
ConfigureBlobStoring(context.Services, configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

3
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json

@ -17,6 +17,9 @@
"yyyy-MM-ddTHH:mm:ss"
]
},
"SkyWalking": {
"Enable": false
},
"AllowedHosts": "*",
"Hosting": {
"BasePath": ""

Loading…
Cancel
Save