当前位置:网站首页>『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



边栏推荐
- 【GO基础02】第一个程序
- 8000 word super detailed custom structure type
- Unity performance optimization direction
- Dovecot set mailbox quota
- 【测开方法论】测开平台pk心得-抉择
- What should I do if I encounter the problem of verification code during automatic testing?
- Basic knowledge in the project
- Uninstall NPM and install NPM_ Use 'NPM uninstall' to uninstall the NPM package 'recommended collection'
- Configuration and use of multithreading
- 如何快速搭建图片服务器[通俗易懂]
猜你喜欢

五种分配方式是否会产生内部碎片、外部碎片

Ansible+cronab batch deployment patrol

The second short contact of gamecloud 1608

如何实现一个App应用程序,限制用户时间使用?

虚拟内存与磁盘

突破性思维在测试工作中的应用

开源的RSS订阅器FreshRSS
![[leetcode ladder] linked list · 021 merge two ordered linked lists](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[leetcode ladder] linked list · 021 merge two ordered linked lists

Having met a tester with three years' experience in Tencent, I saw the real test ceiling

Animation curves are used every day. Can you make one by yourself? After reading this article, you will!
随机推荐
[51nod1676 undirected graph isomorphism] undirected graph hash [easy to understand]
c sqlite ... ...
dovecot 设置邮箱quota
Wet- a good choice for people with English difficulties - console translation
字节跳动技术面都过了,结果还是被刷了,问HR原因竟是。。。
【饭谈】测试平台为什么有组件化?模块化?很多看不到的地方设计的很好是种浪费么?
[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)
PE format: analyze and implement IATHOOK
2022最新软件测试八股文,能不能拿心仪Offer就看你背得怎样了
[assembly language 01] basic knowledge
zigbee开发板(nxpzigbee开发)
Redis内存淘汰机制?
At present, flynk CDC does not support mysql5.5. If you change the source code and release this restriction, there will be a lot of data problems?
In Oracle 19C version, logminer package continuous_ The outdated function of mine leads to CDC failure
Redis usage details
How to use RS485 half duplex chip correctly
Excuse me, how to deal with repeated consumption of MySQL data
JMeter websocket接口测试
Ijcai2022 meeting! Microsoft and other tutorials on domain generalization
2022 love analysis ― bank digitalization practice report