CN111143304B - Micro-service system exception log analysis method based on request link - Google Patents
Micro-service system exception log analysis method based on request link Download PDFInfo
- Publication number
- CN111143304B CN111143304B CN202010127054.XA CN202010127054A CN111143304B CN 111143304 B CN111143304 B CN 111143304B CN 202010127054 A CN202010127054 A CN 202010127054A CN 111143304 B CN111143304 B CN 111143304B
- Authority
- CN
- China
- Prior art keywords
- log
- exception
- abnormal
- request
- service system
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/1734—Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
-
- 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
Abstract
The invention discloses a micro-service system exception log analysis method based on a request link, which comprises the following specific steps: associating the log, the exception and the call link information in the Java Agent according to the request ID; in the data analysis module, generating an abnormal ID (identity) for the abnormal event data, carrying out abnormal aggregation according to the abnormal ID, and simultaneously storing the mapping relation between the abnormal event and the request ID; at the interface inquiry end, inquiring a corresponding call log and a call link according to the abnormal ID association; outputting an exception log in the service application; and calling an API interface triggering the exception, namely, the exception log can be collected and analyzed. The invention can search and analyze the abnormal log in the same platform, and the automatic association of the abnormal log and the calling link can quickly locate the abnormal business.
Description
Technical Field
The invention belongs to the technical field of PAAS and micro-service management systems, and particularly relates to a micro-service system exception log analysis method based on a request link.
Background
In the big data age, the production, sales, administration, management of enterprises are gradually transformed by technology driving into data driving, and the importance of data in this process is self-evident. In mass data accumulated in daily operation of enterprises, the log is one of the most available data with the widest coverage and the most valuable data.
The log refers to various data generated by users, servers, network devices, operating systems, databases, application software and the like, and the core concept of the log is a time sequence increasing event sequence. Based on two basic elements of time and event, we can trace back past records, record present states and search future trends in the log, which is the value of the log. And the exception log records exception information so as to facilitate the viewing and analysis of related personnel.
In a micro-service system, an exception log analysis generally needs to build a centralized log analysis platform, such as ELK. When the business is abnormal, the log analysis system can only inquire by taking the service as the dimension, and can not rapidly and effectively analyze the logs of all the services passing through the request link. Meanwhile, when the system scale is large, the cost for rapidly searching out the needed abnormal logs in the log analysis platform is increased, and besides the inaccurate analysis result, the large operation and maintenance cost of the log analysis platform is also brought. Thus, there is a need for a method that can quickly query logs.
Disclosure of Invention
In order to solve the problems, the invention provides a method for analyzing the abnormal log of a micro-service system based on a request link, which can rapidly locate the business abnormality in the micro-service system based on the abnormal log.
The technical scheme of the invention is as follows: a micro-service system exception log analysis method based on request link comprises the following specific steps:
s1, associating logs, exceptions and call link information in Java Agent according to a request ID;
s2, generating an abnormal ID (identity) for the abnormal event data in a data analysis module, carrying out abnormal aggregation according to the abnormal ID, and simultaneously storing the mapping relation between the abnormal event and the request ID;
s3, at the interface inquiry end, inquiring a corresponding call log and a call link according to the abnormal ID association;
s4, outputting an abnormal log in the service application;
s5, calling an API interface triggering the exception, namely, the exception log can be collected and analyzed.
Preferably, the generation rule of the anomaly ID of the present invention includes: item ID, service name, exception file, and exception line number.
Preferably, the method for realizing the association of the log, the exception and the call link information according to the request ID in the Java Agent comprises the following steps:
s101, intercepting a servlet to generate a unique request ID in each request, and generating calling link information at the same time;
s102, intercepting log frames such as log back and log4j, and unifying the output format of the log;
s103, intercepting an exception log, and converting the exception log into structured exception event data.
Preferably, the method for realizing the association of the log, the exception and the call link information according to the request ID in the Java Agent is performed by a byte code rewriting technique.
The present invention preferably uses a log framework to output an anomaly log in a business application.
Compared with the prior art, the invention has the beneficial effects that:
the invention can search and analyze the abnormal log in the same platform, and the automatic association of the abnormal log and the calling link can quickly locate the abnormal business.
Drawings
FIG. 1 is a schematic diagram of the present invention (associated request IDs in the log console).
Fig. 2 is a schematic diagram of the present invention (retrieving each service log passed in a request based on a request ID).
FIG. 3 is a schematic diagram of the present invention (an exception log aggregate query list).
Fig. 4 is a schematic diagram of the present invention (details of anomaly log).
FIG. 5 is a schematic diagram of the present invention (request link log associated with exception log).
FIG. 6 is a schematic diagram of the present invention (call links associated with exception logs).
Detailed Description
The invention is described in further detail below with reference to the attached drawings and detailed description:
example 1
The specific steps of this embodiment 1 are:
step 1, associating log, exception and call link information in Java Agent according to request ID, as shown in figure 1 and figure 2;
step 2, generating an abnormal ID (identity) for the abnormal event data in a data analysis module, and carrying out abnormal aggregation according to the abnormal ID as shown in fig. 3, and simultaneously storing the mapping relation between the abnormal event and the request ID;
step 3, at the interface inquiry end, inquiring the corresponding call log and call link according to the abnormal ID association;
step 4, using a log framework to output an abnormal log in the service application;
and step 5, calling an API interface triggering the exception, namely, collecting and analyzing an exception log, wherein details of the exception log are shown in fig. 4.
In this embodiment, the generation rule of the anomaly ID is: item ID + service name + exception file + exception line number.
The specific implementation mode for implementing the step 1 comprises the following steps:
step 101, intercepting a unique request ID generated by a servlet in each request through a byte code rewriting technology, and generating call link information at the same time, as shown in fig. 5 and 6;
102, intercepting a log frame such as log back and log4j through a byte code rewriting technology, and unifying the output format of the log;
and 103, intercepting the exception log through a byte code rewriting technology, and converting the exception log into structured exception event data.
Claims (5)
1. A method for analyzing an exception log of a micro-service system based on a request link is characterized by comprising the following specific steps:
s1, associating logs, exceptions and call link information in Java Agent according to a request ID;
s2, generating an abnormal ID (identity) for the abnormal event data in a data analysis module, carrying out abnormal aggregation according to the abnormal ID, and simultaneously storing the mapping relation between the abnormal event and the request ID;
s3, at the interface inquiry end, inquiring a corresponding call log and a call link according to the abnormal ID association;
s4, outputting an abnormal log in the service application;
s5, calling an API interface triggering the exception, namely, the exception log can be collected and analyzed.
2. The method for analyzing the exception log of the micro service system based on the request link according to claim 1, wherein the generation rule of the exception ID comprises: item ID, service name, exception file, and exception line number.
3. The method for analyzing the exception log of the micro service system based on the request link according to claim 1, wherein the implementation method of the step S1 is as follows:
s101, intercepting a servlet to generate a unique request ID in each request, and generating calling link information at the same time;
s102, intercepting a log frame and unifying the output format of a log;
s103, intercepting an exception log, and converting the exception log into structured exception event data.
4. A method for analyzing exception log of micro service system based on request link according to claim 1 or 3, wherein said step S1 is implemented by byte code rewriting technique.
5. The method of claim 1, wherein the exception log is output using a log framework.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2019111405428 | 2019-11-20 | ||
CN201911140542 | 2019-11-20 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111143304A CN111143304A (en) | 2020-05-12 |
CN111143304B true CN111143304B (en) | 2023-09-29 |
Family
ID=70528306
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010127054.XA Active CN111143304B (en) | 2019-11-20 | 2020-02-28 | Micro-service system exception log analysis method based on request link |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111143304B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111522682A (en) * | 2020-06-22 | 2020-08-11 | 上海通联金融服务有限公司 | Method for completing log desensitization in log writing stage based on sensitive information rule |
CN112422335B (en) * | 2020-11-10 | 2023-02-21 | 普元信息技术股份有限公司 | Method, system, device and storage medium for realizing service link analysis based on micro-service architecture in technical middle station |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9223672B1 (en) * | 2013-09-24 | 2015-12-29 | Intuit Inc. | Method and system for providing error repair status data to an application user |
CN105207806A (en) * | 2015-08-20 | 2015-12-30 | 百度在线网络技术(北京)有限公司 | Monitoring method and apparatus of distributed service |
CN106100913A (en) * | 2016-08-25 | 2016-11-09 | 北京票之家科技有限公司 | Error message alignment system and method |
CN106682119A (en) * | 2016-12-08 | 2017-05-17 | 杭州销冠网络科技有限公司 | System and method for asynchronous data synchronization on basis of http service aspect and log system |
CN107678933A (en) * | 2017-09-28 | 2018-02-09 | 中国平安人寿保险股份有限公司 | Daily record generation management method, device, equipment and computer-readable recording medium |
WO2018045756A1 (en) * | 2016-09-06 | 2018-03-15 | 华为技术有限公司 | Fault localization platform, fault localization method and device |
US10078579B1 (en) * | 2015-06-26 | 2018-09-18 | Amazon Technologies, Inc. | Metrics-based analysis for testing a service |
CN108933695A (en) * | 2018-06-25 | 2018-12-04 | 百度在线网络技术(北京)有限公司 | Method and apparatus for handling information |
CN109086158A (en) * | 2018-08-29 | 2018-12-25 | 腾讯科技(深圳)有限公司 | A kind of Analysis on Abnormal method, apparatus and server |
CN109104302A (en) * | 2018-07-18 | 2018-12-28 | 杭州鑫合汇互联网金融服务有限公司 | A kind of full link tracing monitoring method |
CN109597799A (en) * | 2018-11-05 | 2019-04-09 | 北京百度网讯科技有限公司 | Positioning problems method and device, computer equipment, storage medium |
CN109947641A (en) * | 2019-02-20 | 2019-06-28 | 北京百佑科技有限公司 | Automated testing method and device |
JP2019125321A (en) * | 2018-01-19 | 2019-07-25 | 日本電気株式会社 | Communication log recording apparatus, communication log recording method, and communication log recording program |
CN110245035A (en) * | 2019-05-20 | 2019-09-17 | 平安普惠企业管理有限公司 | A kind of link trace method and device |
CN110427299A (en) * | 2019-07-19 | 2019-11-08 | 腾讯科技(深圳)有限公司 | Log processing method, relevant device and the system of micro services system application |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9497065B2 (en) * | 2011-02-26 | 2016-11-15 | British Telecommunications | Service session resource management |
US10255158B2 (en) * | 2013-10-15 | 2019-04-09 | Oracle International Corporation | Monitoring and diagnostics of business transaction failures |
US10185613B2 (en) * | 2016-04-29 | 2019-01-22 | Vmware, Inc. | Error determination from logs |
US10379934B2 (en) * | 2017-07-31 | 2019-08-13 | Oracle International Corporation | System and method of providing post error analysis for instances of applications in cloud service environments on a per user basis |
JP2019169926A (en) * | 2018-03-26 | 2019-10-03 | オムロン株式会社 | Management device, management method, management program, and recording medium |
-
2020
- 2020-02-28 CN CN202010127054.XA patent/CN111143304B/en active Active
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9223672B1 (en) * | 2013-09-24 | 2015-12-29 | Intuit Inc. | Method and system for providing error repair status data to an application user |
US10078579B1 (en) * | 2015-06-26 | 2018-09-18 | Amazon Technologies, Inc. | Metrics-based analysis for testing a service |
CN105207806A (en) * | 2015-08-20 | 2015-12-30 | 百度在线网络技术(北京)有限公司 | Monitoring method and apparatus of distributed service |
CN106100913A (en) * | 2016-08-25 | 2016-11-09 | 北京票之家科技有限公司 | Error message alignment system and method |
WO2018045756A1 (en) * | 2016-09-06 | 2018-03-15 | 华为技术有限公司 | Fault localization platform, fault localization method and device |
CN106682119A (en) * | 2016-12-08 | 2017-05-17 | 杭州销冠网络科技有限公司 | System and method for asynchronous data synchronization on basis of http service aspect and log system |
CN107678933A (en) * | 2017-09-28 | 2018-02-09 | 中国平安人寿保险股份有限公司 | Daily record generation management method, device, equipment and computer-readable recording medium |
JP2019125321A (en) * | 2018-01-19 | 2019-07-25 | 日本電気株式会社 | Communication log recording apparatus, communication log recording method, and communication log recording program |
CN108933695A (en) * | 2018-06-25 | 2018-12-04 | 百度在线网络技术(北京)有限公司 | Method and apparatus for handling information |
CN109104302A (en) * | 2018-07-18 | 2018-12-28 | 杭州鑫合汇互联网金融服务有限公司 | A kind of full link tracing monitoring method |
CN109086158A (en) * | 2018-08-29 | 2018-12-25 | 腾讯科技(深圳)有限公司 | A kind of Analysis on Abnormal method, apparatus and server |
CN109597799A (en) * | 2018-11-05 | 2019-04-09 | 北京百度网讯科技有限公司 | Positioning problems method and device, computer equipment, storage medium |
CN109947641A (en) * | 2019-02-20 | 2019-06-28 | 北京百佑科技有限公司 | Automated testing method and device |
CN110245035A (en) * | 2019-05-20 | 2019-09-17 | 平安普惠企业管理有限公司 | A kind of link trace method and device |
CN110427299A (en) * | 2019-07-19 | 2019-11-08 | 腾讯科技(深圳)有限公司 | Log processing method, relevant device and the system of micro services system application |
Non-Patent Citations (2)
Title |
---|
分布式系统中的日志分析及应用;陆杰;李丰;李炼;;高技术通讯(04) * |
基于微服务架构的日志监控系统的设计与实现;张振;刘俊艳;;软件(11) * |
Also Published As
Publication number | Publication date |
---|---|
CN111143304A (en) | 2020-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109409633B (en) | Business monitoring and risk early warning system | |
US8135827B2 (en) | Distributed capture and aggregation of dynamic application usage information | |
CN111309550A (en) | Data acquisition method, system, equipment and storage medium of application program | |
CN105099740A (en) | Log management system and log collection method | |
CN109284312A (en) | A kind of heterogeneous database change real-time informing method | |
CN111143304B (en) | Micro-service system exception log analysis method based on request link | |
CN112948492A (en) | Data processing system, method and device, electronic equipment and storage medium | |
CN110704484A (en) | Method and system for processing mass real-time data stream | |
CN110928934A (en) | Data processing method and device for business analysis | |
CN112416902A (en) | One-key inspection method for host and database | |
US10915510B2 (en) | Method and apparatus of collecting and reporting database application incompatibilities | |
CN115168400A (en) | External data management system and method | |
CN114090529A (en) | Log management method, device, system and storage medium | |
US20020026433A1 (en) | Knowledge system and methods of business alerting and business analysis | |
CN113407511A (en) | Log aggregation method, log aggregation equipment and computer program product | |
CN107153679B (en) | Extraction statistical method and system for semi-structured big data | |
CN112214459A (en) | Resource processing flow log collection system based on event mechanism | |
CN111212112B (en) | Information processing method and device | |
CN108712306A (en) | A kind of information system automation inspection platform and method for inspecting | |
CN110633191A (en) | Method and system for monitoring service health degree of software system in real time | |
CN112506886B (en) | Multi-source service operation log acquisition method and system | |
CN110297748A (en) | The method, apparatus and computer readable storage medium of error are called in a kind of positioning | |
CN111552674B (en) | Log processing method and equipment | |
CN111352795A (en) | Method and device for monitoring mobile service | |
US11748441B1 (en) | Serving real-time big data analytics on browser using probabilistic data structures |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |