We earn commission when you buy through affiliate links.

This does not influence our reviews or recommendations.Learn more.

Lets learn the fundamentals of Grafana Tempo, a distributed tracing backend.

tempo architecture

Distributed tracing is the way to get fine-grained information about system performance.

It is a way to visualize the lifecycle of a request passing through the app.

The software could consist of multiple services present on a single node or distributed across nodes.

jaeger ui - geekflare

And Grafana Tempo is all about that.

What is Grafana Tempo?

Grafana Labs has added one more project, Grafana Tempo, to their open-source portfolio.

traceid - new

Grafana Tempois an open-source distributed tracing backend that is highly scalable and easy to use.

Tempo is completely compatible with other tracing protocols such as Zipkin, Jaeger,OpenTelemetry, and OpenCensus.

Currently, it supports the Tempo data discovery engine in Loki, monitoring platforms such asPrometheus and Grafana.

grafana

Grafana 7.3+ offers a seamless experience between Grafana and Tempo.

Why use Tempo?

Tempo is used to correlate the metrics, traces, and logs.

prometheus

There are situations where a user is getting the same kind of error multiple times.

If I want to understand what is happening, I will need to look at the exact traces.

But because of downsampling, some valuable information which I might be looking for would have got lost.

traces new

With Tempo, now we need not downsample distributed tracing data.

We can store the complete trace inobject storagelike S3 or GCS, making Tempo very cost-efficient.

Below are the configuration options used in Tempo.

traceid

Tempo Architecture

The above diagram shows the working architecture of Grafana Tempo.

Ingester then creates batches of traces which are called blocks.

Then it sends those blocks to the backend storage (S3/GCS).

It uses a simple HTTP endpoint to expose the traces.

Setup Tempo using Docker

In this section, I will set up Grafana Tempo step-by-step usingDocker.

Firstly, you need a Tempo backend, so set up a docker connection.

Download the Tempo configuration file.

Here I am choosingJaeger Thrift Compact format (port 6831) to send the traces.

Now it’s crucial that you run a Tempo query container.

So first, download the tempo query configuration file.

Using the tempo query configuration file, run a docker container.

Now the Jaeger UI will be accessible athttp://localhost:16686, as shown below.

Running a Demo software on Tempo

Its time to run a demo example given by Grafana Tempo.

spin up the command below to start the stack.

you might see, it has started containers for Grafana, Loki, Tempo, Tempo-query, andPrometheus.

Now synthetic-load-generator running inside a container is generating trace ids which it is putting inside tempo.

execute the command below, and you’re able to view the logs.

These are the trace ids which you should probably pass to generate traces.

I am copying one of the trace ids and putting it in the Jaeger UI search bar.

you could see it has successfully generated the traces related to the trace id I provided.

Conclusion

So that was all about Grafana Tempo.

Go ahead and start using Tempo to generate traces to understand the metrics and issues in yourlogsin detail.