Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and use of skywalking for downlink tracking of net core

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

In this issue, the editor will bring you about the installation and use of net core downlink tracking skywalking. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.

What is the invocation relationship between services when we use a lot of services? What is the sequence\ time performance of the monotonous use of each service? The service went wrong. Which service caused it? What solution do we use to solve these problems? in the past, each system made its own logs, and if there were problems, it was time-consuming and energy-consuming, and some logs were incomplete, which could not be found out. Fortunately, there is now a Skywalking link tracking system, which can trace the invocation relationship and performance status between various services without writing any code.

Build two webapi projects from 0 and use Skywalking to track the call relationship and response time between them. The development environment is VisualStudio2019

1.1. Install skywalking

Install skywalking will encounter a lot of holes, the first installation may not be successful, access to the 8080 port monitoring page will have a lot of problems. Even if the monitoring page is normal, the netcore program may not be able to monitor because link 11800 will fail, mostly due to problems with the skwwalking and elasticsearch versions. Because most of the storage options are elasticsearch, this is the main choice here. Install via docker-compose as below.

The documents are as follows:

Version: '3.3'services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.5.0 container_name: elasticsearch restart: always ports:-9200 Xmx256m 9200 environment:-discovery.type=single-node-bootstrap.memory_lock=true-"ES_JAVA_OPTS=-Xms256m-Xmx256m" ulimits: memlock: soft:-1 hard:-1 oap: image : apache/skywalking-oap-server:7.0.0-es7 container_name: oap depends_on:-elasticsearch links:-elasticsearch restart: always ports:-11800 elasticsearch restart 11800-12800 environment: SW_STORAGE: elasticsearch7 SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200 ui: image: apache/skywalking-ui:7.0.0 container_name: ui depends_on:-oap Links:-oap restart: always ports:-8080 environment: SW_OAP_ADDRESS: oap:12800

Check whether the service is working after installation. The three programs are elastic, skwwalking and skwwalkingui:

1.2 check whether the elastic and monitoring pages are normal

The connection is to install skwwalking server ip:9200 and skwwalking server ip:8080, respectively. If the port is occupied, replace it in advance:

two。 On the netcore program, here first run two procedures 2.1. Add the first netcore program, I am here is net5.

2.2 installation dependency

SkyAPM.Agent.AspNetCore, I'd better choose the version 0.9.0. (it is necessary to ensure that the installation service is normal and the program monitoring is normal before upgrading other versions.)

2.3 add skyapm.json files

Remember to copy the attribute to the output directory and set it to always copy to prevent the configuration file modification from not taking effect. Two things to note here are that 1.ServiceName should be the name of the current program, and Services is the skwwalking server ip:11800.

{"SkyWalking": {"ServiceName": "SkyWalkingDemo", "Namespace": "", "HeaderVersions": ["sw6"], "Sampling": {"SamplePer3Secs":-1, "Percentage":-1.0}, "Logging": {"Level": "Debug", "FilePath": "logs/skyapm- {Date} .log"} "Transport": {"Interval": 3000, "ProtocolVersion": "V6", "QueueSize": 30000, "BatchSize": 3000, "gRPC": {"Servers": "skywalking server ip:11800", "Timeout": 10000, "ConnectTimeout": 10000, "ReportTimeout": 600000} 2.4 Program launchSettings.json

Add a line "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore". If you start with iis express, you also need to add it to the iis express configuration. As follows:

2.5 after running, the monitoring screen looks like this:

3 add another program 3.1 New program steps are the same as 2.1

I will not repeat the following settings. I have changed the address of the startup, and the address of the second after the first startup can not be the same. The procedure is as follows:

3.2 A new controller controller is added here for testing.

The more casual code is as follows, and what to do is clear:

3.3 the monitoring results are as follows:

Having said that, this is just a simple installation and demonstration, there is a practical need to do further research, because the actual project requires a lot.

The above is the installation and use of net core downlink tracking skywalking shared by Xiaobian. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report