源码及系列文章目录
Git 源码 :https://github.com/tangsong1995/TS.Microservices
CSDN 资源 :https://download.csdn.net/download/qq_33649351/34675095
系列文章目录 :https://blog.csdn.net/qq_33649351/article/details/120998558
安装
下载 skywalking : https://skywalking.apache.org/downloads/
windows 下可以使用 apache-skywalking-apm-bin\bin\startup.bat 快速启动。
代码集成
引用包:
SkyAPM.Agent.AspNetCore
SkyAPM.Transport.Grpc
SkyAPM.Transport.Grpc.Protocol
添加 skyapm.json :
{
"SkyWalking": {
"ServiceName": "ts-microservices-webapi",
"Namespace": "",
"HeaderVersions": [
"sw6"
],
"Sampling": {
"SamplePer3Secs": -1,
"Percentage": -1.0
},
"Logging": {
"Level": "Information",
"FilePath": "logs\\skyapm-{Date}.log"
},
"Transport": {
"Interval": 3000,
"ProtocolVersion": "v6",
"QueueSize": 30000,
"BatchSize": 3000,
"gRPC": {
"Servers": "localhost:11800",
"Timeout": 10000,
"ConnectTimeout": 10000,
"ReportTimeout": 600000
}
}
}
}
launchsettings.json 文件中添加环境变量:
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore"