WO2021151312A1 - Method for determining inter-service dependency, and related apparatus - Google Patents

Method for determining inter-service dependency, and related apparatus Download PDF

Info

Publication number
WO2021151312A1
WO2021151312A1 PCT/CN2020/122047 CN2020122047W WO2021151312A1 WO 2021151312 A1 WO2021151312 A1 WO 2021151312A1 CN 2020122047 W CN2020122047 W CN 2020122047W WO 2021151312 A1 WO2021151312 A1 WO 2021151312A1
Authority
WO
WIPO (PCT)
Prior art keywords
span
service
parent
service corresponding
message queue
Prior art date
Application number
PCT/CN2020/122047
Other languages
French (fr)
Chinese (zh)
Inventor
李铭路
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021151312A1 publication Critical patent/WO2021151312A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system

Definitions

  • This application relates to the field of computer technology, and in particular to a method and related devices for determining dependency relationships between services.
  • Jaeger is an open source distributed full-link monitoring system based on the opentracing protocol by Uber. After users access jaeger in their business systems, they can generate tracking information and record the status information of the interface processing and upstream calling components when calling the interface. Information and report to jaeger.
  • the inventor realized that the general user access to the full-link monitoring system jaeger's business system is a complex system with a distributed or micro-service architecture, so a lot of tracking information will be generated, and this tracking information can help users understand the business system Usage status among various components.
  • the amount of link tracking information data is very large. From the perspective of the needs of operation and maintenance personnel, they usually hope to understand the current business from a macro perspective.
  • the interface service status of each component in the system so as to confirm the health status of the current business system and even abnormal components.
  • jaeger's dependency calculation component spark-dependency can only calculate service dependencies within a whole day, and cannot meet the dependency query requirements in any time period. How to be flexible in the business system connected to jaeger Obtaining service dependency is a technical problem being studied by those skilled in the art.
  • the embodiment of the present application discloses a method and related device for determining the dependency relationship between services, which can flexibly obtain the dependency relationship between services.
  • the embodiment of the present application provides a method for determining the dependency relationship between services, which is applied to a business system, and the business system deploys the full-link monitoring system jaeger, and the method includes: using the full-link monitoring system jaeger Obtain the tracking information span when calling the interface; pass the tracking information span into the distributed message queue kafka; consume each tracking information span in the distributed message queue kafka to obtain the service and parent span corresponding to each span , And determine the service corresponding to the parent span; obtain the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
  • the embodiment of the present application provides a device for determining the dependency relationship between services, which is applied to a business system.
  • the business system deploys the full-link monitoring system jaeger.
  • the device includes: an acquisition module for passing The link monitoring system jaeger obtains the tracking information span when the interface is called; the transmission module is used to transfer the tracking information span into the distributed message queue kafka; the consumption module is used to consume each of the distributed message queue kafka Tracking information span, obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span; a generating module is used to obtain each span according to the service corresponding to each span and the service corresponding to the parent span The inter-service call dependencies represented by a span.
  • an embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory , And configured to be executed by the processor, and the program includes instructions for executing the steps in any method of the first aspect of the present application.
  • the business system deploys a full-link monitoring system jaeger, and when the computer program is executed by the processor, the following method is implemented: the full-link monitoring system jaeger obtains the tracking information span when the interface is called; Pass the tracking information span into the distributed message queue kafka; consume each tracking information span in the distributed message queue kafka, obtain the service and parent span corresponding to each span, and determine the corresponding parent span Service; According to the service corresponding to each span and the service corresponding to the parent span, the inter-service call dependency relationship represented by each span is obtained.
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following method: through the full-link monitoring system jaeger Obtain the tracking information span when calling the interface; pass the tracking information span into the distributed message queue kafka; consume each tracking information span in the distributed message queue kafka to obtain the service and parent span corresponding to each span , And determine the service corresponding to the parent span; obtain the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
  • the dependency relationship between computing services does not need to rely on jaeger's native data processing logic to calculate once a day, but based on the characteristics of kafka's timing batch processing, the dependency relationship between services represented by span is calculated in real time, which can flexibly obtain inter-service dependencies. relation.
  • FIG. 1 is a schematic diagram of the architecture of a service system connected to jaeger provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of another architecture of a service system connected to jaeger provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a method for determining a dependency relationship between services provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for determining a dependency relationship between services provided by an embodiment of the present application.
  • Fig. 5 is a schematic structural diagram of an apparatus for determining a dependency relationship between services provided by an embodiment of the present application.
  • Fig. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the technical solution of this application can be applied to the fields of smart city, blockchain and/or big data technology to achieve flexible access to dependencies between services.
  • the data involved in this application such as tracking information, can be stored in a database, or can be stored in a blockchain, which is not limited in this application.
  • Figure 1 is a schematic diagram of the architecture of a Jaeger-enabled business system provided by an embodiment of the present application.
  • the business system includes a user application, a jaeger-collector and a storage component (storage), among which:
  • the user application is used to directly push link tracking information (span) to the jaeger-collector, where there may be one or multiple user applications, and n in Figure 1 is taken as an example for illustration.
  • the distributed full-link monitoring system port jaeger-collector is used to store link tracking information (span) in the currently configured storage component storage to complete data processing and landing.
  • Figure 1 is a conventional business system connected to jaeger, which can only calculate the service dependency relationship within a whole day, and cannot meet the dependency query requirements in any time period. Therefore, the applicant of this application is shown in Figure 1 Optimized on the basis of the business system shown. After jaeger-collector collects the data, a new processing logic is added to calculate the dependencies between services. The new processing logic needs to be implemented based on the new business system architecture. Please refer to the figure. 2. It is a schematic diagram of the architecture of another business system connected to jaeger provided by an embodiment of the present application. In addition to the user application, jaeger-collector and storage components in Figure 1, the business system also includes a distributed message queue Kafka and computing components (dependency-plugin).
  • Jaeger-collector is used to process data (such as span) and transfer it to the distributed message queue kafka.
  • the distributed message queue kafka is used as a middleware to cache the data to be processed to ensure the reliability of data transmission.
  • the computing component (dependency-plugin) is used to connect the distributed message queue kafka in the form of a consumer group, and then consume relevant data from the distributed message queue kafka and calculate the service dependency relationship represented by each span, and save it The service depends on the related storage components.
  • the above-mentioned business system connected to jaeger may also include other components, for example, including some components in jaeger; for example, including conventional components in parts of the business system other than jaeger.
  • the business system shown in FIG. 1 and the hardware device on which the business system shown in FIG. 2 relies may be one server, or a server cluster composed of multiple servers, or other devices with computing capabilities. If the execution subject of the subsequent corresponding operations is an electronic device, it should be understood that it can be replaced by a server, or a server cluster, or other devices with computing capabilities.
  • Figure 3 is a schematic flow diagram of a method for determining dependency relationships between services of a full-link monitoring system provided by an embodiment of the present application.
  • the method can be implemented based on the architecture shown in Figure 2 or based on other accesses. This method includes but is not limited to the following steps.
  • Step S301 The electronic device obtains the tracking information span when the interface is called through the jaeger.
  • the electronic device is deployed with a business system, and the business system is used to support the user to complete the corresponding business.
  • the distributed full-link monitoring system jaeger is deployed in the business system. Therefore, the electronic device can obtain the tracking information span of the calling interface through the jaeger.
  • a globally unique trace ID traceID will be generated, which represents the uniqueness of the interface call request in jaeger.
  • the span will record the global trace ID traceID of the interface request and the current trace ID spanID (that is, the current trace ID).
  • the trace ID of the interface request The trace ID of the interface request), service name, interface name, call time and other information. If there are other upstream components participating in this call, the traceID, spanID and other information of other upstream component calls will also be recorded. Spans with the same traceID indicate that they belong to different call processing in the same interface call request.
  • Step S302 The electronic device transfers the tracking information span to the distributed message queue kafka.
  • the electronic device transfers the tracking information span to the distributed message queue kafka through the jaeger-collector.
  • Step S303 The electronic device consumes each tracking information span in the distributed message queue kafka, obtains the service and parent span corresponding to each span, and determines the service corresponding to the parent span.
  • traverse all spans to obtain the mapping relationship between spanID and service_name (service name). This process can obtain the service corresponding to each span; and traverse all spans and find service_name through parent_span_id (parentID), that is, determine the corresponding parent span service.
  • parentID parent_span_id
  • step S303 may be specifically implemented by the aforementioned computing component (dependency-plugin).
  • Step S304 The electronic device obtains the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
  • parent_service_name + child_service_name (that is, the name of the service corresponding to the parent span + the name of the service corresponding to the child span) is an edge, which represents a service dependency relationship.
  • Jaeger's span collection when consuming span from the distributed message queue Kafka, Jaeger's span collection can be considered compatible with the zipkin protocol of the distributed tracking system.
  • the embodiment of this application will determine whether there is tracking in the span.
  • the category (spanKind) field is used to handle special scenarios where the parent and child spanIDs are the same in the case of zipkin in remote procedure call (RPC) calls.
  • RPC remote procedure call
  • the embodiment of the application will update the child span with the service name of the parent span
  • the dependency relationship of the sub-span is used to update the dependency relationship of all spans that depend on the sub-span with the service name (or spanID) of the sub-span.
  • Step 1 The electronic device subscribes to the topic (topic) of the distributed message queue kafka cluster, and retrieves the span from the distributed message queue kafka cluster for consumption.
  • Step 2 For each span, the electronic device determines whether there is a spanKind field in the span. For different judgment results, there are differences in subsequent operations performed by the electronic device. For ease of description, the following takes the first span as an example. The first span is to retrieve any of the multiple spans from the distributed message queue kafka. One, the operation of the electronic device with respect to the first span is as follows.
  • spanKind field There is a spanKind field in the first span, and the spanKind field is a client (client), then update the span dependency information that is the same as the spanID of the first span and spanKind is the host (server).
  • Step 3 Put the spanID of the first span into the cyclic queue of the Least Recently Used (LRU) elimination algorithm, and put the first span into the cache with a fixed elimination time.
  • LRU Least Recently Used
  • Step 4 Take out the spanID from the circular queue regularly.
  • the spanID of the first span is taken out, check whether the first span has expired in the cache.
  • the two results of expiration and non-expiration correspond to two different follow-ups respectively. The operation is as follows.
  • the above steps 1 to 3 can be specifically completed by the dependency-plugin of the computing component in the business system.
  • other components in the business system can also be used to assist the calculation component dependency-plugin to complete one or more of the above steps 1 to 3.
  • the business system that introduces jaeger in the embodiment of the present application can also be compatible with other protocols, such as opentracing.
  • the calculation process of the dependency relationship when compatible with other protocols can refer to the calculation process of the dependency relationship between computing services compatible with the zipkin protocol, which will not be repeated here.
  • the embodiment of the present application proposes a new service dependency calculation processing flow for the business system that is connected to the full-link monitoring system jaeger
  • the jaeger in the business system can normally follow its original processing
  • the calculation of the service dependency is performed logically.
  • the new service dependency calculation process proposed in the embodiment of this application is used to calculate the service dependency in real time, and the service is calculated according to the original processing logic of Jaeger every day (that is, in units of days) Dependency.
  • the distributed message queue kafka is additionally introduced as a buffer middleware for the data collection process, and then consumed (for example, through self The developed dependency-plugin component for consumption) data in kafka is periodically batch processed span.
  • the dependencies between computing services do not need to rely on jaeger’s native data processing logic. It is calculated once a day, but based on the characteristics of kafka's timing batch processing, it calculates the dependencies between services represented by the span in real time.
  • the components of the computing service dependency are connected to the distributed message queue kafka in the form of a consumer group, the dependency between distributed computing services can be realized.
  • the distributed architecture can meet the capacity requirements of business peaks, and through distributed The decoupling effect of the message queue kafka, at the peak of the business, the service set dependency calculation process newly proposed in this application basically does not affect the performance of the original jaeger.
  • the expired span is clear in real time, and the availability of computing services can be guaranteed when the peak traffic is met.
  • the above method is compatible with multiple link tracing protocols, such as opentracing, zipkin and other protocols.
  • FIG. 5 is a schematic structural diagram of an apparatus 50 for determining a dependency relationship between services provided by an embodiment of the present application.
  • the apparatus 50 may be the electronic device in the foregoing method embodiment or a module in the electronic device.
  • the device is equipped with a business system (which can also be described as applied to a business system), and the business system deploys a full-link monitoring system jaeger.
  • the device 50 includes an acquisition module 501, a transmission module 502, a consumption module 503, and a generation module 504. The description of each module is as follows.
  • the obtaining module 501 is used to obtain the trace information span when the interface is called through the full-link monitoring system jaeger.
  • the transmission module 502 is configured to transfer the tracking information span to the distributed message queue kafka.
  • the consumption module 503 is configured to consume each trace information span in the distributed message queue kafka, obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span.
  • the generating module 504 is configured to obtain the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
  • the acquiring module 501 may be the jaeger-collector in the full link monitoring system jaeger mentioned in the method embodiment.
  • the transmission module 502 and the consumption module 503 may be two sub-modules in the dependency-plugin mentioned in the method embodiment.
  • an auxiliary system is deployed in the business system, and the auxiliary system includes the distributed message queue kafka and computing components; each trace in the distributed message queue kafka is consumed Information span, to obtain the service and parent span corresponding to each span, and to determine the service corresponding to the parent span.
  • the consumption module 503 is specifically configured to consume the distributed message queue kafka through the computing component For each tracking information span, the service and parent span corresponding to each span are obtained, and the service corresponding to the parent span is determined.
  • the jaeger is used to generate the inter-service call dependency relationship represented by each span based on the span. That is to say, in addition to obtaining the inter-service dependency through the newly added process in this application, the jaeger will also obtain the inter-service dependency based on its existing mechanism.
  • the consumption module 503 Specifically used for: judging whether there is a spanKind field in the first span, where the first span is any span in the distributed message queue kafka consumed; based on the judgment result based on the service and the corresponding service of the first span. The service corresponding to the parent span generates an inter-service call dependency relationship represented by the first span.
  • the consumption The module 503 is specifically used to: if the spanKind field does not exist in the first span, update all span dependency information with the spanID of the first span as the parentID; if the spanKind field exists in the first span and the spanKind field is client, update The spanID is the same as the span ID of the first span and spanKind is the span dependency information of the server; if the spanKind field exists in the first span and the spanKind field is the server, then all span dependency information with the spanID of the first span as the parentID is updated.
  • the consumption The unit 503 is also used to: put the spanID of the first span into the circular queue of the least recently used LRU elimination algorithm, and put the first span into the buffer with a fixed elimination time; and periodically take out the spanID from the circular queue
  • the spanID of the first span is obtained, it is determined whether the first span expires in the cache of the fixed elimination time; if it expires, the calculation processing of the dependency relationship of the first span is ended.
  • the trace information when the interface is called includes one or more of the traceID, spanID, service name, interface name, and calling time of the interface call request.
  • each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 3.
  • the distributed message queue kafka is additionally introduced as a buffer middleware for the data collection process, and then consumed (for example, through self The developed dependency-plugin component for consumption) data in kafka is periodically batch processed span.
  • the dependencies between computing services do not need to rely on jaeger’s native data processing logic. It is calculated once a day, but based on the characteristics of kafka's timing batch processing, it calculates the dependencies between services represented by the span in real time.
  • the components of the computing service dependency are connected to the distributed message queue kafka in the form of a consumer group, the dependency between distributed computing services can be realized.
  • the distributed architecture can meet the capacity requirements of business peaks, and through distributed The decoupling effect of the message queue kafka, at the peak of the business, the service set dependency calculation process newly proposed in this application basically does not affect the performance of the original jaeger.
  • the expired span is clear in real time, and the availability of computing services can be guaranteed when the peak traffic is met.
  • the above method is compatible with multiple link tracing protocols, such as opentracing, zipkin and other protocols.
  • FIG. 6 is a schematic diagram of an electronic device structure 60 of a hardware operating environment involved in an embodiment of the application.
  • the electronic device 60 is equipped with a business system (which can also be described as being applied to a business system), and the business system deploys a full-link monitoring system jaeger, where, as shown in FIG. 6, the hardware operating environment involved in the embodiment of the present application
  • the electronic equipment can include the following.
  • the processor 601 may be one or more central processing units (central processing units). processing unit, CPU).
  • CPU central processing units
  • the CPU may be a single-core CPU or a multi-core CPU.
  • the memory 602 includes but is not limited to random access memory (RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable A programmable read only memory (EPROM) or a portable read-only memory (compact disc read-only memory, CD-ROM), the memory 602 is used for related computer programs and data.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • CD-ROM compact disc read-only memory
  • the communication interface 603 is used to implement communication between the electronic device and other devices.
  • FIG. 6 does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or a combination of certain components, or different component arrangements. .
  • the memory 602 may include an operating system, a network communication module, and a text processing program.
  • the operating system is a program that manages and controls the hardware and software resources of electronic devices, and supports the operation of text processing programs and other software or programs.
  • the network communication module is used to implement communication between various components in the memory 602 and communication with other hardware and software in the electronic device.
  • the processor 601 is used to execute the computer program stored in the memory 602 to perform the following operations: obtain the trace information span when the interface is called through the full-link monitoring system jaeger; The span is passed into the distributed message queue kafka; each trace information span in the distributed message queue kafka is consumed, the service and parent span corresponding to each span are obtained, and the service corresponding to the parent span is determined; according to the The service corresponding to each span and the service corresponding to the parent span obtain the calling dependency relationship between the services represented by each span.
  • an auxiliary system is deployed in the business system, and the auxiliary system includes the distributed message queue kafka and computing components; each trace in the distributed message queue kafka is consumed Information span, to obtain the service and parent span corresponding to each span, and to determine the service corresponding to the parent span, the processor 601 is specifically configured to consume the distributed message queue kafka through the computing component For each tracking information span, the service and parent span corresponding to each span are obtained, and the service corresponding to the parent span is determined.
  • the processor is further configured to: generate the inter-service call dependency relationship represented by each span based on the span through the jaeger. That is to say, in addition to obtaining the inter-service dependency through the newly added process in this application, the jaeger will also obtain the inter-service dependency based on its existing mechanism.
  • the processor 601 specifically uses In: judging whether there is a spanKind field in the first span, where the first span is any span in the distributed message queue kafka consumed; based on the judgment result based on the service corresponding to the first span and the The service corresponding to the parent span generates the inter-service call dependency relationship represented by the first span.
  • the The processor 601 is specifically configured to: if the spanKind field does not exist in the first span, update all span dependency information with the spanID of the first span as the parentID; if the spanKind field exists in the first span and the spanKind field is client, then Update the span dependency information that is the same as the spanID of the first span and spanKind is the server; if there is a spanKind field in the first span and the spanKind field is server, then update all the span dependency information that uses the spanID of the first span as the parentID .
  • the processing The device 601 is also used to: put the spanID of the first span into the circular queue with the least recently used LRU elimination algorithm, and put the first span into the buffer with a fixed elimination time; and periodically take out the spanID from the circular queue
  • the spanID of the first span is obtained, it is determined whether the first span expires in the cache of the fixed elimination time; if it expires, the calculation processing of the dependency relationship of the first span is ended.
  • the trace information when the interface is called includes one or more of the traceID, spanID, service name, interface name, and calling time of the interface call request.
  • each operation may also correspond to the corresponding description of the method embodiment shown in FIG. 3.
  • the distributed message queue kafka is additionally introduced as a buffer middleware for the data collection process, and then consumed (for example, Consumption through the self-developed dependency-plugin component) Data in Kafka, timed batch processing span, using this method, due to the additional introduction of distributed message queue Kafka, so the dependency between computing services does not need to rely on the native data processing of Jaeger
  • the logic is calculated once a day, but based on the characteristics of kafka's timing batch processing, it calculates the dependencies between services represented by the span in real time.
  • the components of the computing service dependency are connected to the distributed message queue kafka in the form of a consumer group, the dependency between distributed computing services can be realized.
  • the distributed architecture can meet the capacity requirements of business peaks, and through distributed The decoupling effect of the message queue kafka, at the peak of the business, the service set dependency calculation process newly proposed in this application basically does not affect the performance of the original jaeger.
  • the expired span is clear in real time, and the availability of computing services can be guaranteed when the peak traffic is met.
  • the above method is compatible with multiple link tracing protocols, such as opentracing, zipkin and other protocols.
  • An embodiment of the present application also provides a chip system.
  • the chip system includes at least one processor, a memory, and an interface circuit.
  • the memory, the transceiver, and the at least one processor are interconnected by wires, and the at least one memory
  • a computer program is stored therein; when the computer program is executed by the processor, the method shown in FIG. 3 is implemented.
  • the embodiment of the present application also provides a computer-readable storage medium in which a computer program is stored, and when it runs on a processor, the method flow shown in FIG. 3 is implemented.
  • the following methods can be implemented: obtain the trace information span when the interface is called through the full link monitoring system jaeger; transfer the trace information span into the distributed message queue kafka; consume each of the distributed message queue kafka Track the information span, obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span; obtain the service represented by each span according to the service corresponding to each span and the service corresponding to the parent span Call dependencies between.
  • the program can also implement other steps of the above method when running on the processor, which will not be repeated here.
  • the medium involved in this application such as a computer-readable storage medium, may be non-volatile or volatile.
  • the embodiment of the present application also provides a computer program product.
  • the computer program product runs on a terminal, the method flow shown in FIG. 3 is implemented.
  • the distributed message queue kafka is additionally introduced as a buffer middleware for the data collection process, and then consumed (for example, through self-developed dependency- (plugin component for consumption) data in Kafka, timed batch processing span, using this method, due to the additional introduction of distributed message queue kafka, so the dependency between computing services does not need to rely on jaeger's native data processing logic to calculate once a day, Instead, it calculates the dependencies between services represented by span in real time based on the characteristics of kafka's timing batch processing.
  • the components of the computing service dependency are connected to the distributed message queue kafka in the form of a consumer group, the dependency between distributed computing services can be realized.
  • the distributed architecture can meet the capacity requirements of business peaks, and through distributed The decoupling effect of the message queue kafka, at the peak of the business, the service set dependency calculation process newly proposed in this application basically does not affect the performance of the original jaeger.
  • the expired span is clear in real time, and the availability of computing services can be guaranteed when the peak traffic is met.
  • the above method is compatible with multiple link tracing protocols, such as opentracing, zipkin and other protocols.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Disclosed are a method for determining inter-service dependency, and a related apparatus. The method is applied to a service system. The service system is deployed with a full link monitoring system jaeger. The method comprises: acquiring, by means of a full link monitoring system jaeger, a tracking information span when an interface is called; transmitting the tracking information span into a distributed message queue kafka; consuming each piece of tracking information span in the distributed message queue kafka to obtain a service corresponding to each span, and a parent span, and determining a service corresponding to the parent span; and obtaining, according the service corresponding to each span and the service corresponding to the parent span, an inter-service calling dependency represented by each span. By means the embodiments of the present application, an inter-service dependency can be flexibly acquired.

Description

一种确定服务间依赖关系的方法及相关装置Method and related device for determining dependency between services
本申请要求于2020年8月7日提交中国专利局、申请号为202010787909.1,发明名称为“一种确定服务间依赖关系的方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on August 7, 2020, the application number is 202010787909.1, and the invention title is "a method and related device for determining dependencies between services", the entire content of which is by reference Incorporated in this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种确定服务间依赖关系的方法及相关装置。This application relates to the field of computer technology, and in particular to a method and related devices for determining dependency relationships between services.
背景技术Background technique
jaeger是由uber公司开源,基于opentracing协议的分布式全链路监控系统,用户在自己的业务系统接入jaeger后,可以在调用接口时,产生追踪信息并记录接口处理的状态信息及上游调用组件信息,并上报到jaeger中。发明人意识到,一般用户接入全链路监控系统jaeger的业务系统是分布式或微服务架构的复杂系统,因此会产生非常多的追踪信息,而这些追踪信息可以帮助用户了解到业务系统内各个组件间的使用状况。但是用户在使用的过程中,由于接入了jaeger的业务系统的规模很复杂,链路追踪信息数据量很大,从运维人员的使用需求来看,通常希望先从宏观的角度了解当前业务系统中各组件的接口服务情况,从而确认当前业务系统的健康状态乃至异常组件。Jaeger is an open source distributed full-link monitoring system based on the opentracing protocol by Uber. After users access jaeger in their business systems, they can generate tracking information and record the status information of the interface processing and upstream calling components when calling the interface. Information and report to jaeger. The inventor realized that the general user access to the full-link monitoring system jaeger's business system is a complex system with a distributed or micro-service architecture, so a lot of tracking information will be generated, and this tracking information can help users understand the business system Usage status among various components. However, in the process of using, due to the complex scale of the business system connected to jaeger, the amount of link tracking information data is very large. From the perspective of the needs of operation and maintenance personnel, they usually hope to understand the current business from a macro perspective. The interface service status of each component in the system, so as to confirm the health status of the current business system and even abnormal components.
然而,发明人发现,jaeger的依赖关系计算组件spark-dependency只能计算一整天内的服务依赖关系,无法满足任意时间段内的依赖关系查询需求,如何在接入了jaeger的业务系统中灵活获取服务依赖关系是本领域技术人员正在研究的技术问题。However, the inventor found that jaeger's dependency calculation component spark-dependency can only calculate service dependencies within a whole day, and cannot meet the dependency query requirements in any time period. How to be flexible in the business system connected to jaeger Obtaining service dependency is a technical problem being studied by those skilled in the art.
技术问题technical problem
本申请实施例公开了一种确定服务间依赖关系的方法及相关装置,能够灵活获取服务间依赖关系。The embodiment of the present application discloses a method and related device for determining the dependency relationship between services, which can flexibly obtain the dependency relationship between services.
技术解决方案Technical solutions
第一方面,本申请实施例提供了一种确定服务间依赖关系的方法,应用于业务系统,所述业务系统部署了全链路监控系统jaeger,所述方法包括:通过全链路监控系统jaeger获取调用接口时的追踪信息span;将所述追踪信息span传入分布式消息队列kafka中;消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。In the first aspect, the embodiment of the present application provides a method for determining the dependency relationship between services, which is applied to a business system, and the business system deploys the full-link monitoring system jaeger, and the method includes: using the full-link monitoring system jaeger Obtain the tracking information span when calling the interface; pass the tracking information span into the distributed message queue kafka; consume each tracking information span in the distributed message queue kafka to obtain the service and parent span corresponding to each span , And determine the service corresponding to the parent span; obtain the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
第二方面,本申请实施例提供了一种确定服务间依赖关系的装置,应用于业务系统,所述业务系统部署了全链路监控系统jaeger,所述装置包括:获取模块,用于通过全链路监控系统jaeger获取调用接口时的追踪信息span;传输模块,用于将所述追踪信息span传入分布式消息队列kafka中;消费模块,用于消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;生成模块,用于根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。In the second aspect, the embodiment of the present application provides a device for determining the dependency relationship between services, which is applied to a business system. The business system deploys the full-link monitoring system jaeger. The device includes: an acquisition module for passing The link monitoring system jaeger obtains the tracking information span when the interface is called; the transmission module is used to transfer the tracking information span into the distributed message queue kafka; the consumption module is used to consume each of the distributed message queue kafka Tracking information span, obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span; a generating module is used to obtain each span according to the service corresponding to each span and the service corresponding to the parent span The inter-service call dependencies represented by a span.
第三方面,本申请实施例提供了一种电子设备,所述电子设备包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行本申请第一方面任一方法中的步骤的指令。应用于业务系统,所述业务系统部署了全链路监控系统jaeger,所述计算机程序被所述处理器执行时,实现以下方法:通过全链路监控系统jaeger获取调用接口时的追踪信息span;将所述追踪信息span传入分布式消息队列kafka中;消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。In a third aspect, an embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory , And configured to be executed by the processor, and the program includes instructions for executing the steps in any method of the first aspect of the present application. Applied to a business system, the business system deploys a full-link monitoring system jaeger, and when the computer program is executed by the processor, the following method is implemented: the full-link monitoring system jaeger obtains the tracking information span when the interface is called; Pass the tracking information span into the distributed message queue kafka; consume each tracking information span in the distributed message queue kafka, obtain the service and parent span corresponding to each span, and determine the corresponding parent span Service; According to the service corresponding to each span and the service corresponding to the parent span, the inter-service call dependency relationship represented by each span is obtained.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现以下方法:通过全链路监控系统jaeger获取调用接口时的追踪信息span;将所述追踪信息span传入分布式消息队列kafka中;消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following method: through the full-link monitoring system jaeger Obtain the tracking information span when calling the interface; pass the tracking information span into the distributed message queue kafka; consume each tracking information span in the distributed message queue kafka to obtain the service and parent span corresponding to each span , And determine the service corresponding to the parent span; obtain the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
有益效果Beneficial effect
本申请实施例计算服务间依赖关系不需要依赖于jaeger的原生数据处理逻辑来一天计算一次,而是基于kafka定时批处理的特性实时计算span所代表的服务间依赖关系,可以灵活获取服务间依赖关系。In the embodiment of the application, the dependency relationship between computing services does not need to rely on jaeger's native data processing logic to calculate once a day, but based on the characteristics of kafka's timing batch processing, the dependency relationship between services represented by span is calculated in real time, which can flexibly obtain inter-service dependencies. relation.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图作简单地介绍。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the embodiments of the present application or the background technology.
图1是本申请实施例提供的一种接入了jaeger的业务系统的架构示意图。FIG. 1 is a schematic diagram of the architecture of a service system connected to jaeger provided by an embodiment of the present application.
图2是本申请实施例提供的又一种接入了jaeger的业务系统的架构示意图。FIG. 2 is a schematic diagram of another architecture of a service system connected to jaeger provided by an embodiment of the present application.
图3是本申请实施例提供的一种确定服务间依赖关系的方法的流程示意图。FIG. 3 is a schematic flowchart of a method for determining a dependency relationship between services provided by an embodiment of the present application.
图4是本申请实施例提供的一种确定服务间依赖关系的方法的流程示意图。FIG. 4 is a schematic flowchart of a method for determining a dependency relationship between services provided by an embodiment of the present application.
图5是本申请实施例提供的一种确定服务间依赖关系的装置的结构示意图。Fig. 5 is a schematic structural diagram of an apparatus for determining a dependency relationship between services provided by an embodiment of the present application.
图6是本申请实施例提供的一种电子设备的结构示意图。Fig. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
本发明的实施方式Embodiments of the present invention
下面将结合附图对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solutions of the application, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only These are a part of the embodiments of this application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the protection scope of this application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms “first”, “second”, “third”, “fourth”, etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific sequence. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes unlisted steps or units, or optionally also includes Other steps or units inherent to these processes, methods, products or equipment.
本申请的技术方案可应用于智慧城市、区块链和/或大数据技术领域,以实现灵活获取服务间依赖关系。可选的,本申请涉及的数据如追踪信息等可存储于数据库中,或者可以存储于区块链中,本申请不做限定。The technical solution of this application can be applied to the fields of smart city, blockchain and/or big data technology to achieve flexible access to dependencies between services. Optionally, the data involved in this application, such as tracking information, can be stored in a database, or can be stored in a blockchain, which is not limited in this application.
请参见图1,图1是本申请实施例提供的一种接入了jaeger的业务系统的架构示意图,业务系统包括用户应用、jeager-collector和存储组件(storage),其中:Please refer to Figure 1. Figure 1 is a schematic diagram of the architecture of a Jaeger-enabled business system provided by an embodiment of the present application. The business system includes a user application, a jaeger-collector and a storage component (storage), among which:
用户应用,用于直接将链路追踪信息(span)推送到jaeger-collector中,其中,用户应用可以是一个也可以是多个,图1中n个为例进行示意。The user application is used to directly push link tracking information (span) to the jaeger-collector, where there may be one or multiple user applications, and n in Figure 1 is taken as an example for illustration.
分布式全链路监控系统端口jaeger-collector,用于将链路追踪信息(span)存入当前配置的存储组件storage中,完成数据的处理和落地。The distributed full-link monitoring system port jaeger-collector is used to store link tracking information (span) in the currently configured storage component storage to complete data processing and landing.
图1是一种常规的接入了jaeger的业务系统,其只能计算一整天内的服务依赖关系,无法满足任意时间段内的依赖关系查询需求,因此,本申请申请人在图1所示的业务系统的基础上进行了优化,在jaeger-collector收集到数据之后,新增一条计算服务间依赖关系的处理逻辑,新增的处理逻辑需要基于新的业务系统架构来实现,请参见图2,是本申请实施例提供的又一种接入了jaeger的业务系统的架构示意图,该业务系统除了包括图1中的用户应用、jeager-collector和存储组件之外,还包括分布式消息队列kafka和计算组件(dependency-plugin)。Figure 1 is a conventional business system connected to jaeger, which can only calculate the service dependency relationship within a whole day, and cannot meet the dependency query requirements in any time period. Therefore, the applicant of this application is shown in Figure 1 Optimized on the basis of the business system shown. After jaeger-collector collects the data, a new processing logic is added to calculate the dependencies between services. The new processing logic needs to be implemented based on the new business system architecture. Please refer to the figure. 2. It is a schematic diagram of the architecture of another business system connected to jaeger provided by an embodiment of the present application. In addition to the user application, jaeger-collector and storage components in Figure 1, the business system also includes a distributed message queue Kafka and computing components (dependency-plugin).
jaeger-collector,用于将数据(如span)进行处理并传入分布式消息队列kafka中。Jaeger-collector is used to process data (such as span) and transfer it to the distributed message queue kafka.
分布式消息队列kafka,用于作为中间件缓存待处理数据,保障数据传输的可靠性。The distributed message queue kafka is used as a middleware to cache the data to be processed to ensure the reliability of data transmission.
计算组件(dependency-plugin),用于以消费组的形式连接分布式消息队列kafka,再从分布式消息队列kafka中消费相关数据并计算得出每个span的所代表的服务依赖关系,并保存服务依赖关系到相关的存储组件中。The computing component (dependency-plugin) is used to connect the distributed message queue kafka in the form of a consumer group, and then consume relevant data from the distributed message queue kafka and calculate the service dependency relationship represented by each span, and save it The service depends on the related storage components.
当然,上述接入了jaeger的业务系统中还可以包括其他组件,例如,包括jaeger中的某些组件;再如,包括业务系统中除jaeger外的部分中的常规组件。Of course, the above-mentioned business system connected to jaeger may also include other components, for example, including some components in jaeger; for example, including conventional components in parts of the business system other than jaeger.
需要说明的是,上述图1所示的业务系统、图2所示的业务系统所依托的硬件设备可以为一台服务器,或者由多台服务器组成的服务器集群,或者其他具有计算能力的设备。后续相应操作的执行主体如果是电子设备,则应当理解可以等同替换为服务器,或者服务器集群,或者其他具有计算能力的设备。It should be noted that the business system shown in FIG. 1 and the hardware device on which the business system shown in FIG. 2 relies may be one server, or a server cluster composed of multiple servers, or other devices with computing capabilities. If the execution subject of the subsequent corresponding operations is an electronic device, it should be understood that it can be replaced by a server, or a server cluster, or other devices with computing capabilities.
请参见图3,图3是本申请实施例提供的一种全链路监控系统服务间依赖关系确定方法的流程示意图,该方法可以基于图2所示的架构来实现,也可以基于其他接入了jaeger的业务系统来实现,该方法包括但不限于如下步骤。Please refer to Figure 3. Figure 3 is a schematic flow diagram of a method for determining dependency relationships between services of a full-link monitoring system provided by an embodiment of the present application. The method can be implemented based on the architecture shown in Figure 2 or based on other accesses. This method includes but is not limited to the following steps.
步骤S301:电子设备通过jaeger获取调用接口时的追踪信息span。Step S301: The electronic device obtains the tracking information span when the interface is called through the jaeger.
其中,该电子设备部署了业务系统,该业务系统用于支持用户完成相应的业务。本申请实施例中,该业务系统中部署了分布式全链路监控系统jaeger,因此,该电子设备可以通过jaeger获取调用接口的追踪信息span。Among them, the electronic device is deployed with a business system, and the business system is used to support the user to complete the corresponding business. In the embodiment of the present application, the distributed full-link monitoring system jaeger is deployed in the business system. Therefore, the electronic device can obtain the tracking information span of the calling interface through the jaeger.
需要说明的是,在接入了分布式全链路监控系统jaeger的业务系统中,发生接口调用请求时,会产生全局唯一的追踪标识traceID,代表此次接口调用请求在jaeger中的唯一性,而接口调用请求过程中的组件进行处理时会产生一条追踪信息span,通过spanID来区分不同的span,这里的span会记录此次接口请求的全局追踪标识traceID、当前的追踪标识spanID(即当次接口请求的追踪标识)、服务名、接口名、调用耗时等信息,如果是上游有其他的组件参与了本次调用,还会记录上游其他的组件调用的traceID、spanID等信息。traceID相同的span表示它们属于同一次接口调用请求中的不同调用处理。It should be noted that in the business system that is connected to the distributed full-link monitoring system jaeger, when an interface call request occurs, a globally unique trace ID traceID will be generated, which represents the uniqueness of the interface call request in jaeger. When the components in the interface call request process are processed, a trace information span will be generated, and different spans are distinguished by spanID. The span here will record the global trace ID traceID of the interface request and the current trace ID spanID (that is, the current trace ID). The trace ID of the interface request), service name, interface name, call time and other information. If there are other upstream components participating in this call, the traceID, spanID and other information of other upstream component calls will also be recorded. Spans with the same traceID indicate that they belong to different call processing in the same interface call request.
步骤S302:所述电子设备将所述追踪信息span传入分布式消息队列kafka中。Step S302: The electronic device transfers the tracking information span to the distributed message queue kafka.
可选的,电子设备通过jaeger-collector将追踪信息span传入分布式消息队列kafka中。Optionally, the electronic device transfers the tracking information span to the distributed message queue kafka through the jaeger-collector.
步骤S303:所述电子设备消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务。Step S303: The electronic device consumes each tracking information span in the distributed message queue kafka, obtains the service and parent span corresponding to each span, and determines the service corresponding to the parent span.
具体地,遍历所有span,获取spanID、service_name(服务名)的映射关系,这个过程可以获得每个span对应的服务;以及遍历所有span,通过parent_span_id(即parentID)查找service_name,即确定父span对应的服务。Specifically, traverse all spans to obtain the mapping relationship between spanID and service_name (service name). This process can obtain the service corresponding to each span; and traverse all spans and find service_name through parent_span_id (parentID), that is, determine the corresponding parent span service.
针对新的数据流,按照 parent + child进行分组。For the new data stream, group it according to parent + child.
可选的,步骤S303可以具体由上述计算组件(dependency-plugin)来实现。Optionally, step S303 may be specifically implemented by the aforementioned computing component (dependency-plugin).
步骤S304:所述电子设备根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。Step S304: The electronic device obtains the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
本申请实施例中,parent_service_name + child_service_name(即父span 对应的服务的名称+子span对应的服务的名称)为一条边,表示一条服务依赖关系。In the embodiment of this application, parent_service_name + child_service_name (that is, the name of the service corresponding to the parent span + the name of the service corresponding to the child span) is an edge, which represents a service dependency relationship.
在一种可选的方案中,从分布式消息队列kafka中消费到span时,可以考虑jaeger的span采集兼容分布式跟踪系统zipkin协议,为达到这个目的,本申请实施例会判断span中是否存在跟踪类别(spanKind)字段,以处理zipkin在远程过程调用(Remote Procedure Call,RPC)调用情况下,父子spanID相同的特殊场景,这种场景下,本申请实施例会以父span的服务名来更新子span的依赖关系,以子span的服务名(或者spanID)来更新依赖于此子span的所有span的依赖关系。In an optional solution, when consuming span from the distributed message queue Kafka, Jaeger's span collection can be considered compatible with the zipkin protocol of the distributed tracking system. In order to achieve this goal, the embodiment of this application will determine whether there is tracking in the span. The category (spanKind) field is used to handle special scenarios where the parent and child spanIDs are the same in the case of zipkin in remote procedure call (RPC) calls. In this scenario, the embodiment of the application will update the child span with the service name of the parent span The dependency relationship of the sub-span is used to update the dependency relationship of all spans that depend on the sub-span with the service name (or spanID) of the sub-span.
下面结合图4例举一种兼容zipkin协议的计算服务间依赖关系的方法。The following is an example of a method of calculating dependencies between services compatible with the zipkin protocol in conjunction with Figure 4.
步骤1:电子设备向分布式消息队列kafka集群订阅主题(topic),并从分布式消息队列kafka集群消费取回span。Step 1: The electronic device subscribes to the topic (topic) of the distributed message queue kafka cluster, and retrieves the span from the distributed message queue kafka cluster for consumption.
可以理解,通过这种方式通常可以从分布式消息队列kafka中取回多个span。It can be understood that in this way, multiple spans can usually be retrieved from the distributed message queue kafka.
步骤2:对于每一个span,电子设备判断span中是否存在spanKind字段。针对不同的判断结果,该电子设备执行的后续操作存在差异,为了便于描述,下面以第一span为例进行说明,该第一span为从分布式消息队列kafka中取回多个span中的任意一个,电子设备针对该第一span的操作如下。Step 2: For each span, the electronic device determines whether there is a spanKind field in the span. For different judgment results, there are differences in subsequent operations performed by the electronic device. For ease of description, the following takes the first span as an example. The first span is to retrieve any of the multiple spans from the distributed message queue kafka. One, the operation of the electronic device with respect to the first span is as follows.
A、第一span中不存在spanKind字段,则更新所有以第一span的spanID为parentID(即父标识,也可以称为上一次请求的追踪标识)的span依赖关系信息。A. If the spanKind field does not exist in the first span, update all span dependency information with the spanID of the first span as the parentID (that is, the parent ID, which can also be called the tracking ID of the last request).
B、第一span中存在spanKind字段,并且   spanKind字段为客户(client),则更新与第一span的spanID相同、且spanKind为主机(server)的span依赖关系信息。B. There is a spanKind field in the first span, and the spanKind field is a client (client), then update the span dependency information that is the same as the spanID of the first span and spanKind is the host (server).
C、第一span中存在spanKind字段,并且spanKind字段为server,则更新所有以第一span的spanID为parentID的span依赖关系信息。C. There is a spanKind field in the first span, and the spanKind field is server, then all span dependency information with the spanID of the first span as the parentID is updated.
步骤3:将第一span的spanID放入最近最最少使用(Least Recently Used,LRU)淘汰算法的循环队列中,并且将该第一span放入固定淘汰时间的缓存中。Step 3: Put the spanID of the first span into the cyclic queue of the Least Recently Used (LRU) elimination algorithm, and put the first span into the cache with a fixed elimination time.
步骤4:定时从循环队列中取出其中的spanID,当取出了第一span的spanID后,查看该第一span是否在缓存中过期,针对过期和不过期的两种结果分别对应两种不同的后续操作,具体如下。Step 4: Take out the spanID from the circular queue regularly. When the spanID of the first span is taken out, check whether the first span has expired in the cache. The two results of expiration and non-expiration correspond to two different follow-ups respectively. The operation is as follows.
A、若第一span未过期,则将将执行流程切换到上述步骤2,针对该第一span循环执行上述步骤2~4,直至最终判断出第一span过期,才结束对第一span的依赖关系计算处理流程。A. If the first span has not expired, the execution flow will be switched to the above step 2, and the above steps 2~4 will be executed for the first span in a loop until it is finally judged that the first span has expired, then the dependence on the first span is ended Relational calculation processing flow.
B、若第一span已过期,则结束对第一span的依赖关系计算处理流程。B. If the first span has expired, the dependency calculation processing flow for the first span is ended.
可选的,上述步骤1~3可以具体由业务系统中的计算组件    dependency-plugin来完成。当然,也可以由业务系统中的其他组件辅助计算组件dependency-plugin来完全上述步骤1~3中的一个步骤或者多个步骤。Optionally, the above steps 1 to 3 can be specifically completed by the dependency-plugin of the computing component in the business system. Of course, other components in the business system can also be used to assist the calculation component dependency-plugin to complete one or more of the above steps 1 to 3.
以上列举了一种兼容zipkin协议的计算服务间依赖关系的方法,同样的,本申请实施例中引入了jaeger的业务系统还可以兼容其他协议,例如,opentracing。兼容其他协议时的赖关系计算处理流程可以参照兼容zipkin协议的计算服务间依赖关系计算流程,此处不再一一赘述。The above lists a method for calculating the dependency relationship between services compatible with the zipkin protocol. Similarly, the business system that introduces jaeger in the embodiment of the present application can also be compatible with other protocols, such as opentracing. The calculation process of the dependency relationship when compatible with other protocols can refer to the calculation process of the dependency relationship between computing services compatible with the zipkin protocol, which will not be repeated here.
可选的,本申请实施例虽然针对接入了全链路监控系统jaeger的业务系统提出了一种全新的服务依赖关系计算处理流程,但是该业务系统中的jaeger可以正常地按照其本来的处理逻辑进行服务依赖关系的计算,例如,采用本申请实施例提出的全新的服务依赖关系计算处理流程实时地计算服务依赖关系,并且,每天(即以天为单位)按照jaeger本来的处理逻辑计算服务依赖关系。Optionally, although the embodiment of the present application proposes a new service dependency calculation processing flow for the business system that is connected to the full-link monitoring system jaeger, the jaeger in the business system can normally follow its original processing The calculation of the service dependency is performed logically. For example, the new service dependency calculation process proposed in the embodiment of this application is used to calculate the service dependency in real time, and the service is calculated according to the original processing logic of Jaeger every day (that is, in units of days) Dependency.
在图3所示的方法中,在不破坏全链路监控系统jaeger的原生数据处理逻辑的情况下,额外引入分布式消息队列kafka作为数据收集过程的缓冲中间件,然后消费(例如,通过自研的dependency-plugin组件进行消费)kafka中的数据,定时批处理span,采用这种方法,由于额外引入分布式消息队列kafka,因此计算服务间依赖关系不需要依赖于jaeger的原生数据处理逻辑来一天计算一次,而是基于kafka定时批处理的特性实时计算span所代表的服务间依赖关系。In the method shown in Figure 3, without destroying the native data processing logic of the full-link monitoring system jaeger, the distributed message queue kafka is additionally introduced as a buffer middleware for the data collection process, and then consumed (for example, through self The developed dependency-plugin component for consumption) data in kafka is periodically batch processed span. In this way, due to the additional introduction of distributed message queue kafka, the dependencies between computing services do not need to rely on jaeger’s native data processing logic. It is calculated once a day, but based on the characteristics of kafka's timing batch processing, it calculates the dependencies between services represented by the span in real time.
此外,由于计算服务依赖关系的组件以费者组的形式连接分布式消息队列kafka,因此可实现分布式计算服务间依赖关系,分布式的架构可满足业务高峰的容量要求,并且,通过分布式消息队列kafka的解耦作用,在业务峰值时,本申请新提出的服务集依赖关系计算流程基本不影响原有jaeger的性能。In addition, because the components of the computing service dependency are connected to the distributed message queue kafka in the form of a consumer group, the dependency between distributed computing services can be realized. The distributed architecture can meet the capacity requirements of business peaks, and through distributed The decoupling effect of the message queue kafka, at the peak of the business, the service set dependency calculation process newly proposed in this application basically does not affect the performance of the original jaeger.
另外,通过引入循环队列的LRU淘汰算法及缓存的定时过期机制,实时清楚过期的span,在满足峰值流量时,可保障计算服务的可用性。In addition, through the introduction of the LRU elimination algorithm of the circular queue and the timing expiration mechanism of the cache, the expired span is clear in real time, and the availability of computing services can be guaranteed when the peak traffic is met.
并且,上述方法可兼容多种链路追踪协议,例如opentracing、zipkin等协议。In addition, the above method is compatible with multiple link tracing protocols, such as opentracing, zipkin and other protocols.
上述详细阐述了本申请实施例的方法,为了便于更好地实施本申请实施例的上述方案,相应地,下面提供了本申请实施例的装置。The foregoing describes the methods of the embodiments of the present application in detail. In order to facilitate better implementation of the above solutions of the embodiments of the present application, correspondingly, the apparatuses of the embodiments of the present application are provided below.
请参见图5,图5是本申请实施例提供的一种确定服务间依赖关系的装置50的结构示意图,该装置50可以为上述方法实施例中的电子设备或者该电子设备中的模块,该装置中搭载了业务系统(也可以描述为应用于业务系统),该业务系统部署了全链路监控系统jaeger,所述装置50包括获取模块501、传输模块502、消费模块503和生成模块504。各个模块的描述具体如下。Please refer to FIG. 5, which is a schematic structural diagram of an apparatus 50 for determining a dependency relationship between services provided by an embodiment of the present application. The apparatus 50 may be the electronic device in the foregoing method embodiment or a module in the electronic device. The device is equipped with a business system (which can also be described as applied to a business system), and the business system deploys a full-link monitoring system jaeger. The device 50 includes an acquisition module 501, a transmission module 502, a consumption module 503, and a generation module 504. The description of each module is as follows.
获取模块501,用于通过全链路监控系统jaeger获取调用接口时的追踪信息span。The obtaining module 501 is used to obtain the trace information span when the interface is called through the full-link monitoring system jaeger.
传输模块502,用于将所述追踪信息span传入分布式消息队列kafka中。The transmission module 502 is configured to transfer the tracking information span to the distributed message queue kafka.
消费模块503,用于消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务。The consumption module 503 is configured to consume each trace information span in the distributed message queue kafka, obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span.
生成模块504,用于根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。The generating module 504 is configured to obtain the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
其中,获取模块501可以为方法实施例中提及的全链路监控系统jaeger中的jaeger-collector。传输模块502和消费模块503可以为方法实施例中提及的计算组件(dependency-plugin)中的两个子模块。Wherein, the acquiring module 501 may be the jaeger-collector in the full link monitoring system jaeger mentioned in the method embodiment. The transmission module 502 and the consumption module 503 may be two sub-modules in the dependency-plugin mentioned in the method embodiment.
在一种可选的方案中,所述业务系统部署了辅助系统,所述辅助系统包括所述分布式消息队列kafka和计算组件;在所述消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务方面,所述消费模块503,具体用于:通过所述计算组件消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务。In an optional solution, an auxiliary system is deployed in the business system, and the auxiliary system includes the distributed message queue kafka and computing components; each trace in the distributed message queue kafka is consumed Information span, to obtain the service and parent span corresponding to each span, and to determine the service corresponding to the parent span. The consumption module 503 is specifically configured to consume the distributed message queue kafka through the computing component For each tracking information span, the service and parent span corresponding to each span are obtained, and the service corresponding to the parent span is determined.
在又一种可选的方案中,所述jaeger用于基于所述span生成每个span所代表的服务间调用依赖关系。也即是说,除了通过本申请新增的流程来获取服务间依赖关系外,所述jaeger也会基于其现有的机制获取服务间依赖关系。In yet another optional solution, the jaeger is used to generate the inter-service call dependency relationship represented by each span based on the span. That is to say, in addition to obtaining the inter-service dependency through the newly added process in this application, the jaeger will also obtain the inter-service dependency based on its existing mechanism.
在又一种可选的方案中,在所述根据所述每个span对应的服务和所述父span对应的服务,得到每个span所代表的服务间调用依赖关系方面,所述消费模块503具体用于:判断第一span中是否存在spanKind字段,其中,所述第一span为消费的所述分布式消息队列kafka中的任意一个span;根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系。In yet another optional solution, in terms of obtaining the calling dependency relationship between the services represented by each span according to the service corresponding to each span and the service corresponding to the parent span, the consumption module 503 Specifically used for: judging whether there is a spanKind field in the first span, where the first span is any span in the distributed message queue kafka consumed; based on the judgment result based on the service and the corresponding service of the first span The service corresponding to the parent span generates an inter-service call dependency relationship represented by the first span.
在又一种可选的方案中,在所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系,所述消费模块503具体用于:若第一span中不存在spanKind字段,则更新所有以第一span的spanID为parentID的span依赖关系信息;若第一span中存在spanKind字段,并且spanKind字段为client,则更新与第一span的spanID相同、且spanKind为server的span依赖关系信息;若第一span中存在spanKind字段,并且spanKind字段为server,则更新所有以第一span的spanID为parentID的span依赖关系信息。In yet another optional solution, in the step of generating the inter-service call dependency relationship represented by the first span based on the judgment result based on the service corresponding to the first span and the service corresponding to the parent span, the consumption The module 503 is specifically used to: if the spanKind field does not exist in the first span, update all span dependency information with the spanID of the first span as the parentID; if the spanKind field exists in the first span and the spanKind field is client, update The spanID is the same as the span ID of the first span and spanKind is the span dependency information of the server; if the spanKind field exists in the first span and the spanKind field is the server, then all span dependency information with the spanID of the first span as the parentID is updated.
在又一种可选方案中,在所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系之后,所述消费单元503还用于:将第一span的spanID放入最近最最少使用LRU淘汰算法的循环队列中,并且将该第一span放入固定淘汰时间的缓存中;定时从所述循环队列中取出spanID,当取到所述第一span的spanID时,判断所述第一span在所述固定淘汰时间的缓存中是否过期;若过期,则结束对所述第一span的依赖关系的计算处理。In yet another optional solution, after the call dependency relationship between the services represented by the first span is generated based on the judgment result based on the service corresponding to the first span and the service corresponding to the parent span, the consumption The unit 503 is also used to: put the spanID of the first span into the circular queue of the least recently used LRU elimination algorithm, and put the first span into the buffer with a fixed elimination time; and periodically take out the spanID from the circular queue When the spanID of the first span is obtained, it is determined whether the first span expires in the cache of the fixed elimination time; if it expires, the calculation processing of the dependency relationship of the first span is ended.
在又一种可选的方案中,调用接口时的追踪信息包括接口调用请求的traceID、spanID、服务名、接口名、调用耗时中的一项或多项。In yet another optional solution, the trace information when the interface is called includes one or more of the traceID, spanID, service name, interface name, and calling time of the interface call request.
需要说明的是,在本申请实施例中,各个单元的具体实现还可以对应参照图3所示的方法实施例的相应描述。It should be noted that, in the embodiment of the present application, the specific implementation of each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 3.
在图5所描述的装置中,在不破坏全链路监控系统jaeger的原生数据处理逻辑的情况下,额外引入分布式消息队列kafka作为数据收集过程的缓冲中间件,然后消费(例如,通过自研的dependency-plugin组件进行消费)kafka中的数据,定时批处理span,采用这种方法,由于额外引入分布式消息队列kafka,因此计算服务间依赖关系不需要依赖于jaeger的原生数据处理逻辑来一天计算一次,而是基于kafka定时批处理的特性实时计算span所代表的服务间依赖关系。In the device described in Figure 5, without destroying the native data processing logic of the full-link monitoring system jaeger, the distributed message queue kafka is additionally introduced as a buffer middleware for the data collection process, and then consumed (for example, through self The developed dependency-plugin component for consumption) data in kafka is periodically batch processed span. In this way, due to the additional introduction of distributed message queue kafka, the dependencies between computing services do not need to rely on jaeger’s native data processing logic. It is calculated once a day, but based on the characteristics of kafka's timing batch processing, it calculates the dependencies between services represented by the span in real time.
此外,由于计算服务依赖关系的组件以费者组的形式连接分布式消息队列kafka,因此可实现分布式计算服务间依赖关系,分布式的架构可满足业务高峰的容量要求,并且,通过分布式消息队列kafka的解耦作用,在业务峰值时,本申请新提出的服务集依赖关系计算流程基本不影响原有jaeger的性能。In addition, because the components of the computing service dependency are connected to the distributed message queue kafka in the form of a consumer group, the dependency between distributed computing services can be realized. The distributed architecture can meet the capacity requirements of business peaks, and through distributed The decoupling effect of the message queue kafka, at the peak of the business, the service set dependency calculation process newly proposed in this application basically does not affect the performance of the original jaeger.
另外,通过引入循环队列的LRU淘汰算法及缓存的定时过期机制,实时清楚过期的span,在满足峰值流量时,可保障计算服务的可用性。In addition, through the introduction of the LRU elimination algorithm of the circular queue and the timing expiration mechanism of the cache, the expired span is clear in real time, and the availability of computing services can be guaranteed when the peak traffic is met.
并且,上述方法可兼容多种链路追踪协议,例如opentracing、zipkin等协议。In addition, the above method is compatible with multiple link tracing protocols, such as opentracing, zipkin and other protocols.
参见图6,图6为本申请实施例涉及的硬件运行环境的电子设备结构60示意图。该电子设备60中搭载了业务系统(也可以描述为应用于业务系统),该业务系统部署了全链路监控系统jaeger,其中,如图6所示,本申请的实施例涉及的硬件运行环境的电子设备可以包括如下。Referring to FIG. 6, FIG. 6 is a schematic diagram of an electronic device structure 60 of a hardware operating environment involved in an embodiment of the application. The electronic device 60 is equipped with a business system (which can also be described as being applied to a business system), and the business system deploys a full-link monitoring system jaeger, where, as shown in FIG. 6, the hardware operating environment involved in the embodiment of the present application The electronic equipment can include the following.
处理器601,处理器601可以是一个或多个中央处理器(central processing unit,CPU),在处理器601是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。The processor 601. The processor 601 may be one or more central processing units (central processing units). processing unit, CPU). When the processor 601 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
存储器602,包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory, ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器602用于相关计算机程序及数据。The memory 602 includes but is not limited to random access memory (RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable A programmable read only memory (EPROM) or a portable read-only memory (compact disc read-only memory, CD-ROM), the memory 602 is used for related computer programs and data.
通信接口603,用于实现电子设备与其他设备进行通信。The communication interface 603 is used to implement communication between the electronic device and other devices.
本领域技术人员可以理解,图6中示出的电子设备的结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the electronic device shown in FIG. 6 does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or a combination of certain components, or different component arrangements. .
如图6所示,存储器602中可以包括操作系统、网络通信模块以及文本处理程序。操作系统是管理和控制电子设备硬件和软件资源的程序,支持文本处理程序以及其他软件或程序的运行。网络通信模块用于实现存储器602内部各组件之间的通信,以及与电子设备中其他硬件和软件之间通信。As shown in FIG. 6, the memory 602 may include an operating system, a network communication module, and a text processing program. The operating system is a program that manages and controls the hardware and software resources of electronic devices, and supports the operation of text processing programs and other software or programs. The network communication module is used to implement communication between various components in the memory 602 and communication with other hardware and software in the electronic device.
在图6所示的电子设备中,处理器601用于执行存储器602中存储的计算机程序,来执行如下操作:通过全链路监控系统jaeger获取调用接口时的追踪信息span;将所述追踪信息span传入分布式消息队列kafka中;消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。In the electronic device shown in FIG. 6, the processor 601 is used to execute the computer program stored in the memory 602 to perform the following operations: obtain the trace information span when the interface is called through the full-link monitoring system jaeger; The span is passed into the distributed message queue kafka; each trace information span in the distributed message queue kafka is consumed, the service and parent span corresponding to each span are obtained, and the service corresponding to the parent span is determined; according to the The service corresponding to each span and the service corresponding to the parent span obtain the calling dependency relationship between the services represented by each span.
在一种可选的方案中,所述业务系统部署了辅助系统,所述辅助系统包括所述分布式消息队列kafka和计算组件;在所述消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务方面,所述处理器601,具体用于:通过所述计算组件消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务。In an optional solution, an auxiliary system is deployed in the business system, and the auxiliary system includes the distributed message queue kafka and computing components; each trace in the distributed message queue kafka is consumed Information span, to obtain the service and parent span corresponding to each span, and to determine the service corresponding to the parent span, the processor 601 is specifically configured to consume the distributed message queue kafka through the computing component For each tracking information span, the service and parent span corresponding to each span are obtained, and the service corresponding to the parent span is determined.
在又一种可选的方案中,所述处理器还用于:通过所述jaeger基于所述span生成每个span所代表的服务间调用依赖关系。也即是说,除了通过本申请新增的流程来获取服务间依赖关系外,所述jaeger也会基于其现有的机制获取服务间依赖关系。In yet another optional solution, the processor is further configured to: generate the inter-service call dependency relationship represented by each span based on the span through the jaeger. That is to say, in addition to obtaining the inter-service dependency through the newly added process in this application, the jaeger will also obtain the inter-service dependency based on its existing mechanism.
在又一种可选的方案中,在根据所述每个span对应的服务和所述父span对应的服务,得到每个span所代表的服务间调用依赖关系方面,所述处理器601具体用于:判断第一span中是否存在spanKind字段,其中,所述第一span为消费的所述分布式消息队列kafka中的任意一个span;根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系。In yet another optional solution, in terms of obtaining the call dependency relationship between the services represented by each span according to the service corresponding to each span and the service corresponding to the parent span, the processor 601 specifically uses In: judging whether there is a spanKind field in the first span, where the first span is any span in the distributed message queue kafka consumed; based on the judgment result based on the service corresponding to the first span and the The service corresponding to the parent span generates the inter-service call dependency relationship represented by the first span.
在又一种可选的方案中,在所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系方面,所述处理器601具体用于:若第一span中不存在spanKind字段,则更新所有以第一span的spanID为parentID的span依赖关系信息;若第一span中存在spanKind字段,并且     spanKind字段为client,则更新与第一span的spanID相同、且spanKind为server的span依赖关系信息;若第一span中存在spanKind字段,并且spanKind字段为server,则更新所有以第一span的spanID为parentID的span依赖关系信息。In yet another optional solution, in the aspect of generating the inter-service call dependency relationship represented by the first span based on the judgment result based on the service corresponding to the first span and the service corresponding to the parent span, the The processor 601 is specifically configured to: if the spanKind field does not exist in the first span, update all span dependency information with the spanID of the first span as the parentID; if the spanKind field exists in the first span and the spanKind field is client, then Update the span dependency information that is the same as the spanID of the first span and spanKind is the server; if there is a spanKind field in the first span and the spanKind field is server, then update all the span dependency information that uses the spanID of the first span as the parentID .
在又一种可选方案中,在所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系之后,所述处理器601还用于:将第一span的spanID放入最近最最少使用LRU淘汰算法的循环队列中,并且将该第一span放入固定淘汰时间的缓存中;定时从所述循环队列中取出spanID,当取到所述第一span的spanID时,判断所述第一span在所述固定淘汰时间的缓存中是否过期;若过期,则结束对所述第一span的依赖关系的计算处理。In yet another optional solution, after the inter-service call dependency relationship represented by the first span is generated based on the judgment result based on the service corresponding to the first span and the service corresponding to the parent span, the processing The device 601 is also used to: put the spanID of the first span into the circular queue with the least recently used LRU elimination algorithm, and put the first span into the buffer with a fixed elimination time; and periodically take out the spanID from the circular queue When the spanID of the first span is obtained, it is determined whether the first span expires in the cache of the fixed elimination time; if it expires, the calculation processing of the dependency relationship of the first span is ended.
在又一种可选的方案中,调用接口时的追踪信息包括接口调用请求的traceID、spanID、服务名、接口名、调用耗时中的一项或多项。In yet another optional solution, the trace information when the interface is called includes one or more of the traceID, spanID, service name, interface name, and calling time of the interface call request.
需要说明的是,各个操作的实现还可以对应参照图3所示的方法实施例的相应描述。It should be noted that the implementation of each operation may also correspond to the corresponding description of the method embodiment shown in FIG. 3.
在图6所描述的电子设备60中,在不破坏全链路监控系统jaeger的原生数据处理逻辑的情况下,额外引入分布式消息队列kafka作为数据收集过程的缓冲中间件,然后消费(例如,通过自研的dependency-plugin组件进行消费)kafka中的数据,定时批处理span,采用这种方法,由于额外引入分布式消息队列kafka,因此计算服务间依赖关系不需要依赖于jaeger的原生数据处理逻辑来一天计算一次,而是基于kafka定时批处理的特性实时计算span所代表的服务间依赖关系。In the electronic device 60 described in FIG. 6, without destroying the native data processing logic of the full-link monitoring system jaeger, the distributed message queue kafka is additionally introduced as a buffer middleware for the data collection process, and then consumed (for example, Consumption through the self-developed dependency-plugin component) Data in Kafka, timed batch processing span, using this method, due to the additional introduction of distributed message queue Kafka, so the dependency between computing services does not need to rely on the native data processing of Jaeger The logic is calculated once a day, but based on the characteristics of kafka's timing batch processing, it calculates the dependencies between services represented by the span in real time.
此外,由于计算服务依赖关系的组件以费者组的形式连接分布式消息队列kafka,因此可实现分布式计算服务间依赖关系,分布式的架构可满足业务高峰的容量要求,并且,通过分布式消息队列kafka的解耦作用,在业务峰值时,本申请新提出的服务集依赖关系计算流程基本不影响原有jaeger的性能。In addition, because the components of the computing service dependency are connected to the distributed message queue kafka in the form of a consumer group, the dependency between distributed computing services can be realized. The distributed architecture can meet the capacity requirements of business peaks, and through distributed The decoupling effect of the message queue kafka, at the peak of the business, the service set dependency calculation process newly proposed in this application basically does not affect the performance of the original jaeger.
另外,通过引入循环队列的LRU淘汰算法及缓存的定时过期机制,实时清楚过期的span,在满足峰值流量时,可保障计算服务的可用性。In addition, through the introduction of the LRU elimination algorithm of the circular queue and the timing expiration mechanism of the cache, the expired span is clear in real time, and the availability of computing services can be guaranteed when the peak traffic is met.
并且,上述方法可兼容多种链路追踪协议,例如opentracing、zipkin等协议。In addition, the above method is compatible with multiple link tracing protocols, such as opentracing, zipkin and other protocols.
本申请实施例还提供一种芯片系统,所述芯片系统包括至少一个处理器,存储器和接口电路,所述存储器、所述收发器和所述至少一个处理器通过线路互联,所述至少一个存储器中存储有计算机程序;所述计算机程序被所述处理器执行时,实现图3所示的方法。An embodiment of the present application also provides a chip system. The chip system includes at least one processor, a memory, and an interface circuit. The memory, the transceiver, and the at least one processor are interconnected by wires, and the at least one memory A computer program is stored therein; when the computer program is executed by the processor, the method shown in FIG. 3 is implemented.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在处理器上运行时,实现图3所示的方法流程。例如,可以实现以下方法:通过全链路监控系统jaeger获取调用接口时的追踪信息span;将所述追踪信息span传入分布式消息队列kafka中;消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。The embodiment of the present application also provides a computer-readable storage medium in which a computer program is stored, and when it runs on a processor, the method flow shown in FIG. 3 is implemented. For example, the following methods can be implemented: obtain the trace information span when the interface is called through the full link monitoring system jaeger; transfer the trace information span into the distributed message queue kafka; consume each of the distributed message queue kafka Track the information span, obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span; obtain the service represented by each span according to the service corresponding to each span and the service corresponding to the parent span Call dependencies between.
可选的,该程序在处理器上运行时还可实现上述方法的其他步骤,这里不再赘述。进一步可选的,本申请涉及的介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。Optionally, the program can also implement other steps of the above method when running on the processor, which will not be repeated here. Further optionally, the medium involved in this application, such as a computer-readable storage medium, may be non-volatile or volatile.
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在终端上运行时,实现图3所示的方法流程。The embodiment of the present application also provides a computer program product. When the computer program product runs on a terminal, the method flow shown in FIG. 3 is implemented.
综上所述,在不破坏全链路监控系统jaeger的原生数据处理逻辑的情况下,额外引入分布式消息队列kafka作为数据收集过程的缓冲中间件,然后消费(例如,通过自研的dependency-plugin组件进行消费)kafka中的数据,定时批处理span,采用这种方法,由于额外引入分布式消息队列kafka,因此计算服务间依赖关系不需要依赖于jaeger的原生数据处理逻辑来一天计算一次,而是基于kafka定时批处理的特性实时计算span所代表的服务间依赖关系。In summary, without destroying the native data processing logic of the full-link monitoring system jaeger, the distributed message queue kafka is additionally introduced as a buffer middleware for the data collection process, and then consumed (for example, through self-developed dependency- (plugin component for consumption) data in Kafka, timed batch processing span, using this method, due to the additional introduction of distributed message queue kafka, so the dependency between computing services does not need to rely on jaeger's native data processing logic to calculate once a day, Instead, it calculates the dependencies between services represented by span in real time based on the characteristics of kafka's timing batch processing.
此外,由于计算服务依赖关系的组件以费者组的形式连接分布式消息队列kafka,因此可实现分布式计算服务间依赖关系,分布式的架构可满足业务高峰的容量要求,并且,通过分布式消息队列kafka的解耦作用,在业务峰值时,本申请新提出的服务集依赖关系计算流程基本不影响原有jaeger的性能。In addition, because the components of the computing service dependency are connected to the distributed message queue kafka in the form of a consumer group, the dependency between distributed computing services can be realized. The distributed architecture can meet the capacity requirements of business peaks, and through distributed The decoupling effect of the message queue kafka, at the peak of the business, the service set dependency calculation process newly proposed in this application basically does not affect the performance of the original jaeger.
另外,通过引入循环队列的LRU淘汰算法及缓存的定时过期机制,实时清楚过期的span,在满足峰值流量时,可保障计算服务的可用性。In addition, through the introduction of the LRU elimination algorithm of the circular queue and the timing expiration mechanism of the cache, the expired span is clear in real time, and the availability of computing services can be guaranteed when the peak traffic is met.
并且,上述方法可兼容多种链路追踪协议,例如opentracing、zipkin等协议。In addition, the above method is compatible with multiple link tracing protocols, such as opentracing, zipkin and other protocols.
还需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。It should also be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited by the described sequence of actions. , Because according to this application, some steps can be carried out in other order or at the same time. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application. In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims (20)

  1. 一种确定服务间依赖关系的方法,其中,应用于业务系统,所述业务系统部署了全链路监控系统jaeger,所述方法包括:A method for determining the dependency between services, which is applied to a business system that deploys a full-link monitoring system jaeger, and the method includes:
    通过全链路监控系统jaeger获取调用接口时的追踪信息span;Obtain the trace information span when calling the interface through the full-link monitoring system jaeger;
    将所述追踪信息span传入分布式消息队列kafka中;Pass the tracking information span into the distributed message queue kafka;
    消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;Consuming each tracking information span in the distributed message queue kafka, obtaining the service and parent span corresponding to each span, and determining the service corresponding to the parent span;
    根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。According to the service corresponding to each span and the service corresponding to the parent span, the inter-service call dependency relationship represented by each span is obtained.
  2. 根据权利要求1所述的方法,其中,所述业务系统部署了辅助系统,所述辅助系统包括所述分布式消息队列kafka和计算组件;所述消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务,包括:The method according to claim 1, wherein the business system deploys an auxiliary system, the auxiliary system includes the distributed message queue kafka and a computing component; the consuming each of the distributed message queue kafka Tracking the information span, obtaining the service and parent span corresponding to each span, and determining the service corresponding to the parent span, including:
    通过所述计算组件消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务。Each trace information span in the distributed message queue kafka is consumed by the computing component to obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span.
  3. 根据权利要求2所述的方法,其中,还包括:The method according to claim 2, further comprising:
    通过所述jaeger基于所述span生成每个span所代表的服务间调用依赖关系。The jaeger generates the inter-service call dependency relationship represented by each span based on the span.
  4. 根据权利要求1-3任一项所述的方法,其中,所述根据所述每个span对应的服务和所述父span对应的服务,得到每个span所代表的服务间调用依赖关系,包括:The method according to any one of claims 1 to 3, wherein the obtaining the calling dependency relationship between services represented by each span according to the service corresponding to each span and the service corresponding to the parent span includes :
    判断第一span中是否存在跟踪类别spanKind字段,其中,所述第一span为消费的所述分布式消息队列kafka中的任意一个span;Determine whether there is a tracking category spanKind field in the first span, where the first span is any span in the distributed message queue kafka consumed;
    根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系。According to the judgment result, the inter-service call dependency relationship represented by the first span is generated based on the service corresponding to the first span and the service corresponding to the parent span.
  5. 根据权利要求4所述的方法,其中,所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系,包括:The method according to claim 4, wherein the generating the inter-service call dependency relationship represented by the first span based on the service corresponding to the first span and the service corresponding to the parent span according to the judgment result comprises:
    若第一span中不存在spanKind字段,则更新所有以第一span的spanID为上一次请求的追踪标识parentID的span依赖关系信息;If the spanKind field does not exist in the first span, update all span dependency information that uses the spanID of the first span as the tracking identifier parentID of the last request;
    若第一span中存在spanKind字段,并且      spanKind字段为客户client,则更新与第一span的spanID相同、且spanKind为主机server的span依赖关系信息;If the spanKind field exists in the first span, and the spanKind field is the client client, update the span ID that is the same as the spanID of the first span and spanKind is the span dependency information of the host server;
    若第一span中存在spanKind字段,并且spanKind字段为server,则更新所有以第一span的spanID为parentID的span依赖关系信息。If the spanKind field exists in the first span, and the spanKind field is server, then all span dependency information with the spanID of the first span as the parentID is updated.
  6. 根据权利要求5所述的方法,其中,所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系之后,还包括:The method according to claim 5, wherein after said generating the inter-service call dependency relationship represented by the first span based on the judgment result based on the service corresponding to the first span and the service corresponding to the parent span, the method further comprises :
    将第一span的spanID放入最近最最少使用LRU淘汰算法的循环队列中,并且将该第一span放入固定淘汰时间的缓存中;Put the spanID of the first span into the circular queue with the least recently used LRU elimination algorithm, and put the first span into the cache with a fixed elimination time;
    定时从所述循环队列中取出spanID,当取到所述第一span的spanID时,判断所述第一span在所述固定淘汰时间的缓存中是否过期;Timing out the spanID from the circular queue, and when the spanID of the first span is obtained, determining whether the first span has expired in the fixed elimination time cache;
    若过期,则结束对所述第一span的依赖关系的计算处理。If it expires, the calculation processing of the dependency relationship of the first span is ended.
  7. 根据权利要求1-3任一项所述的方法,其中,调用接口时的追踪信息包括接口调用请求的全局追踪标识traceID、当前的追踪标识spanID、服务名、接口名、调用耗时中的一项或多项。The method according to any one of claims 1-3, wherein the trace information when the interface is called includes one of the global trace ID traceID of the interface call request, the current trace ID spanID, the service name, the interface name, and the calling time. Item or multiple items.
  8. 一种确定服务间依赖关系的装置,其中,应用于业务系统,所述业务系统部署了全链路监控系统jaeger,所述装置包括:A device for determining the dependency relationship between services, which is applied to a business system where the full link monitoring system jaeger is deployed in the business system, and the device includes:
    获取模块,用于通过全链路监控系统jaeger获取调用接口时的追踪信息span;The acquisition module is used to acquire the tracking information span when calling the interface through the full-link monitoring system jaeger;
    传输模块,用于将所述追踪信息span传入分布式消息队列kafka中;The transmission module is used to transfer the tracking information span to the distributed message queue kafka;
    消费模块,用于消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;The consumption module is used to consume each trace information span in the distributed message queue kafka, obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span;
    生成模块,用于根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。The generating module is used to obtain the inter-service call dependency relationship represented by each span according to the service corresponding to each span and the service corresponding to the parent span.
  9. 一种电子设备,其中,应用于业务系统,所述业务系统部署了全链路监控系统jaeger,所述电子设备包括处理器、存储器、通信接口以及一个或多个计算机程序,其中,所述一个或多个计算机程序被存储在所述存储器中,并且被配置由所述处理器执行,所述计算机程序被所述处理器执行时,实现以下方法:An electronic device, wherein, applied to a business system, the business system deploys a full-link monitoring system jaeger, the electronic device includes a processor, a memory, a communication interface, and one or more computer programs, wherein the one Or multiple computer programs are stored in the memory and configured to be executed by the processor, and when the computer program is executed by the processor, the following method is implemented:
    通过全链路监控系统jaeger获取调用接口时的追踪信息span;Obtain the trace information span when calling the interface through the full-link monitoring system jaeger;
    将所述追踪信息span传入分布式消息队列kafka中;Pass the tracking information span into the distributed message queue kafka;
    消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;Consuming each tracking information span in the distributed message queue kafka, obtaining the service and parent span corresponding to each span, and determining the service corresponding to the parent span;
    根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。According to the service corresponding to each span and the service corresponding to the parent span, the inter-service call dependency relationship represented by each span is obtained.
  10. 根据权利要求9所述的电子设备,其中,所述业务系统部署了辅助系统,所述辅助系统包括所述分布式消息队列kafka和计算组件;所述消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务时,具体用于:The electronic device according to claim 9, wherein the business system deploys an auxiliary system, the auxiliary system includes the distributed message queue kafka and a computing component; the consumption of each of the distributed message queue kafka A tracking information span is used to obtain the service and parent span corresponding to each span, and when determining the service corresponding to the parent span, it is specifically used for:
    通过所述计算组件消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务。Each trace information span in the distributed message queue kafka is consumed by the computing component to obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span.
  11. 根据权利要求10所述的电子设备,其中,所述计算机程序被所述处理器执行时,还用于实现:The electronic device according to claim 10, wherein, when the computer program is executed by the processor, it is further used to implement:
    通过所述jaeger基于所述span生成每个span所代表的服务间调用依赖关系。The jaeger generates the inter-service call dependency relationship represented by each span based on the span.
  12. 根据权利要求9-11任一项所述的电子设备,其中,所述根据所述每个span对应的服务和所述父span对应的服务,得到每个span所代表的服务间调用依赖关系时,具体用于:The electronic device according to any one of claims 9-11, wherein, according to the service corresponding to each span and the service corresponding to the parent span, when the calling dependency relationship between the services represented by each span is obtained , Specifically used for:
    判断第一span中是否存在跟踪类别spanKind字段,其中,所述第一span为消费的所述分布式消息队列kafka中的任意一个span;Determine whether there is a tracking category spanKind field in the first span, where the first span is any span in the distributed message queue kafka consumed;
    根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系。According to the judgment result, the inter-service call dependency relationship represented by the first span is generated based on the service corresponding to the first span and the service corresponding to the parent span.
  13. 根据权利要求12所述的电子设备,其中,所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系时,具体用于:The electronic device according to claim 12, wherein when the inter-service call dependency relationship represented by the first span is generated based on the judgment result based on the service corresponding to the first span and the service corresponding to the parent span, specifically Used for:
    若第一span中不存在spanKind字段,则更新所有以第一span的spanID为上一次请求的追踪标识parentID的span依赖关系信息;If the spanKind field does not exist in the first span, update all span dependency information that uses the spanID of the first span as the tracking identifier parentID of the last request;
    若第一span中存在spanKind字段,并且      spanKind字段为客户client,则更新与第一span的spanID相同、且spanKind为主机server的span依赖关系信息;If the spanKind field exists in the first span, and the spanKind field is the client client, update the span ID that is the same as the spanID of the first span and spanKind is the span dependency information of the host server;
    若第一span中存在spanKind字段,并且spanKind字段为server,则更新所有以第一span的spanID为parentID的span依赖关系信息。If the spanKind field exists in the first span, and the spanKind field is server, then all span dependency information with the spanID of the first span as the parentID is updated.
  14. 根据权利要求13所述的电子设备,其中,所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系之后,所述计算机程序被所述处理器执行时还用于实现:The electronic device according to claim 13, wherein, after the inter-service call dependency relationship represented by the first span is generated based on the judgment result based on the service corresponding to the first span and the service corresponding to the parent span, the When the computer program is executed by the processor, it is also used to realize:
    将第一span的spanID放入最近最最少使用LRU淘汰算法的循环队列中,并且将该第一span放入固定淘汰时间的缓存中;Put the spanID of the first span into the circular queue with the least recently used LRU elimination algorithm, and put the first span into the cache with a fixed elimination time;
    定时从所述循环队列中取出spanID,当取到所述第一span的spanID时,判断所述第一span在所述固定淘汰时间的缓存中是否过期;Timing out the spanID from the circular queue, and when the spanID of the first span is obtained, determining whether the first span has expired in the fixed elimination time cache;
    若过期,则结束对所述第一span的依赖关系的计算处理。If it expires, the calculation processing of the dependency relationship of the first span is ended.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,其在处理器上运行时,实现以下方法:A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which, when running on a processor, implements the following method:
    通过全链路监控系统jaeger获取调用接口时的追踪信息span;Obtain the trace information span when calling the interface through the full-link monitoring system jaeger;
    将所述追踪信息span传入分布式消息队列kafka中;Pass the tracking information span into the distributed message queue kafka;
    消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务;Consuming each tracking information span in the distributed message queue kafka, obtaining the service and parent span corresponding to each span, and determining the service corresponding to the parent span;
    根据所述每个span对应的服务和所述父span对应的服务得到每个span所代表的服务间调用依赖关系。According to the service corresponding to each span and the service corresponding to the parent span, the inter-service call dependency relationship represented by each span is obtained.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述业务系统部署了辅助系统,所述辅助系统包括所述分布式消息队列kafka和计算组件;所述消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务时,具体用于:The computer-readable storage medium according to claim 15, wherein the business system deploys an auxiliary system, and the auxiliary system includes the distributed message queue kafka and a computing component; the consuming of the distributed message queue kafka For each tracking information span in, to obtain the service and parent span corresponding to each span, and to determine the service corresponding to the parent span, it is specifically used for:
    通过所述计算组件消费所述分布式消息队列kafka中的每个追踪信息span,得到每个span对应的服务和父span,以及确定所述父span对应的服务。Each trace information span in the distributed message queue kafka is consumed by the computing component to obtain the service and parent span corresponding to each span, and determine the service corresponding to the parent span.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述计算机程序在所述处理器上运行时还用于实现:The computer-readable storage medium according to claim 16, wherein the computer program is also used to implement:
    通过所述jaeger基于所述span生成每个span所代表的服务间调用依赖关系。The jaeger generates the inter-service call dependency relationship represented by each span based on the span.
  18. 根据权利要求15-17任一项所述的计算机可读存储介质,其中,所述根据所述每个span对应的服务和所述父span对应的服务,得到每个span所代表的服务间调用依赖关系时,具体用于:The computer-readable storage medium according to any one of claims 15-17, wherein the inter-service call represented by each span is obtained according to the service corresponding to each span and the service corresponding to the parent span When it is a dependency, it is specifically used for:
    判断第一span中是否存在跟踪类别spanKind字段,其中,所述第一span为消费的所述分布式消息队列kafka中的任意一个span;Determine whether there is a tracking category spanKind field in the first span, where the first span is any span in the distributed message queue kafka consumed;
    根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系。According to the judgment result, the inter-service call dependency relationship represented by the first span is generated based on the service corresponding to the first span and the service corresponding to the parent span.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系时,具体用于:18. The computer-readable storage medium according to claim 18, wherein the inter-service call dependency relationship represented by the first span is generated based on the service corresponding to the first span and the service corresponding to the parent span according to the judgment result When, specifically used for:
    若第一span中不存在spanKind字段,则更新所有以第一span的spanID为上一次请求的追踪标识parentID的span依赖关系信息;If the spanKind field does not exist in the first span, update all span dependency information that uses the spanID of the first span as the tracking identifier parentID of the last request;
    若第一span中存在spanKind字段,并且      spanKind字段为客户client,则更新与第一span的spanID相同、且spanKind为主机server的span依赖关系信息;If the spanKind field exists in the first span, and the spanKind field is the client client, update the span ID that is the same as the spanID of the first span and spanKind is the span dependency information of the host server;
    若第一span中存在spanKind字段,并且spanKind字段为server,则更新所有以第一span的spanID为parentID的span依赖关系信息。If the spanKind field exists in the first span, and the spanKind field is server, then all span dependency information with the spanID of the first span as the parentID is updated.
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述根据判断结果基于所述第一span对应的服务和所述父span对应的服务生成所述第一span代表的服务间调用依赖关系之后,所述计算机程序在所述处理器上运行时还用于实现:18. The computer-readable storage medium according to claim 19, wherein the inter-service call dependency relationship represented by the first span is generated based on the service corresponding to the first span and the service corresponding to the parent span according to the judgment result After that, the computer program is also used to implement when running on the processor:
    将第一span的spanID放入最近最最少使用LRU淘汰算法的循环队列中,并且将该第一span放入固定淘汰时间的缓存中;定时从所述循环队列中取出spanID,当取到所述第一span的spanID时,判断所述第一span在所述固定淘汰时间的缓存中是否过期;若过期,则结束对所述第一span的依赖关系的计算处理。Put the spanID of the first span into the circular queue that uses the least recently used LRU elimination algorithm, and put the first span into the buffer with a fixed elimination time; periodically take out the spanID from the circular queue, and when the When the spanID of the first span is used, it is determined whether the first span has expired in the cache of the fixed elimination time; if it expires, the calculation processing of the dependency relationship of the first span is ended.
PCT/CN2020/122047 2020-08-07 2020-10-20 Method for determining inter-service dependency, and related apparatus WO2021151312A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010787909.1 2020-08-07
CN202010787909.1A CN111913818B (en) 2020-08-07 2020-08-07 Method for determining dependency relationship between services and related device

Publications (1)

Publication Number Publication Date
WO2021151312A1 true WO2021151312A1 (en) 2021-08-05

Family

ID=73282950

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/122047 WO2021151312A1 (en) 2020-08-07 2020-10-20 Method for determining inter-service dependency, and related apparatus

Country Status (2)

Country Link
CN (1) CN111913818B (en)
WO (1) WO2021151312A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114327955A (en) * 2021-12-31 2022-04-12 四川新网银行股份有限公司 Cluster message transmission method and system of centralized application system
CN114398179A (en) * 2022-01-14 2022-04-26 北京思明启创科技有限公司 Method and device for acquiring tracking identifier, server and storage medium
CN114598622A (en) * 2022-03-10 2022-06-07 平安科技(深圳)有限公司 Data monitoring method and device, storage medium and computer equipment

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112702191B (en) * 2020-12-11 2023-07-21 福建天晴在线互动科技有限公司 Link tracking method and terminal
US20230336444A1 (en) * 2020-12-31 2023-10-19 Hillstone Networks Co., Ltd. Method and Apparatus for Determining Application Service Dependency and Processor
CN113157478B (en) * 2021-04-21 2024-05-10 多点(深圳)数字科技有限公司 Distributed system configured data acquisition and service alarm system
CN113179329B (en) * 2021-05-24 2023-07-18 深圳平安智汇企业信息管理有限公司 Service issuing method and device, server and storage medium
CN113596078A (en) * 2021-06-17 2021-11-02 微梦创科网络科技(中国)有限公司 Service problem positioning method and device
CN114785690B (en) * 2022-03-30 2024-04-30 中国人寿保险股份有限公司 Monitoring method based on service grid and related equipment
CN115687406B (en) * 2022-11-07 2023-08-01 北京优特捷信息技术有限公司 Sampling method, device, equipment and storage medium for call chain data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090055826A1 (en) * 2007-08-21 2009-02-26 Kerry Bernstein Multicore Processor Having Storage for Core-Specific Operational Data
CN110569399A (en) * 2019-11-07 2019-12-13 四川新网银行股份有限公司 Link construction method based on pinpoint log
CN110717132A (en) * 2019-09-05 2020-01-21 深圳平安通信科技有限公司 Data collection method and pushing method for full-link monitoring system and related equipment
CN111078504A (en) * 2019-12-25 2020-04-28 深圳前海环融联易信息科技服务有限公司 Distributed call chain tracking method and device, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8132239B2 (en) * 2007-06-22 2012-03-06 Informed Control Inc. System and method for validating requests in an identity metasystem
CN105224445B (en) * 2015-10-28 2017-02-15 北京汇商融通信息技术有限公司 Distributed tracking system
US20170344363A1 (en) * 2016-05-26 2017-11-30 Linkedin Corporation Dependency management
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system
US10489225B2 (en) * 2017-08-10 2019-11-26 Bank Of America Corporation Automatic resource dependency tracking and structure for maintenance of resource fault propagation
CN107766205B (en) * 2017-10-10 2019-11-22 武汉大学 A kind of monitoring system and method towards the tracking of micro services calling process

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090055826A1 (en) * 2007-08-21 2009-02-26 Kerry Bernstein Multicore Processor Having Storage for Core-Specific Operational Data
CN110717132A (en) * 2019-09-05 2020-01-21 深圳平安通信科技有限公司 Data collection method and pushing method for full-link monitoring system and related equipment
CN110569399A (en) * 2019-11-07 2019-12-13 四川新网银行股份有限公司 Link construction method based on pinpoint log
CN111078504A (en) * 2019-12-25 2020-04-28 深圳前海环融联易信息科技服务有限公司 Distributed call chain tracking method and device, computer equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
BURK AARON: "Distributed Tracing with Apache Kafka and Jaeger", OBJECT PARTNERS INC., 25 April 2019 (2019-04-25), XP055832322, Retrieved from the Internet <URL:https://objectpartners.com/2019/04/25/distributed-tracing-with-apache-kafka-and-jaeger/> *
BURK AARON: "Fault Tolerance in Distributed Systems: Tracing with Apache Kaka and Jaeger", 24 July 2019 (2019-07-24), XP055832321, Retrieved from the Internet <URL:https://www.confluent.io/blog/fault-tolerance-distributed-systems-tracing-with-apache-kafka-jaeger/> *
CLOUDVTECH: "Kubernetes Production Practice Series 14: Cases of building a robust APM system using Jaeger and Kafka", CSDN, 3 June 2020 (2020-06-03), CN, pages 1 - 7, XP009529445, Retrieved from the Internet <URL:https://blog.csdn.net/cloudvtech/article/details/105898752> *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114327955A (en) * 2021-12-31 2022-04-12 四川新网银行股份有限公司 Cluster message transmission method and system of centralized application system
CN114327955B (en) * 2021-12-31 2024-04-16 四川新网银行股份有限公司 Cluster message transmission method and system for centralized application system
CN114398179A (en) * 2022-01-14 2022-04-26 北京思明启创科技有限公司 Method and device for acquiring tracking identifier, server and storage medium
CN114398179B (en) * 2022-01-14 2023-03-14 北京思明启创科技有限公司 Method and device for acquiring tracking identifier, server and storage medium
CN114598622A (en) * 2022-03-10 2022-06-07 平安科技(深圳)有限公司 Data monitoring method and device, storage medium and computer equipment
CN114598622B (en) * 2022-03-10 2023-04-25 平安科技(深圳)有限公司 Data monitoring method and device, storage medium and computer equipment

Also Published As

Publication number Publication date
CN111913818A (en) 2020-11-10
CN111913818B (en) 2022-12-02

Similar Documents

Publication Publication Date Title
WO2021151312A1 (en) Method for determining inter-service dependency, and related apparatus
US10320623B2 (en) Techniques for tracking resource usage statistics per transaction across multiple layers of protocols
KR100359366B1 (en) Method and appratus for providing awareness-triggered push
US9191463B2 (en) Stream processing using a client-server architecture
WO2020173080A1 (en) Method and apparatus for querying call chain information
CN109117252B (en) Method and system for task processing based on container and container cluster management system
CN110659109A (en) Openstack cluster virtual machine monitoring system and method
CN108427619B (en) Log management method and device, computing equipment and storage medium
CN114490268A (en) Full link monitoring method, device, equipment, storage medium and program product
CN114090366A (en) Method, device and system for monitoring data
CN112181678A (en) Service data processing method, device and system, storage medium and electronic device
CN111966653A (en) Data processing method, device, server and storage medium for micro-service call link
CN113472687B (en) Data processing method and device
US11228537B2 (en) Resource processing method and system, storage medium and electronic device
US20120072258A1 (en) Methods and computer program products for identifying and monitoring related business application processes
US9740587B2 (en) Distributing power usage data for low-level components of a computing device to subscribing programs
CN113672671A (en) Method and device for realizing data processing
US20170139808A1 (en) Method and dispatcher node for server processing management
CN110913018A (en) Distributed regulation and control service system
WO2021043066A1 (en) Communication method and apparatus for multiple management domains
CN108805741B (en) Fusion method, device and system of power quality data
CN113296968A (en) Address list updating method, device, medium and electronic equipment
CN114844957B (en) Link message conversion method, device, equipment, storage medium and program product
CN103856359A (en) Method and system for obtaining information
Li Design and implementation of distributed asynchronous data aided computer information interaction system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20917116

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20917116

Country of ref document: EP

Kind code of ref document: A1