This is the sixth day of my participation in the August More text Challenge. For details, see:August is more challenging

In the microservice system, it is necessary to monitor each service or observe the service performance when the service is tested. We choose To use SkyWalking to complete this function. Skywalking can be used in a simple operation, and it is convenient to monitor the service operation.

Liverpoolfc.tv: skywalking.apache.org/docs/

Skyapm.github. IO /

Summary of a.

Based on Skywalking, it provides distributed service link tracing, service dependency topology drawing, panel display capabilities such as slow endpoints and slow SQL, and service alarm capabilities. At the same time, it has its own display panel, which can provide the integration capability of front and rear end invocation chains. Support for multiple languages: Java, C#, node.js, Go, PHP, and Nginx LUA.

SkyWalking provides observable capabilities for services, service instances, and endpoints.

2. The architecture

SkyWalking is logically divided into four parts: probe, platform back end, storage, and user interface.

  • Probes can vary from source to source, but they all collect data and format it into a format that SkyWalking can use.
  • Platform back end that supports data aggregation, data analysis, and the process that drives the data flow from the probe to the user interface. Analysis includes Skywalking native tracking and performance metrics as well as third-party sources, including Istio and Envoy Telemetry, Zipkin tracking formatting, and more.
  • Storage SkyWalking data is stored through an open plug-in interface. You can choose an existing storage system such as ElasticSearch, H2 or MySQL Cluster (Sharding-Sphere Management), or you can choose to implement one yourself. Of course, we welcome your contributions to the new storage system implementation.
  • UI A highly customizable Web system based on interfaces that allows users to visually view and manage SkyWalking data.

Install – Java version

1. Basic environment

Required JDK and ElasticSearch to download and install by baidu

Download the corresponding apm bags, skywalking download address: skywalking.apache.org/downloads/ installation:

Jdk1.8 elasticsearch - 7.8.1 apache - skywalking - apm - es7-8.3.0Copy the code

2. Decompress apache-Skywalk-apm-ES7-8.3.0.tar. gz and configure it
  • The contents after decompression

  • Modify config/application.yml to configure storage (this test uses ElasticSearch7)

Store has a variety of ways: elasticsearch6, 7 / h2 / mysql/tidb influxdb

Configuration is as follows

storage:
selector: ${SW_STORAGE:elasticsearch7}
elasticsearch7:
  nameSpace: ${SW_NAMESPACE:""}
  clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
  user: ${SW_ES_USER:""}
  password: ${SW_ES_PASSWORD:""}
Copy the code
3. Start skywalking

Before starting ElasticSearch, ensure that it is started and running properly

Run the startup.sh script in the bin directory to start the startup

Access localhost:8080 to open the UI

Four, start the application

  • – Dskywalking. Agent. The namespace name space – can distinguish between different environments
  • – Dskywalking. Agent. The service_name service name
  • – Dskywalking. Collector. Backend_service skywalking interface address (start the default port 11800)

Jar launch :(includes the full skywalking-agent.jar path, and can’t move the jar)

java -javaagent:/developSoftware/apache-skywalking-apm-bin-es7/agent/skywalking-agent.jar -Dskywalking.agent.namespace=ajisun-dev -Dskywalking.agent.service_name=ajisun-dev:ajisun-platform -Dskywalking.collector.backend_service=localhost:11800 -jaryourApp.jar
Copy the code

Start in idea :(write to VM options)

-javaagent:/developSoftware/apache-skywalking-apm-bin-es7/agent/skywalking-agent.jar -Dskywalking.agent.namespace=ajisun-dev -Dskywalking.agent.service_name=ajisun-dev:ajisun-platform -Dskywalking.collector.backend_service=localhost:11800
Copy the code

As shown in figure:

Effect after startup:

Five, function introduction

1. The dashboard
  1. Throughput CPM, which represents calls per minute.
  2. Apdex score: a measure of server performance
  3. Percentage of response time, includingp99.p95.p90.p75.p50.
  4. SLA indicates the success rate. For HTTP, this represents a request with a response of 200.

Monitoring data summary:

Service dimension data:

2. The topology

Topology View Displays the relationship between services and instances using metrics. Click a service to display monitoring data

  1. Topology Displays the default global topology that contains all services.
  2. Service selectors support displaying direct relationships, both upstream and downstream.
  3. A user-defined group provides any subtopology function of a service group.
  4. Service drill-down is turned on when any service is clicked. The graph allows you to measure, track, and alert the selected services.
  5. The relationship of service metrics provides a measure of service RPC interactions and instances of the two services.
3. Tracking and query

Tracking queries are typical of the distributed agents provided by Skywalk.

  1. The trace part list is not a trace list. Each trace has several segments belonging to different services. If you query by all services or by trace ID, you can list different segments with the same trace ID.
  2. If the span is available click, the details of each span will pop up on the left.
  3. The trace view provides three typical and different usage views to visualize the trace.
  4. The associated service shows all the services that passed through the interface invocation
4. Performance analysis

An interactive feature. Provides method-level performance diagnostics.

  1. Select a specific service.
  2. Set the endpoint name. This endpoint name is usually the operation name of the first span. Find the segment list view on the trace query.
  3. The monitoring time can start now, or any time in the future.
  4. The monitoring duration defines a window of observation time to find appropriate requests for performance analysis. Even if the profile has a very limited impact on the performance of the target system, it is still an additional load. This time allows the impact to be manageable.
  5. The minimum duration threshold provides a filter mechanism so that if a given endpoint responds quickly to requests, it will not be alien. This ensures that the configured data is as expected.
  6. The maximum sampling count represents the maximum data set that the Agent will collect. It helps reduce memory and network load.
  7. An implicit condition that Skywalk accepts only one profile task per service at any one time.
  8. Agents can have different Settings to control or limit this feature, please read the documentation Settings for more details.
  9. Not all SkyWalking ecosystem agents support this feature; Java agents in 7.0.0 support this feature by default.

Once the configuration file is complete, the configured trace segment is displayed. You can analyze any span. In general, we analyze the span with a long self-duration, and if both the span and its subspan have a long duration, we can choose to “include the subspan” or “exclude the subspan” to set the analysis bounds.

After selecting the correct span, click the Analysis button, and you will see the results of the stack-based analysis. The slowest method has been highlighted

Reference: skyapm. Making. IO /