<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Use exemplars with Grafana Mimir on Grafana Labs</title><link>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/</link><description>Recent content in Use exemplars with Grafana Mimir on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/mimir/v2.17.x/manage/use-exemplars/index.xml" rel="self" type="application/rss+xml"/><item><title>About Grafana Mimir exemplars</title><link>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/about-exemplars/</link><pubDate>Thu, 14 Aug 2025 18:42:07 +0000</pubDate><guid>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/about-exemplars/</guid><content><![CDATA[&lt;!-- Note: This topic is mounted in the GEM documentation. Ensure that all updates are also applicable to GEM. --&gt;
&lt;h1 id=&#34;about-grafana-mimir-exemplars&#34;&gt;About Grafana Mimir exemplars&lt;/h1&gt;
&lt;p&gt;An exemplar is a specific trace representative of a repeated pattern of data in a given time interval. It helps you identify higher cardinality metadata from specific events within time series data. To learn more about exemplars and how they can help you isolate and troubleshoot problems with your systems, see &lt;a href=&#34;/docs/grafana/latest/basics/exemplars/&#34;&gt;Introduction to exemplars&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Grafana Mimir includes the ability to store exemplars in-memory. Exemplar storage in Grafana Mimir is implemented similarly to how it is in Prometheus. Exemplars are stored as a fixed size circular buffer that stores exemplars in memory for all series.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&#34;../../../configure/configuration-parameters/#limits&#34;&gt;limits&lt;/a&gt; property can be used to control the size of the circular buffer by the number of exemplars. For reference, an exemplar with just a &lt;code&gt;traceID=&amp;lt;jaeger-trace-id&amp;gt;&lt;/code&gt; uses roughly 100 bytes of memory via the in-memory exemplar storage. If the exemplar storage is enabled, Grafana Mimir will also append the exemplars to WAL for local persistence (for WAL duration).&lt;/p&gt;
]]></content><description>&lt;!-- Note: This topic is mounted in the GEM documentation. Ensure that all updates are also applicable to GEM. -->
&lt;h1 id="about-grafana-mimir-exemplars">About Grafana Mimir exemplars&lt;/h1>
&lt;p>An exemplar is a specific trace representative of a repeated pattern of data in a given time interval. It helps you identify higher cardinality metadata from specific events within time series data. To learn more about exemplars and how they can help you isolate and troubleshoot problems with your systems, see &lt;a href="/docs/grafana/latest/basics/exemplars/">Introduction to exemplars&lt;/a>.&lt;/p></description></item><item><title>Before you begin using exemplars with Grafana Mimir</title><link>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/before-you-begin/</link><pubDate>Thu, 14 Aug 2025 18:42:07 +0000</pubDate><guid>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/before-you-begin/</guid><content><![CDATA[&lt;!-- Note: This topic is mounted in the GEM documentation. Ensure that all updates are also applicable to GEM. --&gt;
&lt;h1 id=&#34;before-you-begin-using-exemplars-with-grafana-mimir&#34;&gt;Before you begin using exemplars with Grafana Mimir&lt;/h1&gt;
&lt;p&gt;Follow the checklist to ensure that your application is generating metrics, traces, and exemplars.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Verify that your application is using the official Prometheus client libraries.&lt;/li&gt;
&lt;li&gt;Ensure that the client library you choose is emitting metrics in &lt;a href=&#34;https://openmetrics.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenMetrics&lt;/a&gt; format by referencing its documentation. For the Prometheus Go client library, for example, this requires you to set &lt;code&gt;EnableOpenMetrics&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;. For the Java library, follow &lt;a href=&#34;https://github.com/prometheus/client_java#exemplars&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;its instructions&lt;/a&gt; on setting the proper header format.&lt;/li&gt;
&lt;li&gt;Obtain the trace ID for the current request and include the trace ID in calls to emit metrics.
&lt;ul&gt;
&lt;li&gt;For histograms, use the &lt;code&gt;ObserveWithExemplar&lt;/code&gt; method to emit the trace ID along with a value for the histogram. These functions are from the Go library but you can find similar functions in the other libraries.&lt;/li&gt;
&lt;li&gt;For counters, use the &lt;code&gt;AddWithExemplar&lt;/code&gt; method to emit the trace ID along with a counter increment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Verify that metrics are being generated with exemplars by running the following command in a shell: &lt;code&gt;curl -H &amp;quot;Accept: application/openmetrics-text&amp;quot; http://&amp;lt;your application&amp;gt;/metrics | grep -i &amp;quot;traceid&amp;quot;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Configure your Prometheus server or Grafana Agent to store and send exemplars.
&lt;ul&gt;
&lt;li&gt;To configure Grafana Agent to send exemplars:
&lt;ol&gt;
&lt;li&gt;Confirm that the Agent is scraping exemplars by verifying that the &lt;code&gt;prometheus_remote_storage_exemplars_total&lt;/code&gt; metric is a non-zero value.&lt;/li&gt;
&lt;li&gt;Add the option &lt;code&gt;send_exemplars: true&lt;/code&gt; under the &lt;code&gt;remote_write&lt;/code&gt; configuration block in the Grafana Agent configuration file.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;To configure a Prometheus server to send exemplars:
&lt;ol&gt;
&lt;li&gt;Run Prometheus with the &lt;code&gt;--enable-feature=exemplar-storage&lt;/code&gt; flag.&lt;/li&gt;
&lt;li&gt;Confirm that Prometheus is scraping exemplars by verifying that the &lt;code&gt;prometheus_remote_storage_exemplars_total&lt;/code&gt; metric is a non-zero value.&lt;/li&gt;
&lt;li&gt;Add the option &lt;code&gt;send_exemplars: true&lt;/code&gt; under the &lt;code&gt;remote_write&lt;/code&gt; configuration block in the Prometheus configuration file.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See also:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../store-exemplars/&#34;&gt;Store exemplars in Grafana Mimir&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../view-exemplar-data/&#34;&gt;View exemplar data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/grafana/tns&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;TNS demo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;!-- Note: This topic is mounted in the GEM documentation. Ensure that all updates are also applicable to GEM. -->
&lt;h1 id="before-you-begin-using-exemplars-with-grafana-mimir">Before you begin using exemplars with Grafana Mimir&lt;/h1>
&lt;p>Follow the checklist to ensure that your application is generating metrics, traces, and exemplars.&lt;/p></description></item><item><title>Store exemplars in Grafana Mimir</title><link>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/store-exemplars/</link><pubDate>Thu, 14 Aug 2025 18:42:07 +0000</pubDate><guid>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/store-exemplars/</guid><content><![CDATA[&lt;h1 id=&#34;store-exemplars-in-grafana-mimir&#34;&gt;Store exemplars in Grafana Mimir&lt;/h1&gt;
&lt;p&gt;You can enable exemplar storage in Grafana Mimir and view the resulting data in Grafana.
While exemplars can be enabled for all tenants at once or for only specific tenants, we recommend enabling and enforcing limits for exemplars for only specific tenants.&lt;/p&gt;
&lt;h2 id=&#34;enable-exemplars-globally&#34;&gt;Enable exemplars globally&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In the Grafana Mimir configuration file, set the &lt;code&gt;limits.max_global_exemplars_per_user&lt;/code&gt; value.
Start with a relatively low number (100,000) and adjust it if needed.&lt;/p&gt;
&lt;p&gt;A partial Grafana Mimir configuration file with &lt;code&gt;max_global_exemplars_per_user&lt;/code&gt; set globally looks as follows:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;limits:
  max_global_exemplars_per_user: 100000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save and deploy the configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Perform a rolling update of Grafana Mimir components.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;enable-exemplars-for-a-specific-tenant&#34;&gt;Enable exemplars for a specific tenant&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Ensure Grafana Mimir uses a runtime configuration file by verifying that the flag &lt;code&gt;-runtime-config.file&lt;/code&gt; is set to a non-null value.
For more information about supported runtime configuration, refer to &lt;a href=&#34;../../../configure/about-runtime-configuration/&#34;&gt;Runtime configuration file&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the runtime configuration file, set the &lt;code&gt;overrides.&amp;lt;TENANT&amp;gt;.max_global_exemplars_per_user&lt;/code&gt; value.
Start with a relatively low number (100,000) and adjust it if needed.&lt;/p&gt;
&lt;p&gt;A partial runtime configuration file with &lt;code&gt;max_global_exemplars_per_user&lt;/code&gt; set for a tenant called &amp;ldquo;tenant-a&amp;rdquo; would look as follows:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;overrides:
  &amp;#34;tenant-a&amp;#34;:
    max_global_exemplars_per_user: 100000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save and deploy the runtime configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After the &lt;code&gt;-runtime-config.reload-period&lt;/code&gt; has elapsed, components reload the runtime configuration file and use the updated configuration.&lt;/p&gt;
]]></content><description>&lt;h1 id="store-exemplars-in-grafana-mimir">Store exemplars in Grafana Mimir&lt;/h1>
&lt;p>You can enable exemplar storage in Grafana Mimir and view the resulting data in Grafana.
While exemplars can be enabled for all tenants at once or for only specific tenants, we recommend enabling and enforcing limits for exemplars for only specific tenants.&lt;/p></description></item><item><title>View exemplar data in Grafana Explore</title><link>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/view-exemplar-data/</link><pubDate>Thu, 14 Aug 2025 18:42:07 +0000</pubDate><guid>https://grafana.com/docs/mimir/v2.17.x/manage/use-exemplars/view-exemplar-data/</guid><content><![CDATA[&lt;!-- Note: This topic is mounted in the GEM documentation. Ensure that all updates are also applicable to GEM. --&gt;
&lt;h1 id=&#34;view-exemplar-data-in-grafana-explore&#34;&gt;View exemplar data in Grafana Explore&lt;/h1&gt;
&lt;p&gt;Grafana Explore visualizes exemplar traces as highlighted points alongside metrics data.
For more information, see &lt;a href=&#34;/docs/grafana/latest/basics/exemplars/view-exemplars/#view-exemplar-data&#34;&gt;View exemplar data&lt;/a&gt; topic in Grafana OSS documentation.&lt;/p&gt;
]]></content><description>&lt;!-- Note: This topic is mounted in the GEM documentation. Ensure that all updates are also applicable to GEM. -->
&lt;h1 id="view-exemplar-data-in-grafana-explore">View exemplar data in Grafana Explore&lt;/h1>
&lt;p>Grafana Explore visualizes exemplar traces as highlighted points alongside metrics data.
For more information, see &lt;a href="/docs/grafana/latest/basics/exemplars/view-exemplars/#view-exemplar-data">View exemplar data&lt;/a> topic in Grafana OSS documentation.&lt;/p></description></item></channel></rss>