CN112579406A - Log call chain generation method and device - Google Patents
Log call chain generation method and device Download PDFInfo
- Publication number
- CN112579406A CN112579406A CN201910936077.2A CN201910936077A CN112579406A CN 112579406 A CN112579406 A CN 112579406A CN 201910936077 A CN201910936077 A CN 201910936077A CN 112579406 A CN112579406 A CN 112579406A
- Authority
- CN
- China
- Prior art keywords
- application
- log
- module
- application module
- identification
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000012544 monitoring process Methods 0.000 claims abstract description 40
- 230000005540 biological transmission Effects 0.000 claims abstract description 27
- 238000005516 engineering process Methods 0.000 claims description 19
- 230000008569 process Effects 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 9
- 230000007613 environmental effect Effects 0.000 claims description 7
- 230000002159 abnormal effect Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 10
- 230000015654 memory Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 238000007726 management method Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 238000007405 data analysis Methods 0.000 description 2
- 238000013480 data collection Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
Abstract
The invention discloses a log call chain generation method and device, and relates to the technical field of computers. One embodiment of the method comprises: generating an identification code according to the identifier of the equipment where the application is located and the current timestamp; monitoring the transmission sequence of the identification codes among the application modules; and extracting logs corresponding to the identification codes in each application module, and arranging and combining the extracted logs according to the transmission sequence to obtain a log calling chain. According to the embodiment, the logs in the log servers are automatically extracted by using the identification codes, and the logs are sorted according to the transmission sequence of the identification codes among the application modules, so that the automatic generation of the log call chain is realized, and a foundation is provided for log centralized filing and abnormal log positioning.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a log call chain generation method and device.
Background
The logs mainly comprise system logs, application program logs and safety logs. System operation and development personnel can know the software and hardware information of the server through the log, check errors in the configuration process and cause of the errors, and therefore timely take measures to correct the errors.
The internet adopts distributed application, and a system in the application is divided into a plurality of different application modules. Therefore, a complete operation flow (i.e. a call chain) involves calling a plurality of different application modules, and logs output by the different application modules are stored in different log servers in a scattered manner.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
1. in the current distributed application scene, logs in each application module are not subjected to centralized filing processing, so that log query needs to be carried out in different log servers, a complete log calling link is difficult to form, and tracking and query of abnormal logs are not facilitated;
2. when the number of log servers is large, if the traditional log logging and log consulting mode is still adopted, the problems of complex operation and low efficiency exist.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a log call chain, which can at least solve the problem that an effective centralized log management and log call chain automatic generation scheme is not available in the prior art.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a log call chain generation method, including:
generating an identification code according to the identifier of the equipment where the application is located and the current timestamp;
monitoring the transmission sequence of the identification codes among the application modules;
and extracting logs corresponding to the identification codes in each application module, and arranging and combining the extracted logs according to the transmission sequence to obtain a log calling chain.
Optionally, the monitoring a transmission sequence of the identification code between the application modules further includes: when the application module comprises the application sub-modules, monitoring a calling sequence of each application sub-module in the application module, and sequentially transmitting the identification codes among the application sub-modules according to the calling sequence.
Optionally, before the extracting the log corresponding to the identification code in each application module, the method further includes: respectively collecting operation data of each application module to generate a log based on the collected operation data; and obtaining the identification of each log according to the identification code, the identification of each application module and the operation time stamp of each application module.
Optionally, the respectively collecting the operation data of each application module includes:
respectively monitoring performance data of each application module in the operation process by using a byte code instrumentation technology; and
and respectively monitoring the environmental data of each application module in the operation process by using an index acquisition technology.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a log call chain generating apparatus including:
the identification code generating module is used for generating an identification code according to the identifier of the equipment where the application is located and the current timestamp;
the sequence monitoring module is used for monitoring the transmission sequence of the identification codes among the application modules;
and the call chain generation module is used for extracting the logs corresponding to the identification codes in each application module, and arranging and combining the extracted logs according to the transmission sequence to obtain a log call chain.
Optionally, the sequential monitoring module is further configured to: when the application module comprises the application sub-modules, monitoring a calling sequence of each application sub-module in the application module, and sequentially transmitting the identification codes among the application sub-modules according to the calling sequence.
Optionally, the system further comprises a data acquisition module, configured to: respectively collecting operation data of each application module to generate a log based on the collected operation data; and obtaining the identification of each log according to the identification code, the identification of each application module and the operation time stamp of each application module.
Optionally, the data acquisition module is configured to:
respectively monitoring performance data of each application module in the operation process by using a byte code instrumentation technology; and
and respectively monitoring the environmental data of each application module in the operation process by using an index acquisition technology.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a log call chain generation electronic device.
The electronic device of the embodiment of the invention comprises: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement any of the above-described log call chain generation methods.
To achieve the above object, according to a further aspect of the embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements any one of the above-described log call chain generation methods.
According to the scheme provided by the invention, one embodiment of the invention has the following advantages or beneficial effects: setting an identification code for automatically marking a log when a user operates an application module; monitoring the transmission sequence of the identification codes among the application modules, and performing subsequent sequencing combination on the logs to generate a log call chain so as to realize the filing management of the logs; by adopting the byte code instrumentation technology to acquire operation data, the intrusion to the application is avoided, and the use safety of the application is ensured.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic main flow diagram of a log call chain generation method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an alternative log call chain generation method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of main modules of a log call chain generation apparatus according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 5 is a schematic block diagram of a computer system suitable for use with a mobile device or server implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The words to which the invention relates are to be construed as follows:
and (4) safety log: every time the computer is turned on or off, the program is run and the system reports errors, the information is recorded and stored in the log file.
Byte code pile inserting technology: and dynamically reconstructing the inserted monitoring instruction of the Class byte by using the Javaagent and the Javassist.
It should be noted that the embodiment of the present invention is mainly applicable to log monitoring in distributed applications, so as to collect logs stored in different log servers in a distributed manner for centralized management, and perform statistics and retrieval on the logs, thereby generating a log call chain, and providing a basis for subsequently improving log query efficiency, rapidly analyzing the logs, and locating abnormal logs.
Referring to fig. 1, a main flowchart of a log call chain generation method provided by an embodiment of the present invention is shown, including the following steps:
s101: generating an identification code according to the identifier of the equipment where the application is located and the current timestamp;
s102: monitoring the transmission sequence of the identification codes among the application modules;
s103: and extracting logs corresponding to the identification codes in each application module, and arranging and combining the extracted logs according to the transmission sequence to obtain a log calling chain.
In the foregoing embodiment, as to step S101, after the user clicks to enter the application, the application may automatically generate a UUID (universal Unique Identifier), so that all elements in the distributed application can have Unique identification information, and the identification information does not need to be specified by the central control end. Therefore, each operation in the application can create a UUID which does not conflict with other operations, and the name duplication problem in log creation does not need to be considered subsequently.
UUID refers to a number generated on a device to ensure uniqueness across all machines in the same air. A UUID consists of the following parts:
1) the current date and time, the first part of UUID is related to time, if the system generates a UUID after a few seconds, the first part is different, and the rest parts are the same;
2) a clock sequence or a random number sequence, such as a random four-digit number;
3) the globally unique IEEE machine identification number is obtained from a network card MAC address (Media Access Control or Medium Access Control, Media Access Control or physical address) if there is a network card, or obtained in another manner if there is no network card.
For step S102, the user has a sequence of operations, such as 1-2-3, 1-3-2, on the application modules within the system. And for the same application module, the operation sequences of different users are different. In order to facilitate the generation of the subsequent log calling chain, the invention generates a branch each time an application module is called, for example, 1.1- >1.1.1- >1.1.2>1.2, similar to a directory structure, so as to record the clicking or operation sequence of the application module by the user.
In order to record the clicking/operating sequence of the application module by the user in more detail, the invention selects to transmit the obtained identification code along with the operating sequence of the application module by the user, for example:
1) a user clicks an order module to operate, and the UUID is in the order module at the moment;
2) then, the user clicks the commodity module to check commodity information, and at the moment, the UUID is transmitted to the commodity module through the order module;
3) then, the user clicks the inventory module to check the inventory information of the commodity, and at the moment, the UUID is transmitted to the inventory module through the commodity module;
4) therefore, the transfer sequence of the UUIDs between the application modules is the order module- > the commodity module- > the inventory module.
One application may include a plurality of application modules, but a user may only click on a part of the application modules for operation, and through the transfer of UUIDs, which application modules are operated by the user can be determined, thereby implementing the screening and sorting of the invoked application modules.
Further, an application module may include a plurality of application sub-modules, for example, a commodity module includes an inventory module and a price module. When the user clicks to view the inventory of the goods, the delivery sequence for the UUID at this time is: the UUID is transmitted to the commodity module first, and then to the inventory module in the commodity module, similarly to 1.1- >1.1.1 in the catalog.
For step S103, the log in the application module is stored in the log server corresponding to the application module. In order to facilitate the subsequent extraction and centralized filing of the log, the log generation method generates the log identifier according to the identifier and the identifier of the application module when the log is generated, so as to obtain the corresponding relationship between the log and the identifier.
However, the same user may perform multiple operations on the same application module or application sub-module, for example, clicking the inventory module and then returning to click the commodity module, that is, the number of operations performed on the commodity module by the user is two, and the two operations may obtain different operation data, so that two logs may be generated.
If the log identifier is generated by using the identifier and the identifier of the application module, the execution sequence of the two logs may not be considered, and therefore, the operation timestamp of the user on the application module needs to be considered on the basis of the original identifier and the identifier of the application module. Such as 17:30 log 1, 18:00 log 2.
Specifically, the method comprises the following steps:
collecting operation data of each application module, and generating a log corresponding to each application module;
and obtaining the identification of each log according to the identification code, the identification of each application module and the operation time stamp of each application module.
The log corresponds to the operation of the user to the calling application module, and after the log is extracted according to the identification code, the log generated in the whole transaction process is recorded in a sequence according to the transmission sequence of the identification code among the application modules, so that a log calling chain is generated.
Call chain solvable problems are usually introduced:
1. quickly locate which component the problem is in; each calling chain generates a calling chain ID, and then inquiry can be carried out through the ID;
2. the time difference between the request and the corresponding can be accurately obtained for the performance of different services (component performance optimization).
The method provided by the embodiment automatically extracts the logs in each log server by using the identification codes, and sorts the logs according to the transmission sequence of the identification codes among the application modules, thereby realizing the automatic generation of the log call chain.
Referring to fig. 2, a schematic flow chart of an alternative log call chain generation method according to an embodiment of the present invention is shown, including the following steps,
s201: generating an identification code according to the identifier of the equipment where the application is located and the current timestamp;
s202: respectively monitoring performance data of each application module in the operation process by using a byte code instrumentation technology;
s203: respectively monitoring environmental data of each application module in the operation process by using an index acquisition technology;
s204: generating a plurality of logs based on the performance data and the environmental data collected for each application module;
s205: obtaining the identification of each log according to the identification code, the identification of each application module and the operation time stamp of each application module;
s206: monitoring the transmission sequence of the identification codes among the application modules;
s207: and extracting logs corresponding to the identification codes in each application module, and arranging and combining the extracted logs according to the transmission sequence to obtain a log calling chain.
In the above embodiment, the descriptions of steps S101 to S103 shown in fig. 1 can be referred to for steps S201, S205 to S207, respectively, and are not repeated herein.
In the above embodiment, for steps S202 to S204, the collection of the operation data of the application module called by the user is divided into the internal performance collection and the external environment collection to obtain the performance data and the environment data, respectively.
1. Internal performance data collection
The acquisition mode can be a byte code instrumentation technology or a hard coding mode, but the hard coding mode and the application code are considered to have higher coupling degree and possibly cause application intrusion to a certain extent, so the byte code instrumentation technology is mainly selected.
Application internal performance data, such as http response time, service response, exception, SQL statement (Structured Query Language), external interface response, are monitored by bytecode instrumentation. And the application internal data can not be invaded while being accurately monitored, so that the application and popularization cost is simplified.
In addition, for general monitoring, the resource index can be easily obtained by calling an operating system command. For example, a linux system command, uptime obtains the machine load condition, a free command obtains the number of available memories of the system, and si and so commands obtain the number of writes and reads of the exchange area.
2. External environment data collection
External environment data of the application module in the operation process, such as CPU usage, memory, file system, disk IO, and network IO statistical data, is collected based on a metricbeat (lightweight index collector), and statistical data similar to a top command can be obtained for each process in the application. In addition, based on the plug-in provided in the metricbeat, the status information such as mysql, redis, nginx and the like can be actively collected.
Therefore, the operation data of each application module includes the performance data and the environment data, so as to generate a log of the current operation of the user in the application module.
A complete log has a very important role:
1) information search: locating corresponding bugs by retrieving log information, and finding out a solution;
2) service diagnosis: by carrying out statistics and analysis on the log information, the load and the service running state of the server are known, and a time-consuming request is found for optimization and the like;
3) and (3) data analysis: if the log is formatted, further data analysis can be carried out, and meaningful information can be counted and aggregated.
The whole framework of the invention is expanded and upgraded on the basis of an ELK (real-time log analysis platform), wherein the ELK consists of three open source tools, namely an elastic search tool, a Logstash tool and a Kiabana tool, is usually applied to a log centralized collection scene and mainly comprises four parts, namely log acquisition, transmission, storage and presentation.
For the generated logs, the logs are collected by using filebeat, and then output to the elastic search through logstack (notes and kafka can also be used) for archiving and storing, and then a log call chain is generated. The client end is usually installed in a log server which needs to collect logs, and the server end is responsible for filtering, modifying and other operations of received logs of each node and then sending the logs to the elastic search.
Kibana is an Elasticissearch front-end display tool based on a browser page, and provides a log analysis friendly Web interface for Logstash and Elasticissearch to help a user gather, analyze and search important logs.
Before the log is transmitted to the ElasticSearch by using logstack, the invention also triggers alarm operation based on user-defined setting, such as performance alarm, CPU reaches 60%, memory use reaches 70%, error log occurs, and the like.
If the basic index reaches the rule set by the user, the data stream can be directly transmitted to an alarm center to trigger alarm based on the logstack-output-http plug-in the logstack; however, if the alarm condition is complex, for example, the number of times of calling a certain interface or a certain method reaches an upper limit or a performance index QPS called within a certain time does not meet a requirement, the data stream may be transmitted to the alarm center based on logstack-output-zabbix to trigger the alarm.
The method provided by the embodiment solves the problem that logs are difficult to archive in a centralized manner in the existing distributed application scene, and realizes that logs are archived according to a call chain mode by monitoring the transmission sequence of the identification codes among application modules, so that subsequent log query and abnormal log positioning are facilitated; the operating data of the application module is collected through the byte code instrumentation technology, and the application cannot be invaded.
Referring to fig. 3, a schematic diagram of main modules of a log call chain generating apparatus 300 according to an embodiment of the present invention is shown, including:
an identification code generation module 301, configured to generate an identification code according to the identifier of the device where the application is located and the current timestamp;
a sequence monitoring module 302, configured to monitor a transmission sequence of the identification code among the application modules;
and the call chain generating module 303 is configured to extract logs corresponding to the identification codes in each application module, and arrange and combine the extracted logs according to the transfer order to obtain a log call chain.
In the device implemented by the present invention, the sequential monitoring module 302 is further configured to: when the application module comprises the application sub-modules, monitoring a calling sequence of each application sub-module in the application module, and sequentially transmitting the identification codes among the application sub-modules according to the calling sequence.
The apparatus further includes a data acquisition module 304 (not shown) for: respectively collecting operation data of each application module to generate a log based on the collected operation data; and obtaining the identification of each log according to the identification code, the identification of each application module and the operation time stamp of each application module.
In the implementation apparatus of the present invention, the data acquisition module 304 is configured to:
respectively monitoring performance data of each application module in the operation process by using a byte code instrumentation technology; and
and respectively monitoring the environmental data of each application module in the operation process by using an index acquisition technology.
In addition, the detailed implementation of the device in the embodiment of the present invention has been described in detail in the above method, so that the repeated description is not repeated here.
The device provided by the embodiment of the invention solves the problem of difficulty in centralized filing of the logs in the existing distributed application scene, and realizes filing of the logs according to a call chain mode by monitoring the transmission sequence of the identification codes among the application modules, thereby facilitating subsequent log query and positioning of abnormal logs; the operating data of the application module is collected through the byte code instrumentation technology, and the application cannot be invaded.
FIG. 4 illustrates an exemplary system architecture 400 to which embodiments of the invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405 (by way of example only). The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 401, 402, 403.
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403.
It should be noted that the method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises an identification code generating module, a sequence monitoring module and a call chain generating module. Where the names of these modules do not in some cases constitute a limitation on the modules themselves, for example, call chain generation may also be described as "log call chain generation".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
generating an identification code according to the identifier of the equipment where the application is located and the current timestamp;
monitoring the transmission sequence of the identification codes among the application modules;
and extracting logs corresponding to the identification codes in each application module, and arranging and combining the extracted logs according to the transmission sequence to obtain a log calling chain.
According to the technical scheme of the embodiment of the invention, the problem of difficulty in centralized filing of the logs in the existing distributed application scene is solved, and the logs are filed in a calling chain mode by monitoring the transmission sequence of the identification codes among the application modules, so that subsequent log query and abnormal log positioning are facilitated; the operating data of the application module is collected through the byte code instrumentation technology, and the application cannot be invaded.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement 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 log call chain generation method, comprising:
generating an identification code according to the identifier of the equipment where the application is located and the current timestamp;
monitoring the transmission sequence of the identification codes among the application modules;
and extracting logs corresponding to the identification codes in each application module, and arranging and combining the extracted logs according to the transmission sequence to obtain a log calling chain.
2. The method of claim 1, wherein the monitoring the transmission sequence of the identification code between the application modules further comprises:
when the application module comprises the application sub-modules, monitoring a calling sequence of each application sub-module in the application module, and sequentially transmitting the identification codes among the application sub-modules according to the calling sequence.
3. The method according to claim 1, further comprising, before the extracting the log corresponding to the identification code in each application module:
respectively collecting operation data of each application module to generate a log based on the collected operation data;
and obtaining the identification of each log according to the identification code, the identification of each application module and the operation time stamp of each application module.
4. The method of claim 3, wherein separately collecting operational data for each application module comprises:
respectively monitoring performance data of each application module in the operation process by using a byte code instrumentation technology; and
and respectively monitoring the environmental data of each application module in the operation process by using an index acquisition technology.
5. An apparatus for generating a log call chain, comprising:
the identification code generating module is used for generating an identification code according to the identifier of the equipment where the application is located and the current timestamp;
the sequence monitoring module is used for monitoring the transmission sequence of the identification codes among the application modules;
and the call chain generation module is used for extracting the logs corresponding to the identification codes in each application module, and arranging and combining the extracted logs according to the transmission sequence to obtain a log call chain.
6. The apparatus of claim 5, wherein the sequential listening module is further configured to:
when the application module comprises the application sub-modules, monitoring a calling sequence of each application sub-module in the application module, and sequentially transmitting the identification codes among the application sub-modules according to the calling sequence.
7. The apparatus of claim 5, further comprising a data acquisition module to:
respectively collecting operation data of each application module to generate a log based on the collected operation data;
and obtaining the identification of each log according to the identification code, the identification of each application module and the operation time stamp of each application module.
8. The apparatus of claim 7, wherein the data acquisition module is configured to:
respectively monitoring performance data of each application module in the operation process by using a byte code instrumentation technology; and
and respectively monitoring the environmental data of each application module in the operation process by using an index acquisition technology.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910936077.2A CN112579406B (en) | 2019-09-29 | 2019-09-29 | Log call chain generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910936077.2A CN112579406B (en) | 2019-09-29 | 2019-09-29 | Log call chain generation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112579406A true CN112579406A (en) | 2021-03-30 |
CN112579406B CN112579406B (en) | 2024-04-05 |
Family
ID=75111252
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910936077.2A Active CN112579406B (en) | 2019-09-29 | 2019-09-29 | Log call chain generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112579406B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115270115A (en) * | 2022-09-27 | 2022-11-01 | 北京航空航天大学 | Edge application behavior information acquisition method and system |
CN115294203A (en) * | 2022-10-09 | 2022-11-04 | 智道网联科技(北京)有限公司 | Log processing method, apparatus and computer-readable storage medium for electronic map |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170187734A1 (en) * | 2015-12-28 | 2017-06-29 | International Business Machines Corporation | System and method for field extraction of data contained within a log stream |
CN107645562A (en) * | 2017-10-12 | 2018-01-30 | 广州爱九游信息技术有限公司 | Data transmission processing method, device, equipment and system |
-
2019
- 2019-09-29 CN CN201910936077.2A patent/CN112579406B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170187734A1 (en) * | 2015-12-28 | 2017-06-29 | International Business Machines Corporation | System and method for field extraction of data contained within a log stream |
CN107645562A (en) * | 2017-10-12 | 2018-01-30 | 广州爱九游信息技术有限公司 | Data transmission processing method, device, equipment and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115270115A (en) * | 2022-09-27 | 2022-11-01 | 北京航空航天大学 | Edge application behavior information acquisition method and system |
CN115294203A (en) * | 2022-10-09 | 2022-11-04 | 智道网联科技(北京)有限公司 | Log processing method, apparatus and computer-readable storage medium for electronic map |
Also Published As
Publication number | Publication date |
---|---|
CN112579406B (en) | 2024-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107330034B (en) | Log analysis method and device, computer equipment and storage medium | |
US11934417B2 (en) | Dynamically monitoring an information technology networked entity | |
CN109660397B (en) | System, method and device for collecting logs | |
US9953066B2 (en) | Automatically generating and reporting merged performance and capacity statistics | |
CN111190888A (en) | Method and device for managing graph database cluster | |
CN113987074A (en) | Distributed service full-link monitoring method and device, electronic equipment and storage medium | |
CN111309550A (en) | Data acquisition method, system, equipment and storage medium of application program | |
CN109672722B (en) | Data deployment method and device, computer storage medium and electronic equipment | |
CN107957940B (en) | Test log processing method, system and terminal | |
CN111367760B (en) | Log collection method and device, computer equipment and storage medium | |
CN110928853A (en) | Method and device for identifying log | |
CN110928934A (en) | Data processing method and device for business analysis | |
US10585678B2 (en) | Insertion of custom activities in an orchestrated application suite | |
CN112579406B (en) | Log call chain generation method and device | |
CN110351131B (en) | Monitoring method and device for distributed link and electronic equipment | |
CN110554951A (en) | Method and device for managing embedded points | |
CN113760730A (en) | Automatic testing method and device | |
CN111930385A (en) | Data acquisition method, device, equipment and storage medium | |
CN111488386A (en) | Data query method and device | |
CN111698109A (en) | Method and device for monitoring log | |
CN114579415A (en) | Method, device, equipment and medium for configuring and acquiring buried point data | |
CN113704203A (en) | Log file processing method and device | |
CN113761433A (en) | Service processing method and device | |
CN111178014A (en) | Method and device for processing business process | |
CN115757041B (en) | Method for collecting dynamically configurable multi-cluster logs and application |
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 |