Definition “Distributed Request Tracing” What is distributed tracing?
The term distributed tracing describes a process to separate the different processes in microservices structures and to make them individually recognizable. Tools for this are profile IDs. The aim is to identify causes of errors more quickly.
Companies on the topic
In order to trace possible errors in microservices infrastructures, distributed tracing is enabled via code.
(© green butterfly stock.adobe.com)
Distributed tracing (often referred to as distributed request tracing) is a system that can identify processes in microservices architectures. As the German translation “distributed tracing” suggests, it is above all about a separation. In order to make the behaviour of the processes recognisable and explainable, they must be distinguishable from each other.
Explanation of the problem
An increasing number of applications rely on microservices. For example, they use native cloud applications almost without exception. The idea behind this is the paradigm of modular design: apps work better if the individual functions are provided separately via special services. The background is the specialisation of the individual services. In addition, a service can be exchanged more easily if required.
To give an example using a metaphor: if you want to build a house (in our case: an application), do not simply commission 30 arbitrary people. Instead, skilled craftsmen such as plumbers, bricklayers and electricians are used. Nobody builds everything, but because of their specialization they do the best possible work (so they are our microservices).
Now there is a problem: for example, a wall is damp. However, bricklayers, plumbers, carpenters and electricians have worked on it. It is therefore not possible to say who made the mistake. From the outside it is only apparent that there is a problem. To translate the image back: if there are errors in microservices infrastructures, there can be a large number of potential culprits. Because numerous services use the place where the problem arose.
Distributed tracing as a solution to the problem
Distributed tracing can solve this problem. This leads to the following procedure:
- Each process in each usage request receives its own unique profile ID.
- Services must use this ID to “sign”their work.
- The ID appears in all logs.
- A connected system stores all important data such as start and end via the ID.
All processes can therefore be identified and analysed using the unique profile ID. Let us return to the metaphor for this: the craftsmen must sign and log each work step unmistakably. For example, if it turns out that only the plumber has worked with water, the service is found where there has been an error.
Implementation of Distributed Tracing
Distributed tracing does not work without additional code. It is therefore an analysis and optimization system that is used by the developer. It is therefore excellent for debugging. However, there are no standards or usable templates, as the infrastructures are too individual. As a rule, distributed tracing grows over time with the development of the actual app. However, providers of microservices often provide their own experience, which can help.