TracesSet up and use tracing

Set up and use tracing

Along with metrics and logs, tracing is one of the three pillars of modern observability. Tracing is a way to track a single request and log that single request as it crosses through all of the services in your infrastructure.

How to use Grafana Cloud Traces

To send traces to Grafana Cloud Traces, you will need a running Grafana Agent instance or an OpenTelemetry Collector instance in your environment as in the following diagram -

Grafana Cloud Traces

In the configuration section of the agent, set the following fields

  - name: default
    receivers:  # enable the receivers that you need
      - endpoint: <Your Traces instance remote_write endpoint>
          username: <Your Traces instance instance ID>
          password: <Your API Key>

See the Tempo documentation to learn more about using the Grafana Agent for traces.

If you would like to use the OpenTelemetry Collector to send traces to Grafana Cloud, check out this blog post that explains how to do so in detail.

A deeper introduction to Tempo

Grafana Tempo is a high volume distributed tracing backend that can retrieve a trace when queried for the trace-id. It builds an index on the high cardinality trace-id field and uses an object store as backend which allows for high parallelization of queries. Read more about this in the architecture section of the docs.

Tempo has strong integrations with a number of existing open source tools including -

  • Grafana! Grafana ships with native support for Tempo using the built-in Tempo data source.
  • Grafana Loki - Loki, with its powerful query language LogQL v2 allows us to filter down on requests that we care about, and jump to traces using the Derived fields support in Grafana.
  • Prometheus exemplars - which allow to jump from Prometheus metrics to Tempo traces by clicking on recorded exemplars. Read more about this integration in this blog post.