当前位置:网站首页>『Skywalking』. Net core fast access distributed link tracking platform
『Skywalking』. Net core fast access distributed link tracking platform
2022-07-25 22:02:00 【Lao Chen chat architecture】
Pay attention to me and don't get lost in learning back-end architecture
If it helps you , welcome Point a praise To encourage
If you need it next time , Sure Collection get up , Avoid missing next time
Share good news
『ScheduleMaster』 Get started quickly with a highly available open source distributed task scheduling platform

After reading this article, you can gain
- .NET Core Access Skywalking
- understand Skywalking The overall architecture design
- understand Skywalking What about the technical indicators of
- All pits during production deployment are skipped

List of articles

One 、 summary
1 Concept ——SkyWalking What is it? ?
Application performance monitor tool for distributed systems, especially designed for microservices, cloud native and container-based (Kubernetes) architectures.
Application performance monitoring tools for distributed systems , Dedicated to micro Services 、 Cloud native architecture and container based (Docker、K8s、Mesos) Architecture and Design .
Provide distributed tracking 、 Service grid telemetry analysis 、 Measurement aggregation and visualization integration solution .
2 Core functions

- Multiple monitoring means . You can use language probes and service mesh Getting monitoring is data
- Multiple language auto probes . Include Java,.NET Core and Node.JS
- Lightweight and efficient . No big data platform , And a lot of server resources
- modularization .UI、 Storage 、 There are various mechanisms for cluster management
- Support alarm
- Excellent visualization solution
3 System architecture

Consider making the description simpler , We give up Metric Index correlation , And focus on Tracing Link related functions .
- Upper part
Agent: Responsible for... From the application , Collect link information , Send to SkyWalking OAP The server . At present, we support SkyWalking、Zikpin、Jaeger And so on Tracing Data and information . And what we're using now is ,SkyWalking Agent collect SkyWalking Tracing data , Pass it to the server . - Lower part
SkyWalking OAP: Responsible for receiving Agent Sent Tracing Data and information , And then analyze it (Analysis Core) , To external storage ( Storage ), Finally, provide the query ( Query ) function . - Right section
Storage:Tracing data storage . At present, we support ES、MySQL、Sharding Sphere、TiDB、H2 Multiple memories . And what we're using now is ES , The main consideration is SkyWalking The development team's own production environment uses ES Mainly . - Left part
SkyWalking UI: Responsible for providing the console , Look at the links and so on .

Two 、 Tool installation
- Skywalking Download installation reference for : Click here to jump

3、 ... and 、.NET Project access
1. NuGet Package reference
- It needs to pass in every service NuGet quote
SkyAPM.Agent.AspNetCore, If it is .net core3.1 You need to choose1.3.0edition
2. Add configuration file skyapm.json

{
"SkyWalking": {
"ServiceName": "demo-application",
"Namespace": "",
"HeaderVersions": [
"sw8" //6.x The following version is sw6
],
"Sampling": {
"SamplePer3Secs": -1,
"Percentage": -1.0
},
"Logging": {
"Level": "Information", // Fill in the blanks
"FilePath": "logs\\skyapm-{Date}.log"// Fill in the blanks
},
"Transport": {
"Interval": 3000,
"ProtocolVersion": "v8", //6.x The following version is v6
"QueueSize": 30000,
"BatchSize": 3000,
"gRPC": {
"Servers": "localhost:11800", //ip:port
"Timeout": 10000,
"ConnectTimeout": 10000,
"ReportTimeout": 600000
}
}
}
}
- Be careful :
- gRPC Of Servers You need to specify the SkyWalking The server address of , The default port is 11800
v8Refers to the version number , The new version isv8
3. Configure environment variables
- Directly change the startup file
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore"

- Or at startup Program.cs->Main() Set the environment variable at the beginning of the method
Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", "SkyAPM.Agent.AspNetCore");

4. skyapm.json File output
- take skyapm.json File properties ” Copy to output directory “ It is amended as follows ” If newer, copy ”


Four 、 Operation monitoring
- Now you can use , open skywalking Address , See the effect
- here , We can see .NET Core The service of the application is
demo-application
1 General service ——General-Service
General service (General-Service): Represents a series or set of workloads that provide the same behavior for requests . In the use of Agent or SDK When , You can define the name of the service .

2 Main monitoring indicators
- Click on
demo-applicationThis service name , You can see the 【 Overall monitoring information 】

ApdexScore: Performance index ,Apdex(Application Performance Index) It is an international standard ,Apdex It is the quantitative value of users' satisfaction with application performance . It provides a unified way to measure and report user experience , Take the end-user experience and application performance as a complete indicator for unified measurement , The highest is 1 The lowest is 0;ResponseTime: response time , That is, within the selected time , Average response time for all requests served (ms);ServiceLoad-Throughput: Service load - throughput , That is, within the selected time , The number of requests that the service responds to per minute (cpm)SuccessRate: Company -(SLA)service level agreement, Service level agreement ,SW Specifically refers to the percentage of successful requests that are responded to every minute .Slow Endpoint in Current Service: Current serviceslowEndpoint , The service indicator dashboard will list the endpoints with the largest response time of the current service Top10, If the response time of an endpoint is too high , We need to pay more attention to its indicators ( Click to copy the endpoint name ).Endpoint Load in Current Service: Current service load ( throughput ) High endpoint , From this, we can infer the load between instances . If the throughput of an instance is found to be low , You need to query instance indicators ( For example, query whether the instance has occurred GC, Or CPU Utilization is too high )
3 Service instance ——Service Instance
Service instance (Service Instance): Each of the above set of workloads is called an instance . It's like Kubernetes Medium pods equally , An instance of an operating system is not necessarily a service . But when you're using Agent When , A service instance is actually a real process on the operating system- Click on [Instance] tab , You can find the service 【 The instance list 】

4 Endpoint ——Endpoint
Endpoint (Endpoint): For the request path received by a specific service , Such as HTTP Of URI Path and gRPC The class name of the service + Method signature . here , We can see .Net Core An endpoint of the application , by API Interface /demo/echoClick on [Endpoint] tab , You can view the 【 Endpoint list 】

5 Topology ——Topology
- Click on [Topology] tab , You can view the 【 Topology 】

6 link ——Trace
- Click on [Trace] tab , You can view the 【 link 】.

7 journal ——Log
- Click on [Log] tab , You can view the 【 journal 】.


5、 ... and 、 Production environment deployment
If the start-up of the third point is adopted Program.cs->Main() Set the environment variable at the beginning of the method
Then the following operations can be omitted
1. Linux Deploy
- Command line startup mode , increase systemd environment variable , The grammar is
Environment=ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=SkyAPM.Agent.AspNetCore
2. Windows IIS Mode deployment
The project is compiled and published to IIS,SkyWalking It doesn't work , We need to be in IIS Set the environment variable in , There are two ways to set environment variables
- Method 1 : There will be web.config, We need to be in web.config Add environment variables to

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\MI.Web.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
<environmentVariables>
<environmentVariable name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="SkyAPM.Agent.AspNetCore" />
<environmentVariable name="SKYWALKING__SERVICENAME" value="xx.Service" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</location>
</configuration>
- Method 2 : adopt IIS To configure
- Select the corresponding item , Click configuration editor



边栏推荐
- Application of breakthrough thinking in testing work
- 面了个腾讯三年经验的测试员,让我见识到了真正的测试天花板
- redis主从架构锁失效问题(主从)
- Guiding principles of information security construction
- [leetcode ladder] linked list · 021 merge two ordered linked lists
- C language: random generated number + bubble sort
- C语言:随机生成数+冒泡排序
- 【测开方法论】测开平台pk心得-抉择
- Ijcai2022 meeting! Microsoft and other tutorials on domain generalization
- All you want to know about interface testing is here
猜你喜欢
![[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)](/img/33/08f7b72ce99e07821a1f4b6e594e13.png)
[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)

The second short contact of gamecloud 1608

立创EDA——我为什么要学EDA

GPON介绍及华为OLT网关注册配置流程

Performance debugging -- chrome performance
![[MAIXPY]kpu: load error:2005, ERR_ READ_ File: read file failed problem solving](/img/0b/da67b5a361a2cdfaf81568d34cf5f7.png)
[MAIXPY]kpu: load error:2005, ERR_ READ_ File: read file failed problem solving

The dragon lizard exhibition area plays a new trick this time. Let's see whose DNA moved?

面了个腾讯三年经验的测试员,让我见识到了真正的测试天花板

2022最新软件测试八股文,能不能拿心仪Offer就看你背得怎样了
![[Flink] flick rocksdbliststate reports an error you cannot add null to a liststate](/img/c0/1923e17f166ab4bc7d20f48398f366.jpg)
[Flink] flick rocksdbliststate reports an error you cannot add null to a liststate
随机推荐
成为比开发硬气的测试人,我都经历了什么?
Preliminary study on Tesseract OCR
卸载npm和安装npm_使用`npm uninstall`卸载npm软件包「建议收藏」
Having met a tester with three years' experience in Tencent, I saw the real test ceiling
Acwing 866. determining prime numbers by trial division
How to configure and use rocksdb in the flinksql environment
[fan Tan] in detail: lower control, upward management, upward drawing cake.
自动化测试岗花20K招人,到最后居然没一个合适的,招两个应届生都比他们强吧
【leetcode天梯】链表 · 021 合并两个有序链表
JS timer and swiper plug-in
[leetcode ladder] linked list · 876 find the middle node of the linked list
Open source RSS subscriber freshrss
[MAIXPY]kpu: load error:2005, ERR_ READ_ File: read file failed problem solving
Guys, how can Flink SQL submit tasks in per job mode?
The automation testing post spent 20K recruiting, but in the end, there was no suitable one. Both fresh students are better than them
Basic knowledge in the project
字节跳动技术面都过了,结果还是被刷了,问HR原因竟是。。。
Basic knowledge in the project
[dinner talk] those things that seem to be for the sake of the company but are actually incomprehensible (2: soft quality "eye edge" during interview)
[51nod1676 undirected graph isomorphism] undirected graph hash [easy to understand]