<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Add metrics and traces on Grafana Labs</title><link>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/</link><description>Recent content in Add metrics and traces on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/index.xml" rel="self" type="application/rss+xml"/><item><title>What metrics and traces add</title><link>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/30-what-traces-and-metrics-add/</link><pubDate>Thu, 19 Nov 2026 14:12:27 -0600</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/30-what-traces-and-metrics-add/</guid><content><![CDATA[&lt;h1 id=&#34;what-metrics-and-traces-add&#34;&gt;What metrics and traces add&lt;/h1&gt;
&lt;p&gt;Each generation links to its OpenTelemetry trace, and the SDK emits metrics you can query in Prometheus. Both are separate from generation data and need an export setup that generation data does not.&lt;/p&gt;
&lt;h2 id=&#34;what-the-trace-shows&#34;&gt;What the trace shows&lt;/h2&gt;
&lt;p&gt;Select the trace link on a generation to open the trace view in Tempo, where you can inspect the full span tree, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;LLM call duration and error status&lt;/li&gt;
&lt;li&gt;Tool execution spans&lt;/li&gt;
&lt;li&gt;Nested agent invocations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each span describes one call, with details such as the model provider, the model name, and token usage. Use the trace to identify latency bottlenecks, understand tool call sequences, and diagnose timeout or error scenarios.&lt;/p&gt;
&lt;h2 id=&#34;what-the-metrics-show&#34;&gt;What the metrics show&lt;/h2&gt;
&lt;p&gt;The SDK emits these OpenTelemetry metrics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;LLM call duration&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Token consumption per call&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Streaming time to first token&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tool calls per generation&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you need custom dashboards, query these metrics in Prometheus.&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;To compare activity and performance in the agent catalog, set an agent name in your instrumentation and export OpenTelemetry metrics.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

]]></content><description>&lt;h1 id="what-metrics-and-traces-add">What metrics and traces add&lt;/h1>
&lt;p>Each generation links to its OpenTelemetry trace, and the SDK emits metrics you can query in Prometheus. Both are separate from generation data and need an export setup that generation data does not.&lt;/p></description></item><item><title>Two Instance IDs</title><link>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/31-two-instance-ids/</link><pubDate>Thu, 19 Nov 2026 14:12:27 -0600</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/31-two-instance-ids/</guid><content><![CDATA[&lt;h1 id=&#34;two-instance-ids&#34;&gt;Two Instance IDs&lt;/h1&gt;
&lt;p&gt;To send OpenTelemetry metrics and traces directly to Grafana Cloud, you also need an OTLP endpoint URL and an OTLP instance ID.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;OTLP endpoint URL&lt;/strong&gt;, the address OpenTelemetry exporters send metrics and traces to. It is the value for &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;OTLP Instance ID&lt;/strong&gt;. An Instance ID is a numeric Grafana Cloud stack ID. This one is the &lt;strong&gt;basic auth&lt;/strong&gt; username for OTLP. Basic auth uses a username and a secret: this Instance ID is the username, and the access policy token is the secret.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;how-to-locate-the-otlp-endpoint-url-and-instance-id&#34;&gt;How to locate the OTLP endpoint URL and Instance ID&lt;/h2&gt;
&lt;p&gt;The page at &lt;code&gt;https://grafana.com/orgs/&amp;lt;org&amp;gt;/stacks/&amp;lt;stack-id&amp;gt;&lt;/code&gt; shows a card for each product on your stack, and each card contains information about that product. The &lt;strong&gt;OpenTelemetry&lt;/strong&gt; card shows the OTLP endpoint URL and the Instance ID.&lt;/p&gt;
&lt;h2 id=&#34;the-two-instance-ids-can-differ&#34;&gt;The two Instance IDs can differ&lt;/h2&gt;
&lt;p&gt;The Instance ID on the OpenTelemetry card is not necessarily the same as the Agent Observability &lt;strong&gt;Instance ID&lt;/strong&gt; you copied from the setup screen and use as &lt;code&gt;AGENTO11Y_AUTH_TENANT_ID&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;learning-hub-image&#34;&gt;
  &lt;a href=&#34;two-instance-ids.svg&#34; title=&#34;The Instance ID on the setup screen in Agent Observability is a numeric stack ID used as AGENTO11Y_AUTH_TENANT_ID. The Instance ID on the OpenTelemetry card on the Grafana Cloud portal is the basic auth username for OTLP.&#34;&gt;
    &lt;img
      
      
      class=&#34;d-inline-block&#34;
      src=&#34;two-instance-ids.svg&#34;
      
      alt=&#34;The Instance ID on the setup screen in Agent Observability is a numeric stack ID used as AGENTO11Y_AUTH_TENANT_ID. The Instance ID on the OpenTelemetry card on the Grafana Cloud portal is the basic auth username for OTLP.&#34; width=&#34;1000&#34; height=&#34;310&#34;/&gt;
    &lt;div class=&#34;learning-hub-image__zoom&#34;&gt;
      &lt;svg width=&#34;24&#34; height=&#34;24&#34; viewBox=&#34;0 0 24 24&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
        &lt;path d=&#34;M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
        &lt;path d=&#34;M10 7V13M7 10H13&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34;/&gt;
      &lt;/svg&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;Use the number shown on the card for OTLP.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;why-not-to-generate-a-second-token&#34;&gt;Why not to generate a second token&lt;/h2&gt;
&lt;p&gt;The access policy token already covers the OTLP scopes because you selected &lt;code&gt;metrics:write&lt;/code&gt;, &lt;code&gt;logs:write&lt;/code&gt;, and &lt;code&gt;traces:write&lt;/code&gt; when you created the access policy.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;Don&amp;rsquo;t click &lt;strong&gt;Generate now&lt;/strong&gt; on the OpenTelemetry card.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

]]></content><description>&lt;h1 id="two-instance-ids">Two Instance IDs&lt;/h1>
&lt;p>To send OpenTelemetry metrics and traces directly to Grafana Cloud, you also need an OTLP endpoint URL and an OTLP instance ID.&lt;/p></description></item><item><title>Direct export or a collector</title><link>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/32-direct-export-or-a-collector/</link><pubDate>Thu, 19 Nov 2026 14:12:27 -0600</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/32-direct-export-or-a-collector/</guid><content><![CDATA[&lt;h1 id=&#34;direct-export-or-a-collector&#34;&gt;Direct export or a collector&lt;/h1&gt;
&lt;p&gt;The hands-on exercise in this section sends OTLP data directly to the Grafana Cloud OTLP gateway. The other route, a local Grafana Alloy or OpenTelemetry Collector, is covered below so you recognize it later.&lt;/p&gt;

&lt;div class=&#34;learning-hub-image&#34;&gt;
  &lt;a href=&#34;direct-export-or-a-collector.svg&#34; title=&#34;In direct export, your application holds the credentials and exports OTLP data to the Grafana Cloud OTLP gateway. With a collector, your application exports unauthenticated OTLP to http://localhost:4318, and Grafana Alloy or the OpenTelemetry Collector receives it and forwards it to Grafana Cloud with credentials.&#34;&gt;
    &lt;img
      
      
      class=&#34;d-inline-block&#34;
      src=&#34;direct-export-or-a-collector.svg&#34;
      
      alt=&#34;In direct export, your application holds the credentials and exports OTLP data to the Grafana Cloud OTLP gateway. With a collector, your application exports unauthenticated OTLP to http://localhost:4318, and Grafana Alloy or the OpenTelemetry Collector receives it and forwards it to Grafana Cloud with credentials.&#34; width=&#34;1000&#34; height=&#34;480&#34;/&gt;
    &lt;div class=&#34;learning-hub-image__zoom&#34;&gt;
      &lt;svg width=&#34;24&#34; height=&#34;24&#34; viewBox=&#34;0 0 24 24&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
        &lt;path d=&#34;M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
        &lt;path d=&#34;M10 7V13M7 10H13&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34;/&gt;
      &lt;/svg&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;h2 id=&#34;direct-export&#34;&gt;Direct export&lt;/h2&gt;
&lt;p&gt;With direct export, no collector needed. The OTLP endpoint and optional auth headers are set through environment variables. In the hands-on exercise you set two:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt;:&lt;/strong&gt; the endpoint URL from the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; card, including &lt;code&gt;/otlp&lt;/code&gt; but excluding paths such as &lt;code&gt;/v1/traces&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt;:&lt;/strong&gt; &lt;code&gt;Authorization=Basic &amp;lt;BASE64_CREDENTIALS&amp;gt;&lt;/code&gt;, with a plain space after &lt;code&gt;Basic&lt;/code&gt;, where &lt;code&gt;&amp;lt;BASE64_CREDENTIALS&amp;gt;&lt;/code&gt; is the Base64-encoded OTLP instance ID and access policy token.&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;Python exporters older than &lt;code&gt;opentelemetry-exporter-otlp-proto-http&lt;/code&gt; 1.27.0 reject the space and log &lt;code&gt;Header format invalid&lt;/code&gt;. On one of those, upgrade the exporter or write &lt;code&gt;Basic%20&amp;lt;BASE64_CREDENTIALS&amp;gt;&lt;/code&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The documented command prints &lt;code&gt;&amp;lt;OTLP_INSTANCE_ID&amp;gt;:&amp;lt;ACCESS_POLICY_TOKEN&amp;gt;&lt;/code&gt;, pipes it through &lt;code&gt;base64&lt;/code&gt;, then through &lt;code&gt;tr -d &#39;\n&#39;&lt;/code&gt;.&lt;/p&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 &lt;code&gt;tr -d &#39;\n&#39;&lt;/code&gt; is not optional. &lt;code&gt;base64&lt;/code&gt; adds a trailing newline that invalidates the header.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Base64, which is a standard encoding that turns the &lt;code&gt;instance-id:token&lt;/code&gt; pair into one string the header can carry, is not encryption. Keep the encoded value as secret as the token.&lt;/p&gt;
&lt;h2 id=&#34;a-collector&#34;&gt;A collector&lt;/h2&gt;
&lt;p&gt;A local Grafana Alloy or OpenTelemetry Collector receives unauthenticated OTLP from your application and forwards it to Grafana Cloud with credentials. Your application then points &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt; at &lt;code&gt;http://localhost:4318&lt;/code&gt; instead of the gateway, and you can skip the OpenTelemetry card.&lt;/p&gt;
&lt;p&gt;A collector gives you centralized token management, retries, relabeling, and metadata enrichment, at the cost of running another process. &lt;strong&gt;Relabeling&lt;/strong&gt;, which is changing or dropping labels on your metrics and traces before they are stored, and &lt;strong&gt;metadata enrichment&lt;/strong&gt;, which is adding fields such as the host or environment, both happen in the collector. For how Alloy does each one, refer to &lt;a href=&#34;/docs/alloy/latest/reference/components/otelcol/otelcol.processor.attributes/&#34;&gt;otelcol.processor.attributes&lt;/a&gt; for relabeling and &lt;a href=&#34;/docs/alloy/latest/reference/components/otelcol/otelcol.processor.resourcedetection/&#34;&gt;otelcol.processor.resourcedetection&lt;/a&gt; for metadata enrichment. This journey does not set up a collector.&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;With this SDK setup, Alloy or the Collector forwards metrics and traces only. Generation data goes directly to the Agent Observability API.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

]]></content><description>&lt;h1 id="direct-export-or-a-collector">Direct export or a collector&lt;/h1>
&lt;p>The hands-on exercise in this section sends OTLP data directly to the Grafana Cloud OTLP gateway. The other route, a local Grafana Alloy or OpenTelemetry Collector, is covered below so you recognize it later.&lt;/p></description></item><item><title>Where the providers go in your sample</title><link>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/33-where-the-providers-go-in-your-sample/</link><pubDate>Thu, 19 Nov 2026 14:12:27 -0600</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/33-where-the-providers-go-in-your-sample/</guid><content><![CDATA[&lt;h1 id=&#34;where-the-providers-go-in-your-sample&#34;&gt;Where the providers go in your sample&lt;/h1&gt;
&lt;p&gt;A &lt;code&gt;TracerProvider&lt;/code&gt; and a &lt;code&gt;MeterProvider&lt;/code&gt; are OpenTelemetry SDK objects your application creates. The Agent Observability SDK records its spans and metrics through them, and they pass that data to an exporter, which sends it over OTLP. The Agent Observability SDK does not create the providers.&lt;/p&gt;

&lt;div class=&#34;learning-hub-image&#34;&gt;
  &lt;a href=&#34;two-libraries-two-providers.svg&#34; title=&#34;Inside your application, the Agent Observability SDK emits OpenTelemetry spans and metrics internally. Your application&amp;#39;s TracerProvider and MeterProvider export the spans and metrics over OTLP to the OTLP endpoint. Generation data goes directly to the Agent Observability API.&#34;&gt;
    &lt;img
      
      
      class=&#34;d-inline-block&#34;
      src=&#34;two-libraries-two-providers.svg&#34;
      
      alt=&#34;Inside your application, the Agent Observability SDK emits OpenTelemetry spans and metrics internally. Your application&amp;#39;s TracerProvider and MeterProvider export the spans and metrics over OTLP to the OTLP endpoint. Generation data goes directly to the Agent Observability API.&#34; width=&#34;1000&#34; height=&#34;460&#34;/&gt;
    &lt;div class=&#34;learning-hub-image__zoom&#34;&gt;
      &lt;svg width=&#34;24&#34; height=&#34;24&#34; viewBox=&#34;0 0 24 24&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
        &lt;path d=&#34;M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
        &lt;path d=&#34;M10 7V13M7 10H13&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34;/&gt;
      &lt;/svg&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;h2 id=&#34;the-two-providers&#34;&gt;The two providers&lt;/h2&gt;
&lt;p&gt;Your sample constructs the Agent Observability client, captures a generation, and calls &lt;code&gt;client.shutdown()&lt;/code&gt;. In Milestone 7 you edit that same file: you add a &lt;code&gt;TracerProvider&lt;/code&gt; and a &lt;code&gt;MeterProvider&lt;/code&gt; above the line that constructs the client, shut them down after &lt;code&gt;client.shutdown()&lt;/code&gt;, and rerun the sample.&lt;/p&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 position in the file matters. If the providers are created after the client, traces and metrics are silently lost.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The SDK configuration page has the snippet for each supported language. The Python snippet adds:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;TracerProvider&lt;/code&gt; with an OTLP span exporter.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;MeterProvider&lt;/code&gt; with an OTLP metric exporter.&lt;/li&gt;
&lt;li&gt;One resource for both providers, &lt;code&gt;Resource.create({&amp;quot;service.name&amp;quot;: &amp;quot;my-agent&amp;quot;})&lt;/code&gt;, which carries one named value, the &lt;strong&gt;&lt;code&gt;service.name&lt;/code&gt;&lt;/strong&gt; attribute set to &lt;code&gt;my-agent&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The snippet shuts down the providers after &lt;code&gt;client.shutdown()&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;what-the-opentelemetry-sdk-reads-from-the-environment&#34;&gt;What the OpenTelemetry SDK reads from the environment&lt;/h2&gt;
&lt;p&gt;Set the OTLP endpoint and any auth headers through environment variables. The OpenTelemetry SDK exporters read them automatically. Generation data goes directly to the Agent Observability API.&lt;/p&gt;
]]></content><description>&lt;h1 id="where-the-providers-go-in-your-sample">Where the providers go in your sample&lt;/h1>
&lt;p>A &lt;code>TracerProvider&lt;/code> and a &lt;code>MeterProvider&lt;/code> are OpenTelemetry SDK objects your application creates. The Agent Observability SDK records its spans and metrics through them, and they pass that data to an exporter, which sends it over OTLP. The Agent Observability SDK does not create the providers.&lt;/p></description></item><item><title>Export metrics and traces</title><link>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/34-export-traces-and-metrics/</link><pubDate>Thu, 19 Nov 2026 14:12:27 -0600</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/34-export-traces-and-metrics/</guid><content><![CDATA[&lt;h1 id=&#34;export-metrics-and-traces&#34;&gt;Export metrics and traces&lt;/h1&gt;
&lt;p&gt;Go back to the Grafana Cloud tab where you opened the learning path and complete Milestone 7, then return here. If you closed that tab, open the path again from the card below. When you rerun your agent, check your Grafana Cloud &lt;strong&gt;Traces&lt;/strong&gt; and &lt;strong&gt;Metrics&lt;/strong&gt; data sources for SDK-emitted spans and metrics.&lt;/p&gt;









  
    
  
  
    
  
&lt;div class=&#34;learning-path-card&#34;&gt;
  




  
  
    
  


&lt;div class=&#34;pathway-row__label mb-1&#34;&gt;
  
  &lt;svg width=&#34;40&#34; height=&#34;40&#34; viewBox=&#34;0 0 40 40&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&lt;rect x=&#34;0.5&#34; y=&#34;0.5&#34; width=&#34;39&#34; height=&#34;39&#34; rx=&#34;3.5&#34; fill=&#34;white&#34; stroke=&#34;#D8D8DF&#34;&gt;&lt;/rect&gt;&lt;path d=&#34;M8 20H14C16.5 20 18.5 18 18.5 15.5V12&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;&gt;&lt;/path&gt;&lt;path d=&#34;M8 20H14C16.5 20 18.5 22 18.5 24.5V28&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;&gt;&lt;/path&gt;&lt;path d=&#34;M14 20H32&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;&gt;&lt;/path&gt;&lt;circle cx=&#34;18.5&#34; cy=&#34;12&#34; r=&#34;2&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;2&#34; fill=&#34;white&#34;&gt;&lt;/circle&gt;&lt;circle cx=&#34;18.5&#34; cy=&#34;28&#34; r=&#34;2&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;2&#34; fill=&#34;white&#34;&gt;&lt;/circle&gt;&lt;path d=&#34;M29 17L32 20L29 23&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;&gt;&lt;/path&gt;&lt;/svg&gt;

  Learning path
&lt;/div&gt;

&lt;h4&gt;Connect an agent to Agent Observability&lt;/h4&gt;
&lt;p&gt;Enable Agent Observability on a Grafana Cloud stack, authenticate the SDK, capture your agent&amp;#39;s first generation, find it in Conversations, and export its traces and metrics.&lt;/p&gt;

&lt;div class=&#34;d-sm-flex gap-half mb-2&#34;&gt;
  &lt;div class=&#34;d-flex align-items-center gap-half text-gray-12 mt-half body-small&#34;&gt;
    &lt;div class=&#34;journey-list__icon&#34;&gt;
  &lt;svg width=&#34;24&#34; height=&#34;24&#34; viewBox=&#34;0 0 24 24&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
  &lt;path fill-rule=&#34;evenodd&#34; clip-rule=&#34;evenodd&#34; d=&#34;M11.9995 22.5039C17.7985 22.5039 22.4995 17.8029 22.4995 12.0039C22.4995 6.20492 17.7985 1.50391 11.9995 1.50391C6.20052 1.50391 1.49951 6.20492 1.49951 12.0039C1.49951 17.8029 6.20052 22.5039 11.9995 22.5039Z&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path d=&#34;M11.9995 12.0039V8.25391&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path d=&#34;M11.9995 12.0078L16.6865 16.6958&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;/svg&gt;
&lt;/div&gt;
    &lt;span&gt;18 min&lt;/span&gt;
  &lt;/div&gt;
  
  &lt;div class=&#34;d-flex align-items-center gap-half text-gray-12 mt-half body-small&#34;&gt;
    &lt;div class=&#34;journey-list__icon&#34;&gt;
  &lt;svg width=&#34;24&#34; height=&#34;25&#34; viewBox=&#34;0 0 24 25&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
  &lt;path fill-rule=&#34;evenodd&#34; clip-rule=&#34;evenodd&#34; d=&#34;M0.75 9.83984C0.75 7.6307 2.54086 5.83984 4.75 5.83984H19.25C21.4591 5.83984 23.25 7.6307 23.25 9.83984V19.1198C23.25 21.329 21.4591 23.1198 19.25 23.1198H4.75C2.54086 23.1198 0.75 21.329 0.75 19.1198V9.83984Z&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path fill-rule=&#34;evenodd&#34; clip-rule=&#34;evenodd&#34; d=&#34;M14.25 1.52344H9.75C8.92157 1.52344 8.25 2.16815 8.25 2.96344V5.84344H15.75V2.96344C15.75 2.16815 15.0784 1.52344 14.25 1.52344Z&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path fill-rule=&#34;evenodd&#34; clip-rule=&#34;evenodd&#34; d=&#34;M12 15.923C12.8284 15.923 13.5 15.2783 13.5 14.483C13.5 13.6877 12.8284 13.043 12 13.043C11.1716 13.043 10.5 13.6877 10.5 14.483C10.5 15.2783 11.1716 15.923 12 15.923Z&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path fill-rule=&#34;evenodd&#34; clip-rule=&#34;evenodd&#34; d=&#34;M13.2742 8.91315L13.7162 10.309C13.8671 10.7897 14.3806 11.0756 14.8902 10.9628L16.3622 10.6354C16.9349 10.5115 17.5249 10.7602 17.8175 11.2488C18.11 11.7374 18.037 12.3519 17.6372 12.7647L16.6062 13.8312C16.2493 14.1997 16.2493 14.7703 16.6062 15.1388L17.6372 16.2053C18.0379 16.6179 18.1115 17.2331 17.8188 17.7222C17.526 18.2113 16.9353 18.4601 16.3622 18.3356L14.8902 18.0082C14.3806 17.8953 13.8671 18.1812 13.7162 18.662L13.2742 20.0559C13.1055 20.5961 12.5877 20.9661 12.0002 20.9661C11.4128 20.9661 10.8949 20.5961 10.7262 20.0559L10.2842 18.661C10.1333 18.1803 9.61982 17.8944 9.11021 18.0072L7.63821 18.3346C7.06469 18.4597 6.47325 18.2109 6.18034 17.7213C5.88742 17.2317 5.96161 16.6159 6.36321 16.2034L7.39421 15.1368C7.75116 14.7684 7.75116 14.1978 7.39421 13.8293L6.36321 12.7628C5.96346 12.35 5.89039 11.7354 6.18296 11.2468C6.47553 10.7582 7.06551 10.5096 7.63821 10.6335L9.11021 10.9608C9.61923 11.0739 10.1324 10.7889 10.2842 10.309L10.7262 8.91507C10.8944 8.37473 11.412 8.00435 11.9995 8.00391C12.5869 8.00346 13.1051 8.37307 13.2742 8.91315V8.91315Z&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;/svg&gt;
&lt;/div&gt;
    &lt;span&gt;Beginner&lt;/span&gt;
  &lt;/div&gt;
  
  
  &lt;div class=&#34;d-flex align-items-center gap-half text-gray-12 mt-half body-small&#34;&gt;
    &lt;div class=&#34;journey-list__icon&#34;&gt;
  &lt;svg width=&#34;24&#34; height=&#34;24&#34; viewBox=&#34;0 0 24 24&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
  &lt;path fill-rule=&#34;evenodd&#34; clip-rule=&#34;evenodd&#34; d=&#34;M0.75 2.75C0.75 1.64543 1.64543 0.75 2.75 0.75H21.25C22.3546 0.75 23.25 1.64543 23.25 2.75V21.25C23.25 22.3546 22.3546 23.25 21.25 23.25H2.75C1.64543 23.25 0.75 22.3546 0.75 21.25V2.75Z&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path d=&#34;M12 4.5L7.5 10.5L4.5 7.5&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path d=&#34;M14.25 8.25H18.75&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path d=&#34;M12 13.5L7.5 19.5L4.5 16.5&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
  &lt;path d=&#34;M14.25 17.25H18.75&#34; stroke=&#34;#FF671D&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;/svg&gt;
&lt;/div&gt;
    &lt;span&gt;Docs &amp;amp; blog posts&lt;/span&gt;
  &lt;/div&gt;
  
&lt;/div&gt;










  






&lt;div class=&#34;pathfinder-cta orange-outline-list br-12 border-color-orange-flat border-width-2 p-1-5 pb-1&#34; x3-data=&#34;selectStack(&#39;/docs/learning-paths/connect-agent-to-agent-observability&#39;, { packageId: &#39;connect-agent-to-agent-observability-lj&#39; })&#34;&gt;
  &lt;div class=&#34;icon-heading d-flex&#34;&gt;
    &lt;div class=&#34;icon-heading__container&#34;&gt;
  &lt;svg width=&#34;30&#34; height=&#34;30&#34; viewBox=&#34;0 0 25 26&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
  &lt;path d=&#34;M16.1401 14.4402C16.2141 14.4402 16.2852 14.4101 16.3373 14.3581C16.5355 14.1569 21.1904 9.39886 21.1904 5.0513C21.1904 2.26537 18.924 0 16.1391 0C13.3541 0 11.0878 2.26537 11.0878 5.0513C11.0878 9.39886 15.7427 14.1569 15.9419 14.3581C15.9939 14.4111 16.065 14.4402 16.1401 14.4402ZM13.5814 5.0513C13.5814 3.63882 14.7266 2.49262 16.1401 2.49262C17.5536 2.49262 18.6978 3.63781 18.6978 5.0513C18.6978 6.46478 17.5526 7.60999 16.1401 7.60999C14.7276 7.60999 13.5814 6.46478 13.5814 5.0513Z&#34; fill=&#34;#FF671D&#34;/&gt;
  &lt;path d=&#34;M24.9034 21.9305C24.0595 18.9113 17.9561 17.4147 12.5704 16.0933C9.54023 15.3496 5.76827 14.4246 5.73524 13.6037C5.72823 13.4225 5.97949 12.7398 9.52922 11.5516C9.80551 11.4585 9.96668 11.1842 9.91262 10.8989C9.85856 10.6136 9.60229 10.4164 9.318 10.4304C4.13956 10.6807 0.501743 12.1602 0.0482666 14.1993C-0.172966 15.1944 0.26149 16.749 3.58398 18.5009L4.29773 18.8763C6.54509 20.0545 8.16879 20.9064 8.1808 21.6992C8.19482 22.6502 5.93745 24.0507 3.72713 25.296C3.58398 25.3761 3.5139 25.5433 3.55495 25.7024C3.59699 25.8616 3.74014 25.9717 3.90431 25.9717H23.0354C23.1315 25.9717 23.2226 25.9337 23.2907 25.8656C24.6971 24.4581 25.2397 23.1347 24.9034 21.9305Z&#34; fill=&#34;#FBC55A&#34;/&gt;
&lt;/svg&gt;
&lt;/div&gt;
    &lt;div class=&#34;no-anchor-heading&#34;&gt;
      &lt;h4&gt;Open in Grafana Cloud&lt;/h4&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&#34;mt-1&#34;&gt;
    &lt;p class=&#34;mb-1 maxw-650&#34;&gt;
      
      Complete this learning path directly in your Grafana Cloud stack with an interactive learning experience.
      
    &lt;/p&gt;
    &lt;div class=&#34;d-flex column-gap-1 justify-content-end&#34;&gt;
      
      &lt;a
        x3-bind:href=&#34;launchUrl&#34;
        class=&#34;btn btn--primary br-8&#34;
        target=&#34;_blank&#34;
        rel=&#34;noopener noreferrer&#34;
        x3-on:click=&#34;trackPathfinderClick(&#39;connect-agent-to-agent-observability&#39;, &#39;Connect an agent to Agent Observability&#39;)&#34;&gt;
        Open in Grafana Cloud
      &lt;/a&gt;
      
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;mt-1&#34;&gt;
  &lt;a
    href=&#34;/docs/learning-paths/connect-agent-to-agent-observability/&#34;
    target=&#34;_blank&#34;
    rel=&#34;noopener noreferrer&#34;
    class=&#34;btn btn--outline arrow w-100p br-8&#34;
    x3-on:click=&#34;$dispatch(&#39;track-view-on-website&#39;, {
      pathId: &#39;connect-agent-to-agent-observability&#39;,
      pathTitle: &#39;Connect an agent to Agent Observability&#39;
    })&#34;&gt;
    View on website
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;



&lt;h2 id=&#34;when-you-finish&#34;&gt;When you finish&lt;/h2&gt;
&lt;p&gt;Your Grafana Cloud &lt;strong&gt;Traces&lt;/strong&gt; and &lt;strong&gt;Metrics&lt;/strong&gt; data sources now have SDK-emitted spans and metrics.&lt;/p&gt;
]]></content><description>&lt;h1 id="export-metrics-and-traces">Export metrics and traces&lt;/h1>
&lt;p>Go back to the Grafana Cloud tab where you opened the learning path and complete Milestone 7, then return here. If you closed that tab, open the path again from the card below. When you rerun your agent, check your Grafana Cloud &lt;strong>Traces&lt;/strong> and &lt;strong>Metrics&lt;/strong> data sources for SDK-emitted spans and metrics.&lt;/p></description></item><item><title>When traces or metrics don't arrive</title><link>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/35-when-traces-or-metrics-dont-arrive/</link><pubDate>Thu, 19 Nov 2026 14:12:27 -0600</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/35-when-traces-or-metrics-dont-arrive/</guid><content><![CDATA[&lt;h1 id=&#34;when-traces-or-metrics-dont-arrive&#34;&gt;When traces or metrics don&amp;rsquo;t arrive&lt;/h1&gt;
&lt;p&gt;Your generation is in &lt;strong&gt;Conversations&lt;/strong&gt;, but no span or metric from the SDK has reached your Grafana Cloud Traces or Metrics data source. These are the export setup facts this route depends on.&lt;/p&gt;
&lt;h2 id=&#34;the-export-setup&#34;&gt;The export setup&lt;/h2&gt;
&lt;p&gt;Each one is a value you set while exporting metrics and traces.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Providers are configured before the client.&lt;/strong&gt; Your application must configure a &lt;code&gt;TracerProvider&lt;/code&gt; and &lt;code&gt;MeterProvider&lt;/code&gt; before creating the Agent Observability client. Without them, SDK-emitted metrics and traces are dropped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Base64 header has no trailing newline.&lt;/strong&gt; &lt;code&gt;base64&lt;/code&gt; adds a trailing newline that invalidates the header, so the &lt;code&gt;tr -d &#39;\n&#39;&lt;/code&gt; in the command is not optional.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use the OTLP Instance ID.&lt;/strong&gt; The Base64 value encodes the &lt;strong&gt;Instance ID&lt;/strong&gt; from the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; card, which can differ from the Agent Observability Instance ID.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your token covers the OTLP scopes.&lt;/strong&gt; The access policy token already covers the OTLP scopes if you selected them when you created the access policy.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="when-traces-or-metrics-dont-arrive">When traces or metrics don&amp;rsquo;t arrive&lt;/h1>
&lt;p>Your generation is in &lt;strong>Conversations&lt;/strong>, but no span or metric from the SDK has reached your Grafana Cloud Traces or Metrics data source. These are the export setup facts this route depends on.&lt;/p></description></item><item><title>Resources</title><link>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/36-resources/</link><pubDate>Thu, 19 Nov 2026 14:12:27 -0600</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-agent-observability/07-add-traces-and-metrics/36-resources/</guid><content><![CDATA[&lt;h1 id=&#34;resources&#34;&gt;Resources&lt;/h1&gt;
&lt;p&gt;These pages cover the trace and metric export setup, the provider snippets for each language, the metrics the SDK emits, and the trace link on a generation.&lt;/p&gt;
&lt;h2 id=&#34;documentation&#34;&gt;Documentation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/observe-and-act/agent-observability/get-started/grafana-cloud/#set-up-traces-and-metrics&#34;&gt;Set up Agent Observability in Grafana Cloud: Set up metrics and traces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/observe-and-act/agent-observability/instrumentation/sdk/#opentelemetry-setup&#34;&gt;Configure the Agent Observability SDK: OpenTelemetry setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/observe-and-act/agent-observability/instrumentation/sdk/#opentelemetry-metrics&#34;&gt;Configure the Agent Observability SDK: OpenTelemetry metrics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/observe-and-act/agent-observability/observe-and-troubleshoot/conversations/#drill-down-into-traces&#34;&gt;Browse and debug conversations: Drill down into traces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/observe-and-act/agent-observability/observe-and-troubleshoot/dashboards/#use-prometheus-metrics-directly&#34;&gt;Monitor agents with analytics: Use Prometheus metrics directly&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- NOTE (planned swap, outline slide 36 row): when Journey 2, Investigate agents and costs with Agent Observability, publishes, the author decides whether to add its link here. The Resources template carries no &#34;Continue learning&#34; section, so nothing is added until then. --&gt;
&lt;h2 id=&#34;community&#34;&gt;Community&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://community.grafana.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Community Forums&lt;/a&gt; to ask questions and share what you found&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://slack.grafana.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Slack&lt;/a&gt; to talk with other users&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="resources">Resources&lt;/h1>
&lt;p>These pages cover the trace and metric export setup, the provider snippets for each language, the metrics the SDK emits, and the trace link on a generation.&lt;/p></description></item></channel></rss>