Applies to version: 2023 R1 and above; author: Łukasz Maciaszkiewicz
Introduction
In the present-day dynamic and distributed application environments data monitoring and analysis are key to ensure high efficiency, reliability, and optimization of an application. To address those challenges, the 2023 R1 WEBCON BPS version has introduced support for OpenTelemetry – a powerful tool that streamlines collection of diagnostic data and metrics from IT systems.
This article discusses configuration of telemetry based on the OpenTelemetry standard in the WEBCON BPS system for its Portal and Service components.
What is telemetry?
Telemetry is a process of collecting, sending, and analyzing diagnostic and operation data from IT systems. In practical terms, this involves monitoring and collecting data from various components of an IT system in order to obtain information about their operation, performance, security, and many other important parameters.
Telemetry offers a number of advantages, such as monitoring and diagnosing problems in real time, performance optimization based on data analysis and bottlenecks identification, streamlined capacity planning and scalability. What is more, it enables remote system monitoring and management, and provides basis for taking informed decisions regarding IT infrastructure maintenance and optimization.
The OpenTelemetry project
OpenTelemetry is an open project aimed at standardizing and streamlining monitoring, analyzing and managing distributed systems. It is a tool that lets developers collect, generate, and send telemetric data (such as metrics, logs, and traces) from applications operating in various environments.
The solution integrates with a broad range of technologies and programming languages, thus allowing developers to collect diagnostic data from different sources, such as cloud services, servers, containers, and distributed applications. Its operation is based on the instrumentation principle, i.e. adding code to an application to collect telemetric data.
OpenTelemetry provides uniform API and libraries for a number of programming languages, which allows developers to use a uniform set of tools for monitoring applications in various environments.
The WEBCON BPS system often acts a central point that integrates various IT systems employed in a company. Thanks to its OpenTelemetry support, system administrators obtain valuable insight into the whole traffic and flows handled by the system. As a result, it is not only possible to monitor the whole traffic, but you can also track all the accompanying actions and operations (including the ones associated with systems integrated with BPS). Apart from obvious advantages in terms of error diagnostics and identification, system administrators get access to important information on matters related to performance.
OpenTelemetry in WEBCON BPS – technical aspects
In technical terms, the support for OpenTelemetry in WEBCON BPS applies to its Portal and Service components. Two pillars of the aforementioned standard are made available, i.e. traces and metrics (currently WEBCON BPS does not support logs within the context of OpenTelemetry).
Besides the OTLP protocol (OpenTelemetry Protocol), which forms a part of the OpenTelemetry project, it is possible to use the Jaeger platform for collecting and processing traces, and the Prometheus tool to receive and analyze metrics.
The OpenTelemetry tool in WEBCON BPS is configured separately for the Portal and Service segments. For the purpose of the configuration, the otlpsettings.json file is used. The file can be created using the otlpsettings.template.json file which is available in the Portal and Service main directories. (Please remember to change the file name by removing the “.template” part from it). In both cases, the configuration is almost identical and the only difference between Portal and Service files is a different name of the main node, i.e. App and Configuration respectively.
The comparison of otlpsettings.json file in Portal (on the right) and Service (on the left) – the only difference is the name of the main node (red frame).
As mentioned, WEBCON BPS supports two OpenTelemetry pillars, i.e. Tracing and Metrics. This also involves support for a number of modules that can be used in the configuration. The tables below contain information on supported instrumentation for both aforementioned pillars.
Tracing |
|
Module’s name |
Remarks |
ASP .NET Core Instrumentation |
|
SqlClient |
For Portal and Service it is possible to view SQL queries. |
HttpClient |
|
WCF Client |
Integration with Service |
* For traces WEBCON BPS supports data export by the OTLP protocol (configuration according to data recipient’s settings) and the Jaeger platform (endpoint address: http://[jaegerAddress]:14268/api/traces).
Metrics |
|
Module’s name |
Remarks |
ProcessInstrumentation |
|
RuntimeInstrumentation |
Configuration in the “ProcessInstrumentation” field |
EventCountersInstrumentation |
Configuration of eventcounter sources (separated with a coma) in the “EventSources” field. |
AspNetCoreInstrumentation |
Configuration in the “WebInstrumentation” field |
HttpClientInstrumentation |
Configuration in the “WebInstrumentation” field |
* Metrics data export is possible through the OTLP protocol (configuration according to the data recipient’s settings) and the Prometheus platform (default endpoint setting: „/metrics”).
Configuration
To configure the OpenTelemetry standard, first set up data collector (a component responsible for collecting, processing, and sending telemetric data). In the discussed example, the Aspecto tool is used to that end. The tool is available at: https://app.aspecto.io/user/login.
Click the attached link to open the service website and click the Sign Up tab to create a user account. You can create an account using an existing Google or Microsoft account, or alternatively by manually entering e-mail address (this can be your WEBCON domain e-mail address) and its associated password – for the purpose of the article the latter variant was selected.
In the yours@example.com field enter your e-mail address and in the your password field put your password which is at least 8-character long and includes at least one upper- and lower-case letter, and a digit. Once you enter the aforementioned data select the checkbox I agree to the Terms of Use and Privacy Policy and click the SIGN-UP button.
The Aspecto service window where you can create your user account
After clicking the button, a window is displayed that informs about successful account registration and sending a confirmation message to the registered e-mail address.
To start using the service, press the Click to confirm your email address button included in the message delivered to your e-mail address. After clicking the button, you are redirected to the Aspecto website where you can continue service configuration.
A welcome window containing two buttons is displayed. To start using the service click the Get Started button.
In the newly opened website select the Yes, I’m collecting data with OpenTelemetry option.
After selecting the option you are redirected to a website containing configuration data. From the perspective of configuring the service in the WEBCON BPS system, the relevant data are contained in the endpoint and headers lines. Keep the data to use in the next step.
To utilize the newly created account, open the otlpsettings.json file located in the Portal and Service main directories. (To edit the file you can use the Notepad software available in the Windows system or any source code editor, e.g. Notepad++). Given that the configuration of the aforementioned file is identical for Portal and Service, the article presents only the configuration of the Portal file, but remember to repeat the described steps for the Service file.
The otlpsettings.json file contains the Metrics and Tracing master node that includes the Otlp subnode. It provides the Endpoint and Headers lines – enter in them the data obtained from the Aspecto service. Remember to add the “https://” prefix to the endpoint address, and replace the colon with equals sign and remove the space to the right of it in the headers line. Therefore, the data used in the discussed case are the following:
- endpoint: https://otelcol.aspecto.io:4317,
- headers: Authorization=b29ac31c-789a-4fd1-a389-d47bf854cdee.
Additionally, remember to change the Enabled parameter to “true” in the Otlp and Tracing nodes and the Otlp subnodes belonging to the Exporters nodes (in the Metrics and Tracing master nodes respectively). The correct configuration is presented in the screenshot attached below.
After saving the changes in the file, the text Waiting for incoming traces displayed in the Aspecto website is replaced with Trace arrived successfully!. Additionally, the Continue button becomes active – click it.
The tool main webpage is displayed. Here, you can manage the collected data.
It is worth noting that you can also use other tools for managing traces. As an example, the article describes the Jaeger tool which can be used for this purpose. In its subsequent part, the article describes the configuration of the Prometheus tool and the Grafana platform associated with it. Both solutions are used for monitoring and analyzing metrics.
Jaeger is used for monitoring and analyzing queries paths in distributed systems. It is a free software available for downloading at https://www.jaegertracing.io/download/.
Click the link, select the software version corresponding with your operating system, and download the file. Unpack its content to the “C:Jaeger” directory (create the folder if necessary).
Add the URL address of a machine where Jaeger is installed to the Endpoint parameter belonging to the Exporters node in the otlpsettings.json file. Save your changes. (The port number 14268 remains unchanged). (If the tool is installed locally, enter “localhost”). Additionally, change the Jaeger node value to “true”.
After saving the changes in the file, go to the “C:Jaeger” directory where the tool is installed, and open the Windows console by entering “cmd” command in the address bar. Enter jaeger-all-in-one.exe in the console window.
Once the file is opened, you can check the Jaeger platform status by copying the http://localhost:16686/ address and pasting it into the Internet browser.
The principal task of the Prometheus tool is collecting, storing, and analyzing metrics regarding performance, status, and other parameters of system and applications. To start using the tool, set the Enabled parameter value to “true” in the Metrics (the Otlp master node) and Prometheus (the Exporters master node) subnodes. Next, download the tool. To do that, click the https://prometheus.io/download/ link, and download the file that corresponds to your operating system. Once downloaded, extract its content to “C:Prometheus” (create the folder if it does not exist). In the folder, find and open the prometheus.yml file (again you can do that using the Notepad application or a code editor, e.g. Notepad++), and add a section containing the Portal address and port in accordance with the screenshot attached below. Remember to maintain correct indentation and use only spaces as whitespaces.
After saving the file, you can check the tool’s status. To do that, go to the Prometheus tool directory (C:Prometheus) and enter the “cmd” command in the address bar. Enter “prometheus.exe” in the Windows console. After running the tool, copy http://localhost:9090/targets and paste it in the Internet browser window. The window shown in the screenshot below is displayed.
The last step consists of configuring Grafana – a tool used for visualizing and monitoring metrics by means of interactive and dynamic navigation screens (the so-called dashboards).
The tool’s installer is available for downloading at https://grafana.com/grafana/download?pg=get&plcmt=selfmanaged-box1-cta1&platform=windows. Following the download, install the software ensuring that the Run Grafana as a service component is selected.
When the installation is completed, open the Internet browser and paste http://localhost:3000/ in the address bar. The Grafana tool log-in website is displayed. The default user name and password is “admin” (you can change the password after logging in).
Add a data source to enable the tool to visualize and monitor data. To do that click the DATA SOURCE tile located in the tool’s main window.
Select the Prometheus option from the list of available data sources in the newly opened window.
In the Prometheus data source configuration window enter URL address of the Prometheus server (e.g. http://localhost:9090/). The remaining settings are optional and can be modified by the user based on their preferences.
After entering all changes, click the Save & test button located at the bottom. A correctly configured data source allows the tool to create diagrams and generate dashboards.
Available metrics
By configuring the ProcessInstrumentation, EventCountersInstrumentation, and WebInstrumentation modules, a user has access to metrics provided by an environment or the ASP.NET platform.
For the ProcessInstrumentation module, you can obtain metrics, such as memory usage, disk operations, network operations, number of threads, or CPU load.
On the other hand, you can view the list of counters available for the EventCountersInstrumentation module by clicking https://learn.microsoft.com/pl-pl/dotnet/core/diagnostics/available-counters. Please note here that the list of available metrics is non-exhaustive and is subject to changes.
Finally, the WebInstrumentation module allows you to monitor and analyze:
In addition, WEBCON BPS provides a set of its own metrics and measures which can be applied to monitor the system. The table below contains the aforementioned measures along with a brief description.
Module’s name |
Description |
webcon-workflow-form-path-transitions |
The number of path transitions. The counter includes each started transition (regardless of whether it resulted in a positive or negative outcome). |
webcon-workflow-form-success-path-transitions |
The number of positively completed path transitions (transitions that ended up with an error are not included). |
webcon-workflow-form-open |
The number of form openings. |
webcon-workflow-form-elements-cache |
The number of instances currently in the cache. Instances are added to the cache on form opening and are removed from it when transiting a path. |
webcon-workflow-form-path-transitions-in-progress |
The number of currently ongoing path transitions. For a correctly operating system, the value should not be too big (a correct path transition can last up to several milliseconds). The measure can increase when the system load is significant (multiple simultaneous path transitions). |
webcon-workflow-form-paths-transition-times |
A histogram of path transitions times. |
webcon-workflow-portal-open |
The number of Portal openings. (The counter includes each instance of Portal opening in a new browser window). |
Summary
The above-described OpenTelemetry configuration allows you to quickly start monitoring and analyzing data from the WEBCON BPS system and the systems integrated with it. Thanks to this, the system administrator receives a useful tool that provides insight into data that are often not available in other ways, and thus is able to enhance and develop their own system.