Function call chain visualization method, system and equipment and storage medium

By using the OpenTelemetry framework to capture and visualize the function call chain in the OpenFaaS platform, the complex and difficult-to-trace problem of function call chains in the platform is solved, real-time monitoring and dynamic updates are realized, and the system maintainability and problem-solving efficiency is improved.

CN119883829APending Publication Date: 2025-04-25SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510046401.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the OpenFaaS platform, the function call chain is complex and difficult to track and manage, and the existing debugging tools lack comprehensive visual support, which causes developers to spend a lot of time and effort in troubleshooting system problems or optimizing performance.

Method used

By configuring the observability telemetry framework OpenTelemetry in Java projects, the OpenTelemetry SDK is initialized, and the tracking information is captured and propagated using the OpenTelemetry Collector to generate a visual function call chain.

Benefits of technology

It realizes real-time capture and parsing function call information, intuitively displays the call relationship between functions, reduces the cost of problem positioning, and improves the system's maintainability and problem-solving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883829A_ABST
    Figure CN119883829A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, in particular to a function call chain visualization method, system and device and a storage medium. According to the function call chain visualization method, an observability telemetry technology framework OpenTelemetry is configured in a Java project, the observability telemetry technology framework OpenTelemetry is initialized, Trace information is captured and spread, Trace information and span Span information are transmitted, telemetry data are received and analyzed, and a visualization function call chain is generated. According to the function call chain visualization method, system and device and the storage medium, the function call information can be captured and analyzed in real time, the call relation between the functions can be visually displayed, a developer can conveniently monitor and debug a complex distributed server-free architecture, and the maintainability and troubleshooting efficiency of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a function call chain visualization method, system, device and storage medium. Background Art

[0002] Current serverless architectures (such as the OpenFaaS platform) have been widely used to build scalable, low-cost cloud computing services. However, on these platforms, the mutual calls and dependencies between multiple functions are often very complex, especially when deployed on a large scale, the function call chain becomes difficult to track and manage. Existing debugging tools lack comprehensive visualization support for function call chains, causing developers to spend a lot of time and energy when troubleshooting system problems or optimizing performance.

[0003] In order to solve the problem of lack of function call chain visualization tools in the open function as a service OpenFaaS platform, the present invention proposes a function call chain visualization method, system, device and storage medium. Summary of the invention

[0004] In order to overcome the deficiencies of the prior art, the present invention provides a simple and efficient function call chain visualization method, system, device and storage medium.

[0005] The present invention is achieved through the following technical solutions:

[0006] A method for visualizing a function call chain, characterized in that it comprises the following steps:

[0007] Step S1: Configure the observability telemetry framework OpenTelemetry in the Java project

[0008] Use the Maven package manager in the Java project to add dependencies for the observability software development kit OpenTelemetrySDK and the Open Observability Telemetry Protocol OTLP (OpenTelemetry Protocol) exporter, initialize the observability software development kit OpenTelemetry SDK, and configure the Open Observability Telemetry Protocol OTLP exporter;

[0009] Step S2: Initialize the observability telemetry technology framework OpenTelemetry

[0010] Set the address of the open observability data collector OpenTelemetry Collector, build an OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter instance, and initialize the observability software development kit OpenTelemetrySdk instance;

[0011] In step S2, the implementation steps include:

[0012] Step S2.1, set the address of the open observability data collector OpenTelemetry Collector through the OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter constructor, and build an OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter instance;

[0013] Step S2.2, add the batch span processor BatchSpanProcessor through the software tool development kit tracking provider SdkTracerProvider constructor;

[0014] Step S2.3: Initialize the observability software development toolkit OpenTelemetrySdk instance by initializing the observability software development toolkit OpenTelemetrySdk constructor.

[0015] Step S3: Capture and propagate trace information

[0016] Get the Tracer instance and build a new span to ensure that the current trace context is propagated when calling downstream functions in the OpenFaaS function.

[0017] In the step S3, active instrumentation is performed during function development, and a tracer instance is obtained through the getTracer method of the global open observability solution GlobalOpenTelemetry. A new span is constructed through the tracer instance, and the trace context is passed by inserting the span into the request header information Header.

[0018] Step S4: Trace information and span information transmission

[0019] When the function is started, an Otel Collector Agent is started in the form of startup parameters and SideCar mode to process telemetry data, and the data is passed to the OpenTelemetry Collector through the general remote procedure call gRPC or Hypertext Transfer Protocol HTTP.

[0020] In the step S4, the open observability Java agent compressed file package -javaagent:opentelemetry-javaagent.jar is added when the Java function is started to implement active function instrumentation and generate telemetry data, including tracing data Trace, log data Log and span data Span, and expose the telemetry data capability to the open observability data collector OpenTelemetry Collector through the open observability Java agent opentelemetry-javaagent.

[0021] Step S5: receiving telemetry data

[0022] The OpenTelemetry Collector receives telemetry data through remote procedure calls (gRPC) or Hypertext Transfer Protocol (HTTP).

[0023] In step S5, the open observability data collector OpenTelemetry Collector receives telemetry data externally through port 4317 in the general remote procedure call gRPC mode, or through port 4318 in the HTTP mode, including the trace data Trace, log data Log and span data Span actively or passively recorded by the function.

[0024] Step S6: Visualize the function call chain

[0025] Analyze telemetry data through the Open Observability Telemetry Protocol (OTLP) exporter to generate visual function call chains;

[0026] In step S6, based on the distributed tracing system Jaeger as the backend system, the span data from the open observability data collector OpenTelemetry Collector is received through the distributed tracing system collector Jaeger Collector, and the span data is formatted and stored in the backend database; the data stored in the backend database is used to generate a visual function call chain, and the generated function call chain is displayed through its user interface UI.

[0027] Step S7: Real-time monitoring and dynamic updating

[0028] Continuously monitor the calls of each function in the OpenFaaS function, automatically capture the dependencies between functions, and dynamically generate a function call chain graph.

[0029] An OpenFaaS function call chain visualization system, including the observability telemetry technology framework OpenTelemetry and the distributed tracing system Jaeger;

[0030] The observability telemetry technology framework OpenTelemetry is responsible for collecting, detecting, collecting and exporting OpenFaaS function metrics, logs and tracing data;

[0031] The distributed tracing system Jaeger is responsible for generating and displaying a visualized OpenFaaS function call chain.

[0032] An OpenFaaS function call chain visualization device, comprising:

[0033] One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the above methods.

[0034] A readable storage medium, characterized in that: a computer program is stored on the readable storage medium, and the computer program implements the above method when executed by a processor.

[0035] The beneficial effects of the present invention are: the function call chain visualization method, system, device and storage medium can capture and parse function call information in real time, and intuitively display the call relationship between functions, which is convenient for developers to monitor and debug complex distributed serverless architectures, and improves the maintainability and troubleshooting efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Attached Figure 1 This is a schematic diagram of the integrated architecture of the open function as a service OpenFaaS function and the observability telemetry technology framework OpenTelemetry of the present invention. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0039] The function call chain visualization method includes the following steps:

[0040] Step S1: Configure the observability telemetry technology framework OpenTelemetry (Otel for short) in the Java project

[0041] Use the Maven package manager in the Java project to add dependencies for the observability software development kit OpenTelemetrySDK and the Open Observability Telemetry Protocol OTLP (OpenTelemetry Protocol) exporter, initialize the observability software development kit OpenTelemetry SDK, and configure the Open Observability Telemetry Protocol OTLP exporter;

[0042] Enable application observability by introducing the necessary libraries and tools to support distributed tracing, metrics collection, and logging, so you can better monitor and debug your applications.

[0043] Step S2: Initialize the observability telemetry technology framework OpenTelemetry

[0044] Set the address of the open observability data collector OpenTelemetry Collector, build an OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter instance, and initialize the observability software development kit OpenTelemetrySdk instance;

[0045] In step S2, the implementation steps include:

[0046] Step S2.1, set the address of the open observability data collector OpenTelemetry Collector through the OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter constructor, and build an OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter instance;

[0047] The OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter instance is a specific instance used to export the collected span data through the Grpc (Google Remote Procedure Call) protocol. In the observability architecture of distributed systems, a span usually refers to the life cycle of an operation or transaction, which can contain multiple events and attributes to record the behavior and performance of the system.

[0048] Step S2.2, add the batch span processor BatchSpanProcessor through the software tool development kit tracking provider SdkTracerProvider constructor;

[0049] Step S2.3: Initialize the observability software development toolkit OpenTelemetrySdk instance by initializing the observability software development toolkit OpenTelemetrySdk constructor.

[0050] Step S3: Capture and propagate trace information

[0051] Get the Tracer instance and build a new span to ensure that the current trace context is propagated when calling downstream functions in the OpenFaaS function.

[0052] In the step S3, active instrumentation is performed during function development, and a tracer instance is obtained through the getTracer method of the global open observability solution GlobalOpenTelemetry. A new span is constructed through the tracer instance, and the trace context is passed by inserting the span into the request header information Header.

[0053] Step S4: Trace information and span information transmission

[0054] When the function is started, an Otel Collector Agent is started in the form of startup parameters and SideCar mode to process telemetry data, and the data is passed to the OpenTelemetry Collector through the general remote procedure call gRPC or Hypertext Transfer Protocol HTTP.

[0055] In the step S4, the open observability Java agent compressed file package -javaagent:opentelemetry-javaagent.jar is added when the Java function is started to implement active function instrumentation and generate telemetry data, including tracing data Trace, log data Log and span data Span, and expose the telemetry data capability to the open observability data collector OpenTelemetry Collector through the open observability Java agent opentelemetry-javaagent.

[0056] Step S5: receiving telemetry data

[0057] The OpenTelemetry Collector receives telemetry data through remote procedure calls (gRPC) or Hypertext Transfer Protocol (HTTP).

[0058] In step S5, the open observability data collector OpenTelemetry Collector receives telemetry data in different formats through port 4317 in the form of general remote procedure call gRPC, or through port 4318 in the form of HTTP, including trace data Trace, log data Log and span data Span actively or passively recorded by the function.

[0059] Step S6: Visualize the function call chain

[0060] Analyze telemetry data through the Open Observability Telemetry Protocol (OTLP) exporter to generate visual function call chains;

[0061] The Open Observability Telemetry Protocol (OTLP) exporter is a component of the observability telemetry framework OpenTelemetry and is how data is sent to different systems / backends.

[0062] In step S6, based on the distributed tracing system Jaeger as the backend system, the span data from the open observability data collector OpenTelemetry Collector is received through the distributed tracing system collector Jaeger Collector, and the span data is formatted and stored in the backend database; the data stored in the backend database is used to generate a visual function call chain, and the generated function call chain is displayed through its user interface UI.

[0063] Jaeger is a system dedicated to distributed tracing, which supports large-scale collection, storage and visualization of tracing information. Through the distributed tracing system interface Jaeger UI, you can view the function call chain and analyze the dependencies between various services. The distributed tracing system Jaeger displays the entire tracing data in a graphical way, including the following:

[0064] Tracing data Trace: Displays the complete call chain of a request, spanning multiple services or functions.

[0065] Span data: Each span represents a service call or function execution, including start time, duration, error information, etc.

[0066] Service topology diagram: displays the dependencies between various functions or services.

[0067] Step S7: Real-time monitoring and dynamic updating

[0068] Continuously monitor the calls of each function in the OpenFaaS function, automatically capture the dependencies between functions, and dynamically generate a function call chain graph.

[0069] The OpenFaaS function call chain visualization system includes the observability telemetry technology framework OpenTelemetry and the distributed tracing system Jaeger;

[0070] The observability telemetry technology framework OpenTelemetry is responsible for collecting, detecting, collecting and exporting OpenFaaS function metrics, logs and tracing data;

[0071] The observability telemetry technology framework OpenTelemetry is mainly used for program remote control data collection. It is a collection of tools, APIs, and SDKs. Moreover, OpenTelemetry is vendor-independent. When integrated with the open source OpenFaaS function, the entire platform is not bound by vendors and has better compatibility.

[0072] The distributed tracing system Jaeger is responsible for generating and displaying a visualized OpenFaaS function call chain.

[0073] The OpenFaaS function call chain visualization tool includes:

[0074] One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the above methods.

[0075] The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0076] In summary, the function call chain visualization method, system, device and storage medium, by integrating the monitoring module and visualization engine, can capture and parse function call information in real time, and intuitively display the calling relationship between functions, helping function developers to reduce the cost of problem location, facilitating developers to monitor and debug complex distributed serverless architectures, and improving the system's maintainability and troubleshooting efficiency.

[0077] The embodiment described above is only one specific implementation of the present invention. Common changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for visualizing a function call chain, characterized in that: The following steps are involved: Step S1: Configure the observability telemetry framework OpenTelemetry in the Java project Use the Maven package manager in the Java project to add dependencies of the observability software development toolkit OpenTelemetry SDK and the Open Observability Telemetry Protocol OTLP exporter, initialize the observability software development toolkit OpenTelemetry SDK, and configure the Open Observability Telemetry Protocol OTLP exporter; Step S2: Initialize the observability telemetry technology framework OpenTelemetry Set the address of the open observability data collector OpenTelemetry Collector, build an OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter instance, and initialize the observability software development kit OpenTelemetrySdk instance; Step S3: Capture and propagate trace information Get the Tracer instance and build a new span to ensure that the current trace context is propagated when calling downstream functions in the OpenFaaS function. Step S4: Trace information and span information transmission When the function is started, an Otel Collector Agent is started in the form of startup parameters and SideCar mode to process telemetry data, and the data is passed to the OpenTelemetry Collector through the general remote procedure call gRPC or Hypertext Transfer Protocol HTTP. Step S5: receiving telemetry data The OpenTelemetry Collector receives telemetry data through remote procedure calls (gRPC) or Hypertext Transfer Protocol (HTTP). Step S6: Visualize the function call chain Analyze telemetry data through the Open Observability Telemetry Protocol (OTLP) exporter to generate visual function call chains; Step S7: Real-time monitoring and dynamic updating Continuously monitor the calls of each function in the OpenFaaS function, automatically capture the dependencies between functions, and dynamically generate a function call chain graph.

2. The method for visualizing a function call chain according to claim 1, characterized in that: In step S2, the implementation steps include: Step S2.1, set the address of the open observability data collector OpenTelemetry Collector through the OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter constructor, and build an OpenTelemetry gRPC span exporter OtlpGrpcSpanExporter instance; Step S2.2, add the batch span processor BatchSpanProcessor through the software tool development kit tracking provider SdkTracerProvider constructor; Step S2.3: Initialize the observability software development toolkit OpenTelemetrySdk instance by initializing the observability software development toolkit OpenTelemetrySdk constructor.

3. The function call chain visualization method according to claim 1, characterized in that: In the step S3, active instrumentation is performed during function development, and a tracer instance is obtained through the getTracer method of the global open observability solution GlobalOpenTelemetry. A new span is constructed through the tracer instance, and the trace context is passed by inserting the span into the request header information Header.

4. The function call chain visualization method according to claim 1, characterized in that: In the step S4, the open observability Java agent compressed file package -javaagent:opentelemetry-javaagent.jar is added when the Java function is started to implement active function instrumentation and generate telemetry data, including trace data, log data and span data, and expose the telemetry data to the open observability data collector OpenTelemetry Collector through the open observability Java agent opentelemetry-javaagent.

5. The function call chain visualization method according to claim 1, characterized in that: In step S5, the open observability data collector OpenTelemetry Collector receives telemetry data externally through port 4317 in a general remote procedure call gRPC manner, or through port 4318 in an HTTP manner, including trace data, log data, and span data actively or passively recorded by the function.

6. The method for visualizing a function call chain according to claim 1, characterized in that: In step S6, based on the distributed tracing system Jaeger as the backend system, the span data from the open observability data collector OpenTelemetry Collector is received through the distributed tracing system collector Jaeger Collector, and the span data is formatted and stored in the backend database; the data stored in the backend database is used to generate a visual function call chain, and the generated function call chain is displayed through its user interface UI.

7. An OpenFaaS function call chain visualization system, characterized by: Including the observability telemetry technology framework OpenTelemetry and the distributed tracing system Jaeger; The observability telemetry technology framework OpenTelemetry is responsible for collecting, detecting, collecting and exporting OpenFaaS function metrics, logs and tracing data; The distributed tracing system Jaeger is responsible for generating and displaying a visualized OpenFaaS function call chain.

8. An OpenFaaS function call chain visualization device, characterized by: include: One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods according to claims 1 to 6.

9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.