CN109726016A - A kind of link tracing methods, devices and systems for distributed system - Google Patents

A kind of link tracing methods, devices and systems for distributed system Download PDF

Info

Publication number
CN109726016A
CN109726016A CN201711035346.5A CN201711035346A CN109726016A CN 109726016 A CN109726016 A CN 109726016A CN 201711035346 A CN201711035346 A CN 201711035346A CN 109726016 A CN109726016 A CN 109726016A
Authority
CN
China
Prior art keywords
node
tracking
call request
label
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711035346.5A
Other languages
Chinese (zh)
Inventor
孙忠英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201711035346.5A priority Critical patent/CN109726016A/en
Publication of CN109726016A publication Critical patent/CN109726016A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

This application discloses a kind of link tracing methods for distributed system comprising: when the call request of remote procedure call is by calculating device node, generate the tracking label of this node;According to the tracking of this node label and call request of this node to sub- node, generates child node and track data;Child node tracking data are encapsulated to this node in the far call request of sub- node;The call request of encapsulation of data is sent to the child node;Child node receives the call request of encapsulation of data, and generates child node tracking label according to call request;It repeats the above steps for this any node and its child node, until each call request of affairs is completed;After the completion of each call request of affairs or single request, the tracking label of the tracking label of this node and child node is reported;Wherein, the calculating device node is known as this node.The application is related to a kind of link tracing device and system for distributed system simultaneously.

Description

A kind of link tracing methods, devices and systems for distributed system
Technical field
This application involves distributed system fields, and in particular to a kind of link tracing method for distributed system.This Apply while being related to a kind of link tracing device and system for distributed system.
Background technique
With the development of internet, distributed system solve server process data are huge, access request is frequent Problem.Distributed system (distributed system) is built upon the software systems on network, and system possesses a variety of logical Physics and logical resource, can dynamically distribute task, and the physics and logical resource of dispersion are realized by computer network Information exchange.
With the development of cloud, operator provides the network in access cloud, and equipment vendor provides a large amount of meter Calculation, storage and Internet resources.In this case, the node in system is more and more, and response requests paths traversed increasingly Complexity, i.e., for the management of distributed system, especially full link tracing is more difficult.Wherein, full link tracing be record or Determine that Distributed Services call the information of path and the whole nodes being related in primary specific request.Link tracing is to be directed to The determination of the information of the particular path of call request and the part of nodes being related to or record.
The link tracing of traditional distributed system mainly relies on program actively to get ready and reports, and developer is needed to write greatly The code of amount realizes function, and point of penetration cannot be guaranteed correctness.
Traditional APM (Application Performance Management, application performance management) technology is only supported The performance monitoring individually applied can not polymerize, and can not realize full link tracing.
Summary of the invention
The application provides a kind of link tracing method for distributed system, cannot be into solve existing distributed system The problem of capable automatic full link tracing.In addition the application provides a kind of link tracing device and system for distributed system.
A kind of link tracing method for distributed system provided by the present application comprising:
When the call request of remote procedure call is by calculating device node, the tracking label of this node is generated;
According to the tracking of this node label and call request of this node to sub- node, generates child node and track data;
Child node tracking data are encapsulated to this node in the far call request of sub- node;
The call request of encapsulation of data is sent to the child node;
Child node receives the call request of encapsulation of data, and generates child node tracking label according to call request;
It repeats the above steps for this any node and its child node, until each call request of affairs is completed;
After the completion of each call request of affairs or single request, by the tracking mark of the tracking label and child node of this node Note reports;
Wherein, the calculating device node is known as this node.
Optionally, if described node is intermediate node, the tracking label for generating this node includes:
Father node is received to request the far call of this node;
The far call request is parsed, obtaining father node is the tracking data that this node generates;
The tracking label of this node is generated according to the tracking data.
Optionally, described nodes keep track label includes the father node mark of the primary task identification for calling task, this node Label and this node label;
Wherein, the father node label of described node and this node label referred to as track label, and the tracking label is The code name of different nodes in primary calling task, for characterizing and distinguishing the different nodes in primary calling task.
Optionally, described according to the tracking of this node label and call request of this node to sub- node, generate child node Tracking data includes:
Tracking label is obtained according to the tracking of described node label;
Call request according to described node to sub- node creates child node label;
Child node tracking data are configured by the tracking label of described node and child node label.
Optionally, described to encapsulate child node tracking data to this node to wrapping in the request of the far call of sub- node It includes:
Child node tracking data are encapsulated to this node in the header file of the far call request of sub- node.
Optionally, described to encapsulate child node tracking data to this node to wrapping in the request of the far call of sub- node It includes:
Child node tracking data are encapsulated to this node in the header file of the far call request of sub- node;
Wherein head text child node tracking data encapsulated to this node to the far call request of sub- node In part, comprising:
This node is written into in the header file of the far call request of sub- node in the tracking label;
This node is written as the father node label of child node in described node label to ask the far call of sub- node In the header file asked;
This node is written into in the header file of the far call request of sub- node in the child node label.
Optionally, the child node receives the call request of encapsulation of data, and generates child node according to call request and chase after Track marks
Child node receives the call request of encapsulation of data;
The call request is parsed, the child node tracking data are obtained;
Data, which are tracked, according to the child node obtains child node tracking label.
Optionally, the call request is parsed, obtaining the child node tracking data includes:
Parse the header file of the call request;
The child node is obtained by the header file and tracks data.
Optionally, it for each node, after the tracking label for generating the node, is chased after described in record in MVC controller Track data.
Optionally, each node is the Tomcat server using Java language;
The far call request is the call request based on http agreement.
Optionally, if described node is root node, the tracking label for generating this node includes:
According to the call request for being directed to child node, the label that creates a trace is called for this.
Optionally, the tracking label includes: tracking label and this node label.
Optionally, described after the completion of each call request of affairs, by the tracking of the tracking label and child node of this node Label, which reports, includes:
It is described after the completion of each call request of affairs, by this node tracking label and child node tracking label report Into unified collector.
Optionally, described after the completion of each call request of affairs, by the tracking of the tracking label and child node of this node It includes: that the tracking label for tracking label and child node of this node is reported to unification in unified collector that label, which reports to, In collector and it is stored in Hbase database.
Optionally, further includes:
Read the tracking label in the collector;
According to the set membership of the far call of the tracking label record, the far call relationship for being directed to affairs is generated Tree.
In addition, the application also provides a kind of link tracing method for distributed system, any for far call Intermediate node, comprising:
The call request of father node is received, and is marked according to the tracking that the call request obtains this node;
According to the tracking of this node label and call request of this node to sub- node, generates child node and track data;
Child node tracking data are encapsulated to this node in the far call request of sub- node;
The call request of encapsulation of data is sent to the child node;
After the completion of each call request of affairs, the tracking label of this node is reported.
In addition, the application also provides a kind of link tracing method for distributed system, the root section for far call Point comprising:
Create the tracking label of this node;
According to the tracking of this node label and call request of this node to sub- node, generates child node and track data;
Child node tracking data are encapsulated to this node in the far call request of sub- node;
The call request of encapsulation of data is sent to the child node;
After the completion of each call request of affairs, the tracking label of this node is reported.
In addition, the application also provides a kind of link tracing method for distributed system, the terminal for far call Node comprising:
Receive the call request of father node;
The call request is parsed, and is marked according to the tracking that the call request obtains this node;
After the completion of each call request of affairs, the tracking label of this node is reported.
In addition, the application also provides a kind of link tracing device for distributed system, any for far call Intermediate node comprising:
This nodes keep track marks determination unit, obtains for receiving the call request of father node, and according to the call request Obtain the tracking label of this node;
Child node tracks data generating unit, for the tracking label according to this node with this node to the calling of sub- node Request generates child node and tracks data;
Encapsulation unit is requested for encapsulating child node tracking data to far call of this node to sub- node In;
Transmission unit, for sending the call request of encapsulation of data to the child node;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
In addition, the application also provides a kind of link tracing device for distributed system, the root section for far call Point comprising:
Creating unit, the tracking for creating this node mark;
Child node tracks data generating unit, for the tracking label according to this node with this node to the calling of sub- node Request generates child node and tracks data;
Encapsulation unit is requested for encapsulating child node tracking data to far call of this node to sub- node In;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
In addition, the application also provides a kind of link tracing device for distributed system, the terminal for far call Node comprising:
Receiving unit, for receiving the call request of father node;
Resolution unit is marked for parsing the call request, and according to the tracking that the call request obtains this node;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
In addition, the application also provides a kind of data processing method comprising:
First calculates the first call request that equipment receives remote procedure call, wherein first call request includes The address information of destination computing device;
Described first, which calculates equipment, generates the label for corresponding to the first calculating equipment;
The label is added to the call request by the first calculating equipment, obtains the second call request;
According to the address information, the first calculating equipment sends the second calculating for second call request and sets It is standby.
Compared with prior art, the one aspect of the application has the advantage that
The automatic full link monitoring tracking of distributed system is realized by byte code enhancement technology, realization, which automatically records, is The full link monitoring of system only need to add affairs it is not necessary to modify any code in application program launching, and point of penetration can protect Correctness is demonstrate,proved, the traditional approach that compares has obvious advantage;
The distribution that this link monitoring method can accomplish is to support cluster scale, supports that two applications are all clusters Scene.
Detailed description of the invention
Fig. 1 is a kind of link tracing method flow diagram for distributed system that the application first embodiment provides;
Fig. 2 is a kind of link tracing side for any intermediate node of distributed system that the application second embodiment provides The flow diagram of method;
Fig. 3 is a kind of stream for link tracing method for distributed system root node that the application 3rd embodiment provides Journey schematic diagram.
Fig. 4 is a kind of link tracing method for distributed system peripheral node that the application fourth embodiment provides Flow diagram;
Fig. 5 is the call relation schematic diagram that four nodes call three times in the embodiment of the present application;
Specific embodiment
Many details are explained in the following description in order to fully understand the application.But the application can be with Much it is different from other way described herein to implement, those skilled in the art can be without prejudice to the application intension the case where Under do similar popularization, therefore the application is not limited by following public specific implementation
It include multiple calculate nodes or computing cluster in distributed system, especially some distributed systems are by more multiple Miscellaneous or fairly large computer cluster is constituted, in each calculate node or cluster using relatively independent.One subtask of system Request may need to complete across multiple calculate nodes or computing cluster.Data communication between distributed system difference calculate node Generally pass through remote procedure call (Remote Procedure Call, RPC) Lai Shixian.RPC refers to that computer (such as is distributed The calculate node of formula system) process on A, the process on an other computer (calculate node of distributed system) B is called, Calling process on A is suspended, and the called process on B starts to execute, and when value returns to A, the process of A is continued to execute. Called side can send result information to called side by the interface parameters of setting.And when B process is unable to complete asking for A It asks, need to call the service on other nodes or is asked in application, can issue to call to computer C by way of as hereinbefore It asks, after completing corresponding data processing by the process on C, returns to B, the process on B relays to A, or combines own process Data processing after be transmitted to A.Similarly, when calling C while it can also call D, C and D that can also further call when B needs Other calculating equipment, and so on.Due to the complexity of distributed system, the completion once requested may need to call multiple meters Operator node, call relation is more complicated, the method for the embodiment of the present application propose it is a kind of how to track this call relation, with compared with It, further can be according to the call relation to distribution accurately to reflect the calling path of request and calling the indexs such as node System carries out resource adjustment, fault location and exclusion.
In the present embodiment, in certain request, when a certain node is called, such as computer B, B can become called section Point, and when B also needs further to call C node, then it is properly termed as passing by B node for call request, that is, passing by certain node It means request call certain node, and other node is further had invoked by certain node.
The application realizes the automatic full link monitoring tracking of distributed system by byte code enhancement technology.Please refer to figure 1, a kind of link tracing method flow diagram for distributed system provided for the application first embodiment.The present embodiment master If the implementation of java distributed system, the application is adapted to conform with all compartment systems of this method principle, does not do have herein Body limitation.
Step S101: when the call request of remote procedure call is by calculating device node (hereinafter referred to as this node), Generate the tracking label of this node.
In the present embodiment, it is the basic unit of link tracing that described node, which is a node of distributed system,.Its In, node can be for using the Tomcat server of Java language;Far call request can be the calling based on http agreement Request.
In the present embodiment, during link tracing, when call request passes by this node, pass through the tracking mark of this node Note reflects the case where this node is by far call request call, and reflects this node in call request by this nodes keep track label Call the relative position in path.As described above, the tracking label is for reflecting whether the request of certain far call is passed through This node, and reflect that this node calls the relative position in path in call request.Specifically, the tracking of the node marks It is made of the tracking label of node, the tracking label is the code name of the different nodes in primary calling task, for characterizing simultaneously Distinguish the different nodes in primary calling task.
Wherein in the present embodiment, the title (or ID) for the node that tracking label is called or passed by by call request is given birth to At since in the primary specific request of distributed system or task, the title (or ID) for the node for being called or passing by is Uniquely, the tracking label determined according to nodename (or ID) is also unique in a link tracing, that is, Ke Yiyong The node that the name of node is referred to as tracking label indicating call request calling or passing by.Tracking label then includes father node less Label, this node label and task identification (its concrete meaning sees below one section);Wherein, this node is reference mode, to receive As this node, the father node refers to without intermediate node and directly issues calling to this node and ask the node of call request The node asked issues the node of call request.The father node label is the node that call request is issued to this node Node label.Certainly, described above is one of set-up mode for tracking label, can also there is other setting sides Formula, such as indicated with Arabic numerals, it is indicated with the Latin alphabet, be will not enumerate herein, as long as in primary calling task In, different nodes are indicated with different code names.
Following four node (node1, node2, node3 and node4) is specifically described for far call three times, schemes The 5 call relation schematic diagrames called three times for four nodes.Referring to FIG. 5, assuming that aforementioned four nodes are Tomcat server, node1 are to be named as TomcatA, and node2 is named as TomcatB, and node3 is named as TomcatC, node4 It is named as TomcatD.
For example, in node A (referred to as TomcatA, i.e. node A are Tomcat server) and node B (TomcatB) two sections Point realizes far call request, and request data is from TomcatA to TomcatB.After far call request starts, firstly, being directed to one All requests of secondary calling task mark the secondary calling task, referred to as task identification with TransactionID, for the secondary tune The call request of the TransactionID is referred to as with the call request between all nodes of task.It is i.e. identical The node of TransactionID occurs that TransactionID=TomcatA is arranged in a far call task TIME 1 (is illustrative nature in the value TomcatA TIME 1 of this TransactionID, is obtained in practice according to default The encoded radio of TransactionID), i.e., TransactionID is marked with the start node comprising calling.Certainly, TransactionID can also have other set-up modes.
Then, it is called for identical TransactionID or label is tracked in the setting of called node, track the setting side of label Formula is as previously described;For example, the label of TomcatA and TomcatB is set as SpanID, that is, label is tracked, is distinguished by SpanID The title of each node;Call request data are from TomcatA to TomcatB, using TomcatB as reference mode (i.e. this node), Then TomcatA is the father node of TomcatB, indicates father node with pSpanID;Then the TomcatB of this link tracing is made For this node, tracking label is SpanID=TomcatB, and the father node label of this node is pSpanID=TomcatA, by Father node label, this node label and TransactionID=TomcatA TIME 1 above-mentioned collectively constitute this node Tracking label, is indicated with TraceID, and data are also referred to as tracked in the present embodiment.
As described above, call request required for called process or service in addition to comprising holding when a RPC is called and reached Capable particular content also includes tracking data as described above.In far call, each node includes a tracking mark TraceID is remembered, with the identical tracking label TransactionID of nodes sharing in a link tracing (Trace);Link SpanID and pSpanID is traced back through to arrange to inherit tree construction;TraceID be by TransactionID, SpanID and The data acquisition system of pSpanID composition, wherein TransactionID indicates calling task ID, and SpanID and pSpanID is indicated The parent-child relationship that RPC is called.
Being illustrated above a kind of situation is the situation that this node has father node, i.e. this node not instead of root node, intermediate Node;A kind of implementation of the tracking label for generating this node includes: to receive father node to the far call of this node Request;The far call request is parsed, obtaining father node is the tracking data that this node generates;It is raw according to the tracking data The tracking of cost node marks.By taking the TomcatB in Fig. 5 as an example, the tracking label for generating this node includes: reception father node TomcatA requests the far call of this node TomcatB;The far call request is parsed, acquisition father node is this node The tracking data of generation, include: in the tracking data task identification TransactionID=TomcatA TIME 1, father's section Point TomcatA label pSpanID=TomcatA and far call request the task definition to be completed;According to the tracking number According to the tracking label for generating this node, including generation: task identification TransactionID=TomcatA TIME 1, father node TomcatA label pSpanID=TomcatA, this node label SpanID=TomcatB.
In addition, if described node is root node, by taking root node TomcatA as an example: the tracking mark for generating this node Note includes: to call the label that creates a trace according to the call request for being directed to child node for this.Specifically, if this node is root Node TomcatA creates a trace according to the request of this far call and marks TraceID;Create task identification TransactionID =TomcatA TIME 1, completing the tracking label of all nodes that this request reaches is TransactionID= TomcatA\TIME\1;This node label SpanID=TomcatA;TomcatA father node TomcatA ' (not shown) label is PSpanID=-1 (root indicates that remote request is called and initiates node).
The far call of this node is requested as described above, receiving father node, generates the tracking label of this node, or After root node generates this nodes keep track label, each node is for after the tracking label for generating the node, is needed in MVC The tracking data are recorded in (Model View Controller model-view-controller) controller;
Step S102: it according to the tracking of this node label and call request of this node to sub- node, generates child node and chases after Track data.
As previously mentioned, if this node does not complete this request, being needed again in the primary calling task of distributed system It sends and requests to next node.Before sending request, this node is according to the tracking of this node label and this node to sub- node Call request, generate child node track data.
Described marked according to the tracking of this node tracks data with call request of this node to sub- node, generation child node It include: that tracking label is obtained according to the tracking label of described node;Call request according to described node to sub- node, wound Build child node label;Child node tracking data are configured by the tracking label of described node and child node label.
Specifically, with continued reference to FIG. 5, after this node TomcatB records the tracking data in MVC controller, Continue to request to next node TomcatC far call;Acquisition task mark is marked according to the tracking of described node TomcatB Know TransactionID=TomcatA TIME 1, and can get the father node label pSpanID=TomcatA of this node;Root Call request according to described node TomcatB to child node TomcatC creates child node label TomcatC;
By the task identification TransactionID=TomcatA TIME 1 and child node mark of described node TomcatB Label TomcatC is configured to child node TomcatC tracking data;It specifically includes: task identification that child node TomcatC, which tracks data, TransactionID=TomcatA TIME 1, child node label SpanID=TomcatC, child node father node (i.e. aforementioned Node TomcatB) label pSpanID=TomcatB.
In practical applications, if complete the request of far call need two with uplink, or simultaneously by two with On node Tomcat, then for each node, according to the tracking label of this node and this node to the calling of each child node Request generates child node respectively and tracks data.
For example, as shown in Figure 5, far call is requested after this node TomcatB, at the same by TomcatC and TomcatD that is, there are two the child nodes of TomcatB, then configures the tracking data of child node C according to foregoing description respectively;Again It repeats no more.
Step S103: child node tracking data are encapsulated to this node in the far call request of sub- node.
After creating child node tracking data, child node tracking data are encapsulated by predetermined manner to this node antithetical phrase section In the far call request of point, this request is made to realize link tracing while working on.
Described encapsulate child node tracking data to far call of this node to sub- node by predetermined manner is requested In include encapsulating the child node according to scheduled format and the position in request data and tracking data.
It is described to encapsulate child node tracking data to this node to one of in the far call request of sub- node Achievable mode includes: the header file encapsulated child node tracking data to this node to the far call request of sub- node In.Described encapsulates child node tracking data to this node to one in the header file of the far call request of sub- node Kind specific implementation can include: the tracking label is written to the header file of far call request of this node to sub- node In;The head of far call request of this node to sub- node is written using described node label as the father node label of child node In file;This node is written into in the header file of the far call request of sub- node in the child node label.
Specifically, this node TomcatB is written in the task identification TransactionID=TomcatA TIME 1 To in the header file of the far call request of child node TomcatC;Using described node label SpanID=TomcatB as son This node is written in the header file of the far call request of sub- node in the father node label pSpanID=TomcatB of node;It will This node is written in the header file of the far call request of sub- node in the child node label SpanID=TomcatC.For It the case where multilink or more child nodes, is packaged respectively, concrete mode can be identical with a node mode, no longer superfluous herein It states.
It is aforementioned by be specifically encapsulated in one of HTTP header optional in each label write-in far call request header file Configuration it is as follows:
HttpGet.setHeader(PINPOINT_TX_ID,"TomcatA\TIME\1");
HttpGet.setHeader(PINPOINT_SPAN_ID,"TomcatC");
HttpGet.setHeader(PINPOINT_PARENT_SPAN_ID,"TomcatB");
In addition it is also possible in other ways by child node tracking data encapsulation, it is any to be able to achieve encapsulation child node tracking number According to, and can be included within the protection scope of the application by the mode that next node parses, it is not particularly limited herein.
S104: Xiang Suoshu child node of step sends the call request of encapsulation of data.
After data encapsulate, the encapsulation of data is sent to child node, continues the execution of far call request;This implementation The request of far call described in example is the call request based on http agreement.
For example, HttpGet get=new HttpGet (" http://TomcatC/hello ");
HttpResponse response=httpClient.execute (get);
HttpClient.execute (get) method is according to the information in HttpGet, by child node tracking data envelope This node is filled to in the far call request of sub- node TomcatC;The calling of encapsulation of data is sent to child node TomcatC Request.
Step S105: child node receives the call request of encapsulation of data, and generates child node tracking according to call request Label.
After child node receives the call request of encapsulation of data, son is generated according to call request in the way of step S101 Nodes keep track label, the then number that the data structure of the child node tracking label is marked with this nodes keep track described in step S101 It is consistent according to structure.
The child node receives the call request of encapsulation of data, and generates child node tracking according to call request and mark it A kind of middle implementation specifically includes: child node receives the call request of encapsulation of data;The call request is parsed, institute is obtained State child node tracking data;Data, which are tracked, according to the child node obtains child node tracking label.
Specifically, child node TomcatC receives the far call request of encapsulation of data;Far call request is parsed, is obtained It obtains child node and tracks data, comprising: child node tracking label ChildTraceID and request data, comprising: child node tracking is marked Task identification TransactionID=TomcatA in note TIME 1, father node TomcatB label is pSpanID= TomcatB;And far call requests the content to be completed.
The call request is parsed, obtaining the child node tracking data includes:
Check the header file of the call request;
The child node is obtained by the header file and tracks data.
Call request is parsed, child node is obtained and tracks data, the present embodiment passes through the tracking label in identification head file TraceID mode and realize, configured according to the configuration of step S103, the two step parts embody this method and pass through increasing Strong Java bytecode enhancing technology realizes link tracing.
For example, TomcatC checks the head file HTTP header of request:
HttpServletRequest.getHeader(PINPOINT_TX_ID);
Recognize the tracking label TraceID in tracking data, in which: tracking label TransactionID= TomcatA ^TIME ^1, father node TomcatB label is pSpanID=TomcatB;This node TomcatC label SpanID =TomcatC.
It receives father node to request the far call of this node, the tracking label of this node is generated, in MVC controller Record the tracking data;Described that the tracking data are recorded in MVC controller, record specifically requests the affairs to be completed.
The case where for the more than two far calls request simultaneously of this node, TraceID weight is marked according to different trackings The multiple above process.
Step S106: repeating the above steps for this any node and its child node, until each call request of affairs is complete At.
For the next node of each this node, this node is father node, and next node is child node, weight Multiple above-mentioned steps, until each call request of affairs is completed.
Step S107: after the completion of each call request of affairs or after the completion of single request, the tracking of this node is marked It is reported with the tracking label of child node.
When this node is finish node, i.e., request is completed, and the tracking of the tracking label and child node of this node is marked It reports, i.e. progress link tracing.
It is described after the completion of each call request of affairs, by this node tracking label and child node tracking label report It specifically includes: it is described after the completion of each call request of affairs, it will be on the tracking label of this node and the tracking label of child node Report is into unified collector.It is described each call request of affairs after the completion of, by the tracking label and child node of this node It includes: that the tracking label of the tracking label of this node and child node is reported to system in unified collector that tracking label, which reports to, In one collector and it is stored in Hbase database.Read the tracking label in the collector;It is marked according to the tracking The set membership of the far call of record generates the far call relational tree for being directed to affairs.
For example, terminating to the HTTP calling of TomcatC, TomcatB's asks when TomcatC completes far call request It asks and also completes;Tracking data are sent to deposit to unified collector (pinpoint collector) pinpoint collector Storage is in HBase database;
UI (User Interface user interface) reads tracking data from HBase database and is created by sorting tree Build call stack.
In the specific implementation, the end UI (User Interface user interface) shows link scatterplot, scatterplot is gone with mouse frame choosing, It will show the details of the scatterplot.
It is of course also possible to after the single request of each node is completed will the tracking data of this node report.Herein Not reinflated description.
Foregoing description realizes the automatic full link of distributed system by the method based on byte code enhancement technology Monitoring, tracing may each be intermediate node, root node or peripheral node for each of distributed system node.Wherein, Byte code enhancement technology is also referred to as Java bytecode enhancing technology, refers to after Java bytecode generation, modifies to it, Enhance its function, the application the above embodiments are by the way that the father node label and this node label of this node are arranged in call request Realize to link tracing, while its data task is completed in call request, realize between request call path node and by Call the tracing record of nodal information.
It is the case where being used as different nodes in the request of different far calls to Mr. Yu's node below.
Referring to FIG. 2, its provided for the application second embodiment it is a kind of for any intermediate node of distributed system The flow diagram of link tracing method.A kind of link tracing method for distributed system of the present embodiment, for long-range Any intermediate node called, comprising:
S201 receives the call request of father node, and is marked according to the tracking that the call request obtains this node;
S202 generates child node and tracks number according to the tracking of this node label and call request of this node to sub- node According to;
S203 encapsulates child node tracking data to this node in the far call request of sub- node;
S204, Xiang Suoshu child node send the call request of encapsulation of data;
S205 reports the tracking label of this node after the completion of each call request of affairs.
Its concrete implementation mode can be referring to the description of above-mentioned first embodiment.
Referring to FIG. 3, it is chased after for a kind of link for distributed system root node that the application 3rd embodiment provides The flow diagram of track method.A kind of link tracing method for distributed system of the present embodiment, for far call Root node (root node herein is known as this node), comprising:
S301 creates the tracking label of this node;
S302 generates child node and tracks number according to the tracking of this node label and call request of this node to sub- node According to;
S303 encapsulates child node tracking data to this node in the far call request of sub- node;
S304, Xiang Suoshu child node send the call request of encapsulation of data;
S305 reports the tracking label of this node after the completion of each call request of affairs.
Its concrete implementation mode can be referring to the description of above-mentioned first embodiment.
Referring to FIG. 4, it is a kind of link for distributed system peripheral node that the application fourth embodiment provides The flow diagram of method for tracing.A kind of link tracing method for distributed system of the present embodiment, for far call Peripheral node (peripheral node herein is known as this node), comprising:
S401 receives the call request of father node;
S402 parses the call request, and is marked according to the tracking that the call request obtains this node;
S403 reports the tracking label of this node after the completion of each call request of affairs.
Its concrete implementation mode can be referring to the description of above-mentioned first embodiment.
In addition, the application also provides a kind of link tracing device for distributed system, any for far call Intermediate node, comprising:
This nodes keep track marks determination unit, obtains for receiving the call request of father node, and according to the call request Obtain the tracking label of this node;
Child node tracks data generating unit, for the tracking label according to this node with this node to the calling of sub- node Request generates child node and tracks data;
Encapsulation unit is requested for encapsulating child node tracking data to far call of this node to sub- node In;
Transmission unit, for sending the call request of encapsulation of data to the child node;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
In addition, the application also provides a kind of link tracing device for distributed system, the root section for far call Point, comprising:
Creating unit, the tracking for creating this node mark;
Child node tracks data generating unit, for the tracking label according to this node with this node to the calling of sub- node Request generates child node and tracks data;
Encapsulation unit is requested for encapsulating child node tracking data to far call of this node to sub- node In;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
In addition, the application also provides a kind of link tracing device for distributed system, the terminal for far call Node characterized by comprising
Receiving unit, for receiving the call request of father node;
Resolution unit is marked for parsing the call request, and according to the tracking that the call request obtains this node;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
Although the application is disclosed as above with preferred embodiment, it is not for limiting the application, any this field skill Art personnel are not departing from spirit and scope, can make possible variation and modification, therefore the guarantor of the application Shield range should be subject to the range that the claim of this application defined.
In addition, a kind of data processing method is also claimed in the application comprising: first, which calculates equipment, receives remote process The first call request called, wherein first call request includes the address information of destination computing device;First meter It calculates equipment and generates and correspond to the first label for calculating equipment;The label is added to the calling by the first calculating equipment asks It asks, obtains the second call request;According to the address information, the first calculating equipment sends second call request to Second calculates equipment.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
1, computer-readable medium can be by any side including permanent and non-permanent, removable and non-removable media Method or technology realize that information stores.Information can be computer readable instructions, data structure, the module of program or other numbers According to.The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory techniques, CD-ROM are read-only Memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or Other magnetic storage devices or any other non-transmission medium, can be used for storage can be accessed by a computing device information.According to Herein defines, and computer-readable medium does not include non-temporary computer readable media (transitory media), such as modulates Data-signal and carrier wave.
2, it will be understood by those skilled in the art that embodiments herein can provide as the production of method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application Form.It can be used moreover, the application can be used in the computer that one or more wherein includes computer usable program code The computer program product implemented on storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Form.

Claims (22)

1. a kind of link tracing method for distributed system characterized by comprising
When the call request of remote procedure call is by calculating device node, the tracking label of this node is generated;
According to the tracking of this node label and call request of this node to sub- node, generates child node and track data;
Child node tracking data are encapsulated to this node in the far call request of sub- node;
The call request of encapsulation of data is sent to the child node;
Child node receives the call request of encapsulation of data, and generates child node tracking label according to call request;
It repeats the above steps for this any node and its child node, until each call request of affairs is completed;
It, will be on the tracking label of this node and the tracking label of child node after the completion of each call request of affairs or single request Report;
Wherein, the calculating device node is known as this node.
2. the link tracing method according to claim 1 for distributed system, it is characterised in that: if described node For intermediate node, the tracking label for generating this node includes:
Father node is received to request the far call of this node;
The far call request is parsed, obtaining father node is the tracking data that this node generates;
The tracking label of this node is generated according to the tracking data.
3. the link tracing method according to claim 2 for distributed system, it is characterised in that: described node chases after Track label includes the father node label and this node label of the primary task identification for calling task, this node;
Wherein, the father node label of described node and this node label referred to as track label, and the tracking label is primary The code name of different nodes in calling task, for characterizing and distinguishing the different nodes in primary calling task.
4. the link tracing method according to claim 3 for distributed system, which is characterized in that described according to this section The tracking label of point and call request of this node to sub- node, generating child node tracking data includes:
Tracking label is obtained according to the tracking of described node label;
Call request according to described node to sub- node creates child node label;
Child node tracking data are configured by the tracking label of described node and child node label.
5. the link tracing method according to claim 1 or 4 for distributed system, which is characterized in that described by institute Child node tracking data are stated to encapsulate to this node to including: in the request of the far call of sub- node
Child node tracking data are encapsulated to this node in the header file of the far call request of sub- node.
6. the link tracing method according to claim 4 for distributed system, it is characterised in that: described by the son Nodes keep track data are encapsulated to this node to including: in the request of the far call of sub- node
Child node tracking data are encapsulated to this node in the header file of the far call request of sub- node;
It is wherein described to encapsulate child node tracking data in the header file requested to far call of this node to sub- node, Include:
This node is written into in the header file of the far call request of sub- node in the tracking label;
Far call request of this node to sub- node is written using described node label as the father node label of child node In header file;
This node is written into in the header file of the far call request of sub- node in the child node label.
7. being used for the link tracing method of distributed system described according to claim 1 or 2 or 3 or 4 or 6, it is characterised in that: The child node receives the call request of encapsulation of data, and generates child node tracking label according to call request and include:
Child node receives the call request of encapsulation of data;
The call request is parsed, the child node tracking data are obtained;
Data, which are tracked, according to the child node obtains child node tracking label.
8. the link tracing method according to claim 7 for distributed system, it is characterised in that: parse the calling Request, obtaining the child node tracking data includes:
Parse the header file of the call request;
The child node is obtained by the header file and tracks data.
9. the link tracing method according to claim 1 for distributed system, it is characterised in that: be directed to each section Point records the tracking data after the tracking label for generating the node in MVC controller.
10. being used for the link tracing method of distributed system described according to claim 1 or 2 or 3 or 4 or 6, feature exists In: each node is the Tomcat server using Java language;
The far call request is the call request based on http agreement.
11. the link tracing method according to claim 1 for distributed system, it is characterised in that: if described this section Point is root node, and the tracking label for generating this node includes:
According to the call request for being directed to child node, the label that creates a trace is called for this.
12. the link tracing method according to claim 11 for distributed system, it is characterised in that: the tracking mark Note includes: tracking label and this node label.
13. the link tracing method of distributed system is used for described according to claim 1 or 2 or 3 or 4 or 6 or 11 or 12, It is characterized in that: it is described after the completion of each call request of affairs, it will be on the tracking label of this node and the tracking label of child node Report includes:
It is described after the completion of each call request of affairs, by this node tracking label and child node tracking label report to system In one collector.
14. the link tracing method according to claim 13 for distributed system, it is characterised in that: described in affairs Each call request after the completion of, the tracking of the tracking label and child node of this node is marked and reports in unified collector and wraps It includes: the tracking label of the tracking label of this node and child node being reported in unified collector and is stored in Hbase data In library.
15. the link tracing method according to claim 13 for distributed system, it is characterised in that: further include:
Read the tracking label in the collector;
According to the set membership of the far call of the tracking label record, the far call relational tree for being directed to affairs is generated.
16. a kind of link tracing method for distributed system, for any intermediate node of far call, feature exists In, comprising:
The call request of father node is received, and is marked according to the tracking that the call request obtains this node;
According to the tracking of this node label and call request of this node to sub- node, generates child node and track data;
Child node tracking data are encapsulated to this node in the far call request of sub- node;
The call request of encapsulation of data is sent to the child node;
After the completion of each call request of affairs, the tracking label of this node is reported.
17. a kind of link tracing method for distributed system, the root node for far call characterized by comprising
Create the tracking label of this node;
According to the tracking of this node label and call request of this node to sub- node, generates child node and track data;
Child node tracking data are encapsulated to this node in the far call request of sub- node;
The call request of encapsulation of data is sent to the child node;
After the completion of each call request of affairs, the tracking label of this node is reported.
18. a kind of link tracing method for distributed system, the peripheral node for far call, which is characterized in that packet It includes:
Receive the call request of father node;
The call request is parsed, and is marked according to the tracking that the call request obtains this node;
After the completion of each call request of affairs, the tracking label of this node is reported.
19. a kind of link tracing device for distributed system, for any intermediate node of far call, feature exists In, comprising:
This nodes keep track marks determination unit, obtains this for receiving the call request of father node, and according to the call request The tracking of node marks;
Child node tracks data generating unit, for being asked according to the tracking of this node label and this node to the calling of sub- node It asks, generates child node and track data;
Encapsulation unit, for encapsulating child node tracking data to this node in the far call request of sub- node;
Transmission unit, for sending the call request of encapsulation of data to the child node;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
20. a kind of link tracing device for distributed system, the root node for far call characterized by comprising
Creating unit, the tracking for creating this node mark;
Child node tracks data generating unit, for being asked according to the tracking of this node label and this node to the calling of sub- node It asks, generates child node and track data;
Encapsulation unit, for encapsulating child node tracking data to this node in the far call request of sub- node;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
21. a kind of link tracing device for distributed system, the peripheral node for far call, which is characterized in that packet It includes:
Receiving unit, for receiving the call request of father node;
Resolution unit is marked for parsing the call request, and according to the tracking that the call request obtains this node;
Reporting unit, for after the completion of each call request of affairs, the tracking label of this node to be reported.
22. a kind of data processing method characterized by comprising
First calculates the first call request that equipment receives remote procedure call, wherein first call request includes target Calculate the address information of equipment;
Described first, which calculates equipment, generates the label for corresponding to the first calculating equipment;
The label is added to the call request by the first calculating equipment, obtains the second call request;
According to the address information, second call request is sent the second calculating equipment by the first calculating equipment.
CN201711035346.5A 2017-10-30 2017-10-30 A kind of link tracing methods, devices and systems for distributed system Pending CN109726016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711035346.5A CN109726016A (en) 2017-10-30 2017-10-30 A kind of link tracing methods, devices and systems for distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711035346.5A CN109726016A (en) 2017-10-30 2017-10-30 A kind of link tracing methods, devices and systems for distributed system

Publications (1)

Publication Number Publication Date
CN109726016A true CN109726016A (en) 2019-05-07

Family

ID=66291444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711035346.5A Pending CN109726016A (en) 2017-10-30 2017-10-30 A kind of link tracing methods, devices and systems for distributed system

Country Status (1)

Country Link
CN (1) CN109726016A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457190A (en) * 2019-07-09 2019-11-15 优估(上海)信息科技有限公司 A kind of full link monitoring method, apparatus and system based on block chain
WO2020259003A1 (en) * 2019-06-27 2020-12-30 深圳前海微众银行股份有限公司 Link tracking method and apparatus
CN112348208A (en) * 2020-10-13 2021-02-09 贵州电网有限责任公司 System and method for monitoring metering and collecting key service full link
CN112363697A (en) * 2020-11-12 2021-02-12 北京云宽志业网络技术有限公司 Data verification method, device, equipment and storage medium
WO2021056739A1 (en) * 2019-09-25 2021-04-01 平安科技(深圳)有限公司 Performance analysis method, device, computer apparatus and storage medium
CN112702191A (en) * 2020-12-11 2021-04-23 福建天晴在线互动科技有限公司 Link tracking method and terminal
CN112965973A (en) * 2021-02-10 2021-06-15 中国工商银行股份有限公司 Distributed database monitoring method and device based on full link monitoring
CN113114612A (en) * 2020-01-13 2021-07-13 北京京东振世信息技术有限公司 Method and device for determining call chain of distributed system
CN113452607A (en) * 2020-03-24 2021-09-28 华为技术有限公司 Distributed link acquisition method and device, computing equipment and storage medium
CN113448745A (en) * 2020-10-14 2021-09-28 北京新氧万维科技咨询有限公司 Service request tracking method and device and electronic equipment
CN113760647A (en) * 2021-04-15 2021-12-07 北京京东乾石科技有限公司 SQL tracking method, device, equipment, system and storage medium
CN114003472A (en) * 2022-01-04 2022-02-01 连连(杭州)信息技术有限公司 Data processing method and device, electronic equipment and storage medium
CN114302249A (en) * 2020-09-22 2022-04-08 华为云计算技术有限公司 Transmission chain information generation method and device
CN114328088A (en) * 2021-12-09 2022-04-12 泰康保险集团股份有限公司 Data acquisition method and device and electronic equipment
CN114547208A (en) * 2022-04-21 2022-05-27 北京奥星贝斯科技有限公司 Method for full link trace transactions and native distributed database
CN114817340A (en) * 2022-06-30 2022-07-29 深圳红途科技有限公司 Data tracing method and device, computer equipment and storage medium
CN114969111A (en) * 2022-08-01 2022-08-30 北京奥星贝斯科技有限公司 Logic sub-plan execution method, device and system of distributed database

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070083640A1 (en) * 2005-10-06 2007-04-12 Sap Ag Link tracking
US20090144324A1 (en) * 2004-01-27 2009-06-04 Sturdy James T Military data link integration apparatus and method
ES2337220A1 (en) * 2007-08-30 2010-04-21 Universidad Carlos Iii De Madrid Linkage management procedure in data link level for communications networks, data track linking procedure, networks and network interconnection device that combines both procedures. (Machine-translation by Google Translate, not legally binding)
CN104219316A (en) * 2014-09-12 2014-12-17 微梦创科网络科技(中国)有限公司 Method and device for processing call request in distributed system
CN106603270A (en) * 2016-11-10 2017-04-26 广州酷狗计算机科技有限公司 Tracking method and device for invoked link in distributed system
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090144324A1 (en) * 2004-01-27 2009-06-04 Sturdy James T Military data link integration apparatus and method
US20070083640A1 (en) * 2005-10-06 2007-04-12 Sap Ag Link tracking
ES2337220A1 (en) * 2007-08-30 2010-04-21 Universidad Carlos Iii De Madrid Linkage management procedure in data link level for communications networks, data track linking procedure, networks and network interconnection device that combines both procedures. (Machine-translation by Google Translate, not legally binding)
CN104219316A (en) * 2014-09-12 2014-12-17 微梦创科网络科技(中国)有限公司 Method and device for processing call request in distributed system
CN106603270A (en) * 2016-11-10 2017-04-26 广州酷狗计算机科技有限公司 Tracking method and device for invoked link in distributed system
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020259003A1 (en) * 2019-06-27 2020-12-30 深圳前海微众银行股份有限公司 Link tracking method and apparatus
CN110457190A (en) * 2019-07-09 2019-11-15 优估(上海)信息科技有限公司 A kind of full link monitoring method, apparatus and system based on block chain
WO2021056739A1 (en) * 2019-09-25 2021-04-01 平安科技(深圳)有限公司 Performance analysis method, device, computer apparatus and storage medium
CN113114612A (en) * 2020-01-13 2021-07-13 北京京东振世信息技术有限公司 Method and device for determining call chain of distributed system
CN113452607A (en) * 2020-03-24 2021-09-28 华为技术有限公司 Distributed link acquisition method and device, computing equipment and storage medium
CN114302249A (en) * 2020-09-22 2022-04-08 华为云计算技术有限公司 Transmission chain information generation method and device
CN112348208A (en) * 2020-10-13 2021-02-09 贵州电网有限责任公司 System and method for monitoring metering and collecting key service full link
CN113448745A (en) * 2020-10-14 2021-09-28 北京新氧万维科技咨询有限公司 Service request tracking method and device and electronic equipment
CN112363697B (en) * 2020-11-12 2021-10-12 北京云宽志业网络技术有限公司 Data verification method, device, equipment and storage medium
CN112363697A (en) * 2020-11-12 2021-02-12 北京云宽志业网络技术有限公司 Data verification method, device, equipment and storage medium
CN112702191A (en) * 2020-12-11 2021-04-23 福建天晴在线互动科技有限公司 Link tracking method and terminal
CN112702191B (en) * 2020-12-11 2023-07-21 福建天晴在线互动科技有限公司 Link tracking method and terminal
CN112965973A (en) * 2021-02-10 2021-06-15 中国工商银行股份有限公司 Distributed database monitoring method and device based on full link monitoring
CN113760647A (en) * 2021-04-15 2021-12-07 北京京东乾石科技有限公司 SQL tracking method, device, equipment, system and storage medium
CN114328088A (en) * 2021-12-09 2022-04-12 泰康保险集团股份有限公司 Data acquisition method and device and electronic equipment
CN114003472A (en) * 2022-01-04 2022-02-01 连连(杭州)信息技术有限公司 Data processing method and device, electronic equipment and storage medium
CN114003472B (en) * 2022-01-04 2022-04-12 连连(杭州)信息技术有限公司 Data processing method and device, electronic equipment and storage medium
CN114547208A (en) * 2022-04-21 2022-05-27 北京奥星贝斯科技有限公司 Method for full link trace transactions and native distributed database
WO2023202497A1 (en) * 2022-04-21 2023-10-26 北京奥星贝斯科技有限公司 Method for full-link tracking of transaction, and native distributed database
CN114817340A (en) * 2022-06-30 2022-07-29 深圳红途科技有限公司 Data tracing method and device, computer equipment and storage medium
CN114969111A (en) * 2022-08-01 2022-08-30 北京奥星贝斯科技有限公司 Logic sub-plan execution method, device and system of distributed database

Similar Documents

Publication Publication Date Title
CN109726016A (en) A kind of link tracing methods, devices and systems for distributed system
US20210081271A1 (en) Dynamic tracing control
US8874776B2 (en) Virtual ad hoc network testbeds for network-aware applications
CN108664385A (en) A kind of test method and device of application programming interface
EP3362901A1 (en) Telemetry response system
CN105052076A (en) Interface management service entity, functional service entity and network element management method
CN105763394B (en) A kind of network link detection method, device and system
CN113472719B (en) Method, equipment and storage medium for protocol analysis of gatekeeper based on data ferry
CN109858257A (en) Access control method and device
CN105391601A (en) Network management equipment performance testing method and system
CN113360386B (en) Method and device for testing driving of switching chip, electronic equipment and storage medium
US11153161B2 (en) Internet of things structure with a 3D adaption matrix
WO2017008658A1 (en) Storage checking method and system for text data
CN114416545A (en) Method and device for determining test code coverage rate and electronic equipment
CN118113781A (en) Redis synchronization method, redis synchronization device, storage medium and processor
CN107623555A (en) A kind of implementation method and device of general purpose communication emulation platform
CN111526028B (en) Data processing method, device and equipment
CN103744991B (en) A kind of method of data transfer between SAP system based on XML
CN105117347A (en) Test data simulation method and system and automation test method and system
CN105743724A (en) Method and device for testing services
CN104980352A (en) Routing method and device for multiline computer room
CN110022332A (en) A kind of Hyper text transfer security protocol Proxy Method, device, equipment and medium
CN110287099B (en) Simplified Loadrunner performance test method, server and computer readable storage medium
CN109814871B (en) Node management method and system based on DDS bus
CN108259527B (en) Proxy-based service processing method and device and network element equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190507

RJ01 Rejection of invention patent application after publication