Automatic logging: Trace discovery through logs
Running distributed tracing systems is very powerful, but it brings its own challenges, and one of them is trace discovery. Tempo supports finding a trace if you know the trace identifier, so we leverage other tools like logs and metrics to discover traces.
Automatic logging provides an easy and fast way of getting trace discovery through logs. Automatic logging writes a well formatted log line to a Loki instance or to stdout for each span, root or process that passes through the tracing pipeline. This allows for automatically building a mechanism for trace discovery. On top of that, we also get metrics from traces using Loki.
For high throughput systems, logging for every span may generate too much volume. In such cases, logging per root span or process is recommended.
Automatic logging searches for a given set of attributes in the spans and logs them as key-value pairs. This allows searching by those key-value pairs in Loki.
To configure it, you need to select your preferred backend and what trace data to log. To see all the available config options, refer to the configuration reference.
tempo: configs: - name: default ... automatic_logging: backend: loki loki_name: default spans: true
Related Tempo resources
GrafanaCONline 2021 is coming June 7-17
Be the first to learn about exciting next-generation features in Grafana 8.0, be inspired by what community members are building, and attend expert-led sessions and workshops on Grafana, Prometheus, Loki logs, and more.
Getting started with tracing and Grafana Tempo
In this session, we will use an instrumented application to demonstrate how to use logs and Prometheus exemplars to find traces effectively in Tempo. The demo will hit on the basics of operating Tempo and reveal how Tempo allows us to scale tracing as far as possible with less operational cost and complexity than ever before.