Catalog

TIPS

This article is based on Skywalking 6.6.0 To write , theoretical support Skywalking 6.0+ All versions .

This article discusses how to use Skywalking Monitoring applications .

Skywalking There are many ways of using , Most popular at present ( And the most powerful ) Is based on Java agent Of .

Java agent Supported framework 、 Middleware etc. , Can be found in https://github.com/apache/skywalking/blob/v6.6.0/docs/en/setup/service-agent/java-agent/Supported-list.md see .

TIPS

  • except Java agent Out of the way ,Skywalking It also supports other languages agent, See https://github.com/apache/skywalking/blob/v6.6.0/docs/en/setup/README.md#language-agents-in-service
  • Besides ,Skywalking It also supports Service Mesh( for example Istio, See https://github.com/apache/skywalking/blob/v6.6.0/docs/en/setup/README.md#service-mesh )、Proxy( for example Envoy Proxy, See https://github.com/apache/skywalking/blob/v6.6.0/docs/en/setup/README.md#service-mesh ) , But these two ways of using are not very popular at present , So I don't want to repeat it , In fact, it is also relatively simple . Interested children's shoes can also be studied .

To configure java agent

  • find SkyWalking In bag agent Catalog ,agent The directory structure is as follows

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    +-- agent
    +-- activations
    apm-toolkit-log4j-1.x-activation.jar
    apm-toolkit-log4j-2.x-activation.jar
    apm-toolkit-logback-1.x-activation.jar
    ...
    +-- config
    agent.config
    +-- plugins
    apm-dubbo-plugin.jar
    apm-feign-default-http-9.x.jar
    apm-httpClient-4.x-plugin.jar
    .....
    skywalking-agent.jar
  • take agent Copy directory to any location

  • To configure config/agent.config
    • take agent.service_name Change it to your microservice name ;
    • If Skywalking And microservices are deployed on different servers , It needs to be modified collector.backend_service Value , This configuration is used to specify microservices and Skywalking Address of correspondence , The default is 127.0.0.1:11800 , Modify as needed . Of course agent.config There's a lot of configuration in the file , The table below explains in detail .

Start the application

java -jar Launched applications

for example , There is one Spring Boot application , Then we have finished modifying agent After the directory :

  • Execute the following command to start :

    1
    2
    #  Be careful -javaagent You have to -jar Before, oh 
    java -javaagent:/opt/agent/skywalking-agent.jar -jar somr-spring-boot.jar
  • If you want to IDE Start the test in , Please refer to the following figure for configuration , Then start .

Tradition Tomcat application

Linux Tomcat 7-9

modify tomcat/bin/catalina.sh The first line of :

1
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/agent/skywalking-agent.jar"; export CATALINA_OPTS

Windows Tomcat 7-9

modify tomcat/bin/catalina.bat The first line of :

1
set "CATALINA_OPTS=-javaagent:/opt/agent/skywalking-agent.jar"

Effect demonstration

Use Skywalking After monitoring the application , When an application API When interviewed , It will show a chart like this .

home page :

image-20191219003122935

Network topology : Can analyze the network destination of the request . Such as below , The request was called first foodie-dev This micro service , And then asked for localhost:3306 This MySQL database .

image-20191219003107863

track : This navigation bar is the most common one we use to locate problems , You can search for specific details of the query . Locate where the performance bottleneck lies .

image-20191219003143025

The alarm : seeing the name of a thing one thinks of its function .Skywalking Configurable alarm rules , When the configured threshold is exceeded , Push the alarm information .

Index comparison : Any indicator can be compared .

Related articles