<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title><![CDATA[Miriam Aparicio - Elastic Observability Labs]]></title>
    <description><![CDATA[Trusted security news & research from the team at Elastic.]]></description>
    <copyright><![CDATA[© 2026. Elasticsearch B.V. All Rights Reserved]]></copyright>
    <image>
      <title><![CDATA[Miriam Aparicio - Elastic Observability Labs]]></title>
      <url>https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltad972c1c27dbefc6/6a88d9782904ea5e8511d473/observability-labs-thumbnail.png</url>
      <link>https://www.elastic.co/observability-labs/author/miriam-aparicio</link>
    </image>
    <link>https://www.elastic.co/observability-labs/author/miriam-aparicio</link>
    <atom:link href="https://www.elastic.co/observability-labs/rss/author/miriam-aparicio.xml" rel="self" type="application/rss+xml"/>
    <language><![CDATA[en]]></language>
    <lastBuildDate>Tue, 24 Nov 2026 14:27:11 GMT</lastBuildDate>
  <item>
    <title><![CDATA[From a checkout alert to the failing span: Investigating with the Elastic AI Agent and Elastic APM flyouts]]></title>
    <description><![CDATA[We didn’t take the agent’s root cause on trust. The service map and the trace backed it up, and one ES|QL query put a number on it: 80 of 138 gold-tier charges failed, and no other tier did.]]></description>
    <content:encoded><![CDATA[<p>A checkout alert fired at a 25% failure rate, two services upstream of the root cause. The<a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/builtin-agents-reference"> Elastic AI Agent</a> read the alert and moved the problem off the front end. The payment service was rejecting card charges with “Invalid token,” which passed up through checkout as a failed order. So we looked into it. </p><p>Selecting payment on the agent’s service map opened the Elastic APM service flyout and then the failing transaction, the full trace, and the span that threw. The stack trace pointed at line 37 of charge.js. One Elasticsearch Query Language (ES|QL) query settled the part that the agent was unsure about: over 30 minutes, 80 of 138 gold-tier charges failed, and no other tier did.</p><p>In this blog post, we follow that investigation end to end on the <a href="https://github.com/elastic/opentelemetry-demo">OpenTelemetry (OTel) Demo</a> and Elastic Observability 9.6.</p><p>The following diagram shows the three ways in. An alert or the full service map sends its context to the AI Agent, which answers with a service map of its own. Selecting a service there or a <code>service.name</code> value in Discover opens the service flyout.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt8c957adb61e7ccdc/6aede202371a186000610bf7/image4.png" alt="APM root cause analysis flow: alert or service map into the Elastic AI Agent, then service to span flyouts" /><h2><strong>Set up a payment fault in the OTel Demo</strong></h2><p>The OTel Demo is an online shop built from services written in many languages and instrumented with OTel SDKs. We ran <a href="https://github.com/elastic/opentelemetry-demo">Elastic's fork of the demo</a> (version 2.2.1) against a local Elastic Stack 9.6 deployment. It sends its traces, metrics, and logs through the <a href="https://www.elastic.co/docs/reference/opentelemetry/edot-collector">Elastic Agent 9.5.5 running in OpenTelemetry mode</a>.</p><p>The demo ships with feature flags that inject faults, served by its feature flag service, <code>flagd</code>. We set the <code>paymentFailure</code> flag to 25%. The payment service then fails a quarter of its charge requests, and it marks every request it fails with <code>app.loyalty.level=gold</code>.</p><p>Shoppers don't see the payment service. They see orders that fail at checkout, so our alert watches checkout from the shopper's side: a failed transaction rate threshold rule on the front end's <code>POST /api/checkout</code> transaction that fires above 10% over five minutes. A few minutes after we turned on the flag, it fired with the reason "Failed transactions is 25% in the last 5 mins for service: frontend, type: request. Alert when &gt; 10%."</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt59604c1e36ec0bf8/6aede29e7111f53b3d2f8444/image3.png" alt="Checkout failures alert details in Elastic Observability with Add to chat to open the Elastic AI Agent" /><h2><strong>How do you find the root cause of an Elastic APM alert?</strong></h2><p>This investigation ran in four steps, and each one checked the step before it.</p><h3><strong>1. Start with the alert in the Elastic AI Agent</strong></h3><p>The alert details page has an <a href="https://www.elastic.co/docs/solutions/observability/ai/agent-builder-observability#observability-agent-investigation-requirements"><strong>Add to chat</strong></a> button in its header. It opens the AI Agent with the alert attached and sends <em>Investigate this alert</em> for you. The agent retrieves the rule, status, reason, and related entities with your permissions, so you don't have to describe the problem at the outset.</p><p>A few seconds later, the agent had moved the problem off the front end: "Failed checkouts are not a frontend problem: the payment service is rejecting card charges with 'Invalid token', and the error passes up through checkout to the frontend." It found the same error in the payment, checkout, and frontend logs, and it noted that the three services had nearly the same failure rate, so payment failures accounted for almost all of the failed checkouts. The agent ran on Anthropic Claude Opus 5.5 through the Elastic Inference Service (EIS). Its answers vary between runs, so expect different wording and numbers on yours.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltb55df2f22eeac238/6aede2f70318009b73e574f0/image6.png" alt="Elastic AI Agent names the root cause: the payment service rejecting card charges with Invalid token" /><p>The agent also listed what it wasn't sure about. Every error message that it sampled contained <code>app.loyalty.level=gold</code>, so it suggested that only one customer tier was affected, with medium confidence: "Every sample says gold. I haven't checked whether all gold-tier requests fail or only some." The next sections check that lead.</p><h3><strong>2. Check the AI Agent’s answer on the Elastic APM service map</strong></h3><p>We told the agent, <em>Show me the service map for payment</em>. It responded with the same interactive map that service pages show, centered on payment: checkout calls payment, and payment calls <code>flagd</code>. The map carries alert, Service Level Objective (SLO), and anomaly badges. It also records when it was captured (as "Topology as of") and links to the full map with <strong>Explore in Service map</strong>. Along with the map, the agent pointed out that "calls from checkout fail quickly, in about 2.3ms on average. Requests are being rejected right away rather than timing out."</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltebd335aa9fe7ba5e/6aede338c5e5fa828c5f35f7/image5.png" alt="Elastic AI Agent answers with an APM service map for payment, showing checkout calls payment and payment calls flagd" /><p>Selecting <strong>payment</strong> on that map opens its service flyout next to the conversation, with the service's latency and failed transaction rate, along with throughput. The failed transaction rate chart jumps when the fault starts, which confirms what the agent said without leaving the conversation.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltfc7e06f8632cb752/6aede3724316a6f9e0e9def8/image8.png" alt="APM service flyout for payment opened from the AI Agent’s service map, with latency, failed transaction rate, throughput" /><h3><strong>3. Drill from the service flyout to the failing span</strong></h3><p>The service flyout lists payment transactions. Selecting <strong>grpc.oteldemo.PaymentService/Charge</strong> opens the transaction flyout on top of it, with the transaction's metrics, a latency distribution that shows failed transactions separately, and trace samples. A failed sample shows an Error badge on the charge.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt159ece88f1d1268c/6aede39de90eec2aa51fc936/image7.png" alt="APM transaction flyout for PaymentService/Charge with latency distribution and a failed trace sample" /><p>Selecting the transaction in the sample's timeline opens the full trace. It follows one order from the load generator through <code>frontend-proxy</code> and <code>frontend</code> to <code>checkout</code>, which calls cart, product catalog, currency, shipping, and finally payment. Every span on the path from the load generator's <code>POST</code> request down to payment's <code>charge</code> span is marked as a failure, and checkout's call to payment failed after 3.3 ms.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltbde453b1b49c14ab/6aede41f752ef5f5c0d99e60/image10.png" alt="Full trace of a failed order from load generator through frontend and checkout to the payment charge span" /><p>Selecting payment's <strong>charge</strong> span opens its document. The <strong>Errors</strong> section shows the cause: "Payment request failed. Invalid token. app.loyalty.level=gold." <strong>View error</strong> opens the exception itself, with a stack trace that points at line 37 of the payment service's charge.js.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt631f290d7c2b7e6c/6aede47c50d81e407e2d0bb2/image9.png" alt="Span document for the payment charge span, with the Errors section showing Payment request failed, Invalid token" /><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt8ae77c12af366cff/6aede4aa1a6f6e6f9c53d975/image13.png" alt="Exception behind the failed payment charge, with a stack trace pointing at line 37 of the payment service charge.js" /><p>Following are the four flyouts and what each one gives you:</p><p>Fyout</p><p>Opens from</p><p>Shows</p><p>Drills to</p><p>Service</p><p>The AI Agent’s map, the service map, or a service name in Discover</p><p>Latency, failed transaction rate, throughput, transactions list</p><p>Transaction</p><p>Transaction</p><p>Selecting a transaction in the service flyout</p><p>Transaction metrics, latency distribution with failures separated, trace samples</p><p>Trace</p><p>Trace</p><p>Selecting a transaction in a sample’s timeline</p><p>The full span timeline across every service on the path</p><p>Span</p><p>Span</p><p>Selecting a span in the trace</p><p>The span document, including the Errors section and View error </p><p>Exception and stack trace</p><p><strong>Back</strong> returns you through the trace, the transaction, and the service, one flyout at a time. The flyouts keep the service's environment and time range as you go. If you change the environment on the service flyout, the transaction flyout follows it when the transaction exists there. If you change the transaction type or choose an environment without that transaction, the transaction flyout keeps the previous data and shows a warning.</p><h3><strong>4. Confirm the root cause with one ES|QL query</strong></h3><p>The trace explains one failed order. The agent's open question was about all of them: <em>do only gold-tier customers fail, and do all of them fail?</em> One ES|QL query over payment's charge spans answers it. We ran it in Discover, where the time picker sets the time range:</p><p>Over the last 30 minutes, 80 of 138 gold-tier charges failed, and none of the platinum, silver, or bronze charges did. The agent's lead holds. Only gold-tier customers are affected, but not every gold-tier charge fails. In this demo, the answer is built in, because the fault marks the requests it fails as gold. On real services, the same query is how you tell a pattern apart from a coincidence before you act on it. The <code>attributes</code>. prefix is where Elastic Agent stores OTel span attributes, so data from Elastic APM agents needs different field names.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt3f7b28772e7bef3b/6aede528a1f30e3f323489ae/image11.png" alt="ES|QL query in Discover groups payment charges by loyalty level: 80 of 138 gold charges failed, no other tier" /><p>Two other 9.6 changes help when you reach a failing service without an alert.</p><h2><strong>View service dependencies on the Service map panel</strong></h2><p>The service overview and transaction details pages, including those for mobile services, now include a <a href="https://www.elastic.co/docs/solutions/observability/apm/service-map"><strong>Service map</strong> panel</a>. On the payment service overview, it shows checkout as the caller that depends on payment and <code>flagd</code> as the service payment calls. <strong>Hops</strong> sets how many connections to follow (1 by default), and <strong>Max visible</strong> caps the number of nodes (8 by default). The small defaults keep the panel readable when a service has many dependencies.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt206264a7a9e9becb/6aede5674316a689d5e9df04/image12.png" alt="Service map panel on the payment service overview, showing checkout as caller and flagd as dependency, with Hops control" /><p><strong>Explore in Service map</strong> opens the full map with the time range, environment, and Kibana Query Language (KQL) query preserved and with the service selected. On the full map, you can select several services at once in the <strong>service.name</strong> control of the search bar, for example, checkout and payment, and the map highlights both with their connections. When you copy the map to a dashboard, the panel keeps those highlights and filters, and <strong>View in Service map</strong> on the panel brings them back.</p><p>The panel replaces the per-service <strong>Service map</strong> tab.</p><h2><strong>Start an investigation from the Service map page or Discover</strong></h2><p>If there's no alert yet, start from the full Service map page.<strong> Investigate map</strong> in the toolbar sends the current view to the AI Agent: the time range, environment, KQL query, service group, and highlighted services. </p><p>The agent surveys every service in that view and orders what it finds by severity: </p><ol><li><p>Active alerts.</p></li><li><p>Violated or degrading SLOs. </p></li><li><p>Machine learning anomalies. </p></li><li><p>Unusual error rates or latency. </p></li></ol><p>On our map, it reached the same conclusion without the alert as a starting point: "The main problem is that payment is rejecting charges for gold-tier loyalty customers."</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt9f207afc1da6f4d8/6aede5af91a6e87bd50c8853/image14.png" alt="Investigate map on the APM service map sends the view to the Elastic AI Agent, which finds the payment root cause" /><p>If you're already in Discover, the <a href="https://www.elastic.co/docs/solutions/observability/apm/discover-traces#investigate-with-flyouts">same flyout stack</a> is one click away. Open a trace document, and select the service name in its <strong>Overview</strong> tab. That opens the service flyout, and the transaction, trace, and span flyouts follow from there. The service flyout opens with the document's environment and the time range you set in Discover.</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt455a3972e4e80cb8/6aede5df39e2b470c86a72ea/image1.png" alt="Failed payment span in Discover with its Overview tab open and the payment service name ready to select" /><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt4170665f12bd6322/6aede5fc1a6f6e18ca53d97b/image15.png" alt="Payment APM service flyout opened from Discover, carrying the document’s environment and the Discover time range" /><h2><strong>Current limitations of the Elastic APM flyouts and Investigate map</strong></h2><ul><li><p>Services with unprocessed OTel data, for example, data sent straight from a contrib Collector, show key metrics in the service flyout, with <strong>Error rate</strong> in place of <strong>Failed transaction rate</strong>, but no Transactions table, so the transaction drilldown is unavailable. You can still open their spans from the document's expanded trace timeline in Discover.</p></li><li><p><strong>Investigate map</strong> action is available on the full Service map page only. Maps embedded in alert details and dashboards don't show it.</p></li><li><p><strong>Investigate map</strong> sends, at most, 50 highlighted services to the agent.</p></li><li><p>The service flyout opened from Discover doesn't inherit the Discover query or filter pills.</p></li><li><p>Service map connections for gRPC calls that use the current remote procedure call (RPC) semantic conventions (<code>rpc.system.name</code>) need EDOT Collector 9.3.3 or later, or Elastic Agent 9.5 or later in OpenTelemetry mode. With EDOT Collector 9.3.0, the map didn't connect checkout to payment.</p></li></ul><h2><strong>Requirements: Elastic Stack version, license, and privileges</strong></h2><p>These features need the following.</p><ul><li><p><strong>Version:</strong> Elastic Stack 9.6 or later, or Elastic Observability Serverless.</p></li><li><p><strong>License:</strong> Enterprise on the Elastic Stack, or the <a href="https://www.elastic.co/docs/solutions/observability/observability-serverless-feature-tiers#obs-subscription-features">Observability Complete feature tier</a> on Elastic Observability Serverless.</p></li><li><p><strong>Model:</strong> The AI Agent needs a model, through EIS or a generative AI (GenAI) connector.</p></li><li><p><strong>Role privilege:</strong> Users need the AI Agent privilege in their role, listed as Agent Builder, to see <strong>Add to chat</strong> and <strong>Investigate map</strong>.</p></li><li><p><strong>Advanced setting:</strong> Chat Experience must be set to Agent, which is the default in 9.6. (Deployments that chose the AI Assistant earlier keep that choice.)</p></li><li><p><strong>Availability: T</strong>he investigation flyouts are generally available (GA). The rest of the traces experience in Discover remains in technical preview.</p></li></ul><h2><strong>Run this investigation on your own services</strong></h2><p>Pick a service that alerted recently, and open the alert. Then select <strong>Add to chat</strong>. When the agent answers, select a service on its map and follow the flyouts down to a span. The docs cover each piece:</p><ul><li><p><a href="https://www.elastic.co/docs/solutions/observability/ai/agent-builder-observability#observability-agent-investigation-requirements">Investigate an alert or the service map</a></p></li><li><p><a href="https://www.elastic.co/docs/solutions/observability/apm/discover-traces#investigate-with-flyouts">Investigate a service with flyouts</a></p></li><li><p><a href="https://www.elastic.co/docs/solutions/observability/apm/service-map">Service map in Elastic APM</a></p></li></ul><p>To share feedback, reach out through the Elastic community forums or open an issue in the Kibana repository.</p><p></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/apm-root-cause-analysis-ai-agent-service-map</link>
    <guid isPermaLink="false">apm-root-cause-analysis-ai-agent-service-map</guid>
    <category><![CDATA[APM]]></category>
    <category><![CDATA[Agentic AI]]></category>
    <category><![CDATA[OpenTelemetry]]></category>
    <dc:creator><![CDATA[Costas Pipilas,Jenny Pavlova,Miriam Aparicio]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blta1d22f1ae32cf3e8/6aede1b52f17b0382e38fa02/image2.jpg" length="0" type="image/jpeg"/>
    <pubDate>Mon, 09 Nov 2026 16:15:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[LLM tracing in Elastic APM: prompts, responses, and token counts in the span view]]></title>
    <description><![CDATA[In a twenty-call agentic trace, you can see which span is using the most tokens and read the prompt that caused it. Both live in Elastic APM, so there is no second tool to run.]]></description>
    <content:encoded><![CDATA[<p>Elastic APM now does LLM tracing in the trace view. The GenAI tab in the span flyout has the whole conversation, so you can read the system prompt, the user messages and the model response, and copy any of them. Every GenAI span row in the waterfall shows input and output token counts, so in an agentic trace with twenty LLM calls you can find the span using the most tokens without opening any of them. Your LLM calls are now in the same waterfall as your database queries and HTTP spans.</p>
<p>Both features follow the <a href="https://github.com/open-telemetry/semantic-conventions-genai/tree/main/docs/gen-ai">OTel GenAI semantic conventions</a> and work with any OTel-instrumented provider. If your framework already emits OTel GenAI span attributes, there is nothing to change.</p>
<h2 id="howotelgenaispansarestructured">How OTel GenAI spans are structured</h2>
<p>A GenAI span stores everything as span attributes. A typical chat span includes:</p>
<ul>
<li><code>gen_ai.provider.name</code>: the provider (<code>openai</code>, <code>anthropic</code>, <code>aws.bedrock</code>, etc.); <code>gen_ai.system</code> is supported as a fallback for older instrumentation.</li>
<li><code>gen_ai.operation.name</code>: the operation type (<code>chat</code>, <code>embeddings</code>, etc.).</li>
<li><code>gen_ai.request.model</code>: the model being called.</li>
<li><code>gen_ai.usage.input_tokens</code>: tokens consumed by the prompt.</li>
<li><code>gen_ai.usage.output_tokens</code>: tokens generated in the response.</li>
<li><code>gen_ai.input.messages</code>, <code>gen_ai.output.messages</code>: conversation messages.</li>
<li><code>gen_ai.system_instructions</code>: the system prompt.</li>
</ul>
<p>Both features read from these attributes:</p>
<p>| Feature | What it shows | Where it appears | Attributes it reads |
| --- | --- | --- | --- |
| <strong>GenAI tab</strong> | Details (operation type, request model, provider, input and output token counts, response model, response ID) and Conversation (system prompt, user messages, model response) | Span flyout in the APM trace view, and the span flyout in Discover | Appears with any <code>gen_ai.*</code> attribute. Conversation needs <code>gen_ai.system_instructions</code>, <code>gen_ai.input.messages</code>, and <code>gen_ai.output.messages</code> |
| <strong>Token count badges</strong> | Input and output token counts for each GenAI span | Every GenAI span row in the trace waterfall | <code>gen_ai.usage.input_tokens</code>, <code>gen_ai.usage.output_tokens</code> |</p>
<h2 id="howtoreadllmpromptsandresponsesinthegenaitab">How to read LLM prompts and responses in the GenAI tab</h2>
<p>When any <code>gen_ai.*</code> attribute is present on a span, the span flyout shows a dedicated <strong>GenAI</strong> tab next to <strong>Metadata</strong>.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltaeedbb89fd9c6871/6a968cd2144a15728fde3efd/genai-tab-span-details.png" alt="GenAI tab in span details flyout" /></p>
<p>The Details section shows model metadata from the span attributes: operation type, request model, provider, input and output token counts, response model, and response ID. The Conversation section shows the full exchange, populated from <code>gen_ai.system_instructions</code> (system prompt), <code>gen_ai.input.messages</code> (user messages), and <code>gen_ai.output.messages</code> (model response), each with a copy button so you can pull the exact prompt or response out of the trace without scraping text from a formatted table.</p>
<p>All raw span attributes remain accessible on the <strong>Metadata</strong> tab.</p>
<p>The <strong>GenAI</strong> tab is also available in the span flyout in <strong>Discover</strong>, so you can inspect LLM prompts and responses directly alongside your log and trace data without switching to the APM view.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd1ccc4e30c48f8ed/6a968ced36a7416fdf27288b/genai-tab-discover.png" alt="GenAI tab in Discover span flyout" /></p>
<h2 id="whatinstrumentationdoesllmtracingrequire">What instrumentation does LLM tracing require?</h2>
<p>No Kibana-side configuration is needed. The GenAI tab appears automatically when any <code>gen_ai.*</code> attribute is present on a span. Full Conversation support requires the <a href="https://github.com/open-telemetry/semantic-conventions-genai/blob/main/docs/gen-ai/gen-ai-spans.md">OTel GenAI v1.37.0 span-attribute model</a>: <code>gen_ai.input.messages</code>, <code>gen_ai.output.messages</code>, and <code>gen_ai.system_instructions</code>.</p>
<p>Frameworks that emit the older span-events model (<code>gen_ai.user.message</code>, <code>gen_ai.assistant.message</code>, <code>gen_ai.choice</code>) will show the Details metadata section but will not populate the Conversation section. For a current list of compatible instrumentations, see the <a href="https://github.com/open-telemetry/opentelemetry-python-genai/#released-instrumentations">OTel GenAI semantic conventions</a>.</p>
<p>To verify, open the span in Discover, check that <code>gen_ai.input.messages</code> and <code>gen_ai.output.messages</code> are present, and confirm the Conversation section renders.</p>
<p>If your application already sends APM data to Elastic from a GenAI workload, open any GenAI span in the trace view and check for the GenAI tab.</p>
<h2 id="llmtokenusageinthetracewaterfall">LLM token usage in the trace waterfall</h2>
<p>Token count badges now appear on each GenAI span row in the waterfall, so you can scan the full trace without drilling in. In agentic traces with ten or twenty LLM calls, this lets you identify which span is driving token consumption before opening any span.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt2d47691c65ef8799/6a968d055f9db7338e560d85/genai-waterfall-tokens.png" alt="Trace waterfall with token counts on GenAI spans" /></p>
<p>Each row shows input and output token count badges sourced from <code>gen_ai.usage.input_tokens</code> and <code>gen_ai.usage.output_tokens</code>. The row label is the span name, which instrumentation frameworks typically set to something like <code>chat gpt-4o-mini</code>.</p>
<p>Waterfall-level token counts are most useful in agentic traces where a chain of LLM calls uses different models or the same model with varying context sizes.</p>
<h2 id="whichllmprovidersdoeselasticapmsupportforgenaitracing">Which LLM providers does Elastic APM support for GenAI tracing?</h2>
<p>Elastic APM's LLM tracing works with any OTel-instrumented provider: the GenAI tab and waterfall token counts use the same OTel attribute schema regardless of which provider your application uses. Provider is read from <code>gen_ai.provider.name</code>, falling back to <code>gen_ai.system</code> for older instrumentation.</p>
<p>The <a href="https://github.com/open-telemetry/semantic-conventions-genai/tree/main/docs/gen-ai">OTel GenAI semantic conventions</a> that enable this provider detection are currently in a <code>Development</code> lifecycle. Check the <a href="https://github.com/open-telemetry/semantic-conventions-genai/releases">release notes</a> before upgrading instrumentation.</p>
<h2 id="howtoenablellmtracinginelasticapm">How to enable LLM tracing in Elastic APM</h2>
<blockquote>
  <p><strong>Availability:</strong> Both features are available as a Technical Preview on Elastic Serverless and will be available as a Technical Preview in Elastic Stack 9.6.</p>
</blockquote>
<p>To try these features:</p>
<ol>
<li>Instrument your GenAI application with an OTel SDK that follows the <a href="https://github.com/open-telemetry/semantic-conventions-genai/tree/main/docs/gen-ai">OTel GenAI semantic conventions</a> (v1.37.0 or later for full Conversation support).</li>
<li>Send traces to <a href="https://www.elastic.co/observability">Elastic Observability</a> using OTLP, the Elastic APM agent, or an EDOT SDK.</li>
<li>Open the <strong>APM</strong> section in Kibana, navigate to a service that makes LLM calls, and open the trace waterfall for any transaction.</li>
</ol>
<p>The GenAI tab appears on any span with at least one <code>gen_ai.*</code> attribute set; token count badges appear when <code>gen_ai.usage.input_tokens</code> or <code>gen_ai.usage.output_tokens</code> are present.</p>
<p>If you don't have a GenAI application to test with, the <a href="https://github.com/jennypavlova/otel-genai-chat-app">otel-genai-chat-app</a> repository is a minimal OpenAI chat app pre-instrumented with EDOT. Set <code>OPENAI_API_KEY</code> and follow the EDOT commands in the <a href="https://github.com/jennypavlova/otel-genai-chat-app#otel-genai-chat-app">README</a> to send traces to Elastic and see both features in action.</p>
<h2 id="whatsnextforllmobservabilityinelasticapm">What's next for LLM observability in Elastic APM</h2>
<p>We're exploring cost estimation per span (estimated spend based on model pricing and token counts, surfaced in the waterfall) and tool call rendering (structured display of tool/function call inputs and outputs for agentic spans).</p>
<p>If you are building GenAI applications and want early access or to share feedback, reach out through the <a href="https://discuss.elastic.co/c/observability">Elastic community forums</a> or open an issue in the <a href="https://github.com/elastic/kibana/issues">kibana repository</a>.</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/llm-tracing-elastic-apm-genai-spans</link>
    <guid isPermaLink="false">llm-tracing-elastic-apm-genai-spans</guid>
    <category><![CDATA[AI]]></category>
    <category><![CDATA[APM]]></category>
    <category><![CDATA[OpenTelemetry]]></category>
    <category><![CDATA[What's New]]></category>
    <dc:creator><![CDATA[Jenny Pavlova,Miriam Aparicio,Costas Pipilas]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt7b5da648bcacf4aa/6a968bfc5c312610fa43eee4/header.png" length="0" type="image/png"/>
    <pubDate>Tue, 01 Sep 2026 15:22:01 GMT</pubDate>
  </item>
  </channel>
</rss>