OpenTelemetry

OpenTelemetry (OTel) is an observability framework and toolkit designed to create and manage telemetry data such as traces, metrics, and logs. It is a collection of APIs, SDKs, and tools to instrument, generate, and export telemetry data.

It provides an overview of the performance and behavior of your application. OTel analyzes the internal state of an application by collecting the data and examining their traces in Jaeger.

You can configure OpenTelemetry in JasperReports Server to overcome the performance issues in the application by enabling tracing. OTel analyzes the data(or logs) and shows the traces of the logs in Jaeger UI. To configure OTel and Jaeger, see Configuring OpenTelemetry and Jaegar Agent.

Tracing can be used to investigate performance problems with JasperReports Server.

For example, lets consider that an application performance is slow than usual for a longer time. An application can be slow due to any of the reasons such as it took a lot of time to retrieve data from the network or database took some time to run queries. To find out the reason behind an application slow performance, logs are analyzed to see if there are any errors.

When no errors could be found in the logs, and the root cause remain unknown, then enabling tracing helps to detect the unknown issues. Tracing identifies the slow queries, captures the exact places (spans) and time spent in the specific area of the code. Therefore, configuring OTel optimizes all such unknown issues and helps in improving the overall code quality and performance of the application.

OpenTelemetry performs the following functionality:

Instrument data - The data is instrumented by adding annotations or new lines in the code, which help to instrument the code. The instrumentation can be either Manual or Automated. Manual instrumentation uses opentelemetry-api and opentelemetry-sdk whereas Automated instrumentation uses opentelemetry-api.
Generate data - The instrumented data is captured using a Java agent jar, which is specific to the Java language. The java agent jar collects the instrumented data emitted by the code.
Export data - The collected data, which is emitted by the code is then exported and visualized using Jaegar analysis tools.

For more information, see the official website of OpenTelemetry.

Spans

Spans represent smaller chunks of operation or a unit of work performed within an API request. All operations within an API request are considered as span. OpenTelemetry uses a visualization tool called Jaeger to view the smaller chunks of operation or spans. Using Jaegar UI, you can view the total API execution time, start time of methods, and hidden errors of the code in the logs.

Traces

Traces are helpful in finding out the reason behind the slow performance of the application. Traces help to find out what happens when an API request is made to an application.

It helps us to understand the complete path when a request is made to an application. It captures the exact spans or places in the code where the problem occurred. It includes the total execution time, start time of methods, and hidden errors in logs, which resulted in performance issues of the application.