架构师_程序员_码农网

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 17555|回复: 2

[.NET Core] ASP.NET Core 链路追踪(二)使用 SkyAPM 集成

[复制链接]
发表于 2020-11-6 10:34:10 | 显示全部楼层 |阅读模式
如何使用 Docker 搭建 Skywalking 教程

ASP.NET Core 链路追踪(一)安装 Skywalking 教程
https://www.itsvse.com/thread-9456-1-1.html
本文讲解如何将 ASP.NET Core 和 Skywalking 集成在一起。

首先,新建一个 asp.net core 3.1 的 mvc 项目,名称为:sky-apm-demo

nuget 安装命令:




安装 SkyAPM.DotNet.CLI 工具

这个工具只是帮我们通过命令行参数生成 skyapm.json 配置文件,其实,安不安装也无所谓,而且这里还有一个坑。

QQ截图20201106102009.jpg

生成的配置文件 HeaderVersions 和 ProtocolVersion 是错误的,这会导致,无法将数据提交给 Skywalking 服务

QQ截图20201106102248.jpg

正确配置如下:


配置文档:https://github.com/SkyAPM/SkyAPM-dotnet/blob/master/docs/guides/skyapm_config_cn.md

将 skyapm.json 文件复制到我们项目根目录。

修改“/Properties/launchSettings.json”文件,添加 ASPNETCORE_HOSTINGSTARTUPASSEMBLIES 配置,如下:

同时,我们在控制器新建两个方法,如下:

启动我们的网站,尝试访问不同的 URL 地址,如下:

QQ截图20201106102735.jpg

我们可以在项目根目录 logs 的文件夹,查看到 skyapm 日志,如下:

2020-11-06 10:04:49.972 +08:00 [sky_apm_demo] [Information] SkyApm.InstrumentStartup : Initializing ...
2020-11-06 10:04:50.004 +08:00 [sky_apm_demo] [Information] SkyApm.Service.RegisterService : Loaded instrument service [SkyApm.Service.RegisterService].
2020-11-06 10:04:50.004 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Loaded instrument service [SkyApm.Service.PingService].
2020-11-06 10:04:50.005 +08:00 [sky_apm_demo] [Information] SkyApm.Service.SegmentReportService : Loaded instrument service [SkyApm.Service.SegmentReportService].
2020-11-06 10:04:50.005 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Loaded instrument service [SkyApm.Service.CLRStatsService].
2020-11-06 10:04:50.005 +08:00 [sky_apm_demo] [Information] SkyApm.Sampling.SimpleCountSamplingInterceptor : Loaded instrument service [SkyApm.Sampling.SimpleCountSamplingInterceptor].
2020-11-06 10:04:50.005 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.ConnectService : Loaded instrument service [SkyApm.Transport.Grpc.ConnectService].
2020-11-06 10:04:50.038 +08:00 [sky_apm_demo] [Information] SkyApm.Diagnostics.TracingDiagnosticProcessorObserver : Loaded diagnostic listener [Microsoft.AspNetCore].
2020-11-06 10:04:50.039 +08:00 [sky_apm_demo] [Information] SkyApm.InstrumentStartup : Started SkyAPM .NET Core Agent.
2020-11-06 10:04:50.080 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.ConnectionManager : Connected server[192.168.40.129:11800].
2020-11-06 10:04:51.030 +08:00 [sky_apm_demo] [Information] SkyApm.Service.RegisterService : Reported Service Instance Properties[Service=sky_apm_demo,InstanceId=e0a72ff567ea445eb51bd43c1d8983fc].
2020-11-06 10:05:08.194 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 2 trace segment. cost: 00:00:00.1514860s
2020-11-06 10:05:10.996 +08:00 [sky_apm_demo] [Information] SkyApm.Diagnostics.TracingDiagnosticProcessorObserver : Loaded diagnostic listener [HttpHandlerDiagnosticListener].
2020-11-06 10:05:14.037 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 4 trace segment. cost: 00:00:00.0230363s
2020-11-06 10:05:20.041 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:05:20 +00:00
2020-11-06 10:05:20.045 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 8M ThreadPool 32759 32767 1000 1000
2020-11-06 10:05:29.021 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 3 trace segment. cost: 00:00:00.0098886s
2020-11-06 10:05:32.023 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 3 trace segment. cost: 00:00:00.0082101s
2020-11-06 10:05:35.031 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 6 trace segment. cost: 00:00:00.0180070s
2020-11-06 10:05:41.024 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 6 trace segment. cost: 00:00:00.0124269s
2020-11-06 10:05:47.021 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 2 trace segment. cost: 00:00:00.0101354s
2020-11-06 10:05:50.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 10M ThreadPool 32762 32767 1000 1000
2020-11-06 10:06:20.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:06:20 +00:00
2020-11-06 10:06:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 10M ThreadPool 32760 32767 1000 1000
2020-11-06 10:06:50.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 10M ThreadPool 32762 32767 1000 1000
2020-11-06 10:07:20.023 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:07:20 +00:00
2020-11-06 10:07:20.023 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 10M ThreadPool 32761 32767 1000 1000
2020-11-06 10:07:50.016 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 11M ThreadPool 32760 32767 1000 1000
2020-11-06 10:08:20.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:08:20 +00:00
2020-11-06 10:08:20.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 11M ThreadPool 32759 32767 1000 1000
2020-11-06 10:08:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 11M ThreadPool 32759 32767 1000 1000
2020-11-06 10:09:20.025 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:09:20 +00:00
2020-11-06 10:09:20.029 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 11M ThreadPool 32758 32767 1000 1000
2020-11-06 10:09:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 12M ThreadPool 32762 32767 1000 1000
2020-11-06 10:10:20.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 12M ThreadPool 32761 32767 1000 1000
2020-11-06 10:10:20.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:10:20 +00:00
2020-11-06 10:10:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 12M ThreadPool 32761 32767 1000 1000
2020-11-06 10:11:20.026 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 13M ThreadPool 32760 32767 1000 1000
2020-11-06 10:11:20.026 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:11:20 +00:00
2020-11-06 10:11:50.015 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 13M ThreadPool 32760 32767 1000 1000
2020-11-06 10:12:20.023 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:12:20 +00:00
2020-11-06 10:12:20.025 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 13M ThreadPool 32761 32767 1000 1000
2020-11-06 10:12:50.024 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 13M ThreadPool 32761 32767 1000 1000
2020-11-06 10:13:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:13:20 +00:00
2020-11-06 10:13:20.021 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 14M ThreadPool 32759 32767 1000 1000
2020-11-06 10:13:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 1 0 0 4M ThreadPool 32759 32767 1000 1000
2020-11-06 10:14:20.016 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 4M ThreadPool 32760 32767 1000 1000
2020-11-06 10:14:20.016 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:14:20 +00:00
2020-11-06 10:14:50.014 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 5M ThreadPool 32758 32767 1000 1000
2020-11-06 10:15:20.029 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 5M ThreadPool 32761 32767 1000 1000
2020-11-06 10:15:20.029 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:15:20 +00:00
2020-11-06 10:15:50.014 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 5M ThreadPool 32762 32767 1000 1000
2020-11-06 10:16:20.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:16:20 +00:00
2020-11-06 10:16:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 5M ThreadPool 32759 32767 1000 1000
2020-11-06 10:16:50.013 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 6M ThreadPool 32763 32767 1000 1000
2020-11-06 10:17:20.024 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 6M ThreadPool 32763 32767 1000 1000
2020-11-06 10:17:20.024 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:17:20 +00:00
2020-11-06 10:17:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 6M ThreadPool 32763 32767 1000 1000
2020-11-06 10:18:20.017 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 7M ThreadPool 32763 32767 1000 1000
2020-11-06 10:18:20.017 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:18:20 +00:00
2020-11-06 10:18:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 7M ThreadPool 32762 32767 1000 1000
2020-11-06 10:19:20.021 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 7M ThreadPool 32763 32767 1000 1000
2020-11-06 10:19:20.021 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:19:20 +00:00
2020-11-06 10:19:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 7M ThreadPool 32763 32767 1000 1000
2020-11-06 10:20:20.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:20:20 +00:00
2020-11-06 10:20:20.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 8M ThreadPool 32760 32767 1000 1000
2020-11-06 10:20:50.014 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 8M ThreadPool 32763 32767 1000 1000
2020-11-06 10:21:20.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 8M ThreadPool 32760 32767 1000 1000
2020-11-06 10:21:20.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:21:20 +00:00
2020-11-06 10:21:50.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 8M ThreadPool 32760 32767 1000 1000
2020-11-06 10:22:20.014 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 9M ThreadPool 32763 32767 1000 1000
2020-11-06 10:22:20.015 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:22:20 +00:00
2020-11-06 10:22:50.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 9M ThreadPool 32764 32767 1000 1000
2020-11-06 10:23:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 9M ThreadPool 32762 32767 1000 1000
2020-11-06 10:23:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:23:20 +00:00
2020-11-06 10:23:50.014 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 9M ThreadPool 32764 32767 1000 1000
2020-11-06 10:24:20.014 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 10M ThreadPool 32761 32767 1000 1000
2020-11-06 10:24:20.014 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:24:20 +00:00
2020-11-06 10:24:50.008 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 10M ThreadPool 32765 32767 1000 1000
2020-11-06 10:25:20.021 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:25:20 +00:00
2020-11-06 10:25:20.022 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 10M ThreadPool 32763 32767 1000 1000
2020-11-06 10:25:50.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 10M ThreadPool 32765 32767 1000 1000
2020-11-06 10:26:20.018 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 11M ThreadPool 32763 32767 1000 1000
2020-11-06 10:26:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:26:20 +00:00
2020-11-06 10:26:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 11M ThreadPool 32763 32767 1000 1000
2020-11-06 10:27:20.017 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 12M ThreadPool 32761 32767 1000 1000
2020-11-06 10:27:20.017 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:27:20 +00:00
2020-11-06 10:27:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 2 trace segment. cost: 00:00:00.0075005s
2020-11-06 10:27:23.031 +08:00 [sky_apm_demo] [Information] SkyApm.Transport.Grpc.V8.SegmentReporter : Report 6 trace segment. cost: 00:00:00.0156606s
2020-11-06 10:27:50.015 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 13M ThreadPool 32763 32767 1000 1000
2020-11-06 10:28:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 13M ThreadPool 32763 32767 1000 1000
2020-11-06 10:28:20.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:28:20 +00:00
2020-11-06 10:28:50.020 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 13M ThreadPool 32763 32767 1000 1000
2020-11-06 10:29:20.021 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 13M ThreadPool 32763 32767 1000 1000
2020-11-06 10:29:20.021 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:29:20 +00:00
2020-11-06 10:29:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 14M ThreadPool 32765 32767 1000 1000
2020-11-06 10:30:20.033 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:30:20 +00:00
2020-11-06 10:30:20.033 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 14M ThreadPool 32763 32767 1000 1000
2020-11-06 10:30:50.019 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 14M ThreadPool 32761 32767 1000 1000
2020-11-06 10:31:20.017 +08:00 [sky_apm_demo] [Information] SkyApm.Service.PingService : Ping server @2020/11/6 2:31:20 +00:00
2020-11-06 10:31:20.017 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 14M ThreadPool 32761 32767 1000 1000
2020-11-06 10:31:50.015 +08:00 [sky_apm_demo] [Information] SkyApm.Service.CLRStatsService : Report CLR Stats. CPU UsagePercent 0 GenCollectCount 0 0 0 15M ThreadPool 32763 32767 1000 1000



访问 SkyWalking UI 面板,可以看到用户请求的 URL 地址,服务调用的情况,如下图:

QQ截图20201106103017.jpg QQ截图20201106102951.jpg QQ截图20201106103043.jpg QQ截图20201106103102.jpg

最后,附上源码:

游客,如果您要查看本帖隐藏内容请回复





上一篇:ASP.NET Core 链路追踪(一)安装 Skywalking 教程
下一篇:.NET 基于 JWT 的邮箱验证教程
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
发表于 2020-11-30 11:39:33 | 显示全部楼层
[HttpGet]
        public async Task<IActionResult> Test()
        {
            var client = clientFactory.CreateClient();
            var response = await client.GetAsync($"https://www.itsvse.com/");
            if (response.IsSuccessStatusCode)
            {
                var str = await response.Content.ReadAsStringAsync();
                return Content(str);
            }
            else return Content("error");
        }


        [HttpGet]
        public async Task<IActionResult> Test1()
        {
            var client = clientFactory.CreateClient();
            var response = await client.GetAsync($"https://www.baidu.com/");
            if (response.IsSuccessStatusCode)
            {
                var str = await response.Content.ReadAsStringAsync();
                return Content(str);
            }
            else return Content("error");
        }
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
发表于 2021-4-7 10:42:03 | 显示全部楼层
我能连接,没有提交TRACE!!?
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

免责声明:
码农网所发布的一切软件、编程资料或者文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:help@itsvse.com

QQ|手机版|小黑屋|架构师 ( 鲁ICP备14021824号-2 )|网站地图

GMT+8, 2024-4-23 15:22

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表