Author: Zhao Yuguang, Seata Contributor, SkyWalking PMC
Background preface
As you can see in the title of the article, at this moment, Seata and SkyWalking two ecological integrations have achieved phased results. The following is a combination of the content of the article and I will come to you slowly.
The cause of the matter is like this. Seata and SkyWalking are leaders in the field of distributed transactions and one-stop APM respectively. This can be known from the Github Star rankings, so I won't repeat them. So as early as 2019, Seata users put forward the request to use SkyWalking observation.
After Seata is integrated into SkyWalking monitoring, it has the APM feature. When users locate the problems of Seata's distributed transactions, they can analyze the problems through multiple dimensions such as distributed links, machine indicators, and log content to improve the effectiveness of locating problems.
In combination with this request, the students interested in the two communities began preliminary discussions and practices. However, since Seata’s transmission protocol at that time did not have a transmission-oriented message header similar to HTTP Header, the first version was implemented. Realized monitoring and observation, but the compatibility is very unfriendly, which is obviously lacking in the monitoring of distributed transactions. Therefore, we started a second discussion and concluded that compatibility preconditions are necessary. Therefore, if Seata wants to upgrade the transmission protocol, Seata put this matter in RoadMap. The SkyWalking community has also put this matter on hold.
Time flies, and more than a year has passed in a blink of an eye. The Seata community has completed the upgrade of the transmission protocol in the process, so we will restart this matter.
1. After Seata connects to SkyWalking, what do users get
The background has been narrated. Because it has been a long time, maybe everyone is not very clear about the effects of the two ecological integrations. Here is my personal understanding, and I will introduce the two ecological integrations that will bring to users. benefit:
- Seata's performance can be better observed:
I see that many Seata users ask questions when sharing, Seata performance consumption data, because the performance consumption of distributed transactions is very related to the scene, so users can observe their own scenes more easily through SkyWalking and give their own answers.
- There are traces in the execution of distributed transactions
In AT mode, Seata passes the global transaction XID through the transmission-oriented message header. After the global transaction is executed, each execution process in the DB will be cleaned up. This is very unfriendly when backtracking the execution process. Seata does not store massive amounts of data, which severely increases the space of the database tables associated with distributed transactions and causes unnecessary performance consumption. Therefore, after the integration of the two ecosystems, SkyWalking-related database monitoring can record the massive data of these execution processes.
- the efficiency of positioning problems
Print the XID in the log and print the TraceId at the same time. When there is a problem and you want to trace back the global link associated with the XID, you can enter the TraceId on the display end of SkyWalking, and integrate into SkyWalking through the overall monitoring of Seata, which not only has the monitoring of the entire link field, The dashboard, topology map, online analysis and alarms are also monitored.
- Getting Started with Seata to improve one dimension
Distributed transactions have always been hot, but only Seata can really land in the market, so Seata does not have an open source learning template, so there are fewer materials to quickly guide you to get started. In addition, Seata has 3 roles and 4 classic modes, which can be combined in various ways. In summary, users can't help but be in the cloud. After the two ecosystems are integrated, users can clearly know the execution process of Seata from God (monitoring). , And then analyze the working principle.
2. Typical AT mode monitoring scenario
Below is the official AT mode Demo to show the APM features after access.
Officially described ToC transaction scenario
- User requests transaction services
- Transaction Service Locked Inventory
- Transaction Service Create Invoice
- Billing services for deductions
When Seata and SkyWalking merge, the scene is restored
Global transaction normal link description
Global transaction abnormal link description
User manual
Official website
SkyWalking APM:
http://seata.io/zh-cn/docs/user/apm/skywalking.html
Most used link
Seata: https://github.com/seata/seata
Samples: https://github.com/seata/seata-samples
Release: https://github.com/seata/seata/releases
Official website: ">https://seata.io
Contribution
Welcome everyone to contribute Seata-related practical articles to: _slievrly@gmail.com_
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。