You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/05/08 14:13:36 UTC

[skywalking-website] branch master updated: add blog SkyWalking ShenYu observability practices (#449)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 356f0dd329 add blog SkyWalking ShenYu observability practices (#449)
356f0dd329 is described below

commit 356f0dd3290cf72e6741411a068d6413b2536ebe
Author: hutaishi <hu...@qq.com>
AuthorDate: Sun May 8 22:13:30 2022 +0800

    add blog SkyWalking ShenYu observability practices (#449)
---
 .../admin.png                                      | Bin 0 -> 106023 bytes
 .../database.png                                   | Bin 0 -> 67393 bytes
 .../endpoint.png                                   | Bin 0 -> 90308 bytes
 .../gateway-error-span.png                         | Bin 0 -> 89161 bytes
 .../gateway-instance.png                           | Bin 0 -> 157415 bytes
 .../grpc-error-span-log.png                        | Bin 0 -> 54911 bytes
 .../grpc-error-span.png                            | Bin 0 -> 108468 bytes
 .../grpc-error.png                                 | Bin 0 -> 101120 bytes
 .../grpc-generic-call.png                          | Bin 0 -> 45401 bytes
 .../grpc-ok.png                                    | Bin 0 -> 100299 bytes
 .../grpc-service-span.png                          | Bin 0 -> 95487 bytes
 .../img.png                                        | Bin 0 -> 103852 bytes
 .../index.md                                       | 144 +++++++++++++++++++++
 .../jvm.png                                        | Bin 0 -> 148858 bytes
 .../log-trace-detail.png                           | Bin 0 -> 55469 bytes
 .../log-trace.png                                  | Bin 0 -> 137018 bytes
 .../overview.png                                   | Bin 0 -> 138178 bytes
 .../shenyu-arch.png                                | Bin 0 -> 253638 bytes
 .../span-connect.png                               | Bin 0 -> 114223 bytes
 .../topology.png                                   | Bin 0 -> 164674 bytes
 .../topology2.png                                  | Bin 0 -> 127895 bytes
 .../admin.png                                      | Bin 0 -> 106023 bytes
 .../database.png                                   | Bin 0 -> 67393 bytes
 .../endpoint.png                                   | Bin 0 -> 90308 bytes
 .../gateway-error-span.png                         | Bin 0 -> 89161 bytes
 .../gateway-instance.png                           | Bin 0 -> 157415 bytes
 .../grpc-error-span-log.png                        | Bin 0 -> 54911 bytes
 .../grpc-error-span.png                            | Bin 0 -> 108468 bytes
 .../grpc-error.png                                 | Bin 0 -> 101120 bytes
 .../grpc-generic-call.png                          | Bin 0 -> 45401 bytes
 .../grpc-ok.png                                    | Bin 0 -> 100299 bytes
 .../grpc-service-span.png                          | Bin 0 -> 95487 bytes
 .../img.png                                        | Bin 0 -> 103852 bytes
 .../index.md                                       | 136 +++++++++++++++++++
 .../jvm.png                                        | Bin 0 -> 148858 bytes
 .../log-trace-detail.png                           | Bin 0 -> 55469 bytes
 .../log-trace.png                                  | Bin 0 -> 137018 bytes
 .../overview.png                                   | Bin 0 -> 138178 bytes
 .../shenyu-arch.png                                | Bin 0 -> 253638 bytes
 .../span-connect.png                               | Bin 0 -> 114223 bytes
 .../topology.png                                   | Bin 0 -> 164674 bytes
 .../topology2.png                                  | Bin 0 -> 127895 bytes
 42 files changed, 280 insertions(+)

diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/admin.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/admin.png
new file mode 100644
index 0000000000..cf61aea701
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/admin.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/database.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/database.png
new file mode 100644
index 0000000000..efbc70b23f
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/database.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/endpoint.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/endpoint.png
new file mode 100644
index 0000000000..92a4381fc5
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/endpoint.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-error-span.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-error-span.png
new file mode 100644
index 0000000000..762cee2b9b
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-error-span.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-instance.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-instance.png
new file mode 100644
index 0000000000..711340536e
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-instance.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span-log.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span-log.png
new file mode 100644
index 0000000000..536bd6a281
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span-log.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span.png
new file mode 100644
index 0000000000..2bea8e9939
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error.png
new file mode 100644
index 0000000000..fec5481e63
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-generic-call.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-generic-call.png
new file mode 100644
index 0000000000..8c72b966dc
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-generic-call.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-ok.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-ok.png
new file mode 100644
index 0000000000..f8a1857203
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-ok.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-service-span.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-service-span.png
new file mode 100644
index 0000000000..4f86fa0286
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-service-span.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/img.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/img.png
new file mode 100644
index 0000000000..a742ef7533
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/img.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/index.md b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/index.md
new file mode 100644
index 0000000000..28fea6f307
--- /dev/null
+++ b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/index.md
@@ -0,0 +1,144 @@
+---
+title: "Apache ShenYu(incubating) plugin implementation principles and observability practices"
+date: 2022-05-08
+author: hutaishi
+description: This article introduces the principle of ShenYu(incubating) plugin implementation and the observability practice of ShenYu(incubating) gateway
+tags:
+- SkyWalking
+- Apache ShenYu (incubating)
+- Observability
+- Tracing
+- Metrics
+- Logging
+---
+
+### Content
+
+1. [Introduction of SkyWalking and ShenYu](#1.-Introduction-of-SkyWalking-and-ShenYu)
+2. [Apache ShenYu plugin implementation principle](#2.-Apache-ShenYu-plugin-implementation-principle)
+3. [Adding generalized call tracking to the gRPC plugin and keeping it compatible](#3.-Adding-generalized-call-tracking-to-the-gRPC-plugin-and-keeping-it-compatible)
+4. [ShenYu Gateway Observability Practice](#4.-ShenYu-Gateway-Observability-Practice)
+5. [Summary](#5.-Summary)
+
+
+## 1. Introduction of SkyWalking and ShenYu
+
+### 1.1 SkyWalking
+
+[SkyWalking](https://github.com/hutaishi/skywalking) is an Application Performance Monitoring (APM) and Observability Analysis Platform (OAP) for microservices, distributed systems, and cloud natives,
+Has powerful features that provide a multi-dimensional means of application performance analysis, including distributed topology diagrams, application performance metrics, distributed link tracing, log correlation analysis and alerts. Also has a very rich ecology. Widely used in various companies and open source projects.
+
+### 1.2 Apache ShenYu (incubating)
+
+[Apache ShenYu (incubating)](https://github.com/apache/incubator-shenyu)
+High-performance,multi-protocol,extensible,responsive API Gateway. Compatible with a variety of mainstream framework systems, support hot plug, 
+users can customize the development, meet the current situation and future needs of users in a variety of scenarios, experienced the temper of large-scale scenes.
+Rich protocol support: `Http`, `Spring Cloud`, `gRPC`, `Dubbo`, `SOFARPC`, `Motan`, `Tars`, etc.
+
+![](shenyu-arch.png)
+
+
+## 2. Apache ShenYu plugin implementation principle
+
+ShenYu's asynchrony is a little different from previous exposure to asynchrony, it is a full-link asynchrony, the execution of each plug-in is asynchronous, and thread switching is not a single fixed situation (and the individual plug-in implementation is related).
+The gateway initiates service calls of various protocol types, and the existing SkyWalking plugins create ExitSpan (synchronous or asynchronous) when they initiate service calls.  The gateway receives the request and creates an asynchronous EntrySpan.
+The asynchronous EntrySpan needs to be concatenated with the synchronous or asynchronous ExitSpan, otherwise the link will be broken.
+
+
+There are 2 types of tandem solutions:
+- **Snapshot Delivery**:  
+  Pass the snapshot after creating the EntrySpan to the thread that created the ExitSpan in some way.  
+  Currently this approach is used in the asynchronous WebClient plugin, which can receive asynchronous snapshots. shenYu proxy Http service or SpringCloud service is to achieve span concatenation through snapshot passing.
+- **LocalSpan transit**:  
+  Other RPC class plugins do not receive snapshots for concatenation like Asynchronous WebClient. Although you can modify other RPC plugins to receive snapshots for concatenation, it is not recommended or necessary to do so.
+  This can be achieved by creating a LocalSpan in the thread where the ExitSpan is created, and then connecting the asynchronous EntrySpan and LocalSpan by `snapshot passing`. This can be done without changing the original plugin code.
+
+
+The span connection is shown below:  
+![](span-connect.png)
+
+You may ask if it is possible to create LocalSpan inside a generic plugin, instead of creating one separately for ShenYu RPC plugin?
+The answer is no, because you need to ensure that LocalSpan and ExitSpan are in the same thread, and ShenYu is fully linked asynchronously. The code to create LocalSpan is reused in the implementation.
+
+
+## 3. Adding generalized call tracking to the gRPC plugin and keeping it compatible
+
+The existing SkyWalking gRPC plugin only supports calls initiated by way of stubs. For the gateway there is no proto file, the gateway takes generalized calls (not through stubs), so tracing RPC requests, you will find that the link will break at the gateway node.
+In this case, it is necessary to make the gRPC plugin support generalized calls, while at the same time needing to remain compatible and not affect the original tracing method. This is achieved by determining whether the request parameter is a DynamicMessage, and if it is not, then the original tracing logic through the stub is used.
+If not, then the original tracing logic via stubs is used, and if not, then the generalized call tracing logic is used. The other compatibility is the difference between the old and new versions of gRPC, as well as the compatibility of various cases of obtaining server-side IP, for those interested in the source code.
+
+![](grpc-generic-call.png)
+
+## 4. ShenYu Gateway Observability Practice
+The above explains the principle of SkyWalking ShenYu plug-in implementation, the following deployment application to see the effect. SkyWalking powerful, in addition to the link tracking requires the development of plug-ins, other powerful features out of the box.
+Here only describe the link tracking and application performance analysis part, if you want to experience the power of SkyWalking features, please refer to the [SkyWalking official documentation](https://skywalking.apache.org/).  
+Version description:  
+- skywalking-java: `8.11.0-SNAPSHOT` source code build. Note: The shenyu plugin will be released in version 8.11.0, and will probably release it initially in May or June. the Java agent is in the regular release phase.
+- skywalking: `9.0.0` V9 version
+
+Usage instructions:  
+SkyWalking is designed to be very easy to use. Please refer to the official documentation for configuring and activating the shenyu plugin.
+- [SkyWalking Documentation](https://skywalking.apache.org/docs/main/latest/readme/)
+- [SkyWalking Java Agent Documentation](https://skywalking.apache.org/docs/skywalking-java/latest/readme/)
+
+
+### 4.1 Sending requests to the gateway
+Initiate various service requests to the gateway via the `postman` client or `other means`.
+
+### 4.2 Request Topology Diagram
+
+![](topology.png)
+  
+---
+![](topology2.png)
+
+---
+### 4.3 Request Trace (in the case of gRPC)
+
+#### Normal Trace:  
+![](grpc-ok.png)
+
+#### Abnormal Trace:  
+![](grpc-error.png)
+
+Click on the link node to see the corresponding node information and exception information   
+#### Service Provider Span  
+![](grpc-error-span.png)
+
+#### Gateway request span
+![](gateway-error-span.png)
+
+### 4.4 Service Metrics Monitoring
+
+
+![](overview.png)
+
+### 4.5 Gateway background metrics monitoring
+
+#### Database Monitoring:
+![](database.png)
+
+#### Thread pool and connection pool monitoring:
+![img.png](img.png)
+
+### 4.6 JVM Monitoring
+![](jvm.png)
+
+### 4.7 Endpoint Analysis
+![](endpoint.png)
+
+### 4.8 Exception log and exception link analysis
+[See official documentation for log configuration](https://skywalking.apache.org/docs/skywalking-java/latest/en/setup/service-agent/java-agent/application-toolkit-logback-1.x/)
+
+Log monitoring
+![](log-trace.png)
+
+Distributed link trace details corresponding to exception logs
+![](log-trace-detail.png)
+
+
+## 5. Summary
+SkyWalking has very comprehensive support for metrics, link tracing, and logging in observability, and is powerful, easy to use, and designed for large distributed systems, microservices, cloud-native, container architectures, and has a rich ecosystem.
+Using SkyWalking to provide powerful observability support for Apache ShenYu (incubating) gives ShenYu a boost. Finally, if you are interested in high-performance responsive gateways, you can follow
+[Apache ShenYu (incubating)](https://github.com/apache/incubator-shenyu).
+Also, thanks to SkyWalking such an excellent open source software to the industry contributions.
\ No newline at end of file
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/jvm.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/jvm.png
new file mode 100644
index 0000000000..89624f4aa5
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/jvm.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace-detail.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace-detail.png
new file mode 100644
index 0000000000..c888946cf2
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace-detail.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace.png
new file mode 100644
index 0000000000..c5b38f7848
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/overview.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/overview.png
new file mode 100644
index 0000000000..46505dbebb
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/overview.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/shenyu-arch.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/shenyu-arch.png
new file mode 100644
index 0000000000..5e25ec586b
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/shenyu-arch.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/span-connect.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/span-connect.png
new file mode 100644
index 0000000000..1d8c8ec035
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/span-connect.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology.png
new file mode 100644
index 0000000000..1e00f8ed7a
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology.png differ
diff --git a/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology2.png b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology2.png
new file mode 100644
index 0000000000..fbd9709bc8
Binary files /dev/null and b/content/blog/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology2.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/admin.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/admin.png
new file mode 100644
index 0000000000..cf61aea701
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/admin.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/database.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/database.png
new file mode 100644
index 0000000000..efbc70b23f
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/database.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/endpoint.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/endpoint.png
new file mode 100644
index 0000000000..92a4381fc5
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/endpoint.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-error-span.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-error-span.png
new file mode 100644
index 0000000000..762cee2b9b
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-error-span.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-instance.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-instance.png
new file mode 100644
index 0000000000..711340536e
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/gateway-instance.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span-log.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span-log.png
new file mode 100644
index 0000000000..536bd6a281
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span-log.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span.png
new file mode 100644
index 0000000000..2bea8e9939
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error-span.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error.png
new file mode 100644
index 0000000000..fec5481e63
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-error.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-generic-call.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-generic-call.png
new file mode 100644
index 0000000000..8c72b966dc
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-generic-call.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-ok.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-ok.png
new file mode 100644
index 0000000000..f8a1857203
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-ok.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-service-span.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-service-span.png
new file mode 100644
index 0000000000..4f86fa0286
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/grpc-service-span.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/img.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/img.png
new file mode 100644
index 0000000000..a742ef7533
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/img.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/index.md b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/index.md
new file mode 100644
index 0000000000..c48e8b57ed
--- /dev/null
+++ b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/index.md
@@ -0,0 +1,136 @@
+---
+title: "Apache ShenYu (incubating)插件实现原理和可观测性实践"
+date: 2022-05-08
+author: hutaishi
+description: 本文介绍Apache ShenYu (incubating)插件实现原理和ShenYu网关的可观测性实践
+zh_tags:
+- SkyWalking
+- Apache ShenYu (incubating)
+- Observability
+- Tracing
+- Metrics
+- Logging
+---
+
+### 目录
+
+1. [SkyWalking和ShenYu介绍](#1.-SkyWalking和ShenYu介绍)
+2. [ApacheShenYu插件实现原理](#2.-ApacheShenYu插件实现原理)
+3. [给gRPC插件增加泛化调用追踪并保持兼容](#3.-给gRPC插件增加泛化调用追踪并保持兼容)
+4. [ShenYu网关可观测性实践](#4.-ShenYu网关可观测性实践)
+5. [总结](#5.-总结)
+
+
+
+## 1.SkyWalking和ShenYu介绍
+
+### 1.1 SkyWalking
+
+[SkyWalking](https://github.com/hutaishi/skywalking)是一个针对微服务、分布式系统、云原生的应用性能监控(APM)和可观测性分析平台(OAP),
+拥有强大的功能,提供了多维度应用性能分析手段,包含分布式拓扑图、应用性能指标、分布式链路追踪、日志关联分析和告警。同时还拥有非常丰富的生态。广泛应用于各个公司和开源项目。
+
+### 1.2 Apache ShenYu (incubating)
+
+[Apache ShenYu (incubating)](https://github.com/apache/incubator-shenyu)是一个高性能,多协议,易扩展,响应式的API网关。
+兼容各种主流框架体系,支持热插拔,用户可以定制化开发,满足用户各种场景的现状和未来需求,经历过大规模场景的锤炼。
+支持丰富的协议:`Http`、`Spring Cloud`、`gRPC`、`Dubbo`、`SOFARPC`、`Motan`、`Tars`等等。
+
+![](shenyu-arch.png)
+
+
+## 2.ApacheShenYu插件实现原理
+
+ShenYu的异步和以往接触的异步有一点不一样,是一种全链路异步,每一个插件的执行都是异步的,并且线程切换并不是单一固定的情况(和各个插件实现有关)。
+网关会发起各种协议类型的服务调用,现有的SkyWalking插件发起服务调用的时候会创建ExitSpan(同步或异步).  网关接收到请求会创建异步的EntrySpan。
+异步的EntrySpan需要和同步或异步的ExitSpan串联起来,否则链路会断。
+串联方案有2种:
+- **快照传递**: 将创建EntrySpan之后的快照通过某种方式传递到创建ExitSpan的线程中。  
+ 目前这种方式应用在异步的WebClient插件中,该插件能接收异步快照。ShenYu代理Http服务或SpringCloud服务便是通过快照传递实现span串联。
+- **LocalSpan中转**:
+ 其它RPC类插件不像异步WebClient那样可以接收快照实现串联。尽管你可以改动其它RPC插件让其接收快照实现串联,但不推荐也没必要,
+ 因为可以通过在创建ExitSpan的线程中,创建一个LocalSpan就可以实现和ExitSpan串联,然后将异步的EntrySpan和LocalSpan通过`快照传递`的方式串联。这样实现完全可以不改动原先插件的代码。
+
+span连接如下图所示:  
+![](span-connect.png)
+
+也许你会问是否可以在一个通用的插件里面创建LocalSpan,而不是ShenYu RPC插件分别创建一个?
+答案是不行,因为需要保证LocalSpan和ExitSpan在同一个线程,而ShenYu是全链路异步. 在实现上创建LocalSpan的代码是复用的。
+
+
+## 3. 给gRPC插件增加泛化调用追踪并保持兼容
+
+现有的SkyWalking gRPC插件只支持通过存根的方式发起的调用。而对于网关而言并没有proto文件,网关采取的是泛化调用(不通过存根),所以追踪rpc请求,你会发现链路会在网关节点断掉。
+在这种情况下,需要让gRPC插件支持泛化调用,而同时需要保持兼容,不影响原先的追踪方式。实现上通过判断请求参数是否是动态消息(DynamicMessage),如果不是则走原先通过存根的追踪逻辑,
+如果是则走泛化调用追踪逻辑。另外的兼容则是在gRPC新旧版本的差异,以及获取服务端IP各种情况的兼容,感兴趣的可以看看源码。
+
+![](grpc-generic-call.png)
+
+## 4. ShenYu网关可观测性实践
+上面讲解了SkyWalking ShenYu插件的实现原理,下面部署应用看下效果。SkyWalking功能强大,除了了链路追踪需要开发插件外,其它功能强大功能开箱即用。
+这里只描述链路追踪和应用性能剖析部分,如果想体验SkyWalking功能的强大,请参考[SkyWalking官方文档](https://skywalking.apache.org/)。  
+版本说明:  
+- skywalking-java: `8.11.0-SNAPSHOT`源码构建。说明:shenyu插件会在8.11.0版本发布,可能会在5月或6月初步发布它。Java代理正处于常规发布阶段。
+- skywalking: `9.0.0` V9 版本
+
+用法说明:  
+SkyWalking的设计非常易用,配置和激活插件请参考官方文档。
+- [SkyWalking Documentation](https://skywalking.apache.org/docs/main/latest/readme/)
+- [SkyWalking Java Agent Documentation](https://skywalking.apache.org/docs/skywalking-java/latest/readme/)
+
+### 4.1 向网关发起请求
+通过`postman`客户端或者其它方式向网关发起各种服务请求
+
+### 4.2 请求拓扑图
+![](topology.png)
+
+---
+![](topology2.png)
+
+### 4.3 请求链路(以gRPC为例)
+
+#### 正常链路:  
+![](grpc-ok.png)
+
+#### 异常链路:  
+![](grpc-error.png)
+
+点击链路节点变可以看到对应的节点信息和异常信息  
+#### 服务提供者span
+![](grpc-error-span.png)
+
+#### 网关请求span
+![](gateway-error-span.png)
+
+### 4.4 服务指标监控
+
+服务指标监控
+![](overview.png)
+
+### 4.5 网关后台指标监控
+#### 数据库监控:
+![](database.png)
+
+#### 线程池和连接池监控
+![img.png](img.png)
+
+### 4.6 JVM监控
+![](jvm.png)
+
+### 4.7 接口分析
+![](endpoint.png)
+
+### 4.8 异常日志和异常链路分析
+[日志配置见官方文档](https://skywalking.apache.org/docs/skywalking-java/latest/en/setup/service-agent/java-agent/application-toolkit-logback-1.x/)
+
+日志监控
+![](log-trace.png)
+
+异常日志对应的分布式链路追踪详情
+![](log-trace-detail.png)
+
+
+## 5. 总结
+SkyWalking在可观测性方面对指标、链路追踪、日志有着非常全面的支持,功能强大,简单易用,专为大型分布式系统、微服务、云原生、容器架构而设计,拥有丰富的生态。
+使用SkyWalking为Apache ShenYu (incubating)提供强大的可观测性支持,让ShenYu如虎添翼。最后,如果你对高性能响应式网关感兴趣,可以关注
+[Apache ShenYu (incubating)](https://github.com/apache/incubator-shenyu) 。
+同时感谢SkyWalking这么优秀的开源软件对行业所作的贡献。
\ No newline at end of file
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/jvm.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/jvm.png
new file mode 100644
index 0000000000..89624f4aa5
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/jvm.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace-detail.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace-detail.png
new file mode 100644
index 0000000000..c888946cf2
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace-detail.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace.png
new file mode 100644
index 0000000000..c5b38f7848
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/log-trace.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/overview.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/overview.png
new file mode 100644
index 0000000000..46505dbebb
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/overview.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/shenyu-arch.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/shenyu-arch.png
new file mode 100644
index 0000000000..5e25ec586b
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/shenyu-arch.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/span-connect.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/span-connect.png
new file mode 100644
index 0000000000..1d8c8ec035
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/span-connect.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology.png
new file mode 100644
index 0000000000..1e00f8ed7a
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology.png differ
diff --git a/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology2.png b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology2.png
new file mode 100644
index 0000000000..fbd9709bc8
Binary files /dev/null and b/content/zh/2022-05-08-Apache-ShenYu(incubating)-Integrated-Skywalking-Practice-Observability/topology2.png differ