SkyWalking from installation to use

Write in front

skywalking is an observability analysis platform and application performance management system. It is an integrated solution for service tracking, measurement and recording, and supports multiple languages. Similar to zipkin, but much more powerful than it. I encountered many problems when using it, so I recorded the whole process in detail for reference.


skywalking: v8.6.0 for H2/MySQL/TiDB/InfluxDB/ElasticSearch 7
mysql: 8
springboot: 2.1.13.RELEASE


Official website Download the latest version:

Upload to the server and unzip

tar -zxvf apache-skywalking-apm-es7-8.6.0.tar.gz

Modify / Apache skywalking APM bin ES7 / config / application YML file, which specifies the cluster status, storage, configuration and other configurations of your skywalking. Make the following modifications:

112 that 's ok: selector: ${SW_STORAGE:h2}
Replace with: selector: ${SW_STORAGE:mysql}

The above changes indicate the use of mysql Store, and then modify 172 lines mysql Connection feature configuration for:
take ip,The user and password are changed to their own machine mysql And create a file named swtest Empty library, skywalking The table will be created at startup

      jdbcUrl: ${SW_JDBC_URL:"jdbc:mysql://"}
      dataSource.user: ${SW_DATA_SOURCE_USER:root}
      dataSource.password: ${SW_DATA_SOURCE_PASSWORD:root}

Above, we change the storage of skywalking to mysql. You need to:
/Add mysql driver package in apache-skywalking-apm-bin-es7 / OAP LIBS Directory: Download according to version.
After all the above are completed, you can start up: / apache-skywalking-apm-bin-es7/bin sh.
If the startup is successful, access http://ip:8080 The following page appears:

If the page does not come out, go to / apache-skywalking-apm-bin-es7/logs / to view the log. If port 8080 is occupied, go to / apache-skywalking-apm-bin-es7 / webapp / webapp YML modification


Skywalking is to realize local or remote service detection, data capture and so on through Java agent. When I understand the agent, I understand it as a client. Only when my service carries this client can my data be obtained by skywalking service. Next, see the specific operation:
Copy a copy of the agent folder under / apache-skywalking-apm-bin-es7 / and put it under / home. Start the service you want to listen to: Java - javaagent: / home / agent / skywalking agent jar -Dskywalking. agent. service_ name=demo -jar /home/project/demo. jar --server. port=20211 --spring. profiles. active=dev
The above command: - javaagent specifies the probe position, - dskywalking agent. service_ Name specifies the service name
If the startup is successful, we can see the current service on the home page:

In addition, when our service makes an interface request, we can see the trend details of the request on the topology map and tracking page:

Log monitoring

logback is used for logging. See the configuration directly:

  1. Introducing skywalking Toolkit:
  1. logback-spring. Introducing GRPCLogClientAppender into XML
<appender name="grpc-log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
    <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
        <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
            <pattern>%date [%X{tid}] [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">

<root level="INFO">
    <appender-ref ref="grpc-log" />
  1. springboot project configuration import
  config: classpath:logback-spring.xml
  1. Agent configuration: / Apache skywalking APM bin ES7 / agent / config / agent config

When you start the access, you can see:

Added by jotgabbi on Mon, 10 Jan 2022 23:33:47 +0200