A method, device and medium for collecting and processing observable data
By collecting and processing network data packets, it solves the problems of code compilation and language limitations of existing technologies, realizes non-invasive, multi-language supported application observable data collection, and satisfies the complex monitoring of cloud native applications and microservice systems. need.
Patent Information
- Application Number
- CN202211674914.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-12-26
AI Technical Summary
Existing application observability technology requires compilation or manual modification of the code, resulting in an impact on business systems, and can only be applied to specific languages and cannot meet the complex needs of cloud native applications and microservice systems.
By collecting network data packets generated during the socket connection establishment process, preliminary protocol judgment and pre-filtering are performed, process metadata is associated, and sent to user mode for processing. It supports accurate sampling, avoids code-level modifications, and is suitable for multiple languages.
It realizes non-invasive application observable data collection, reduces CPU resource consumption, supports multiple language types, and meets the complex monitoring needs of cloud native applications and microservice systems.
Smart Images

Figure CN116016702B
Abstract
Description
Technical Field
[0001] The present application relates to the fields of cloud computing, microservices and cloud-native applications, and in particular to a method, device and medium for collecting and processing application observable data. Background Art
[0002] In today's Internet Technology (IT) systems, cloud-native applications and microservice systems are becoming more and more popular, with an increasing number of services and increasing complexity. Especially in cloud computing environments, from physical hosts to cloud servers, to containers orchestrated by Kubernetes, and various upper-layer service processes, traditional monitoring systems that focus on ensuring service stability can no longer meet the needs, and various application observability technologies are developing rapidly. The so-called application observability means that for any possible evolution of the state and control vector, the current state can be estimated using only information from the output, aiming to white-box the application and restore various behaviors and characteristics of the application. Kubernetes, referred to as k8s, is an open source system that is mainly used for the management of integrated applications across hosts in a cluster.
[0003] The current commonly used application observation technology is mainly fully automatic injection through the bytecode of a certain language. It can automatically perform point tracking and inject Java bytecode during the Java language compilation stage to achieve service observation.
[0004] Although this method does not require manual code modification, it does require code compilation. Therefore, it is still invasive at the bytecode level, will have a certain impact on the business system, and can only be applied to a specific language.
[0005] It can be seen that providing a method, device and medium for collecting and processing observable application data without the need to compile code is a technical problem that needs to be solved urgently by people in this field. Summary of the invention
[0006] The purpose of this application is to provide a method, device and medium for collecting and processing application observable data without the need to compile the code.
[0007] In order to solve the above technical problems, the present application provides an application observable data collection and processing method, including:
[0008] Collect network data packets generated during the socket connection establishment process;
[0009] Make a preliminary judgment on the network protocol to which the network data packet protocol belongs and obtain the protocol type;
[0010] Pre-filter network packets based on protocol type to exclude invalid and non-configured protocols;
[0011] Associate network packets with process metadata;
[0012] Send network data packets to user mode;
[0013] Process network packets in user mode for querying.
[0014] Preferably, in the above-mentioned application observable data collection and processing method, processing the network data packet in user mode for querying includes:
[0015] Parse network data packets according to protocol type;
[0016] Aggregate and analyze data requests and responses of network data packets;
[0017] Filter the network data packets after data parsing to obtain network data packets of preset specified type protocols;
[0018] Associate process metadata with application metadata.
[0019] Preferably, in the above-mentioned application observable data collection and processing method, after associating the process metadata with the application metadata, it also includes:
[0020] Aggregate and classify the data sources of network data packets;
[0021] Load network packets into a time series database.
[0022] Preferably, in the above-mentioned application observable data collection and processing method, collecting network data packets generated during the socket connection establishment process includes:
[0023] Deploy the agent collection terminal;
[0024] Control the agent collection end to collect network data packets generated during the establishment of the socket connection through eBPF.
[0025] Preferably, in the above-mentioned application observable data collection and processing method, after controlling the agent collection end to collect network data packets generated during the socket connection establishment process through eBPF, it also includes:
[0026] Create eBPF Map;
[0027] Correspondingly, network packets are associated with process metadata, including:
[0028] The network data packet is associated with the process metadata through the eBPF Map, where the process metadata includes the process identifier and the file descriptor.
[0029] Preferably, in the above-mentioned application observable data collection and processing method, after sending the network data packet to the user state and before parsing the network data packet according to the protocol type, it also includes:
[0030] Copy network packets to cache;
[0031] Analyze the specific application source to which the network data packets belong.
[0032] Preferably, in the above-mentioned application observable data collection and processing method, after parsing the network data packet according to the protocol type, it also includes:
[0033] Delete the original data of the network data packet in the cache after data parsing.
[0034] In order to solve the above technical problems, the present application also provides an application observable data acquisition and processing device, comprising:
[0035] The collection module is used to collect network data packets generated during the socket connection establishment process;
[0036] A judgment module, used to make a preliminary judgment on the network protocol to which the network data packet protocol belongs, and obtain the protocol type;
[0037] A first filtering module, used for pre-filtering network data packets according to protocol types to exclude invalid protocols and non-configured protocols;
[0038] A first association module, used to associate the network data packet with the process metadata;
[0039] The sending module is used to send network data packets to the user state;
[0040] The processing module is used to process the network data packets in the user state for query.
[0041] In order to solve the above technical problems, the present application also provides an application observable data acquisition and processing device, comprising:
[0042] Memory for storing computer programs;
[0043] The processor is used to implement the steps of the above-mentioned application observable data collection and processing method when executing the computer program.
[0044] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned application observable data collection and processing method are implemented.
[0045] The application observable data collection and processing method provided by the present application includes: collecting network data packets generated during the establishment of a socket connection; making a preliminary judgment on the network protocol to which the network data packet protocol belongs to obtain the protocol type; pre-filtering the network data packet according to the protocol type to exclude invalid protocols and non-configuration protocols; associating the network data packet with process metadata; sending the network data packet to the user state; processing the network data packet in the user state for query. The present application supports precise sampling by performing protocol analysis and pre-filtering on the network data packet in the kernel state, does not require byte modification at the code level, is non-invasive at the bytecode level, and does not limit the language type, which can greatly reduce the consumption of system resources such as the CPU.
[0046] In addition, the present application also provides a device and a medium, which correspond to the above method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 A flowchart of a method for collecting and processing observable data provided by an embodiment of the present application;
[0049] Figure 2 A flowchart of another method for collecting and processing observable data provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the association between process metadata and application metadata provided in an embodiment of the present application;
[0051] Figure 4 A structural diagram of an application observable data acquisition and processing device provided in an embodiment of the present application;
[0052] Figure 5 A structural diagram of another application observable data acquisition and processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] The core of this application is to provide a method, device and medium for collecting and processing application observable data.
[0055] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0056] In today's Internet technology systems, cloud-native applications and microservice systems are becoming more and more popular, and the number of services is increasing and the complexity is increasing. Especially in the cloud computing environment, from physical hosts to cloud servers, to containers orchestrated by Kubernetes, and various upper-layer service processes, the traditional monitoring system that focuses on ensuring service stability can no longer meet the needs, and various application observability technologies are developing rapidly. The so-called application observability means that for any possible evolution of the state and control vector, the current state can be estimated using only information from the output, aiming to white-box the application and restore various behaviors and characteristics of the application.
[0057] Cloud native is a distributed cloud based on distributed deployment and unified operation and management, and a set of cloud technology product systems built on technologies such as containers and microservices.
[0058] Kubernetes, abbreviated as k8s, is an open source system that is mainly used to manage integrated applications across hosts in a cluster. A core feature of k8s is that it dynamically manages containers to ensure that the state of the cluster meets user needs. Pod is the smallest unit for scheduling and management in a cluster. All containers run in Pod, and each Pod can run one or more containers.
[0059] The commonly used application observation technologies are mainly divided into the following categories: 1. Manual method, each interface and call point needs to be manually tracked, which is very inconvenient and requires a lot of code modification, affecting program operation. 2. Semi-automatic method, based on the development framework of a certain language, it is necessary to modify some codes, such as tracking at the Hyper Text Transfer Protocol (HTTP) layer to obtain certain continuous business data. 3. Fully automatic injection through the bytecode method of a certain language, which can automatically track and inject Java bytecode during the Java language compilation stage to achieve service observation.
[0060] All three methods above will consume considerable system resources. The first two methods require manual code modification, and the third method does not require manual code modification, but requires code compilation. Therefore, it is still invasive at the bytecode level, which will have a certain impact on the business system and can only be applied to a specific language.
[0061] In order to solve the above technical problems, the present application provides an application observable data collection and processing method, Figure 1 A flowchart of a method for collecting and processing observable data provided by an embodiment of the present application is shown in FIG. Figure 1 As shown, including:
[0062] S11: Collect network data packets generated during the socket connection establishment process;
[0063] Socket is an encapsulation of the Transmission Control Protocol / Internet Protocol (TCP / IP). Socket itself is not a protocol, but an Application Programming Interface (API). Through Socket, we can use the TCP / IP protocol. Socket connection is the so-called long connection. In theory, once the client and server establish a connection, they will not actively disconnect; however, due to various environmental factors, the connection may be disconnected, for example: the server or client host crashes, the network fails, or there is no data transmission between the two for a long time, the network firewall may disconnect the connection to release network resources. So when there is no data transmission in a socket connection, a heartbeat message needs to be sent to maintain the connection. The specific heartbeat message format can be customized.
[0064] Step S11 collects the network data packets generated during the socket connection establishment process, that is, completes the original data collection of all application processes under the current operating system (OS), and the kernel functions of each stage of the socket connection (such as connect(), accept(), recv(), sendto()...).
[0065] Preferably, the collection of network data packets generated during the socket connection establishment process supports on-demand sampling, and does not completely rely on network event drive. The network data packets generated during the socket connection establishment process are collected according to a preset sampling period.
[0066] The process of step S11 occurs in kernel mode.
[0067] S12: Preliminarily determine the network protocol to which the network data packet protocol belongs, and obtain the protocol type;
[0068] Step S12 makes a preliminary judgment on the network protocol to which the network data packet protocol belongs, and obtains the protocol type corresponding to each process in the network data packet. For example, protocols such as HTTP and TCP can be judged by string matching of the data packet protocol header. For protocols of binary data packet type, string matching cannot be used directly. It is necessary to judge whether the signature of the message conforms to the format of the corresponding message.
[0069] S13: pre-filtering the network data packets according to the protocol type to exclude invalid protocols and non-configured protocols;
[0070] Step S13 pre-filtering refers to excluding invalid protocols and non-configured protocols from the collected data packets. For example, if we only want to keep HTTP type protocols, we can set it according to actual needs.
[0071] S14: Associating network packets with process metadata;
[0072] The process metadata mentioned in step S14 refers to the meta data that characterizes the process. Meta is an auxiliary tag in the header area of the Hypertext Markup Language (HTML), located in the head of the document and does not contain any content. The attributes of the tag define the name / value pairs associated with the document. The meta element can provide meta-information of the relevant page, such as descriptions and keywords for search engines and update frequency. Process metadata includes the process number (pid) and the file descriptor (fd) of the socket connection.
[0073] S15: Send the network data packet to the user state;
[0074] S16: Process the network data packet in user mode for query.
[0075] The processed network data packets are sent to the user state, and application observation can be implemented based on the network data packets in the user state.
[0076] The application observable data collection and processing method provided by the present application includes: collecting network data packets generated during the establishment of a socket connection; making a preliminary judgment on the network protocol to which the network data packet protocol belongs to obtain the protocol type; pre-filtering the network data packet according to the protocol type to exclude invalid protocols and non-configuration protocols; associating the network data packet with process metadata; sending the network data packet to the user state; processing the network data packet in the user state for query. The present application supports precise sampling by performing protocol analysis and pre-filtering on the network data packet in the kernel state. It does not require byte modification at the code level, is non-invasive at the bytecode level, and does not limit the language type, which can greatly reduce the consumption of system resources such as the CPU.
[0077] In another embodiment, processing a network data packet in user mode for querying includes:
[0078] S21: parsing the network data packet according to the protocol type;
[0079] S22: performing aggregate analysis on data requests and responses of network data packets;
[0080] S23: filtering the network data packets after data parsing to obtain network data packets of a preset specified type of protocol;
[0081] S24: Associating the process metadata with the application metadata.
[0082] In step S12, a preliminary judgment is made on the network protocol to which the network data packet protocol belongs to obtain the protocol type. In step S21, data analysis is performed on the network data packet according to the protocol type. Data analysis is performed according to the type derived from the protocol, and the specific content in the data packet is analyzed through different protocol type formats.
[0083] Step S22 performs aggregate analysis on the data requests and responses of the network data packets, and performs aggregate analysis on the data requests. For example, it is necessary to analyze which data packets belong to the same request, and match the request (request) and the response (response). How to associate these data requests when the data packets are out of order is a difficult problem, and we use multiple methods here. 1. For requests with request-id in the header file, the corresponding request and response can be identified by request-id. 2. Sort the data packets according to the timestamp. Generally speaking, the request and response of the same request are always separated by a fixed time range, with the request in front, so as to match the request and response. 3. If the current request does not match the response, you can wait for a while to observe whether the next returned message can match.
[0084] Step S23 filters the network data packets after data analysis to obtain network data packets of preset specified type protocols; post-filtering is performed after protocol analysis, where the specified protocol type can be filtered out more accurately.
[0085] Step S24 associates the process metadata with the application metadata.
[0086] At the user level, process data and application metadata are associated. First, Figure 3 As shown in the figure, an independent configuration management database (CMDB) and a directed acyclic graph (DAG) model for maintaining application meta information are established, including various application metadata, such as containers and container image information, k8s clusters and their namespaces, pods (Pod is the smallest deployable computing unit created and managed in Kubernetes, and Pod is a group of containers), Scalable Video Coding (SVC), Deployment (Deployment is a controller used to manage releases in k8s) and other resources. The DAG model contains the dependencies of various applications. The associated application metadata is divided into associated process meta and associated network address (remoteaddress).
[0087] a). Specific steps for associating process meta: The pid (process number) in the eBPF meta obtained in kernel state can be directly associated with an application. The specific path is to query the Linux directory / proc / ${PID} through pid. In this directory,
[0088] 1. If the application process is started by container or k8s, the K8s Metas and Container Metas of the process are found by querying the cgroup under this path. K8s Metas includes Namespcae, Pod, Deployment and other information, and Container Metas includes container information, such as Container, Image, etc. These meta information point to specific applications in the CMDB model and DAG model mentioned above.
[0089] 2. If the application process is not started through a container but directly called through a command line, query the cmdline information in the / proc / ${PID} directory to find the Process Meta of the process, including the startup command and parameters, which can also be associated with a specific application.
[0090] b) The purpose of associating the remote address is to locate the specific cloud service, host or k8s pod through the network source address and destination address. This is divided into two situations: monitoring before the connection request (connect, accept function) is established and monitoring after the connection request (connect, accept function) is established.
[0091] If the monitoring here is before the connection request (connect, accept function) is established, then we can directly get the Remote Address information from the socket function call stack by parsing the parameters.
[0092] If the monitoring is done after the connection request (connect, accept function) is established, then the pid and fd obtained in the first step are used for association. Specifically, the file inode information in the system / proc / ${PID} / ${FD} directory is queried, the netlink information is obtained from the inode, and the remote address information can be obtained from the netlink.
[0093] After getting the remote address, we associate it with the specific cloud server, host or k8s pod through the CMDB model.
[0094] After that, it also includes:
[0095] S25: Aggregate and classify the data sources of network data packets;
[0096] S26: Load the network data packet into the time series database.
[0097] Step S25 aggregates and classifies the data sources of the network data packets, for example, aggregates and classifies indicators such as Pod, virtual machine, and computer room, and can also be cross-validated with the application's own logs. Step S26 loads the network data packets into the time series database, which is called the time series database. The time series database is mainly used to process data with time tags (which change in the order of time, i.e., time serialization). Data with time tags is also called time series data. In this way, data support for original performance data and resource data can be provided to downstream services such as real-time topology, service application quality and efficiency, and inspection systems. By querying the data in the time series database, downstream services can perform root cause tracing analysis when the system generates an alarm.
[0098] Preferably, collecting network data packets generated during the socket connection establishment process includes:
[0099] Deploy the agent collection terminal;
[0100] Control the agent collection end to collect network data packets generated during the establishment of the socket connection through eBPF.
[0101] The collection-side agent is deployed on each node through a daemon set. In this mode, the agent usually actively collects indicators, usually used to collect node-level indicators, such as node resource indicators, container resource indicators on the node, and node performance indicators.
[0102] Extended Berkeley Packet Filter (eBPF) is a packet filtering technology that is derived from the Berkeley Packet Filter (BPF). As an extension of BPF technology, BPF provides a mechanism for safely injecting code when kernel events and user program events occur, which allows non-kernel developers to control the kernel. eBPF is an extension of BPF, which gradually expands the original single packet filtering event to kernel functions, user functions, trace points, performance events (perf_events), and security controls. The eBPF program architecture emphasizes security and stability, and looks more like a kernel module, but unlike kernel modules, eBPF programs do not need to recompile the kernel, and can ensure that the eBPF program runs to completion without causing system crashes. Unlike regular threads, eBPF programs do not run there after startup. They will only execute after an event is triggered. These events include system calls, kernel trace points, kernel function and user function call exits, network events, and so on. With the help of powerful kernel-mode stubs (kprobe) and user-mode stubs (uprobe), eBPF programs can be inserted almost anywhere in the kernel and applications.
[0103] In this embodiment, only one set of agents needs to be deployed on the host OS where all applications are located to complete the raw data collection of all application processes under the current OS. We use eBPF technology to perform network connection in the OS kernel, that is, the kernel functions of each stage of socket connection use CD test software (kprobe) to track and obtain network data packets.
[0104] According to the above embodiment, after the control agent collection end collects the network data packets generated during the socket connection establishment process through eBPF, it also includes:
[0105] Create eBPF Map;
[0106] Correspondingly, network packets are associated with process metadata, including:
[0107] The network data packet is associated with the process metadata through the eBPF Map, where the process metadata includes the process identifier and the file descriptor.
[0108] Using eBPF's kprobe to obtain network packets from the kernel socket function is only the first step. After obtaining the packets, a series of eBPF Maps are established in the kernel to associate these network packets with process metadata data.
[0109] According to the above embodiment, after sending the network data packet to the user state, before parsing the network data packet according to the protocol type, the method further includes:
[0110] Copy network packets to cache;
[0111] Analyze the specific application source to which the network data packets belong.
[0112] After the network data packet is copied to the cache, the specific application source to which the network data packet belongs is analyzed.
[0113] In addition, after parsing the network data packet according to the protocol type, it also includes:
[0114] Delete the original data of the network data packet in the cache after data parsing.
[0115] Recover the parsed data packets in the user-mode cache from the memory in a timely manner to release the memory in a timely manner.
[0116] In the above embodiments, the observable data acquisition and processing method is described in detail, and the present application also provides an embodiment corresponding to the observable data acquisition and processing device. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.
[0117] From the perspective of functional modules, Figure 4 A structural diagram of an observable data acquisition and processing device provided in an embodiment of the present application, such as Figure 4 As shown, the observable data acquisition and processing device is applied, including:
[0118] The collection module 41 is used to collect network data packets generated during the socket connection establishment process;
[0119] A judgment module 42 is used to make a preliminary judgment on the network protocol to which the network data packet protocol belongs, and obtain the protocol type;
[0120] A first filtering module 43, used to pre-filter network data packets according to protocol types to exclude invalid protocols and non-configured protocols;
[0121] A first association module 44, configured to associate the network data packet with the process metadata;
[0122] The sending module 45 is used to send the network data packet to the user state;
[0123] The processing module 46 is used to process the network data packet in the user mode for query.
[0124] Specifically, the acquisition module 41 acquires the network data packets generated during the establishment of the socket connection; the judgment module 42 makes a preliminary judgment on the network protocol to which the network data packet protocol belongs, and obtains the protocol type; the first filtering module 43 pre-filters the network data packet according to the protocol type to exclude invalid protocols and non-configured protocols; the first association module 44 associates the network data packet with the process metadata; the sending module 45 sends the network data packet to the user state; the processing module 46 processes the network data packet in the user state for query. This application supports precise sampling by performing protocol analysis and pre-filtering on network data packets in the kernel state, does not require byte modification at the code level, is non-invasive at the bytecode level, and does not limit the language type, which can greatly reduce the consumption of system resources such as the CPU.
[0125] Preferably, it also includes:
[0126] A parsing subunit, used for parsing network data packets according to protocol types;
[0127] An aggregation analysis subunit, used for performing aggregation analysis on data requests and responses of network data packets;
[0128] A pre-filtering subunit is used to filter the network data packets after data parsing to obtain network data packets of a preset specified type of protocol;
[0129] The first associating subunit is used to associate the process metadata with the application metadata.
[0130] The aggregation and classification subunit aggregates and classifies the data sources of the network data packets;
[0131] The loading subunit is used to load the network data packets into the time series database.
[0132] Deployment subunit, used to deploy the agent collection end;
[0133] The collection subunit is used to control the agent collection end to collect network data packets generated during the establishment of the socket connection through eBPF.
[0134] Create a subunit to create an eBPF Map;
[0135] Correspondingly, network packets are associated with process metadata, including:
[0136] The second association subunit is used to associate the network data packet with the process metadata through the eBPF Map, wherein the process metadata includes a process identifier and a file descriptor.
[0137] A copy module, used to copy network packets to a cache;
[0138] The analysis module is used to analyze the specific application source to which the network data packet belongs.
[0139] The deletion module is used to delete the original data of the network data packet after data parsing in the cache.
[0140] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0141] Figure 5 A structural diagram of another observable data acquisition and processing device provided in an embodiment of the present application, such as Figure 5 As shown, the observable data acquisition and processing device includes: a memory 50 for storing computer programs;
[0142] The processor 51 is used to implement the steps of the method for obtaining user operation habit information as described in the above embodiment (applying the observable data collection and processing method) when executing the computer program.
[0143] The application observable data collection and processing device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.
[0144] Among them, the processor 51 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 51 may be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 51 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 51 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 51 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0145] The memory 50 may include one or more computer-readable storage media, which may be non-transitory. The memory 50 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 50 is at least used to store the following computer program 501, wherein, after the computer program is loaded and executed by the processor 51, it can implement the relevant steps of the application observable data acquisition and processing method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 50 may also include an operating system 502 and data 503, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 502 may include Windows, Unix, Linux, etc. Data 503 may include but is not limited to data involved in implementing the application observable data acquisition and processing method, etc.
[0146] In some embodiments, the application observable data acquisition and processing device may further include a display screen 52 , an input and output interface 53 , a communication interface 54 , a power supply 55 , and a communication bus 56 .
[0147] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the application of the observable data acquisition and processing device, and may include more or less components than those shown in the figure.
[0148] The application observable data acquisition and processing device provided in the embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the application observable data acquisition and processing method includes: acquiring network data packets generated during the establishment of a socket connection; making a preliminary judgment on the network protocol to which the network data packet protocol belongs to obtain the protocol type; pre-filtering the network data packet according to the protocol type to exclude invalid protocols and non-configuration protocols; associating the network data packet with process metadata; sending the network data packet to the user state; processing the network data packet in the user state for query. The present application supports precise sampling by performing protocol analysis and pre-filtering on the network data packet in the kernel state. It does not require byte modification at the code level, is non-invasive at the bytecode level, and does not limit the language type, which can greatly reduce the consumption of system resources such as the CPU.
[0149] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps described in the embodiment of the above-mentioned application observable data acquisition and processing method are implemented.
[0150] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0151] The computer-readable storage medium provided in this embodiment stores a computer program thereon. When the processor executes the program, the following method can be implemented: applying an observable data collection and processing method, including: collecting network data packets generated during the establishment of a socket connection; making a preliminary judgment on the network protocol to which the network data packet protocol belongs to obtain a protocol type; pre-filtering the network data packet according to the protocol type to exclude invalid protocols and non-configuration protocols; associating the network data packet with process metadata; sending the network data packet to the user state; processing the network data packet in the user state for query. The present application supports precise sampling by performing protocol analysis and pre-filtering on network data packets in the kernel state. It does not require byte modification at the code level, is non-invasive at the bytecode level, and does not limit the language type, which can greatly reduce the consumption of system resources such as the CPU.
[0152] The above is a detailed introduction to the observable data acquisition and processing method, device and medium provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can refer to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0153] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for collecting and processing observable data, characterized in that: include: Collect network data packets generated during the socket connection establishment process; Perform a preliminary judgment on the network protocol to which the network data packet protocol belongs to, and obtain the protocol type; Pre-filtering the network data packets according to the protocol type to exclude invalid protocols and non-configured protocols; Associating the network data packet with process metadata, wherein the process metadata includes a process ID and a file descriptor of a socket connection; Sending the network data packet to user mode; Processing the network data packet in the user state to query; The processing of the network data packet in the user state to perform query includes: Performing data parsing on the network data packet according to the protocol type; Performing aggregate analysis on the data requests and responses of the network data packets; Filtering the network data packets after data parsing to obtain the network data packets of a preset specified type of protocol; Associating the process metadata with the application metadata includes: associating the process meta and associating the network address.
2. The method for collecting and processing application observable data according to claim 1, characterized in that: After associating the process metadata with the application metadata, the method further includes: Aggregating and classifying the data sources of the network data packets; The network data packet is loaded into a time series database.
3. The method for collecting and processing application observable data according to claim 1, characterized in that: The network data packets generated during the acquisition of the socket connection establishment process include: Deploy the agent collection terminal; Control the agent collection end to collect network data packets generated during the establishment of the socket connection through eBPF.
4. The method for collecting and processing application observable data according to claim 3, characterized in that: After the controlling the agent collection end to collect network data packets generated during the socket connection establishment process through eBPF, it also includes: Create eBPF Map; Correspondingly, associating the network data packet with the process metadata includes: The network data packet is associated with process metadata through the eBPF Map, wherein the process metadata includes a process identifier and a file descriptor.
5. The method for collecting and processing application observable data according to claim 1, characterized in that: After sending the network data packet to the user state and before parsing the network data packet according to the protocol type, the method further includes: Copying the network data packet to a cache; Analyze the specific application source to which the network data packet belongs.
6. The method for collecting and processing application observable data according to claim 5, characterized in that: After parsing the network data packet according to the protocol type, the method further includes: The original data of the network data packet after data parsing in the cache is deleted.
7. An application observable data acquisition and processing device, characterized in that: include: The collection module is used to collect network data packets generated during the socket connection establishment process; A judgment module, used for making a preliminary judgment on the network protocol to which the network data packet protocol belongs, and obtaining a protocol type; A first filtering module, configured to pre-filter the network data packets according to the protocol type to exclude invalid protocols and non-configured protocols; A first associating module, configured to associate the network data packet with process metadata, wherein the process metadata includes a process ID and a file descriptor of a socket connection; A sending module, used for sending the network data packet to the user state; A processing module, used for processing the network data packet in the user state to perform a query; The processing of the network data packet in the user state to perform query includes: Performing data parsing on the network data packet according to the protocol type; Performing aggregate analysis on the data requests and responses of the network data packets; Filtering the network data packets after data parsing to obtain the network data packets of a preset specified type of protocol; Associating the process metadata with the application metadata includes: associating the process meta and associating the network address.
8. An application observable data acquisition and processing device, characterized in that: include: Memory for storing computer programs; A processor is used to implement the steps of the method for collecting and processing observable data as described in any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for collecting and processing observable data as claimed in any one of claims 1 to 6 are implemented.
