<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Get started on Grafana Labs</title><link>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/</link><description>Recent content in Get started on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/enterprise-traces/v2.8.x/getting-started/index.xml" rel="self" type="application/rss+xml"/><item><title>Best practices for traces</title><link>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/best-practices/</link><pubDate>Tue, 10 Jun 2025 20:46:23 +0000</pubDate><guid>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/best-practices/</guid><content><![CDATA[&lt;h1 id=&#34;best-practices-for-traces&#34;&gt;Best practices for traces&lt;/h1&gt;
&lt;p&gt;This page provides some general best practices for tracing.&lt;/p&gt;


&lt;div data-shared=&#34;best-practices-traces.md&#34;&gt;
            &lt;h2 id=&#34;span-and-resource-attributes&#34;&gt;Span and resource attributes&lt;/h2&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/tempo/v2.7.x/introduction/&#34;&gt;Traces&lt;/a&gt; are built from spans, which denote units of work such as a call to, or from, an upstream service. Spans are constructed primarily of span and resource attributes.
Spans also have a hierarchy, where parent spans can have children or siblings.&lt;/p&gt;
&lt;p&gt;In the screenshot below, the left side of the screen (1) shows the list of results for the query. The right side (2) lists each span that makes up the selected trace.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/tempo/screenshot-trace-explore-spans-g10.png&#34;
  alt=&#34;Traces example with query results and spans&#34; width=&#34;1474&#34;
     height=&#34;788&#34;/&gt;&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;span attribute&lt;/strong&gt; is a key/value pair that provides context for its span. For example, if the span deals with calling another service via HTTP, an attribute could include the HTTP URL (maybe as the span attribute key &lt;code&gt;http.url&lt;/code&gt;) and the HTTP status code returned (as the span attribute &lt;code&gt;http.status_code&lt;/code&gt;). Span attributes can consist of varying, non-null types.&lt;/p&gt;
&lt;p&gt;Unlike a span attribute, a &lt;strong&gt;resource attribute&lt;/strong&gt; is a key/value pair that describes the context of how the span was collected. Generally, these attributes describe the process that created the span.
This could be a set of resource attributes concerning a Kubernetes cluster, in which case you may see resource attributes, for example: &lt;code&gt;k8s.namespace&lt;/code&gt;, &lt;code&gt;k8s.container_name&lt;/code&gt;, and &lt;code&gt;k8s.cluster&lt;/code&gt;.
These can also include information on the libraries that were used to instrument the spans for a trace, or any other infrastructure information.&lt;/p&gt;
&lt;p&gt;For more information, read the &lt;a href=&#34;https://opentelemetry.io/docs/specs/otel/overview/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Attribute and Resource&lt;/a&gt; sections in the OpenTelemetry specification.&lt;/p&gt;
&lt;h3 id=&#34;naming-conventions-for-span-and-resource-attributes&#34;&gt;Naming conventions for span and resource attributes&lt;/h3&gt;
&lt;p&gt;The OpenTelemetry project defines a number of semantic conventions for attributes, which can help you to determine which attributes are most important to include in your spans. These conventions provide a common vocabulary for describing different types of entities, which can help to ensure that your data is consistent and meaningful.&lt;/p&gt;
&lt;p&gt;When naming attributes, use consistent, nested namespaces to ensures that attribute keys are obvious to anyone observing the spans of a trace and that common attributes can be shared by spans.
Using our example from above, the &lt;code&gt;http&lt;/code&gt; prefix of the attribute is the namespace, and &lt;code&gt;url&lt;/code&gt; and &lt;code&gt;status_code&lt;/code&gt; are keys within that namespace.
Attributes can also be nested, for example &lt;code&gt;http.url.protocol&lt;/code&gt; might be &lt;code&gt;HTTP&lt;/code&gt; or &lt;code&gt;HTTPS&lt;/code&gt;, whereas &lt;code&gt;http.url.path&lt;/code&gt; might be &lt;code&gt;/api/v1/query&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For more details around semantic naming conventions, refer to the &lt;a href=&#34;https://opentelemetry.io/docs/specs/otel/common/attribute-naming/#recommendations-for-opentelemetry-authors&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Recommendations for OpenTelemetry Authors&lt;/a&gt; and &lt;a href=&#34;https://github.com/open-telemetry/semantic-conventions/blob/main/docs/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Semantic Conventions&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;Some third-party libraries provide auto-instrumentation that generate span and span attributes when included in a source base.&lt;/p&gt;
&lt;p&gt;For more information about instrumenting your app for tracing, refer to the &lt;a href=&#34;/docs/tempo/latest/getting-started/instrumentation/&#34;&gt;Instrument for distributed tracing&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h3 id=&#34;how-many-attributes-should-spans-have&#34;&gt;How many attributes should spans have?&lt;/h3&gt;
&lt;p&gt;The decision of how many attributes to include in your spans is up to you. There is no hard and fast rule.
Keep the number of attributes to a minimum, as each attribute adds overhead to the tracing system.
In Grafana Cloud, this results in higher tracing costs.&lt;/p&gt;
&lt;p&gt;Only include attributes that are relevant to the operation that the span represents. For example, if you are tracing an HTTP request, you might include attributes such as the request method, the URL, and the response status code.&lt;/p&gt;
&lt;p&gt;If you are unsure whether or not to include an attribute, it is always better to err on the side of caution and leave it out. You can always add additional attributes later if you need them.&lt;/p&gt;
&lt;p&gt;In general, consider the following guidelines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Don&amp;rsquo;t include metrics or logs as attributes in your spans.&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t use redundant attributes.&lt;/li&gt;
&lt;li&gt;When determining which attributes to add, consider an application&amp;rsquo;s service flow, and execution in the context of only the current span.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The OpenTelemetry project doesn&amp;rsquo;t specify a maximum number of attributes that a span can have.
However, the default limits for the number of attributes per span is &lt;a href=&#34;https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#attribute-limits&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;128 entries&lt;/a&gt;, so you will have to adjust that. There are also default limits on attribute value and name character lengths.&lt;/p&gt;
&lt;h2 id=&#34;determining-where-to-add-spans&#34;&gt;Determining where to add spans&lt;/h2&gt;
&lt;p&gt;When instrumenting, determine the smallest piece of work that you need to observe in a trace to be of value to ensure that you don’t over (or under) instrument.&lt;/p&gt;
&lt;p&gt;Creating a new span for any work that has a relatively significant duration allows the observation of a trace to immediately show where significant amounts of time are spent during the processing of a request into your application or system.&lt;/p&gt;
&lt;p&gt;For example, adding a span for a call to another services (either instrumented or not) may take an unknown amount of time to complete, and therefore being able to separate this work shows when services are taking longer than expected.&lt;/p&gt;
&lt;p&gt;Adding a span for a piece of work that might call many other functions in a loop is a good signal of how long that loop is taking (you might add a span attribute that counts how many time the loop runs to determine if the duration is acceptable).
However, adding a span for each method or function call in that loop might not, as it might produce hundreds or thousands of worthless spans.&lt;/p&gt;
&lt;h2 id=&#34;span-length&#34;&gt;Span length&lt;/h2&gt;
&lt;p&gt;While there are some (high) default limits to the length that a span (and by definition, the traces they belong to) can be, these can be adjusted by 
    &lt;a href=&#34;/docs/tempo/v2.7.x/configuration/#ingestion-limits&#34;&gt;these configurations&lt;/a&gt;.
Traces that include a large number of spans and/or long-running spans can have an impact on the time taken to query them once stored.
Cloud Traces users should contact Grafana Support to modify overrides.&lt;/p&gt;
&lt;p&gt;For long-running spans and traces, the best way to see this impact on requests is to send a few test cases and see what the performance looks like and to evaluate the trace size.&lt;/p&gt;
&lt;p&gt;From there, you can modify the configuration for Tempo or determine ways to re-architect how the trace is produced.&lt;/p&gt;
&lt;p&gt;You can consider breaking up the spans in several ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Decompose the query
&lt;ul&gt;
&lt;li&gt;For example, if a complex SQL query involves multiple operations (for example, uses joins, subqueries, or unions), consider creating separate spans for each significant operation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Improve granulation of long-running spans
&lt;ul&gt;
&lt;li&gt;For long-running operations, you could create a new span for every predetermined interval of execution time.


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;This requires time-based tracking in your application&amp;rsquo;s code and is more complex to implement.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Use span linking
&lt;ul&gt;
&lt;li&gt;Should data flow hit bottlenecks where further operations on that data might be batched at a later time, the use of &lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/overview.md#links-between-spans&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;span links&lt;/a&gt; can help keep traces constrained to an acceptable time range, while sharing context with other traces that work on the same data. This can also improve the readability of traces.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="best-practices-for-traces">Best practices for traces&lt;/h1>
&lt;p>This page provides some general best practices for tracing.&lt;/p>
&lt;div data-shared="best-practices-traces.md">
&lt;h2 id="span-and-resource-attributes">Span and resource attributes&lt;/h2>
&lt;p>
&lt;a href="/docs/tempo/v2.7.x/introduction/">Traces&lt;/a> are built from spans, which denote units of work such as a call to, or from, an upstream service. Spans are constructed primarily of span and resource attributes.
Spans also have a hierarchy, where parent spans can have children or siblings.&lt;/p></description></item><item><title>Instrument for distributed tracing</title><link>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/instrumentation/</link><pubDate>Tue, 10 Jun 2025 20:46:23 +0000</pubDate><guid>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/instrumentation/</guid><content><![CDATA[&lt;h1 id=&#34;instrument-for-distributed-tracing&#34;&gt;Instrument for distributed tracing&lt;/h1&gt;
&lt;p&gt;Client instrumentation is the first building block to a functioning distributed tracing visualization pipeline.
Client instrumentation is the process of adding instrumentation points in the application that create and offload spans.&lt;/p&gt;
&lt;p&gt;Check out these resources for help instrumenting tracing with your favorite languages.
Most of these guides include complete end-to-end examples with Grafana, Loki, Mimir, and Tempo.&lt;/p&gt;
&lt;h2 id=&#34;instrumentation-frameworks&#34;&gt;Instrumentation frameworks&lt;/h2&gt;
&lt;p&gt;Most of the popular client instrumentation frameworks have SDKs in the most commonly used programming languages.
You should pick one according to your application needs.&lt;/p&gt;
&lt;p&gt;OpenTelemetry has the most active development in the community and may be a better long-term choice.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://opentelemetry.io/docs/concepts/instrumenting/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://zipkin.io/pages/tracers_instrumentation&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Zipkin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;opentelemetry&#34;&gt;OpenTelemetry&lt;/h2&gt;
&lt;p&gt;A collection of tools, APIs, and SDKs, OpenTelemetry helps engineers instrument, generate, collect, and export telemetry data such as metrics, logs, and traces, to analyze software performance and behavior.
For more information refer to &lt;a href=&#34;/oss/opentelemetry/&#34;&gt;OpenTelemetry overview&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;auto-instrumentation-frameworks&#34;&gt;Auto-instrumentation frameworks&lt;/h3&gt;
&lt;p&gt;OpenTelemetry provides auto-instrumentation agents and libraries of Java, .NET, Python, Go, and JavaScript applications, among others.
For more information, refer for the &lt;a href=&#34;https://opentelemetry.io/docs/instrumentation/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Instrumentation documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;These libraries capture telemetry
information from a client application with minimal manual instrumentation of the codebase.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-java-instrumentation&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Java auto-instrumentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry .NET auto-instrumentation&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/blog/2023/10/31/how-to-configure-opentelemetry-.net-automatic-instrumentation-with-grafana-cloud&#34;&gt;How to configure OpenTelemetry .NET automatic instrumentation with Grafana Cloud&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-python-contrib&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Python auto-instrumentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-go-instrumentation&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Go auto-instrumentation&lt;/a&gt; and &lt;a href=&#34;https://opentelemetry.io/docs/instrumentation/go/getting-started/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Jaeger client libraries have been deprecated. For more information, refer to the &lt;a href=&#34;https://www.jaegertracing.io/docs/1.50/client-libraries/#deprecating-jaeger-clients&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Deprecating Jaeger clients article&lt;/a&gt;. Jaeger recommends using OpenTelemetry SDKs.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;additional-otel-resources&#34;&gt;Additional OTel resources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/monitor-applications/application-observability/&#34;&gt;Grafana Application Observability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-go-instrumentation/tree/main/examples&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Go instrumentation examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://opentelemetry.io/docs/instrumentation/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Language Specific Instrumentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;other-instrumentation-resources&#34;&gt;Other instrumentation resources&lt;/h2&gt;
&lt;h3 id=&#34;zipkin&#34;&gt;Zipkin&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://zipkin.io/pages/tracers_instrumentation.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Zipkin Language Specific Instrumentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;grafana-blog&#34;&gt;Grafana Blog&lt;/h2&gt;
&lt;p&gt;The Grafana blog periodically features instrumentation posts.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/blog/2023/10/31/how-to-configure-opentelemetry-.net-automatic-instrumentation-with-grafana-cloud&#34;&gt;How to configure OpenTelemetry .NET automatic instrumentation with Grafana Cloud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/blog/2021/02/03/auto-instrumenting-a-java-spring-boot-application-for-traces-and-logs-using-opentelemetry-and-grafana-tempo/&#34;&gt;Java Spring Boot Auto-Instrumentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/blog/2020/11/09/trace-discovery-in-grafana-tempo-using-prometheus-exemplars-loki-2.0-queries-and-more/&#34;&gt;Go &#43; OpenMetrics Exemplars&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/blog/2021/02/11/instrumenting-a-.net-web-api-using-opentelemetry-tempo-and-grafana-cloud/&#34;&gt;.NET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https:/grafana.com/blog/2021/05/04/get-started-with-distributed-tracing-and-grafana-tempo-using-foobar-a-demo-written-in-python/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;community-resources&#34;&gt;Community resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/mnadeem/nodejs-opentelemetry-tempo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;NodeJS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/mnadeem/boot-opentelemetry-tempo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Java Spring Boot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/dgzlopes/foobar-demo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="instrument-for-distributed-tracing">Instrument for distributed tracing&lt;/h1>
&lt;p>Client instrumentation is the first building block to a functioning distributed tracing visualization pipeline.
Client instrumentation is the process of adding instrumentation points in the application that create and offload spans.&lt;/p></description></item><item><title>Tracing in Grafana</title><link>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/tempo-in-grafana/</link><pubDate>Tue, 10 Jun 2025 20:46:23 +0000</pubDate><guid>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/tempo-in-grafana/</guid><content><![CDATA[&lt;h1 id=&#34;tracing-in-grafana&#34;&gt;Tracing in Grafana&lt;/h1&gt;
&lt;p&gt;Grafana has a built-in Tempo data source that can be used to query Tempo and visualize traces.
This page describes the high-level features and their availability.
Use the latest versions for best compatibility and stability.&lt;/p&gt;


&lt;div data-shared=&#34;tempo-in-grafana.md&#34;&gt;
            &lt;!--  Use traces in Grafana --&gt;
&lt;h2 id=&#34;query-your-data&#34;&gt;Query your data&lt;/h2&gt;
&lt;p&gt;Using tracing data in Grafana and Grafana Cloud Traces, you can search for traces, generate metrics from spans, and link your tracing data with logs, metrics, and profiles.&lt;/p&gt;
&lt;h3 id=&#34;use-traces-drilldown-to-investigate-tracing-data&#34;&gt;Use Traces Drilldown to investigate tracing data&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Traces Drilldown is currently in &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;public preview&lt;/a&gt;. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href=&#34;/docs/grafana-cloud/visualizations/simplified-exploration/traces/&#34;&gt;Grafana Traces Drilldown&lt;/a&gt; helps you visualize insights from your Tempo traces data.
Using the app, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;em&gt;Rate&lt;/em&gt;, &lt;em&gt;Errors&lt;/em&gt;, and &lt;em&gt;Duration&lt;/em&gt; (RED) metrics derived from traces to investigate issues&lt;/li&gt;
&lt;li&gt;Uncover related issues and monitor changes over time&lt;/li&gt;
&lt;li&gt;Browse automatic visualizations of your data based on its characteristics&lt;/li&gt;
&lt;li&gt;Do all of this without writing TraceQL queries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Expand your observability journey and learn about &lt;a href=&#34;/docs/grafana-cloud/visualizations/simplified-exploration/&#34;&gt;the Drilldown apps suite&lt;/a&gt;.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/a3uB1C2oHA4&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&gt;
&lt;h3 id=&#34;search-for-traces&#34;&gt;Search for traces&lt;/h3&gt;
&lt;p&gt;Search for traces using common dimensions such as time range, duration, span tags, service names, etc.
Use the Explore trace view to quickly diagnose errors and high latency events in your system.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_search.png&#34;
  alt=&#34;Sample search visualization&#34; width=&#34;1794&#34;
     height=&#34;816&#34;/&gt;&lt;/p&gt;
&lt;h3 id=&#34;search-is-non-deterministic&#34;&gt;Search is non-deterministic&lt;/h3&gt;
&lt;p&gt;Most search functions are deterministic.
When given the same criteria, a deterministic algorithm returns consistent results.
For example, let&amp;rsquo;s say that you query a search engine for the definition of &amp;ldquo;traces.&amp;rdquo;
The results list the same top matches for each query for &amp;ldquo;traces&amp;rdquo; in that search engine.&lt;/p&gt;
&lt;p&gt;However, Tempo search is non-deterministic.
If you perform the same search twice, you’ll get different lists, assuming the possible number of results for your search is greater than the number of results you have your search set to return.&lt;/p&gt;
&lt;p&gt;When performing a search, Tempo does a massively parallel search over the given time range, and takes the first &lt;code&gt;N&lt;/code&gt; results.
Even identical searches differ due to things like machine load and network latency.
This approach values speed over predictability and is quite simple; enforcing that the search results are consistent would introduce additional complexity (and increase the time the user spends waiting for results).
TraceQL follows the same behavior.&lt;/p&gt;
&lt;p&gt;By adding &lt;code&gt;most_recent=true&lt;/code&gt; to your TraceQL queries, the search results become deterministic.
For more information, refer to 
    &lt;a href=&#34;/docs/tempo/v2.8.x/traceql/#retrieving-most-recent-results-experimental&#34;&gt;Retrieve most recent results&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&#34;use-trace-search-results-as-panels-in-dashboards&#34;&gt;Use trace search results as panels in dashboards&lt;/h4&gt;
&lt;p&gt;You can embed tracing panels and visualizations in dashboards.
You can also save queries as panels.
For more information, refer to the &lt;a href=&#34;/docs/grafana-cloud/visualizations/panels-visualizations/visualizations/traces/#add-traceql-with-table-visualizations&#34;&gt;Traces Visualization&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;For example dashboards, visit &lt;a href=&#34;https://play.grafana.org&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;play.grafana.org&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/fab5705a-e213-4527-8c23-92cb7452e746/traces-and-basic-operations-on-them?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Traces and basic operations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/explore?schemaVersion=1&amp;amp;panes=%7B%22cf2%22:%7B%22datasource%22:%22grafanacloud-traces%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22tempo%22,%22uid%22:%22grafanacloud-traces%22%7D,%22queryType%22:%22traceqlSearch%22,%22limit%22:20,%22tableType%22:%22traces%22,%22filters%22:%5B%7B%22id%22:%22ab3bc4be%22,%22operator%22:%22%3D%22,%22scope%22:%22span%22%7D%5D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D%7D&amp;amp;orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Explore with a Tempo data source&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;use-traceql-to-query-data-and-generate-metrics&#34;&gt;Use TraceQL to query data and generate metrics&lt;/h3&gt;
&lt;p&gt;Inspired by PromQL and LogQL, TraceQL is a query language designed for selecting traces.&lt;/p&gt;
&lt;p&gt;Using Grafana &lt;strong&gt;Explore&lt;/strong&gt;, you can search traces.
The default traces search reviews the whole trace.
TraceQL provides a method for formulating precise queries so you can zoom in to the data you need.
Query results return faster because the queries limit what is searched.&lt;/p&gt;
&lt;p&gt;You can construct queries using the 
    &lt;a href=&#34;/docs/grafana/next/datasources/tempo/query-editor/traceql-editor/&#34;&gt;TraceQL query editor&lt;/a&gt; or use the 
    &lt;a href=&#34;/docs/grafana/next/datasources/tempo/query-editor/traceql-search/&#34;&gt;Search query type&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For details about constructing queries, refer to the 
    &lt;a href=&#34;/docs/tempo/v2.8.x/traceql/&#34;&gt;TraceQL documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;traceql-metrics-queries&#34;&gt;TraceQL metrics queries&lt;/h4&gt;



&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;TraceQL metrics is an &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;experimental feature&lt;/a&gt;. Engineering and on-call support is not available. Documentation is either limited or not provided outside of code comments. No SLA is provided. Enable the  feature toggle in Grafana to use this feature. Do not enable this feature in production environments.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;


&lt;p&gt;TraceQL language provides metrics queries as an experimental feature.
Metric queries extend trace queries by applying an aggregate function to trace query results. For example: &lt;code&gt;{ span:name = &amp;quot;foo&amp;quot; } | rate() by (span:status)&lt;/code&gt;
This powerful feature creates metrics from traces, much in the same way that LogQL metric queries create metrics from logs.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana-cloud/visualizations/simplified-exploration/traces/&#34;&gt;Grafana Traces Drilldown&lt;/a&gt; is powered by metrics queries.&lt;/p&gt;
&lt;p&gt;For more information about available queries, refer to 
    &lt;a href=&#34;/docs/tempo/v2.8.x/traceql/metrics-queries/&#34;&gt;TraceQL metrics queries&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;generate-metrics-from-spans&#34;&gt;Generate metrics from spans&lt;/h3&gt;
&lt;p&gt;RED metrics can drive service graphs and other ready-to-go visualizations of your span data.
RED metrics represent:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Rate&lt;/em&gt;, the number of requests per second&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Errors&lt;/em&gt;, the number of those requests that are failing&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Duration&lt;/em&gt;, the amount of time those requests take&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information about RED method, refer to &lt;a href=&#34;/blog/2018/08/02/the-red-method-how-to-instrument-your-services/&#34;&gt;The RED Method: how to instrument your services&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To enable metrics-generator in Grafana Cloud, refer to &lt;a href=&#34;/docs/grafana-cloud/send-data/traces/metrics-generator/&#34;&gt;Enable metrics-generator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To enable metrics-generator for Tempo, refer to 
    &lt;a href=&#34;/docs/tempo/v2.8.x/configuration/#metrics-generator&#34;&gt;Configure metrics-generator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_service_graph.png&#34;
  alt=&#34;Service graph view&#34; width=&#34;1597&#34;
     height=&#34;895&#34;/&gt;&lt;/p&gt;
&lt;p&gt;These metrics exist in your Hosted Metrics instance and can also be easily used to generate powerful custom dashboards.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_custom_metrics_dash.png&#34;
  alt=&#34;Custom Metrics Dashboard&#34; width=&#34;1611&#34;
     height=&#34;776&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Metrics automatically generate exemplars as well which allows easy metrics to trace linking.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_exemplars.png&#34;
  alt=&#34;Trace Exemplars&#34; width=&#34;1843&#34;
     height=&#34;781&#34;/&gt;&lt;/p&gt;
&lt;h4 id=&#34;service-graph-view&#34;&gt;Service graph view&lt;/h4&gt;
&lt;p&gt;Service graph view displays a table of request rate, error rate, and duration metrics (RED) calculated from your incoming spans.
It also includes a node graph view built from your spans.&lt;/p&gt;
&lt;p&gt;To use the service graph view, you need to enable 
    &lt;a href=&#34;/docs/tempo/v2.8.x/metrics-generator/service_graphs/&#34;&gt;service graphs&lt;/a&gt; and 
    &lt;a href=&#34;/docs/tempo/v2.8.x/metrics-generator/span_metrics/&#34;&gt;span metrics&lt;/a&gt;.
After it&amp;rsquo;s enabled, this pre-configured view is immediately available in &lt;strong&gt;Explore &amp;gt; Service Graphs&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Refer to the 
    &lt;a href=&#34;https://docs/tempo/v2.8.x/metrics-generator/service-graph-view&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;service graph view documentation&lt;/a&gt; for further information.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/apm-overview.png&#34;
  alt=&#34;Service graph view overview&#34; width=&#34;1266&#34;
     height=&#34;915&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;integrate-other-telemetry-signals&#34;&gt;Integrate other telemetry signals&lt;/h2&gt;
&lt;h3 id=&#34;link-traces-and-logs&#34;&gt;Link traces and logs&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re already doing request/response logging with trace IDs, they can be easily extracted from logs to jump directly to your traces.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_sample.png&#34;
  alt=&#34;Logs to Traces visualization&#34; width=&#34;1606&#34;
     height=&#34;889&#34;/&gt;&lt;/p&gt;
&lt;p&gt;In the other direction, you can configure Grafana and Grafana Cloud to create a link from an individual span to your Loki logs.
If you see a long-running span or a span with errors, you
can immediately jump to the logs of the process causing the error.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_to_logs.png&#34;
  alt=&#34;Traces to Logs visualization&#34; width=&#34;1584&#34;
     height=&#34;883&#34;/&gt;&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Cloud Traces only supports custom tags added by Grafana Support.
Cloud Traces supports these default tags: &lt;code&gt;cluster&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, and &lt;code&gt;pod&lt;/code&gt;.
Contact Support to add a custom tag.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;link-traces-and-metrics&#34;&gt;Link traces and metrics&lt;/h3&gt;
&lt;p&gt;Grafana can correlate different signals by adding the functionality to link between traces and metrics. &lt;a href=&#34;/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/&#34;&gt;Trace to metrics&lt;/a&gt; lets you navigate from a trace span to a selected data source.
Using trace to metrics, you can quickly see trends or aggregated data related to each span.&lt;/p&gt;
&lt;p&gt;For example, you can use span attributes to metric labels by using the &lt;code&gt;$__tags&lt;/code&gt; keyword to convert span attributes to metrics labels.&lt;/p&gt;
&lt;p&gt;To set up Trace to metrics for your data source, refer to &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/data-sources/tempo/configure-tempo-data-source/#trace-to-metrics&#34;&gt;Trace to metric configuration&lt;/a&gt;.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/xOolCpm2F8c&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&gt;
&lt;h3 id=&#34;link-traces-and-profiles&#34;&gt;Link traces and profiles&lt;/h3&gt;
&lt;p&gt;Using Trace to profiles, you can correlate different signals by adding the functionality to link between traces and profiles.&lt;/p&gt;
&lt;p&gt;Trace to profiles lets you link your 
    &lt;a href=&#34;/docs/pyroscope/v2.8.x/&#34;&gt;Grafana Pyroscope&lt;/a&gt; data source to tracing data in Grafana or Grafana Cloud.
When configured, this connection lets you run queries from a trace span into the profile data.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/tempo/profiles/tempo-profiles-Span-link-profile-data-source.png&#34;
  alt=&#34;Selecting a link in the span queries the profile data source&#34; width=&#34;1681&#34;
     height=&#34;1102&#34;/&gt;&lt;/p&gt;
&lt;p&gt;For more information, refer to the 
    &lt;a href=&#34;/docs/grafana/next/datasources/tempo/configure-tempo-data-source/#trace-to-profiles&#34;&gt;Traces to profiles documentation&lt;/a&gt; and the 
    &lt;a href=&#34;https://docs/grafana/next/datasources/grafana-pyroscope/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Pyroscope data source documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For Cloud Traces, Refer to the &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/data-sources/tempo/configure-tempo-data-source/#trace-to-profiles&#34;&gt;Traces to profiles documentation&lt;/a&gt; for configuration instructions.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/AG8VzfFMLxo&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="tracing-in-grafana">Tracing in Grafana&lt;/h1>
&lt;p>Grafana has a built-in Tempo data source that can be used to query Tempo and visualize traces.
This page describes the high-level features and their availability.
Use the latest versions for best compatibility and stability.&lt;/p></description></item><item><title>Metrics from traces</title><link>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/metrics-from-traces/</link><pubDate>Tue, 10 Jun 2025 20:46:23 +0000</pubDate><guid>https://grafana.com/docs/enterprise-traces/v2.8.x/getting-started/metrics-from-traces/</guid><content><![CDATA[&lt;h1 id=&#34;metrics-from-traces&#34;&gt;Metrics from traces&lt;/h1&gt;
&lt;p&gt;Metrics provide a powerful insight into the systems you are monitoring with your observability strategy.
Instead of running an additional service to generate metrics, you can use Grafana Tempo to generate metrics from traces.&lt;/p&gt;
&lt;p&gt;Grafana Tempo can generate metrics from tracing data using the metrics-generator, TraceQL metrics (experimental), and the metrics summary API (deprecated).
Refer to the table for a summary of these metrics and their capabilities.
Metrics summary is not included because it is deprecated.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;/th&gt;
              &lt;th&gt;Metrics-generator&lt;/th&gt;
              &lt;th&gt;TraceQL metrics&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Functionality&lt;/td&gt;
              &lt;td&gt;An optional component within Tempo that processes incoming spans to produce predefined metrics, specifically focusing on RED (Rate, Error, Duration) metrics and service graphs.&lt;/td&gt;
              &lt;td&gt;An experimental feature in Tempo that allows for on-the-fly computation of metrics directly from trace data using the TraceQL query language, without the need for a separate metrics storage backend.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Capabilities&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;Span metrics:&lt;/strong&gt; Calculates the total count and duration of spans based on dimensions like service name, operation, span kind, status code, and other span attributes. &lt;br&gt; &lt;strong&gt;Service graphs&lt;/strong&gt;: Analyzes traces to map relationships between services, identifying transactions and recording metrics related to request counts and durations.&lt;/td&gt;
              &lt;td&gt;Ad-hoc aggregation and analysis of trace data by applying functions to trace query results, similar to how LogQL operates with logs.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Output&lt;/td&gt;
              &lt;td&gt;The generated metrics are written to a Prometheus-compatible database, enabling integration with time-series databases for storage and analysis.&lt;/td&gt;
              &lt;td&gt;Generates metrics dynamically at query time, facilitating flexible and detailed investigations into specific behaviors or patterns within the trace data.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Use case&lt;/td&gt;
              &lt;td&gt;Ideal for continuous monitoring and alerting, leveraging predefined metrics that will be stored in a time-series database. Less expressive for trace-specific analysis as it focuses on standard telemetry dimensions and RED metrics.&lt;/td&gt;
              &lt;td&gt;More expressive and flexible for analyzing trace data directly, enabling complex trace-based queries and fine-grained exploration. Suited for exploratory analysis and debugging, allowing users to derive insights from trace data without prior metric definitions or storage considerations.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Setup&lt;/td&gt;
              &lt;td&gt;Configure the metrics-generator in the Tempo configuration file, enable processors like span metrics or service graphs, and send metrics to a Prometheus-compatible database.&lt;/td&gt;
              &lt;td&gt;Configure the local-blocks processor in overrides and in the metrics-generator configurations.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Query range&lt;/td&gt;
              &lt;td&gt;Supports querying over long time ranges, limited only by retention of the metrics backend.&lt;/td&gt;
              &lt;td&gt;Limited to a maximum query range of 3 hours by default (as of now), as metrics are computed from stored traces in real time.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Query language&lt;/td&gt;
              &lt;td&gt;Metrics are consumed using PromQL via Prometheus/Grafana.&lt;/td&gt;
              &lt;td&gt;Uses TraceQL which has a PromQL-inspired syntax, but not all PromQL features are supported; it’s a similar but distinct subset with different semantics.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;metrics-generator&#34;&gt;Metrics-generator&lt;/h2&gt;
&lt;p&gt;Tempo can generate metrics from ingested traces using the metrics-generator, an optional Tempo component. The metrics-generator runs two different processors: 
    &lt;a href=&#34;/docs/enterprise-traces/v2.8.x/metrics-generator/service_graphs/&#34;&gt;service graphs&lt;/a&gt; and 
    &lt;a href=&#34;/docs/enterprise-traces/v2.8.x/metrics-generator/span_metrics/&#34;&gt;span metrics&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The metrics-generator looks at incoming spans, and calculates rate, error, and duration (RED) metrics from them, which it then writes to a time series database like Prometheus.
By querying Prometheus, you can see the overall request rate, erroring request rate, and distribution of request latency in your system.
By using the labels on those metrics, you can get a more granular view of request rate, error rate, and latency at a per-service, per-namespace, or per-operation level.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Useful for investigating&lt;/th&gt;
              &lt;th&gt;Metric&lt;/th&gt;
              &lt;th&gt;Meaning&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Unusual spikes in activity&lt;/td&gt;
              &lt;td&gt;Rate&lt;/td&gt;
              &lt;td&gt;Number of requests per second&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Overall issues in your tracing ecosystem&lt;/td&gt;
              &lt;td&gt;Error&lt;/td&gt;
              &lt;td&gt;Number of those requests that are failing&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Response times and latency issues&lt;/td&gt;
              &lt;td&gt;Duration&lt;/td&gt;
              &lt;td&gt;Amount of time those requests take, represented as a histogram&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;The metrics-generator generates metrics from tracing data using the &lt;code&gt;services_graphs&lt;/code&gt;, &lt;code&gt;span_metrics&lt;/code&gt;, and &lt;code&gt;local_blocks&lt;/code&gt; processors.
The &lt;code&gt;service_graphs&lt;/code&gt; and &lt;code&gt;span_metrics&lt;/code&gt; processors generate metrics that are written to a Prometheus-compatible backend.
The &lt;code&gt;local_blocks&lt;/code&gt; processor adds support for TraceQL metrics and provides the capability of answering TraceQL metric queries to the generators without writing any data to the Prometheus backend.
The metrics-generator processes spans and write metrics using the Prometheus remote write protocol.&lt;/p&gt;
&lt;p&gt;For more information, refer to 
    &lt;a href=&#34;/docs/enterprise-traces/v2.8.x/metrics-generator/&#34;&gt;Metrics generator&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;use-cases-for-span-metrics&#34;&gt;Use-cases for span metrics&lt;/h3&gt;
&lt;p&gt;Span metrics are of particular interest if your system isn&amp;rsquo;t monitored with metrics but it has distributed tracing implemented. You get out-of-the-box metrics from your tracing pipeline.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;In Grafana Cloud, the metrics-generator is disabled by default. Contact Grafana Support to enable metrics generation in your organization.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;After the metrics-generator is enabled in your organization, refer to 
    &lt;a href=&#34;/docs/tempo/v2.8.x/configuration/#metrics-generator&#34;&gt;Metrics-generator configuration&lt;/a&gt; for information about metrics-generator options.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png&#34;
  alt=&#34;Trace service graph&#34; width=&#34;1290&#34;
     height=&#34;1145&#34;/&gt;&lt;/p&gt;
&lt;p&gt;These metrics exist in your Hosted Metrics instance and can also be easily used to generate powerful custom dashboards.&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;&lt;img src=&#34;../assets/trace_custom_metrics_dash.png&#34; alt=&#34;Trace custom metrics dashboard&#34;&gt;&lt;/p&gt;
&lt;p&gt;The metrics-generator automatically generates exemplars as well which allows easy metrics to trace linking.

    &lt;a href=&#34;/docs/grafana/next/fundamentals/exemplars/&#34;&gt;Exemplars&lt;/a&gt; are available in Grafana Cloud.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 600px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/grafana/exemplars/screenshot-exemplar-span-details.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/grafana/exemplars/screenshot-exemplar-span-details.png&#34;data-srcset=&#34;/media/docs/grafana/exemplars/screenshot-exemplar-span-details.png?w=320 320w, /media/docs/grafana/exemplars/screenshot-exemplar-span-details.png?w=550 550w, /media/docs/grafana/exemplars/screenshot-exemplar-span-details.png?w=750 750w, /media/docs/grafana/exemplars/screenshot-exemplar-span-details.png?w=900 900w, /media/docs/grafana/exemplars/screenshot-exemplar-span-details.png?w=1040 1040w, /media/docs/grafana/exemplars/screenshot-exemplar-span-details.png?w=1240 1240w, /media/docs/grafana/exemplars/screenshot-exemplar-span-details.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Span details&#34;width=&#34;765&#34;height=&#34;1086&#34;title=&#34;Span details&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/exemplars/screenshot-exemplar-span-details.png&#34;
            alt=&#34;Span details&#34;width=&#34;765&#34;height=&#34;1086&#34;title=&#34;Span details&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Span details&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;traceql-metrics-experimental&#34;&gt;TraceQL metrics (experimental)&lt;/h2&gt;
&lt;p&gt;Traces are a unique observability signal that contain causal relationships between the components in your system.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Do you want to know how many database calls across all systems are downstream of your application?&lt;/li&gt;
&lt;li&gt;What services beneath a given endpoint are currently failing?&lt;/li&gt;
&lt;li&gt;What services beneath an endpoint are currently slow?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The experimental TraceQL metrics can answer all these questions by parsing your traces in aggregate.&lt;/p&gt;
&lt;p&gt;You can query data generated by TraceQL metrics in a similar way that you would query results stored in Prometheus, Grafana Mimir, or other Prometheus-compatible Time-Series-Database (TSDB).
TraceQL metrics queries allows you to calculate metrics on trace span data on-the-fly with Tempo (your tracing database), without requiring a time-series-database like Prometheus.&lt;/p&gt;
&lt;p&gt;TraceQL metrics, powered by the API of the same name, return Prometheus-like time series for a given metrics query.
Metrics queries apply a function to trace query results.
TraceQL metrics uses the &lt;code&gt;local_blocks&lt;/code&gt; processor in metrics-generator.&lt;/p&gt;
&lt;p&gt;TraceQL metrics power the 
    &lt;a href=&#34;/docs/grafana/next/explore/simplified-exploration/traces/&#34;&gt;Grafana Traces Drilldown app&lt;/a&gt;.
You can explore the power of visualizing your metrics in the Grafana Traces Drilldown app using Grafana Play.&lt;/p&gt;

&lt;Box backgroundColor=&#34;primary&#34; borderColor=&#34;strong&#34; borderStyle=&#34;solid&#34; padding=&#34;2&#34;&gt;
  &lt;Grid columns=&#34;2&#34; gap=&#34;2&#34;&gt;
    &lt;div&gt;
      &lt;h4&gt;Give it a try using Grafana Play&lt;/h4&gt;
      &lt;p&gt;With Grafana Play, you can explore and see how it works, learning from practical examples to accelerate your development.
This feature can be seen on &lt;a href=&#34;https://play.grafana.org/a/grafana-exploretraces-app/explore&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;the Grafana Play site&lt;/a&gt;.&lt;/p&gt;
      &lt;div&gt;
        &lt;a class=&#34;btn btn--primary arrow&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34; href=&#34;https://play.grafana.org/a/grafana-exploretraces-app/explore&#34;&gt;Try it&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div&gt;
      &lt;img src=&#34;/media/docs/icons/docs-play.svg&#34; width=&#34;228&#34; height=&#34;182&#34; alt=&#34;Give it a try using Grafana Play&#34;&gt;
    &lt;/div&gt;
  &lt;/Grid&gt;
&lt;/Box&gt;

&lt;p&gt;Refer to these resources for additional information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/enterprise-traces/v2.8.x/traceql/metrics-queries/solve-problems-metrics-queries/&#34;&gt;Solves problems with TraceQL metrics queries&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/tempo/v2.8.x/operations/traceql-metrics/&#34;&gt;Configure TraceQL metrics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/enterprise-traces/v2.8.x/traceql/metrics-queries/&#34;&gt;TraceQL metrics queries&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/enterprise-traces/v2.8.x/traceql/metrics-queries/functions/&#34;&gt;TraceQL metrics functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;metrics-summary-api-deprecated&#34;&gt;Metrics summary API (deprecated)&lt;/h2&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;The metrics summary API is deprecated as of Tempo 2.7. Features powered by the metrics summary API, like the 
    &lt;a href=&#34;/docs/grafana/next/datasources/tempo/query-editor/traceql-search/#optional-use-aggregate-by&#34;&gt;Aggregate by table&lt;/a&gt;, are also deprecated in Grafana Cloud and Grafana 11.3 and later.
It will be removed in a future release.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The metrics summary API was an early capability in Tempo for generating ad hoc RED metrics at query time.
This data was displayed in the Aggregate by table in Grafana Explore, where you could see request rate, error rate, and latency values of your system over the last hour, computed from your trace data.
Those values were broken down by any and all attributes attached to your traces.&lt;/p&gt;
&lt;p&gt;When you used the “Aggregate by” option, Grafana made a call to Tempo’s metrics summary API, which returned these RED metrics based on spans of &lt;code&gt;kind=server&lt;/code&gt; seen in the last hour.&lt;/p&gt;
&lt;p&gt;The metrics summary API returns RED metrics for &lt;code&gt;kind=server&lt;/code&gt; spans sent to Tempo in the last hour.
The metrics summary feature creates metrics from trace data without using metrics-generator.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;/blog/2023/12/07/traces-to-metrics-ad-hoc-red-metrics-in-grafana-tempo-with-aggregate-by/&#34;&gt;Traces to metrics: Ad hoc RED metrics in Grafana Tempo with &amp;lsquo;Aggregate by&amp;rsquo;&lt;/a&gt; for more information about metrics summary API.&lt;/p&gt;
&lt;p&gt;The metrics summary API and the Aggregate by table have been deprecated in favor of TraceQL metrics.
For more information, refer to 
    &lt;a href=&#34;/docs/enterprise-traces/v2.8.x/api_docs/metrics-summary/#deprecation-in-favor-of-traceql-metrics&#34;&gt;Deprecation in favor of TraceQL metrics&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="metrics-from-traces">Metrics from traces&lt;/h1>
&lt;p>Metrics provide a powerful insight into the systems you are monitoring with your observability strategy.
Instead of running an additional service to generate metrics, you can use Grafana Tempo to generate metrics from traces.&lt;/p></description></item></channel></rss>