CN117014300A - Micro-service log monitoring method and device, storage medium and computer equipment - Google Patents
Micro-service log monitoring method and device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN117014300A CN117014300A CN202310991166.3A CN202310991166A CN117014300A CN 117014300 A CN117014300 A CN 117014300A CN 202310991166 A CN202310991166 A CN 202310991166A CN 117014300 A CN117014300 A CN 117014300A
- Authority
- CN
- China
- Prior art keywords
- service
- log
- micro
- log information
- custom
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 46
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000001914 filtration Methods 0.000 claims abstract description 47
- 238000001514 detection method Methods 0.000 claims description 35
- 238000005538 encapsulation Methods 0.000 claims description 28
- 230000005856 abnormality Effects 0.000 claims description 22
- 238000004891 communication Methods 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 7
- 238000011161 development Methods 0.000 abstract description 15
- 238000012423 maintenance Methods 0.000 abstract description 7
- 230000002159 abnormal effect Effects 0.000 description 9
- 239000003795 chemical substances by application Substances 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 230000009466 transformation Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000012806 monitoring device Methods 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 239000003814 drug Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/069—Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0631—Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/04—Processing captured monitoring data, e.g. for logfile generation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/133—Protocols for remote procedure calls [RPC]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method and a device for monitoring a micro-service log, a storage medium and computer equipment, belongs to the technical field of data monitoring, is suitable for the medical field, and mainly solves the problems of long log monitoring development period and high development and maintenance cost of a medical application system comprising a plurality of subsystems in the prior art, and comprises the following steps: starting a custom log filter based on a service subscription application; when the custom log filter detects that a remote call service interface of a micro service provider is called by an agent object, performing service access operation on the micro service provider; and determining service operation log information corresponding to the service access operation based on the log information filtering rule of the custom log filter.
Description
Technical Field
The invention relates to the technical field of data monitoring, and is suitable for the medical field, in particular to a method and a device for monitoring a micro service log, a storage medium and computer equipment.
Background
With the continuous development of various businesses in the medical field, the existing large-scale medical software system is mostly developed by adopting a micro-service mode, and a huge volume is formed by a plurality of sub-services. Since each subsystem in a huge medical application system may be responsible for development by different development teams, the problem of calling errors between systems, including system anomalies, such as: network fluctuation call overtime, parameter abnormality and the like; also included are business anomalies such as: insufficient inventory, no current address being vendable, etc. Therefore, a developer is required to know the abnormal condition of the system in time and dynamically make corresponding operations.
Currently, log monitoring of individual medical application systems is responsible for developing dedicated log monitoring applications by specialized teams and requires specialized team maintenance. Although the dedicated log monitoring system is multifunctional, there are problems of long development period and high development and maintenance costs.
Disclosure of Invention
In view of the above, the present invention provides a method and apparatus for monitoring a micro-service log, a storage medium, and a computer device, which are mainly aimed at solving the problems of long log monitoring development period and high development and maintenance costs for a medical application system including a plurality of subsystems.
According to one aspect of the present invention, there is provided a micro service log monitoring method, including:
starting a custom log filter based on a service subscription application;
when the custom log filter detects that a remote call service interface of a micro service provider is called by an agent object, performing service access operation on the micro service provider;
and determining service operation log information corresponding to the service access operation based on the log information filtering rule of the custom log filter.
Further, before the service subscription application based on the service subscription application and the custom log filter is started, the method further includes:
receiving a service registration application of a micro service provider, wherein the service registration application is used for representing the service registration application for acquiring log information of the micro service provider;
and acquiring a remote call service interface of the micro service provider based on the service registration application, and carrying out custom configuration of a log filter based on the remote call service interface to obtain the custom log filter.
Further, the starting the custom log filter based on the service subscription application includes:
receiving a service subscription application of a service consumer, and establishing an association relationship between the service consumer and a subscribed micro-service provider based on the service subscription application;
and generating a proxy object corresponding to the service consumer based on the association relation, so that the proxy object starts the custom log filter.
Further, when the custom log filter detects that the remote call service interface of the micro service provider is called by the proxy object, before performing the service access operation on the micro service provider, the method further includes:
acquiring an access link corresponding to the remote call service interface;
and carrying out encapsulation processing on the access link to obtain an encapsulation link, so that the proxy object carries out service access operation on the micro service provider based on the encapsulation link.
Further, when the custom log filter detects that the remote call service interface of the micro service provider is called by the proxy object, performing service access operation on the micro service provider includes:
acquiring a load balancing strategy, and calling a remote call interface of the micro service provider through the proxy object based on the load balancing strategy;
when the custom log filter detects that the remote call interface is called by the proxy object, determining an encapsulation link corresponding to the remote call interface;
and carrying out service access operation on the micro service provider based on the encapsulation link.
Further, the determining service running log information corresponding to the service access operation based on the log information filtering rule of the custom log filter includes:
acquiring a service running context snapshot corresponding to the service access operation;
and carrying out information filtering operation on the service operation context snapshot by adopting the log information filtering rule to obtain the service operation log information corresponding to the service access operation.
Further, the method further comprises:
classifying the service operation log information to obtain system log information and service log information;
performing anomaly detection on the system log information and the service log information respectively to obtain a system anomaly detection result corresponding to the system log information and a service anomaly detection result corresponding to the service log information;
and carrying out abnormality warning based on the system abnormality detection result and/or the business abnormality detection result.
According to another aspect of the present invention, there is provided a micro service log monitoring apparatus comprising:
the filtering starting module is used for starting a custom log filter based on the service subscription application;
the service access module is used for performing service access operation on the micro-service provider when the custom log filter detects that the remote call service interface of the micro-service provider is called by the proxy object;
and the log information determining module is used for determining service running log information corresponding to the service access operation based on the log information filtering rule of the custom log filter.
Further, the apparatus further comprises a filter configuration module for:
receiving a service registration application of a micro service provider, wherein the service registration application is used for representing the service registration application for acquiring log information of the micro service provider;
and acquiring a remote call service interface of the micro service provider based on the service registration application, and carrying out custom configuration of a log filter based on the remote call service interface to obtain the custom log filter.
Further, the filtering starting module is further configured to:
receiving a service subscription application of a service consumer, and establishing an association relationship between the service consumer and a subscribed micro-service provider based on the service subscription application;
and generating a proxy object corresponding to the service consumer based on the association relation, so that the proxy object starts the custom log filter.
Further, the device also comprises a packaging module for:
acquiring an access link corresponding to the remote call service interface;
and carrying out encapsulation processing on the access link to obtain an encapsulation link, so that the proxy object carries out service access operation on the micro service provider based on the encapsulation link.
Further, the service access module is further configured to:
acquiring a load balancing strategy, and calling a remote call interface of the micro service provider through the proxy object based on the load balancing strategy;
when the custom log filter detects that the remote call interface is called by the proxy object, determining an encapsulation link corresponding to the remote call interface;
and carrying out service access operation on the micro service provider based on the encapsulation link.
Further, the log information determining module is further configured to:
acquiring a service running context snapshot corresponding to the service access operation;
and carrying out information filtering operation on the service operation context snapshot by adopting the log information filtering rule to obtain the service operation log information corresponding to the service access operation.
Further, the device further comprises an anomaly classification and alarm module for:
classifying the service operation log information to obtain system log information and service log information;
performing anomaly detection on the system log information and the service log information respectively to obtain a system anomaly detection result corresponding to the system log information and a service anomaly detection result corresponding to the service log information;
and carrying out abnormality warning based on the system abnormality detection result and/or the business abnormality detection result.
According to still another aspect of the present invention, there is provided a storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the micro service log monitoring method described above.
According to yet another aspect of the present invention, there is provided a computer device comprising a processor, a memory, a communication interface and a communication bus, said processor, said memory and said communication interface completing communication with each other via said communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the micro-service log monitoring method.
By means of the technical scheme, the technical scheme provided by the embodiment of the invention has at least the following advantages:
compared with the prior art, the invention starts the custom log filter based on service subscription application; when the custom log filter detects that a remote call service interface of a micro service provider is called by an agent object, performing service access operation on the micro service provider; based on the log information filtering rule of the custom log filter, determining service operation log information corresponding to the service access operation, and realizing log monitoring of a micro service provider. The invention is based on the low-cost and easy-to-access elegant mode of the dubbo, realizes the log monitoring of the service system under the condition of not carrying out any code transformation on the service system, and has shorter development period and lower development and maintenance cost compared with the special log monitoring application for developing in the prior art. In addition, the invention independently carries out the custom configuration of the log information filtering rules on different interfaces aiming at the consumer or the server, and the differentiated configuration strategy better meets the increasingly-changed log monitoring requirement.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
fig. 1 shows a flow diagram of a micro service log monitoring method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating another method for monitoring micro service log according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for monitoring a micro service log according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a micro service log monitoring device according to an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a structure of another micro service log monitoring apparatus according to an embodiment of the present invention;
fig. 6 shows a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a micro-service log monitoring method, as shown in fig. 1, which comprises the following steps:
101. starting a custom log filter based on a service subscription application;
in the embodiment of the invention, the current execution end starts a custom log filter based on a service subscription application, wherein the service subscription application is used for representing subscription applications of services provided by each micro service provider. The micro service provider is used for representing the micro service provider for providing the micro service for the large medical software system in the medical field, such as the micro service provider of the online inquiry service, the micro service provider of the registration service, the micro service provider of the payment service, the micro service provider of the user identity authentication service, the micro service provider of the inspection report downloading and printing service, and the like. The custom log filter is used for representing the filter of the custom filtering operation of the service running log of each micro service provider, and can independently carry out custom configuration of log information filtering rules on different interfaces, and the different configuration strategies are more in line with the increasingly-changing log monitoring requirements.
102. When the custom log filter detects that a remote call service interface of a micro service provider is called by an agent object, performing service access operation on the micro service provider;
in the embodiment of the invention, the current execution end adopts the started log filter to detect the calling condition of the remote calling service interface of the micro service provider, and when detecting that the remote calling service interface of the micro service provider is called by the proxy object, the current execution end performs service access operation on the micro service provider. Wherein the service interface, i.e. the RPC service interface, is invoked remotely. The proxy object is generated in a proxy layer in the dubbo framework based on the subscription condition of the service consumer, and is used for the service consumer to initiate interface call through the proxy object.
103. And determining service operation log information corresponding to the service access operation based on the log information filtering rule of the custom log filter.
In the embodiment of the invention, the current execution end determines service running log information corresponding to service access operation based on the log information filtering rule of the custom log filter. The log information filtering rule is used for representing the filtering and filtering of the log information of each stage of service operation to obtain an information filtering rule of target log information, and comprises the log information filtering rule for filtering the calling times and the calling time of a remote calling service interface; filtering rules of log information of the system call duration; the embodiment of the invention is not particularly limited, and the log information filtering rules and the like of the service interruption when the service runs are provided.
Further, as a refinement and extension of the foregoing embodiment, in order to perform personalized configuration on the custom filter and further meet the increasingly changing log monitoring requirement, another micro-service log monitoring method is provided, as shown in fig. 2, and before the step of starting the custom log filter based on the service subscription application, the method further includes:
201. receiving a service registration application of a micro service provider;
in the embodiment of the invention, a registration center (registor) of a current execution end in a dubbo framework receives a service registration application of a micro service provider, wherein the service registration application is used for representing the service registration application for acquiring log information of the micro service provider; when the micro service provider applies for service registration, the service name, the remote call service interface, that is, the RPC service interface, and other information related to the service are generally provided, and the embodiment of the present invention is not limited specifically.
202. And acquiring a remote call service interface of the micro service provider based on the service registration application, and carrying out custom configuration of a log filter based on the remote call service interface to obtain the custom log filter.
In the embodiment of the invention, the current execution terminal obtains the remote call service interface of the micro service provider based on the service registration application, and performs the custom configuration of the log filter based on the remote call service interface to obtain the custom log filter. The custom configuration of the custom log filter (dubbolog filter) includes configuration of a group (group) to which the log filter belongs, for example, whether the log filter belongs to a group of micro service providers or a group of service consumers, etc., and the embodiment of the present invention is not limited specifically; the configuration of the execution order (order) of the log filter, such as 666, 110, 089, etc., is also included, and the embodiment of the present invention is not limited in detail. The smaller the value of the execution order (order), the earlier the execution. Therefore, in order not to disturb the service function of the original large medical software system based on dubbo, a larger value, such as 999 and 998, is generally configured for the filter execution sequence in the embodiment of the present invention, and the embodiment of the present invention is not specifically limited.
It should be noted that, in addition to the above-mentioned belonging group configuration and execution sequence configuration, the custom configuration of the log filter further includes path configuration, for example, a META-INF folder is created under the project catalog resources of the large medical software system, then a subfolder dubbo.internal is created, and finally a com alibaba.dubbo.prc.filter file is created, where the file content is:
dubboblog filter = custom log filter dubboblog filter class path above
The starting the custom log filter based on the service subscription application comprises the following steps:
203. receiving a service subscription application of a service consumer, and establishing an association relationship between the service consumer and a subscribed micro-service provider based on the service subscription application;
in the embodiment of the invention, a current execution end receives a service subscription application of a service consumer, and establishes an association relationship between the service consumer and a subscribed service provider based on the service subscription application; if the service consumer a applies for service subscription to registration service, payment service, etc., an association relationship is established between the service consumer a and a micro service provider of registration service, a micro service provider of payment service, etc., and the embodiment of the invention is not limited specifically.
204. And generating a proxy object corresponding to the service consumer based on the association relation, so that the proxy object starts the custom log filter.
In the embodiment of the invention, the current execution end queries the association relation between the service consumer and the subscribed micro service provider, determines the micro service provider corresponding to the service consumer, and then generates the proxy object corresponding to the service consumer based on the service name of the micro service provider, the remote call service interface and other information, so that the proxy object starts the custom log filter.
Further, as a refinement and extension of the foregoing embodiment, in order to facilitate the call of the interface by the proxy object, another method for monitoring a micro service log is provided, where, when the custom log filter detects that the remote call service interface of the micro service provider is called by the proxy object, before performing a service access operation on the micro service provider, the method further includes:
acquiring an access link corresponding to the remote call service interface;
and carrying out encapsulation processing on the access link to obtain an encapsulation link, so that the proxy object carries out service access operation on the micro service provider based on the encapsulation link.
In the embodiment of the invention, the current execution end acquires the access link corresponding to the remote call service interface, and encapsulates the access link by adopting the routing layer in the dubbo framework to obtain the encapsulated link which can be connected to the specific server, so that the proxy object performs service access operation on the associated micro-service provider based on the encapsulated link. If the micro service provider associated with the proxy object a generated by the service consumer a includes a micro service provider of a registration service, a micro service provider of a payment service, and the like, the proxy object a performs service access operation on the registration service through a package link of a remote call service interface corresponding to the micro service provider of the registration service; the proxy object a performs service access operation on the payment service through the encapsulation link of the remote call service interface corresponding to the micro service provider of the payment service, and the embodiment of the invention is not particularly limited.
Further, as a refinement and extension of the foregoing embodiment, in order to further streamline interface call, another method for monitoring a micro service log is provided, where when the custom log filter detects that a remote call service interface of a micro service provider is called by a proxy object, performing a service access operation on the micro service provider includes:
acquiring a load balancing strategy, and calling a remote call interface of the micro service provider through the proxy object based on the load balancing strategy;
when the custom log filter detects that the remote call interface is called by the proxy object, determining an encapsulation link corresponding to the remote call interface;
and carrying out service access operation on the micro service provider based on the encapsulation link.
In the embodiment of the invention, a current execution end acquires a load balancing strategy and calls a remote call interface of a micro-service provider through a proxy object based on the load balancing strategy. The load balancing policy includes a weighted random policy, a minimum active number policy, a consistency Hash policy, and the like, and the embodiment of the invention is not limited in detail. The custom filter configured in the current execution end is provided with a call interception mechanism, so that interception of call processes of a micro service provider and a service consumer is provided, namely, when RPC call is executed each time, the corresponding custom log filter takes effect. When the custom log filter detects that the remote call interface is called by the proxy object, determining an encapsulation link corresponding to the remote call interface, and then performing service access operation on the micro service provider based on the encapsulation link.
Further, as a refinement and extension of the foregoing embodiment, in order to obtain service running log information quickly and accurately, another micro service log monitoring method is provided, and the determining, based on the log information filtering rule of the custom log filter, service running log information corresponding to the service access operation includes:
acquiring a service running context snapshot corresponding to the service access operation;
and carrying out information filtering operation on the service operation context snapshot by adopting the log information filtering rule to obtain the service operation log information corresponding to the service access operation.
In the embodiment of the invention, the current execution end obtains the service running context snapshot corresponding to the service access operation, wherein the service running context snapshot comprises text information, picture information and the like of the service page, and the embodiment of the invention is not particularly limited. And the current execution end adopts a log information filtering rule to carry out information filtering operation on the information in the service operation context snapshot, so as to obtain service operation log information corresponding to the service access operation.
Further, as a refinement and expansion of the specific implementation manner of the foregoing embodiment, in order to perform classification processing on log abnormal information and timely perform abnormal alarm, another micro-service log monitoring method is provided, as shown in fig. 3, where the method further includes:
301. classifying the service operation log information to obtain system log information and service log information;
in the embodiment of the invention, a current execution end classifies service operation log information to obtain system log information and service log information; if so, dividing the log information obtained by filtering the log information filtering rule based on the system call duration into system log information; the log information obtained by filtering the log information filtering rule based on the service interruption in service operation is divided into service log information and the like, and the embodiment of the invention is not particularly limited.
302. Performing anomaly detection on the system log information and the service log information respectively to obtain a system anomaly detection result corresponding to the system log information and a service anomaly detection result corresponding to the service log information;
in the embodiment of the invention, the current execution end respectively carries out anomaly detection on the system log information and the service log information to obtain the system anomaly detection results corresponding to the system log information, such as the anomaly detection results of overtime network fluctuation calling, parameter anomalies and the like, and the embodiment of the invention is not particularly limited. And obtaining a service abnormality detection result corresponding to the service log information, such as insufficient residual number, insufficient medicine inventory, no detection of a laboratory sheet in the current time period, and the like.
303. And carrying out abnormality warning based on the system abnormality detection result and/or the business abnormality detection result.
In the embodiment of the invention, the current execution terminal carries out abnormal alarm based on the system abnormal detection result and/or the service abnormal detection result. The abnormal alarm may be in the form of a short message, a telephone, a mail, etc., and the embodiment of the invention is not particularly limited.
After obtaining the system abnormality detection result and/or the service abnormality detection result, the system abnormality detection method can also carry out grading treatment on the abnormal conditions, determine the severity of the abnormality, and then take different abnormality alarm forms based on the abnormal conditions with different severity.
Compared with the prior art, the embodiment of the invention starts the custom log filter based on the service subscription application; when the custom log filter detects that a remote call service interface of a micro service provider is called by an agent object, performing service access operation on the micro service provider; based on the log information filtering rule of the custom log filter, determining service operation log information corresponding to the service access operation, and realizing log monitoring of a micro service provider. The invention is based on the low-cost and easy-to-access elegant mode of the dubbo, realizes the log monitoring of the service system under the condition of not carrying out any code transformation on the service system, and has shorter development period and lower development and maintenance cost compared with the special log monitoring application for developing in the prior art. In addition, the invention independently carries out the custom configuration of the log information filtering rules on different interfaces aiming at the consumer or the server, and the differentiated configuration strategy better meets the increasingly-changed log monitoring requirement.
As an implementation of the method shown in fig. 1, an embodiment of the present invention provides a micro service log monitoring device, as shown in fig. 4, where the device includes:
a filter starting module 41, configured to start a custom log filter based on a service subscription application;
a service access module 42, configured to perform a service access operation on the micro service provider when the custom log filter detects that a remote call service interface of the micro service provider is called by a proxy object;
the log information determining module 43 is configured to determine service running log information corresponding to the service access operation based on a log information filtering rule of the custom log filter.
Further, as shown in fig. 5, the apparatus further includes a filter configuration module 44 for:
receiving a service registration application of a micro service provider, wherein the service registration application is used for representing the service registration application for acquiring log information of the micro service provider;
and acquiring a remote call service interface of the micro service provider based on the service registration application, and carrying out custom configuration of a log filter based on the remote call service interface to obtain the custom log filter.
Further, the filter starting module 41 is further configured to:
receiving a service subscription application of a service consumer, and establishing an association relationship between the service consumer and a subscribed micro-service provider based on the service subscription application;
and generating a proxy object corresponding to the service consumer based on the association relation, so that the proxy object starts the custom log filter.
Further, as shown in fig. 5, the apparatus further includes a packaging module 45 for:
acquiring an access link corresponding to the remote call service interface;
and carrying out encapsulation processing on the access link to obtain an encapsulation link, so that the proxy object carries out service access operation on the micro service provider based on the encapsulation link.
Further, the service access module 42 is further configured to:
acquiring a load balancing strategy, and calling a remote call interface of the micro service provider through the proxy object based on the load balancing strategy;
when the custom log filter detects that the remote call interface is called by the proxy object, determining an encapsulation link corresponding to the remote call interface;
and carrying out service access operation on the micro service provider based on the encapsulation link.
Further, the log information determining module 43 is further configured to:
acquiring a service running context snapshot corresponding to the service access operation;
and carrying out information filtering operation on the service operation context snapshot by adopting the log information filtering rule to obtain the service operation log information corresponding to the service access operation.
Further, as shown in fig. 5, the apparatus further includes an anomaly classification and alarm module 46 for:
classifying the service operation log information to obtain system log information and service log information;
performing anomaly detection on the system log information and the service log information respectively to obtain a system anomaly detection result corresponding to the system log information and a service anomaly detection result corresponding to the service log information;
and carrying out abnormality warning based on the system abnormality detection result and/or the business abnormality detection result.
Compared with the prior art, the embodiment of the invention starts the custom log filter based on the service subscription application; when the custom log filter detects that a remote call service interface of a micro service provider is called by an agent object, performing service access operation on the micro service provider; based on the log information filtering rule of the custom log filter, determining service operation log information corresponding to the service access operation, and realizing log monitoring of a micro service provider. The invention is based on the low-cost and easy-to-access elegant mode of the dubbo, realizes the log monitoring of the service system under the condition of not carrying out any code transformation on the service system, and has shorter development period and lower development and maintenance cost compared with the special log monitoring application for developing in the prior art. In addition, the invention independently carries out the custom configuration of the log information filtering rules on different interfaces aiming at the consumer or the server, and the differentiated configuration strategy better meets the increasingly-changed log monitoring requirement.
According to one embodiment of the present invention, there is provided a storage medium storing at least one executable instruction that can perform the micro service log monitoring method of any of the above method embodiments.
Fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and the specific embodiment of the present invention is not limited to the specific implementation of the computer device.
As shown in fig. 6, the computer device may include: a processor 602, a communication interface (Communications Interface), a memory 606, and a communication bus 608.
Wherein: processor 602, communication interface 604, and memory 606 perform communication with each other via communication bus 608.
Communication interface 604 is used to communicate with network elements of other devices, such as clients or other servers.
The processor 602 is configured to execute the program 610, and may specifically perform the relevant steps of the micro service log monitoring method described above.
In particular, program 610 may include program code including computer-operating instructions.
The processor 602 may be a central processing unit CPU or a specific integrated circuit ASIC (Application Specific Integrated Circuit) or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the computer device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 606 for storing a program 610. The memory 606 may comprise high-speed RAM memory or may further comprise non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 610 may be specifically operable to cause the processor 602 to:
starting a custom log filter based on a service subscription application;
when the custom log filter detects that a remote call service interface of a micro service provider is called by an agent object, performing service access operation on the micro service provider;
and determining service operation log information corresponding to the service access operation based on the log information filtering rule of the custom log filter.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for monitoring a micro service log, comprising:
starting a custom log filter based on a service subscription application;
when the custom log filter detects that a remote call service interface of a micro service provider is called by an agent object, performing service access operation on the micro service provider;
and determining service operation log information corresponding to the service access operation based on the log information filtering rule of the custom log filter.
2. The method of claim 1, wherein prior to launching the custom log filter based on the service subscription application, the method further comprises:
receiving a service registration application of a micro service provider, wherein the service registration application is used for representing the service registration application for acquiring log information of the micro service provider;
and acquiring a remote call service interface of the micro service provider based on the service registration application, and carrying out custom configuration of a log filter based on the remote call service interface to obtain the custom log filter.
3. The method of claim 1, wherein the launching a custom log filter based on the service subscription application comprises:
receiving a service subscription application of a service consumer, and establishing an association relationship between the service consumer and a subscribed micro-service provider based on the service subscription application;
and generating a proxy object corresponding to the service consumer based on the association relation, so that the proxy object starts the custom log filter.
4. The method of claim 1, wherein when the custom log filter detects that a remote invocation service interface of a micro service provider is invoked by a proxy object, the method further comprises, prior to performing a service access operation on the micro service provider:
acquiring an access link corresponding to the remote call service interface;
and carrying out encapsulation processing on the access link to obtain an encapsulation link, so that the proxy object carries out service access operation on the micro service provider based on the encapsulation link.
5. The method of claim 4, wherein the performing a service access operation on the micro-service provider when the custom log filter detects that a remote invocation service interface of the micro-service provider is invoked by a proxy object comprises:
acquiring a load balancing strategy, and calling a remote call interface of the micro service provider through the proxy object based on the load balancing strategy;
when the custom log filter detects that the remote call interface is called by the proxy object, determining an encapsulation link corresponding to the remote call interface;
and carrying out service access operation on the micro service provider based on the encapsulation link.
6. The method of claim 1, wherein the determining service run log information corresponding to the service access operation based on log information filtering rules of the custom log filter comprises:
acquiring a service running context snapshot corresponding to the service access operation;
and carrying out information filtering operation on the service operation context snapshot by adopting the log information filtering rule to obtain the service operation log information corresponding to the service access operation.
7. The method according to any one of claims 1 to 6, further comprising:
classifying the service operation log information to obtain system log information and service log information;
performing anomaly detection on the system log information and the service log information respectively to obtain a system anomaly detection result corresponding to the system log information and a service anomaly detection result corresponding to the service log information;
and carrying out abnormality warning based on the system abnormality detection result and/or the business abnormality detection result.
8. A micro service log monitoring apparatus, comprising:
the filtering starting module is used for starting a custom log filter based on the service subscription application;
the service access module is used for performing service access operation on the micro-service provider when the custom log filter detects that the remote call service interface of the micro-service provider is called by the proxy object;
and the log information determining module is used for determining service running log information corresponding to the service access operation based on the log information filtering rule of the custom log filter.
9. A storage medium having stored therein at least one executable instruction for performing operations corresponding to the micro service log monitoring method according to any one of claims 1 to 7.
10. A computer device comprising a processor, a memory, a communication interface and a communication bus, said processor, said memory and said communication interface completing communication with each other through said communication bus;
the memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform the operations corresponding to the micro service log monitoring method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310991166.3A CN117014300A (en) | 2023-08-07 | 2023-08-07 | Micro-service log monitoring method and device, storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310991166.3A CN117014300A (en) | 2023-08-07 | 2023-08-07 | Micro-service log monitoring method and device, storage medium and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117014300A true CN117014300A (en) | 2023-11-07 |
Family
ID=88572397
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310991166.3A Pending CN117014300A (en) | 2023-08-07 | 2023-08-07 | Micro-service log monitoring method and device, storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117014300A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118897784A (en) * | 2024-10-08 | 2024-11-05 | 深圳市智慧城市科技发展集团有限公司 | Interface call log analysis method, device, equipment, medium and product |
-
2023
- 2023-08-07 CN CN202310991166.3A patent/CN117014300A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118897784A (en) * | 2024-10-08 | 2024-11-05 | 深圳市智慧城市科技发展集团有限公司 | Interface call log analysis method, device, equipment, medium and product |
CN118897784B (en) * | 2024-10-08 | 2025-05-30 | 深圳市智慧城市科技发展集团有限公司 | Interface call log analysis method, device, equipment, medium and product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111245900B (en) | Distributed message sending processing system and processing method thereof | |
CN113039763A (en) | NF service consumer restart detection using direct signaling between NFs | |
CN109104368B (en) | A method, device, server and computer-readable storage medium for requesting connection | |
CN113141405B (en) | Service access method, middleware system, electronic device, and storage medium | |
CN114172966A (en) | Service calling method and device and service processing method and device under unitized architecture | |
CN106790291B (en) | Intrusion detection prompting method and device | |
CN108683668A (en) | Resource checksum method, apparatus, storage medium and equipment in content distributing network | |
CN117215900A (en) | Log acquisition method, device and equipment | |
CN117014300A (en) | Micro-service log monitoring method and device, storage medium and computer equipment | |
US20050102350A1 (en) | Pattern based web services | |
CN114020513B (en) | A method and device for processing log information | |
CN110275701B (en) | Data processing method, device, medium and computing equipment | |
CN110503504B (en) | Information identification method, device and equipment of network product | |
CN117130683A (en) | Business calling methods, devices, equipment and storage media | |
CN117539564A (en) | Page hot updating method and device, electronic equipment and readable storage medium | |
CN114185502B (en) | Log printing method, device, equipment and medium based on production line environment | |
CN113726855B (en) | Service aggregation method, device, electronic equipment and computer-readable storage medium | |
CN116880970A (en) | Application function calling method and device, terminal equipment and storage medium | |
CN112667491B (en) | Function test method and device for virtual machine | |
CN113986760A (en) | Microservice Mock testing method and device, computer equipment and storage medium | |
CN112860340A (en) | Method, device and equipment for starting micro-service instance and storage medium | |
CN113760693A (en) | Method and apparatus for local debugging of microservice systems | |
US12028360B1 (en) | Techniques for multi-tenant vulnerability scanning utilizing sensitive data | |
CN112799710B (en) | Model release system and model release method | |
CN113778969B (en) | A log processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |