Micropower service learning (five) - Micro service call tracking

Micro track background service call - to quickly locate the cause of a service call fails.

In addition there are several roles:

First, the optimization system bottlenecks

  By consuming record on each link after the call, quickly locate the bottleneck of the whole system, to make targeted optimization.

Second, optimize the link call

  You can analyze the call path passes through the service to track, and then assess whether it is reasonable. For example, a service call downstream depend on a number of services through link analysis, can evaluate whether each dependency are necessary, can be reduced by optimizing the business service depends.

Third, generate a network topology

  By tracking service link information recorded in the system, the network topology can generate a system call graph, the reaction system relies on what services, as well as the relationship between service calls what. On the network topology can also put more information call the service marked out, play a role in monitoring service.

Fourth, the transparent data transmission

  In addition to tracking service, business and often a need, expect the user data, from the beginning of the call has been passed down to each service system can get to the information. Such as business want to do some A / B testing, this time through the service tracking system, the A / B switch logic test has been passed down through each layer of the service can get to the switch level can be unified A / B testing.

 

Service tracking system principle

The core idea: a globally unique ID will be distributed through the same on each node of a service request together, thus reducing the original call relationship, the system can track, analyze call data and statistical indicators of the various systems. (Google paper --Dapper)

Thus derived: Twitter the Zipkin, Eagle Eye Ali, US group MTrace (below), etc.

 

  traceid : a user identifier of a particular request ID. When a user requests access to the system, RPC calls in the network layer to generate a first globally unique traceid, and each layer will be as RPC call back continuously transmitted, so that by the time the user can traceid request path system call series.

  spanId: RPC call for identifying a location in the distributed request. When the user request into the system, the initial value of the first layer spanId A RPC calls in the network is 0, the RPC calls into the layer B is 0.1 time spanId when spanId proceed to the next level RPC call 0.1 C .1, and B in the same layer as the RPC call spanId E 0.2, this is the case, you can pass through spanId spanId can locate a position of RPC requests which the system call, and it is dependent on the downstream Who.

 

Guess you like

Origin www.cnblogs.com/gzhcsu/p/11411530.html