<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Exemplars on Grafana Labs</title><link>https://grafana.com/docs/enterprise-metrics/v2.2.x/operations/exemplars/</link><description>Recent content in Exemplars on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/enterprise-metrics/v2.2.x/operations/exemplars/index.xml" rel="self" type="application/rss+xml"/><item><title>Prerequisites</title><link>https://grafana.com/docs/enterprise-metrics/v2.2.x/operations/exemplars/prereq_exemplars/</link><pubDate>Mon, 17 Mar 2025 14:18:51 +0100</pubDate><guid>https://grafana.com/docs/enterprise-metrics/v2.2.x/operations/exemplars/prereq_exemplars/</guid><content><![CDATA[&lt;h1 id=&#34;before-you-begin&#34;&gt;Before you begin&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;/ul&gt;
&lt;p&gt;See also:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../enable_exemplars/&#34;&gt;Enable exemplars in GEM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../view_exemplars/&#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;h1 id="before-you-begin">Before you begin&lt;/h1>
&lt;p>Follow the checklist to ensure that your application is generating metrics, traces, and exemplars.&lt;/p>
&lt;ul>
&lt;li>Verify that your application is using the official Prometheus client libraries.&lt;/li>
&lt;li>Ensure that the client library you choose is emitting metrics in &lt;a href="https://openmetrics.io/" target="_blank" rel="noopener noreferrer">OpenMetrics&lt;/a> format by referencing its documentation. For the Prometheus Go client library, for example, this requires you to set &lt;code>EnableOpenMetrics&lt;/code> to &lt;code>true&lt;/code>. For the Java library, follow &lt;a href="https://github.com/prometheus/client_java#exemplars" target="_blank" rel="noopener noreferrer">its instructions&lt;/a> on setting the proper header format.&lt;/li>
&lt;li>Obtain the trace ID for the current request and include the trace ID in calls to emit metrics.
&lt;ul>
&lt;li>For histograms, use the &lt;code>ObserveWithExemplar&lt;/code> 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>
&lt;li>For counters, use the &lt;code>AddWithExemplar&lt;/code> method to emit the trace ID along with a counter increment.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Verify that metrics are being generated with exemplars by running the following command in a shell: &lt;code>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>.&lt;/li>
&lt;/ul>
&lt;p>See also:&lt;/p></description></item><item><title>Enable exemplars</title><link>https://grafana.com/docs/enterprise-metrics/v2.2.x/operations/exemplars/enable_exemplars/</link><pubDate>Mon, 17 Mar 2025 14:18:51 +0100</pubDate><guid>https://grafana.com/docs/enterprise-metrics/v2.2.x/operations/exemplars/enable_exemplars/</guid><content><![CDATA[&lt;h1 id=&#34;enable-exemplars-in-gem&#34;&gt;Enable exemplars in GEM&lt;/h1&gt;
&lt;p&gt;You can enable exemplar storage in Grafana Enterprise Metrics 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;adjust-per-tenant-exemplar-limits-via-the-ui&#34;&gt;Adjust per tenant exemplar limits via the UI&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Open the Grafana Enterprise Metrics plugin in your Grafana instance.&lt;/li&gt;
&lt;li&gt;In the tenants&amp;rsquo; view, select the tenant where you want to adjust the exemplar limit.&lt;/li&gt;
&lt;li&gt;Click the &amp;ldquo;edit&amp;rdquo; icon for the &lt;code&gt;limit max_global_exemplars_per_user&lt;/code&gt; parameter to edit the value. We recommend starting with a relatively low number (10,000) and adjusting it if needed.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The new limit takes effect automatically in all GEM components in five (5) minutes.&lt;/p&gt;
&lt;h2 id=&#34;enable-exemplars-globally&#34;&gt;Enable exemplars globally&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Open the Grafana Enterprise Metrics configuration file.&lt;/li&gt;
&lt;li&gt;In the limits &lt;a href=&#34;../../../config/reference/#limits_config&#34;&gt;config section&lt;/a&gt;, set the &lt;code&gt;max_global_exemplars_per_user&lt;/code&gt; value. We recommend starting with a relatively low number (10,000) and adjusting it if needed.&lt;/li&gt;
&lt;li&gt;Restart all GEM components for the changes to effect.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;See also:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../prereq_exemplars/&#34;&gt;Before you begin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../view_exemplars/&#34;&gt;View exemplar data&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="enable-exemplars-in-gem">Enable exemplars in GEM&lt;/h1>
&lt;p>You can enable exemplar storage in Grafana Enterprise Metrics 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 exemplars</title><link>https://grafana.com/docs/enterprise-metrics/v2.2.x/operations/exemplars/view_exemplars/</link><pubDate>Mon, 17 Mar 2025 14:18:51 +0100</pubDate><guid>https://grafana.com/docs/enterprise-metrics/v2.2.x/operations/exemplars/view_exemplars/</guid><content><![CDATA[&lt;h2 id=&#34;view-exemplar-data&#34;&gt;View exemplar data&lt;/h2&gt;
&lt;p&gt;Explore visualizes exemplar traces as highlighted stars alongside metrics data. For more information, see &lt;a href=&#34;/docs/grafana/latest/basics/exemplars/view-exemplars/#in-explore&#34;&gt;View exemplar data&lt;/a&gt; topic in Grafana OSS documentation.&lt;/p&gt;
&lt;p&gt;See also:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../prereq_exemplars/&#34;&gt;Before you begin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../enable_exemplars/&#34;&gt;Enable exemplars in GEM&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h2 id="view-exemplar-data">View exemplar data&lt;/h2>
&lt;p>Explore visualizes exemplar traces as highlighted stars alongside metrics data. For more information, see &lt;a href="/docs/grafana/latest/basics/exemplars/view-exemplars/#in-explore">View exemplar data&lt;/a> topic in Grafana OSS documentation.&lt;/p>
&lt;p>See also:&lt;/p></description></item></channel></rss>