<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: OpenObserve</title>
    <description>The latest articles on DEV Community by OpenObserve (openobserve).</description>
    <link>https://dev.to/openobserve</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F13191%2Fa8a5832e-60af-4ee0-a047-091276bd76be.png</url>
      <title>DEV Community: OpenObserve</title>
      <link>https://dev.to/openobserve</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/openobserve"/>
    <language>en</language>
    <item>
      <title>Your App Passed the Black Friday Load Test. Did Your Dashboards?</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Tue, 24 Nov 2026 15:00:00 +0000</pubDate>
      <link>https://dev.to/openobserve/your-app-passed-the-black-friday-load-test-did-your-dashboards-pkf</link>
      <guid>https://dev.to/openobserve/your-app-passed-the-black-friday-load-test-did-your-dashboards-pkf</guid>
      <description>&lt;p&gt;Checkout starts timing out. Five engineers open the same dashboard. Now they’re waiting, too.&lt;/p&gt;

&lt;p&gt;The traffic spike is putting more logs, metrics, and traces into your observability stack. At the same time, engineers are refreshing dashboards and widening searches while scheduled alerts keep running. Your app can have enough capacity to handle peak traffic while the tools you’d use to troubleshoot it are already falling behind.&lt;/p&gt;

&lt;p&gt;Here’s a drill you can add to your next load test, plus what to change if it exposes a bottleneck.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Rehearse what your on-call team actually does
&lt;/h2&gt;

&lt;p&gt;Before ramping up traffic, record how long your main incident dashboard takes to load, how fresh the data is, and how long queries wait to start. Then repeat those checks at peak load while your team investigates a simulated checkout issue.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leave scheduled alerts enabled and open the dashboards your responders normally use.&lt;/li&gt;
&lt;li&gt;Have someone search the last 15 minutes for checkout errors. Have someone else group a week of errors by service. Can both searches finish while people are refreshing dashboards?&lt;/li&gt;
&lt;li&gt;Emit a log event with a unique marker and time how long it takes to become searchable.&lt;/li&gt;
&lt;li&gt;Trigger a test alert and check when it evaluates and when the notification arrives.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Decide what counts as passing before you start. If the on-call team needs to investigate the last minute of checkout activity, a dashboard that opens in two seconds with data that’s three minutes old has failed the drill.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Figure out where the time went
&lt;/h2&gt;

&lt;p&gt;“Search was slow” gives you four different places to look.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What you see&lt;/th&gt;
&lt;th&gt;Where to look first&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The dashboard loads quickly, but the test event is missing.&lt;/td&gt;
&lt;td&gt;Check &lt;strong&gt;ingestion lag&lt;/strong&gt;. See if it rose as telemetry volume climbed and whether the ingesters are keeping up.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Queries spend longer waiting to start, but execution time stays steady.&lt;/td&gt;
&lt;td&gt;Check &lt;strong&gt;query contention&lt;/strong&gt;. See what else was running, including scheduled alerts, pipelines, and wide searches.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Queries start quickly, but take longer to finish.&lt;/td&gt;
&lt;td&gt;Trace &lt;strong&gt;one slow query&lt;/strong&gt;. Check whether it spent more time fetching the file list, reading files, or executing the query.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The test alert arrives late.&lt;/td&gt;
&lt;td&gt;Check &lt;strong&gt;evaluation and delivery separately&lt;/strong&gt;. Find out whether the alert ran late or the notification was delayed after it fired.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The cover video walks through this in OpenObserve. Ashish Kolhe and Hengfei Yang show where to find a query’s time range and scan size, how to cancel a running query, and how to use a trace to see where a slow search spent its time.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Change one thing and run the drill again
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;If the seven-day aggregation holds up short incident searches,&lt;/strong&gt; try separating scheduled work from interactive queries or limiting how many expensive searches can run at once. Repeat the same workload and check whether short searches recover while alerts still evaluate on time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If dashboard refreshes are doing most of the work,&lt;/strong&gt; check the default time range and refresh interval. A dashboard that opens on seven days of data can be expensive when five people are refreshing it together. Set the default to the window responders actually need and measure again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a second run, restart a query node in your test environment&lt;/strong&gt; while the workload is still running. If your setup uses a local cache, a replacement node may need time to warm it. Measure how long the dashboard takes to recover. A steady-state test won’t give you that number.&lt;/p&gt;

&lt;p&gt;The cover video shows what the query side of this drill looks like in practice. Ashish Kolhe and Hengfei Yang inspect running searches and use a query trace to find where a slow search spent its time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://na2.hubs.ly/H095KSG0" rel="noopener noreferrer"&gt;Watch the full peak-season monitoring webinar on OpenObserve&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
      <category>monitoring</category>
      <category>performance</category>
    </item>
    <item>
      <title>Make your voice count in the State of Observability &amp; Reliability report</title>
      <dc:creator>Manas Sharma</dc:creator>
      <pubDate>Wed, 18 Nov 2026 08:57:28 +0000</pubDate>
      <link>https://dev.to/openobserve/make-your-voice-count-in-the-state-of-observability-reliability-report-5h79</link>
      <guid>https://dev.to/openobserve/make-your-voice-count-in-the-state-of-observability-reliability-report-5h79</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqds3409y2kk1eg0ihmfs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqds3409y2kk1eg0ihmfs.png" alt="State of Observability &amp;amp; Reliability survey: &amp;quot;Too many alerts? Too many tools? Tell us." width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every postmortem I’ve read has the same line buried somewhere: “time to identify root cause: 47 min.” Nobody writes down that 40 of those minutes went on opening tabs and asking “which dashboard are you looking at?” in Slack.&lt;/p&gt;

&lt;p&gt;That part never makes it into the reports either. Most “state of observability” reports are written from the vendor side.&lt;/p&gt;

&lt;p&gt;So we put together a short survey for the people actually on call. It covers tool sprawl, alert noise, on-call load, what budget cuts did to your logging, and where AI actually helps during an incident.&lt;/p&gt;

&lt;p&gt;Takes about 2 minutes&lt;br&gt;
No name needed, and results are only reported in aggregate&lt;/p&gt;

&lt;p&gt;👉&lt;a href="https://na2.hubs.ly/H08VCdN0" rel="noopener noreferrer"&gt;Take the survey&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The goal is a report that reflects how engineers actually work, and it only does that if enough people who carry the pager speak up. When the results are out, I’ll share them right here.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
      <category>monitoring</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Your LLM Costs Are Growing. Here's What to Fix First.</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Wed, 11 Nov 2026 22:56:01 +0000</pubDate>
      <link>https://dev.to/openobserve/your-llm-costs-are-growing-heres-what-to-fix-first-3ae3</link>
      <guid>https://dev.to/openobserve/your-llm-costs-are-growing-heres-what-to-fix-first-3ae3</guid>
      <description>&lt;p&gt;LLM costs can look manageable during development. Then the application goes into production, more users arrive, and one request starts triggering multiple model calls, agents, tools, and retries.&lt;/p&gt;

&lt;p&gt;The bill grows, but which part of the application is responsible?&lt;/p&gt;

&lt;p&gt;Choosing a cheaper model might help. But the bigger savings often come from reducing unnecessary work across the entire AI workflow.&lt;/p&gt;

&lt;p&gt;Here are five places to look.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Stop using your most expensive model for everything
&lt;/h2&gt;

&lt;p&gt;Not every task needs advanced reasoning.&lt;/p&gt;

&lt;p&gt;A complex planning step might justify a powerful model. Extracting information from a document, classifying a request, or loading context might work just as well with a smaller one.&lt;/p&gt;

&lt;p&gt;A practical routing strategy:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Model choice&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Complex planning and orchestration&lt;/td&gt;
&lt;td&gt;High-capability model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Summarization and moderate reasoning&lt;/td&gt;
&lt;td&gt;Mid-tier model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Simple extraction and classification&lt;/td&gt;
&lt;td&gt;Smaller model&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For example, one approach discussed in our &lt;a href="https://openobserve.ai/webinars-videos/launching-ai-projects-production/" rel="noopener noreferrer"&gt;AI production panel&lt;/a&gt; used Anthropic Opus for complex reasoning, Sonnet for intermediate tasks, and Haiku for simpler operations.&lt;/p&gt;

&lt;p&gt;But there's a catch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The cheapest orchestrator isn't always the cheapest workflow.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If a weaker orchestrator sends work to three unnecessary agents, the extra model calls, tool invocations, and retries can cost more than using a stronger model for the initial decision.&lt;/p&gt;

&lt;p&gt;Optimize for the cost of completing the task successfully, not just the price of an individual model call.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Stop paying to process the same context repeatedly
&lt;/h2&gt;

&lt;p&gt;Look at what's inside your prompts.&lt;/p&gt;

&lt;p&gt;System instructions, tool definitions, reference documents, and application rules often stay the same across requests. Yet applications may repeatedly send that context to the model.&lt;/p&gt;

&lt;p&gt;Prompt caching can reduce this repeated processing on supported providers.&lt;/p&gt;

&lt;p&gt;A useful prompt structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[CACHEABLE PREFIX]
System instructions
Tool definitions
Reference context
Examples

[DYNAMIC CONTENT]
Session context
Current user request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep stable content together and place frequently changing information later, subject to your provider's caching requirements.&lt;/p&gt;

&lt;p&gt;But don't assume caching automatically saves money. Cache writes, reads, minimum token thresholds, and expiration rules vary by provider.&lt;/p&gt;

&lt;p&gt;Measure cache usage and compare the actual cost before and after.&lt;/p&gt;

&lt;p&gt;See: &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html" rel="noopener noreferrer"&gt;Amazon Bedrock prompt caching documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Find out how many model calls one request actually creates
&lt;/h2&gt;

&lt;p&gt;A user sees one request. Your application might execute something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User request
    |
Orchestrator ($)
    |
    +-- Agent A --&amp;gt; Model --&amp;gt; Tool ($)
    |
    +-- Agent B --&amp;gt; Model --&amp;gt; Tool ($)
    |
    +-- Retry --&amp;gt; Model ($)
    |
Final response ($)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That single interaction might involve several billable model calls.&lt;/p&gt;

&lt;p&gt;Provider billing can tell you how much you spent, but not necessarily which workflow decision caused the expense.&lt;/p&gt;

&lt;p&gt;Track token usage and cost by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model and agent&lt;/li&gt;
&lt;li&gt;Workflow and session&lt;/li&gt;
&lt;li&gt;User or service&lt;/li&gt;
&lt;li&gt;Retries and fallbacks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then investigate which workflows are generating unnecessary calls.&lt;/p&gt;

&lt;p&gt;This is where distributed tracing becomes valuable. Connecting model calls, agent steps, and tool invocations within the same trace helps reveal where the cost is coming from.&lt;/p&gt;

&lt;p&gt;With &lt;a href="https://openobserve.ai/docs/integration/ai/" rel="noopener noreferrer"&gt;OpenObserve's AI integrations&lt;/a&gt;, teams can collect telemetry for AI sessions, model calls, tokens, latency, and costs alongside application traces.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Watch for hidden cost multipliers
&lt;/h2&gt;

&lt;p&gt;Some of the most expensive AI behavior doesn't look like an error.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hidden cost&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Agent loops&lt;/td&gt;
&lt;td&gt;The same model or tool is called repeatedly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Poor routing&lt;/td&gt;
&lt;td&gt;Unnecessary agents execute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Oversized context&lt;/td&gt;
&lt;td&gt;Irrelevant tokens are processed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fallbacks&lt;/td&gt;
&lt;td&gt;Multiple models are called for one task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Low-quality responses&lt;/td&gt;
&lt;td&gt;Users repeat requests to get a useful answer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That last one is particularly important.&lt;/p&gt;

&lt;p&gt;Imagine switching to a cheaper model that reduces inference cost by 40%. If the model produces enough poor responses that users must retry, your actual savings could be much smaller.&lt;/p&gt;

&lt;p&gt;A cheaper request is not necessarily a cheaper completed task.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Give token usage an owner
&lt;/h2&gt;

&lt;p&gt;Cost optimization becomes difficult when nobody knows which application, team, or workflow is responsible for spending.&lt;/p&gt;

&lt;p&gt;Instead of only tracking a monthly total, attribute usage to meaningful owners and set thresholds.&lt;/p&gt;

&lt;p&gt;Compare these two situations:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Without attribution:&lt;/strong&gt; AI spending increased 35% this month.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With attribution:&lt;/strong&gt; A new agent added three model calls to every execution of one workflow, driving most of the increase.&lt;/p&gt;

&lt;p&gt;The second tells you what to investigate.&lt;/p&gt;

&lt;p&gt;Budgets don't have to mean restricting experimentation. They make unusually expensive usage visible so teams can decide when additional spending is justified.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should you optimize first?
&lt;/h2&gt;

&lt;p&gt;Start with this checklist:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Route simple tasks to smaller models where quality remains acceptable.&lt;/li&gt;
&lt;li&gt;Cache stable prompt context and measure actual savings.&lt;/li&gt;
&lt;li&gt;Trace complete workflows, not just individual model calls.&lt;/li&gt;
&lt;li&gt;Identify unnecessary retries, fallbacks, and agent loops.&lt;/li&gt;
&lt;li&gt;Attribute token usage to workflows, users, or services.&lt;/li&gt;
&lt;li&gt;Compare cost, latency, and task success before and after changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The metric that matters: cost per successful task
&lt;/h2&gt;

&lt;p&gt;A useful starting metric is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost per successful task = Total workflow cost / Number of successful tasks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This includes the cost of failed attempts and retries in the total, rather than counting only the final successful model call.&lt;/p&gt;

&lt;p&gt;You still need a reliable way to define and measure task success. That may involve automated evaluations, workflow checks, or other task-specific signals.&lt;/p&gt;

&lt;p&gt;The goal isn't to minimize tokens at any cost. It's to use the least expensive combination of models, prompts, and agent steps that can reliably complete the work.&lt;/p&gt;

&lt;p&gt;For more production lessons on LLM costs, evaluation, and agent observability, watch &lt;a href="https://openobserve.ai/webinars-videos/launching-ai-projects-production/" rel="noopener noreferrer"&gt;What Nobody Tells You About Running AI in Production&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>programming</category>
      <category>llm</category>
    </item>
    <item>
      <title>The Alert Fired. It Wasn't the Root Cause.</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Tue, 06 Oct 2026 16:17:08 +0000</pubDate>
      <link>https://dev.to/openobserve/the-alert-fired-it-wasnt-the-root-cause-35hk</link>
      <guid>https://dev.to/openobserve/the-alert-fired-it-wasnt-the-root-cause-35hk</guid>
      <description>&lt;p&gt;The alert fires.&lt;/p&gt;

&lt;p&gt;You open the dashboard, find the service that triggered it, and start investigating.&lt;/p&gt;

&lt;p&gt;Except the thing that alerted isn't always the thing that broke.&lt;/p&gt;

&lt;p&gt;Sometimes it's just where the problem became visible.&lt;/p&gt;

&lt;p&gt;During a &lt;a href="https://na2.hubs.ly/H08dmVR0" rel="noopener noreferrer"&gt;recent panel on production alerting&lt;/a&gt;, engineering leaders from Apple, Cars.com, and SLB shared incidents where the first signal pointed in one direction while the root cause was somewhere else.&lt;/p&gt;

&lt;p&gt;Three incidents stood out.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The recovery hid the failure
&lt;/h2&gt;

&lt;p&gt;At Cars.com, Heather Osborn's team dealt with intermittent application timeouts for months.&lt;/p&gt;

&lt;p&gt;The service would time out, restart, and recover.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;timeout → restart → healthy → timeout → restart → healthy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The automation was working.&lt;/p&gt;

&lt;p&gt;That was also the problem.&lt;/p&gt;

&lt;p&gt;Each restart removed the immediate symptom without removing the underlying failure. Eventually, the issue was traced back to a minor PostgreSQL update.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automated recovery can make a system look healthy while the same problem keeps happening underneath.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A recurring signal may not deserve a page every time, but that doesn't mean you should stop tracking it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. One failure created alerts everywhere
&lt;/h2&gt;

&lt;p&gt;At SLB, Barnadeep Bhowmik saw almost the opposite problem.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;429&lt;/code&gt;s appeared. Storage failures followed. Downstream services started alerting.&lt;/p&gt;

&lt;p&gt;Eventually, three separate war rooms were investigating what looked like different problems.&lt;/p&gt;

&lt;p&gt;They weren't.&lt;/p&gt;

&lt;p&gt;The failures shared an upstream cause, ultimately traced back to an Active Directory server with a patch pending a restart.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             upstream failure
                   │
        ┌──────────┼──────────┐
        ↓          ↓          ↓
      429s      storage     service
                 errors     failures
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every alert could be technically correct and still not tell you anything new.&lt;/p&gt;

&lt;p&gt;When alerts suddenly appear across multiple services, the better question may not be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is broken?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It may be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do these failures have in common?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Sometimes the signal is what's missing
&lt;/h2&gt;

&lt;p&gt;Sarah Kaplan from Apple shared an incident that started with &lt;code&gt;503&lt;/code&gt;s.&lt;/p&gt;

&lt;p&gt;Capacity looked suspicious. Kubernetes nodes were intermittently going offline. DNS queries were failing.&lt;/p&gt;

&lt;p&gt;The investigation eventually reached an Unbound DNS issue involving larger DNS payloads.&lt;/p&gt;

&lt;p&gt;But one of the useful clues was much simpler:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some nodes stopped logging.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We usually monitor things that happen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;errors increased
latency spiked
CPU crossed 80%
requests failed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But absence can be a signal too.&lt;/p&gt;

&lt;p&gt;A node normally sends logs. Then it doesn't.&lt;/p&gt;

&lt;p&gt;A job normally completes. Then it doesn't.&lt;/p&gt;

&lt;p&gt;A service normally receives traffic. Then it stops.&lt;/p&gt;

&lt;p&gt;Sometimes what &lt;strong&gt;stopped happening&lt;/strong&gt; tells you more than another threshold crossing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why doesn't the first alert always reveal the root cause?
&lt;/h2&gt;

&lt;p&gt;Because alerts detect conditions, not causality.&lt;/p&gt;

&lt;p&gt;A downstream service can cross a threshold because an upstream dependency failed. Automated remediation can hide a recurring failure. And sometimes the most useful clue doesn't trigger an alert at all.&lt;/p&gt;

&lt;p&gt;The first alert is often an &lt;strong&gt;entry point into the incident&lt;/strong&gt;, not a diagnosis.&lt;/p&gt;

&lt;p&gt;That's why I like separating three things:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;The question&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Observable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Could this signal help us understand what happened?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Alertable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Does someone need to investigate this?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pageable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Does someone need to act right now?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Those aren't the same bar.&lt;/p&gt;

&lt;p&gt;You want plenty of useful telemetry.&lt;/p&gt;

&lt;p&gt;You want fewer alerts.&lt;/p&gt;

&lt;p&gt;And you want even fewer things waking someone up at 2 a.m.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should you check after an alert fires?
&lt;/h2&gt;

&lt;p&gt;Before assuming the alerting service is the root cause, ask:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Impact:&lt;/strong&gt; Are users actually affected?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Correlation:&lt;/strong&gt; What else changed at the same time?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependencies:&lt;/strong&gt; What do the affected systems share?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recovery:&lt;/strong&gt; Is automation repeatedly hiding the symptom?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Absence:&lt;/strong&gt; What normally happens that suddenly stopped?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The alert doesn't need to know the root cause.&lt;/p&gt;

&lt;p&gt;It needs to tell you that something deserves your attention.&lt;/p&gt;

&lt;p&gt;Your telemetry needs to help you figure out &lt;strong&gt;why&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So the next time an alert fires, don't just ask:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What triggered this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ask:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is this where the problem started, or just where it became visible?&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;These incidents came from our panel &lt;em&gt;&lt;a href="https://na2.hubs.ly/H08dmVR0" rel="noopener noreferrer"&gt;From Alert Noise to Actionable Signals: Lessons from Production&lt;/a&gt;&lt;/em&gt;, with Sarah Kaplan, Heather Osborn, and Barnadeep Bhowmik.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's the most misleading alert you've chased in production?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sre</category>
      <category>observability</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Your AI Agent Returned 200 OK but Failed the Task. Now What?</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Tue, 01 Sep 2026 15:48:07 +0000</pubDate>
      <link>https://dev.to/openobserve/your-ai-agent-returned-200-ok-but-did-it-actually-do-the-job-51h6</link>
      <guid>https://dev.to/openobserve/your-ai-agent-returned-200-ok-but-did-it-actually-do-the-job-51h6</guid>
      <description>&lt;p&gt;Your API returned &lt;code&gt;200 OK&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Latency looks normal.&lt;/p&gt;

&lt;p&gt;No exceptions were thrown.&lt;/p&gt;

&lt;p&gt;Every dashboard is green.&lt;/p&gt;

&lt;p&gt;And your AI agent gave the user the wrong answer.&lt;/p&gt;

&lt;p&gt;That’s one of the problems teams discover when AI moves from a demo into production: &lt;strong&gt;a technically successful request doesn't necessarily mean a successful task.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In traditional applications, failures usually leave evidence. A request times out. A dependency fails. CPU spikes. An exception gets thrown.&lt;/p&gt;

&lt;p&gt;AI systems can fail much more quietly.&lt;/p&gt;

&lt;p&gt;They can call the wrong tool, retrieve the wrong context, route a request to the wrong agent, silently recover from a failed step, or simply produce an incorrect answer that looks completely reasonable.&lt;/p&gt;

&lt;p&gt;As Michael Tuszynski, Principal Architect at Presidio, put it during the &lt;a href="https://na2.hubs.ly/H07yNYK0" rel="noopener noreferrer"&gt;What Nobody Tells You About Running AI in Production&lt;/a&gt; panel:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Failure doesn't show up as an error. Failure shows up as a really well-formed answer.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That changes what we need to monitor.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;200 OK&lt;/code&gt; isn't task success
&lt;/h2&gt;

&lt;p&gt;Consider a relatively simple multi-agent workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
  ↓
Orchestrator
  ↓
Specialized agent
  ↓
Retrieval
  ↓
Tool call
  ↓
Model
  ↓
Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every component in that chain can technically succeed while the overall task fails.&lt;/p&gt;

&lt;p&gt;The orchestrator might choose the wrong agent.&lt;/p&gt;

&lt;p&gt;The retrieval step might return irrelevant context.&lt;/p&gt;

&lt;p&gt;A tool might execute successfully with the wrong parameters.&lt;/p&gt;

&lt;p&gt;The model might then take all of that information and produce a polished response.&lt;/p&gt;

&lt;p&gt;From the application's perspective:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;status = 200
latency = 8.4s
error = false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the user's perspective:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;task_completed = false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That second signal is the one that matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trace the trajectory, not just the response
&lt;/h2&gt;

&lt;p&gt;Once an AI application starts using agents and tools, a prompt and response aren't enough to explain what happened.&lt;/p&gt;

&lt;p&gt;Suppose a user asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Find a provider near me who accepts my insurance and has availability this week.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The application might need to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Interpret the request
2. Determine the required specialty
3. Route it to a provider agent
4. Search provider data
5. Check insurance eligibility
6. Retrieve appointment availability
7. Reconcile the results
8. Generate the response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the answer is wrong, knowing that the final model call took 2.8 seconds doesn't help much.&lt;/p&gt;

&lt;p&gt;You need the trajectory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which agent was selected?&lt;/li&gt;
&lt;li&gt;What context did it receive?&lt;/li&gt;
&lt;li&gt;Which tools were called?&lt;/li&gt;
&lt;li&gt;What arguments were passed?&lt;/li&gt;
&lt;li&gt;Did something fail and get retried?&lt;/li&gt;
&lt;li&gt;Did the agent recover?&lt;/li&gt;
&lt;li&gt;Which model handled each step?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's where tracing becomes useful.&lt;/p&gt;

&lt;p&gt;Treat the complete user request as a trace and the individual actions as spans:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;trace: provider_search

├── orchestrator
├── provider_agent
│   ├── retrieve_provider_data
│   ├── check_insurance
│   └── check_availability
├── response_synthesis
└── evaluation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, instead of trying to reproduce a bad response, you can reconstruct it.&lt;/p&gt;

&lt;p&gt;This is also why instrumenting AI workflows with OpenTelemetry from the beginning makes sense. Models and agent frameworks will change. Your ability to understand what happened shouldn't depend on a particular framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add the signal traditional monitoring doesn't have
&lt;/h2&gt;

&lt;p&gt;Tracing tells you &lt;strong&gt;what happened&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It doesn't necessarily tell you whether the result was &lt;strong&gt;good&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's where evals come in.&lt;/p&gt;

&lt;p&gt;Kunal Pitale, an engineering leader focused on platform engineering at Atlantic Health, described this as the semantic layer missing from traditional monitoring.&lt;/p&gt;

&lt;p&gt;A service can be available. The calls can succeed. The latency can be acceptable.&lt;/p&gt;

&lt;p&gt;But was the answer correct?&lt;/p&gt;

&lt;p&gt;Did the agent choose the right tool?&lt;/p&gt;

&lt;p&gt;Did it actually complete what the user requested?&lt;/p&gt;

&lt;p&gt;Production AI needs both operational telemetry and quality signals.&lt;/p&gt;

&lt;p&gt;One useful approach is to maintain a set of known-good examples and run them whenever you change a model, prompt, skill, or tool.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Known-good task
      ↓
Run agent
      ↓
Evaluate result
      ↓
Compare with expected behavior
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then production failures can feed that evaluation set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;production failure
      ↓
inspect trace
      ↓
understand what went wrong
      ↓
add regression case
      ↓
change prompt/tool/model
      ↓
rerun evals
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same principle we've used for software regression testing starts applying to AI behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure success at the task level
&lt;/h2&gt;

&lt;p&gt;This also changes the metrics that matter.&lt;/p&gt;

&lt;p&gt;Instead of stopping at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;request count
error rate
latency
token usage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you start asking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;task success rate
tool failure rate
retry rate
agent loop rate
evaluation score
tokens per successful task
cost per successful task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last one is particularly interesting.&lt;/p&gt;

&lt;p&gt;Imagine two agent configurations:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Agent A&lt;/th&gt;
&lt;th&gt;Agent B&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cost/request&lt;/td&gt;
&lt;td&gt;$0.08&lt;/td&gt;
&lt;td&gt;$0.12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Task success&lt;/td&gt;
&lt;td&gt;62%&lt;/td&gt;
&lt;td&gt;94%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Agent A looks cheaper if you're only looking at cost per request.&lt;/p&gt;

&lt;p&gt;It looks very different when you ask what a &lt;strong&gt;successful outcome&lt;/strong&gt; costs.&lt;/p&gt;

&lt;p&gt;This is why cost, quality, and observability become difficult to separate in production AI systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd instrument from day one
&lt;/h2&gt;

&lt;p&gt;If I were putting an agent into production today, at minimum I'd want visibility into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;End-to-end traces across agents, models, and tools&lt;/li&gt;
&lt;li&gt;Tool calls, arguments, failures, and retries&lt;/li&gt;
&lt;li&gt;Model and prompt versions&lt;/li&gt;
&lt;li&gt;Input and output tokens&lt;/li&gt;
&lt;li&gt;Cost by agent and task&lt;/li&gt;
&lt;li&gt;Evaluation scores&lt;/li&gt;
&lt;li&gt;Task success&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most importantly, I'd want those signals correlated.&lt;/p&gt;

&lt;p&gt;High token usage alone might not mean anything.&lt;/p&gt;

&lt;p&gt;High token usage combined with repeated tool calls, increasing latency, and a falling evaluation score tells you something is going wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Green dashboards aren't enough anymore
&lt;/h2&gt;

&lt;p&gt;Getting an AI application to produce an answer is increasingly easy.&lt;/p&gt;

&lt;p&gt;Operating one reliably is a different problem.&lt;/p&gt;

&lt;p&gt;The production questions become:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- What did the agent actually do?
- Why did it make that decision?
- Which tools and models were involved?
- Did it accomplish what the user asked?
- How much did that successful task cost?
- Can I reconstruct what happened when it gets something wrong?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because eventually your AI system &lt;strong&gt;will&lt;/strong&gt; be wrong.&lt;/p&gt;

&lt;p&gt;The dangerous failure isn't always an exception.&lt;/p&gt;

&lt;p&gt;Sometimes it's a confident, beautifully formatted answer delivered while every traditional health metric remains green.&lt;/p&gt;

&lt;p&gt;The goal of AI observability is to make that failure visible.&lt;/p&gt;




&lt;p&gt;We're working on this problem at &lt;a href="https://na2.hubs.ly/H07yN_r0" rel="noopener noreferrer"&gt;OpenObserve by correlating complete AI sessions&lt;/a&gt; with agent and tool traces, model calls, token usage, cost, latency, and agent behavior.&lt;/p&gt;

&lt;p&gt;If you're building agents in production, I'd be curious: &lt;strong&gt;what signal has been most useful for catching failures that your traditional monitoring missed?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>monitoring</category>
      <category>discuss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Your System Can't Tell You It's Down: Why Synthetic Monitoring Matters</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Thu, 06 Aug 2026 15:52:52 +0000</pubDate>
      <link>https://dev.to/openobserve/your-system-cant-tell-you-its-down-why-synthetic-monitoring-matters-3m78</link>
      <guid>https://dev.to/openobserve/your-system-cant-tell-you-its-down-why-synthetic-monitoring-matters-3m78</guid>
      <description>&lt;p&gt;&lt;strong&gt;Synthetic monitoring detects availability problems before users do by running automated checks against your applications from outside the system. Unlike logs, metrics, and traces, synthetic checks can detect failures even when your application is not receiving traffic.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your observability stack tells you what happened inside your system.&lt;/p&gt;

&lt;p&gt;But what happens when the system itself is unavailable?&lt;/p&gt;

&lt;p&gt;A broken TLS certificate, expired domain, failed API endpoint, or broken checkout flow may produce little or no telemetry because requests never reach your application.&lt;/p&gt;

&lt;p&gt;That is the gap synthetic monitoring solves.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is synthetic monitoring?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://na2.hubs.ly/H072GH90" rel="noopener noreferrer"&gt;Synthetic monitoring&lt;/a&gt; uses automated probes to continuously test applications, APIs, and user workflows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsimceyay4yps55byqrj8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsimceyay4yps55byqrj8.gif" alt=" " width="600" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Common examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checking an API endpoint returns the expected response&lt;/li&gt;
&lt;li&gt;Verifying TLS certificates before expiration&lt;/li&gt;
&lt;li&gt;Testing TCP connectivity&lt;/li&gt;
&lt;li&gt;Running a complete browser workflow like login or checkout&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of waiting for customers to report problems, teams detect failures proactively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Synthetic monitoring without another tool
&lt;/h2&gt;

&lt;p&gt;Many synthetic monitoring solutions create another observability silo.&lt;/p&gt;

&lt;p&gt;You end up with one dashboard for logs, another for metrics, another for traces, and another for synthetic checks.&lt;/p&gt;

&lt;p&gt;OpenObserve Synthetic Monitoring keeps check results alongside your existing telemetry.&lt;/p&gt;

&lt;p&gt;Synthetic results can be queried, added to dashboards, and used for alerts alongside logs, metrics, and traces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test APIs and real user journeys
&lt;/h2&gt;

&lt;p&gt;OpenObserve supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP checks&lt;/li&gt;
&lt;li&gt;TCP checks&lt;/li&gt;
&lt;li&gt;TLS checks&lt;/li&gt;
&lt;li&gt;SSH checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For browser monitoring, checks run using Playwright.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcwot2v30e27bboabd4ae.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcwot2v30e27bboabd4ae.gif" alt=" " width="720" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Engineers can use existing Playwright scripts or record browser journeys and convert them into monitors.&lt;/p&gt;

&lt;p&gt;The same workflows used for testing can also help detect production issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Monitor internal applications
&lt;/h2&gt;

&lt;p&gt;Public synthetic checks cannot always reach internal systems.&lt;/p&gt;

&lt;p&gt;Private Locations allow teams to run synthetic checks inside their own network using an outbound-only agent.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No inbound firewall rules.&lt;/li&gt;
&lt;li&gt;No exposing internal endpoints.&lt;/li&gt;
&lt;li&gt;No separate monitoring infrastructure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Know why something failed
&lt;/h2&gt;

&lt;p&gt;A failed check should provide more than "availability dropped."&lt;/p&gt;

&lt;p&gt;Each run includes execution history and failure evidence so engineers can understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which step failed&lt;/li&gt;
&lt;li&gt;Where it failed&lt;/li&gt;
&lt;li&gt;What the application returned&lt;/li&gt;
&lt;li&gt;Screenshots of browser failures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of only knowing that something broke, teams can quickly understand what happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;Synthetic Monitoring is available in beta on OpenObserve Cloud.&lt;/p&gt;

&lt;p&gt;Create a check, choose your schedule and location, and start receiving results in the &lt;em&gt;synthetics_results&lt;/em&gt; stream.&lt;/p&gt;

&lt;p&gt;Learn more about &lt;a href="https://na2.hubs.ly/H072GN70" rel="noopener noreferrer"&gt;Synthetic Monitoring at OpenObserve&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>testing</category>
      <category>news</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Top 10 Microservices Monitoring Tools in 2026</title>
      <dc:creator>Simran Kumari</dc:creator>
      <pubDate>Tue, 16 Jun 2026 15:17:16 +0000</pubDate>
      <link>https://dev.to/openobserve/top-10-microservices-monitoring-tools-in-2026-50jk</link>
      <guid>https://dev.to/openobserve/top-10-microservices-monitoring-tools-in-2026-50jk</guid>
      <description>&lt;p&gt;Running microservices without solid monitoring is like flying without instruments. You might be fine for a while — but the first time something goes wrong across three services simultaneously, you'll spend hours in the dark. I've seen teams lose entire afternoons to an incident that turned out to be a slow database query two hops away from the service throwing errors.&lt;/p&gt;

&lt;p&gt;The tools in this list represent the realistic options engineering teams are actually running in 2026: from fully open source setups to enterprise SaaS platforms. They're not all equivalent, and I'll be direct about where each one falls short.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; OpenObserve is at the top because it covers the widest ground for the most teams at the lowest operational cost. The rest of the list is ordered roughly by how commonly they appear in real production setups.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What to Look for in a Microservices Monitoring Tool
&lt;/h2&gt;

&lt;p&gt;Before the list, here's what actually matters when evaluating these tools:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unified telemetry.&lt;/strong&gt; If your logs live in one place, your metrics in another, and your traces in a third, you'll context-switch constantly during incidents. Tools that correlate all three signals in a single query interface save the most time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Query language access.&lt;/strong&gt; A tool that lets &lt;em&gt;any&lt;/em&gt; engineer write a query to investigate an incident is more useful than one where only the observability specialist can extract meaningful answers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cardinality handling.&lt;/strong&gt; High-cardinality labels (per-endpoint, per-user, per-region) are exactly what you need during debugging — and exactly what breaks naive time-series databases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost at scale.&lt;/strong&gt; Several tools on this list look affordable at low ingest volumes and become very expensive once you hit production traffic. Model the math before you commit.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. OpenObserve
&lt;/h2&gt;

&lt;p&gt;If you want logs, metrics, and traces in one place without paying per-GB ingestion fees, OpenObserve is where to start. It's open source, runs on Kubernetes with a Helm chart in under ten minutes, and accepts OpenTelemetry data natively.&lt;/p&gt;

&lt;p&gt;The 140x log compression versus Elasticsearch is the headline number — and it holds up in practice. Teams migrating from ELK report storage cost reductions in the 70–90% range.&lt;/p&gt;

&lt;p&gt;The query interface supports both SQL and PromQL. SQL for log analysis means your entire engineering team can write queries on day one, not just the person who memorized LogQL syntax.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unified logs, metrics, and traces in a single platform&lt;/li&gt;
&lt;li&gt;140x log compression vs Elasticsearch&lt;/li&gt;
&lt;li&gt;SQL and PromQL query support&lt;/li&gt;
&lt;li&gt;Native OpenTelemetry — no proprietary agents&lt;/li&gt;
&lt;li&gt;Handles high-cardinality Kubernetes metrics natively&lt;/li&gt;
&lt;li&gt;Free cloud tier: up to 50 GB/day ingest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Younger ecosystem than Prometheus or ELK&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Teams wanting a unified open source platform, Kubernetes-native environments, organizations migrating away from ELK or Datadog.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Grafana LGTM Stack (Loki, Grafana, Tempo, Mimir)
&lt;/h2&gt;

&lt;p&gt;The LGTM stack is the open source path to full-stack observability if you want to own all the components. Loki handles log aggregation, Tempo handles distributed tracing, Mimir handles long-term metrics storage, and Grafana ties everything together.&lt;/p&gt;

&lt;p&gt;Paytm Insider reported saving 75% of their logging and monitoring costs after migrating to Loki. Tempo stores trace data in object storage (S3, GCS) which keeps costs predictable at scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mature, battle-tested components with a massive dashboard community&lt;/li&gt;
&lt;li&gt;Loki's label-based indexing keeps log storage costs significantly lower than Elasticsearch&lt;/li&gt;
&lt;li&gt;Grafana Cloud removes operational burden if you don't want to self-host&lt;/li&gt;
&lt;li&gt;Deep CNCF ecosystem integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're running four separate systems, each with its own configuration and failure modes&lt;/li&gt;
&lt;li&gt;Three query languages: PromQL, LogQL, and TraceQL — new engineers need to learn all three&lt;/li&gt;
&lt;li&gt;Cross-signal correlation requires deliberate configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Teams with existing Prometheus/Grafana investment who want to extend incrementally.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Datadog
&lt;/h2&gt;

&lt;p&gt;Datadog is the most fully-featured SaaS observability platform available. The agent auto-discovers services, there are over 900 integrations, and the product now covers security monitoring, synthetic testing, RUM, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;900+ integrations covering virtually every modern stack technology&lt;/li&gt;
&lt;li&gt;Single agent handles metrics, logs, and traces with Kubernetes auto-discovery&lt;/li&gt;
&lt;li&gt;AI-assisted anomaly detection&lt;/li&gt;
&lt;li&gt;Enterprise support SLAs and compliance certifications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pricing scales with hosts, log volume, and metrics cardinality simultaneously — routinely one of the top infrastructure costs for large deployments&lt;/li&gt;
&lt;li&gt;Proprietary query syntax creates vendor lock-in&lt;/li&gt;
&lt;li&gt;Cost surprises are common for teams that didn't model the math upfront&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Enterprise teams with observability budgets who need broad vendor-managed integrations.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Dynatrace
&lt;/h2&gt;

&lt;p&gt;Dynatrace takes a fundamentally different approach: its OneAgent does full auto-instrumentation, discovering your services and dependencies without manual OpenTelemetry setup. The Davis AI engine runs continuous anomaly detection and attempts to surface root causes before you go looking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OneAgent auto-instrumentation requires minimal manual setup&lt;/li&gt;
&lt;li&gt;Davis AI reduces alert noise and performs automatic root cause analysis&lt;/li&gt;
&lt;li&gt;Handles hybrid and on-premise deployments better than most cloud-native platforms&lt;/li&gt;
&lt;li&gt;Automatic service dependency maps are genuinely useful for complex architectures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Custom enterprise pricing, typically starting ~$69/host/month&lt;/li&gt;
&lt;li&gt;Per-user seat licensing restricts how many engineers can access the platform during an incident&lt;/li&gt;
&lt;li&gt;Less suited for teams who want to understand and own their instrumentation layer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Large enterprises with complex hybrid environments, regulated industries needing on-premise deployment.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. New Relic
&lt;/h2&gt;

&lt;p&gt;New Relic now offers a consumption-based model with a generous free tier — 100 GB/month free data ingest. For smaller teams, this makes it an accessible entry point into full-stack SaaS observability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;100 GB/month free ingest is enough for a real production evaluation&lt;/li&gt;
&lt;li&gt;Strong APM with distributed tracing built into the core product&lt;/li&gt;
&lt;li&gt;Single interface for infrastructure monitoring, APM, log management, and browser monitoring&lt;/li&gt;
&lt;li&gt;Closest like-for-like SaaS migration path from Datadog&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NRQL is proprietary — same lock-in concern as Datadog&lt;/li&gt;
&lt;li&gt;Pricing past the free tier can scale unexpectedly at high ingest volumes&lt;/li&gt;
&lt;li&gt;AI-powered anomaly detection not yet at the level of Dynatrace's Davis engine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Small to mid-size teams wanting SaaS full-stack observability, APM-primary use cases.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Elastic Observability (ELK Stack / OpenSearch)
&lt;/h2&gt;

&lt;p&gt;Elasticsearch has been the dominant log search platform for years, and Elastic's observability product extends the ELK stack into metrics and traces. If your organization already runs Elasticsearch, adding the observability layers is a logical extension.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log search capabilities are excellent, especially for compliance-driven retention and security workloads&lt;/li&gt;
&lt;li&gt;Full-text search across application logs is a genuine strength&lt;/li&gt;
&lt;li&gt;OpenSearch (AWS-maintained fork) provides a fully open source alternative&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High memory requirements; scaling is complex and costly in both infrastructure and engineering time&lt;/li&gt;
&lt;li&gt;License changes introduced uncertainty for some organizations&lt;/li&gt;
&lt;li&gt;Adding metrics and traces means adding more components, not simplifying&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Organizations with existing Elasticsearch investment, security and compliance log management use cases.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Jaeger
&lt;/h2&gt;

&lt;p&gt;Jaeger is a CNCF-graduated distributed tracing tool originally built by Uber. It does one thing and does it well: distributed tracing across microservices. Jaeger v2 introduced native OpenTelemetry support, which significantly improves the instrumentation story.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CNCF-graduated with long-term maintenance backing&lt;/li&gt;
&lt;li&gt;Native OpenTelemetry support in v2&lt;/li&gt;
&lt;li&gt;Integrates cleanly alongside existing metrics and logging stacks&lt;/li&gt;
&lt;li&gt;Adaptive sampling gives control over trace volume without losing critical data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Traces only — always lives alongside other tools&lt;/li&gt;
&lt;li&gt;UI is functional but limited for complex analytical queries&lt;/li&gt;
&lt;li&gt;Moving to a full-stack tracing alternative is a sideways step, not an upgrade&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Adding distributed tracing to an existing stack, CNCF-standard Kubernetes environments.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Honeycomb
&lt;/h2&gt;

&lt;p&gt;Honeycomb is built around a different data model: instead of separate logs, metrics, and traces, it centers everything on high-cardinality events with arbitrary dimensions. This makes it powerful for debugging production issues where the interesting questions involve combinations of attributes you didn't think to aggregate in advance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;BubbleUp automatically surfaces which attribute combinations correlate with poor user experiences&lt;/li&gt;
&lt;li&gt;High-cardinality event model handles user ID, session ID, request ID without exploding storage costs&lt;/li&gt;
&lt;li&gt;Developer-centric design that changes how engineers think about production debugging&lt;/li&gt;
&lt;li&gt;Native OpenTelemetry support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requires buying into Honeycomb's event-based worldview — the transition takes real time&lt;/li&gt;
&lt;li&gt;Consumption-based pricing grows quickly at high volumes&lt;/li&gt;
&lt;li&gt;Less suited as a general infrastructure monitoring platform&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Developer-centric teams debugging novel production issues, genuinely high-cardinality microservices workloads.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Apache SkyWalking
&lt;/h2&gt;

&lt;p&gt;SkyWalking is an open source APM designed specifically for cloud-native and microservices architectures, with particular strength in Java-based environments where it has mature auto-instrumentation support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auto-instrumentation is especially mature for Java&lt;/li&gt;
&lt;li&gt;Service topology graph auto-generates from trace data&lt;/li&gt;
&lt;li&gt;Supports multiple storage backends: Elasticsearch, MySQL, TiDB&lt;/li&gt;
&lt;li&gt;Growing CNCF ecosystem presence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smaller adoption than Prometheus, Jaeger, or commercial platforms&lt;/li&gt;
&lt;li&gt;Auto-instrumentation advantages are less compelling outside JVM environments&lt;/li&gt;
&lt;li&gt;UI and alerting lag behind more mature platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Java-heavy microservices architectures, teams wanting open source APM without ELK's operational overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. Zipkin
&lt;/h2&gt;

&lt;p&gt;Zipkin is one of the oldest distributed tracing tools still in active use, originally developed at Twitter. It captures timing data across service calls, helps troubleshoot latency problems, and generates dependency diagrams.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple and mature, with well-understood instrumentation and extensive documentation&lt;/li&gt;
&lt;li&gt;Dependency diagram quickly identifies error paths and calls to deprecated services&lt;/li&gt;
&lt;li&gt;Flexible transport options including HTTP and Kafka&lt;/li&gt;
&lt;li&gt;Low operational overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintained primarily by volunteers — slower feature development and uncertain long-term roadmap&lt;/li&gt;
&lt;li&gt;No built-in support for logs or metrics&lt;/li&gt;
&lt;li&gt;Minimal built-in UI; runs out of road quickly for complex filtering needs&lt;/li&gt;
&lt;li&gt;Largely superseded by Jaeger in new deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Teams needing simple, low-overhead distributed tracing without committing to a heavier platform. Existing Zipkin users who haven't found a reason to migrate.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Open Source&lt;/th&gt;
&lt;th&gt;Unified (L+M+T)&lt;/th&gt;
&lt;th&gt;OTel Native&lt;/th&gt;
&lt;th&gt;Relative Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OpenObserve&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Infrastructure only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Grafana LGTM&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅ (multi-tool)&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Infra or Cloud&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Datadog&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dynatrace&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New Relic&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elastic&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;Medium–High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jaeger&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌ (traces only)&lt;/td&gt;
&lt;td&gt;✅ (v2)&lt;/td&gt;
&lt;td&gt;Infrastructure only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Honeycomb&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Medium–High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apache SkyWalking&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Infrastructure only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zipkin&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌ (traces only)&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Infrastructure only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  How to Choose
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Starting fresh on Kubernetes?&lt;/strong&gt; OpenObserve gives you unified observability without SaaS pricing or the overhead of running four separate systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Already running Prometheus + Grafana?&lt;/strong&gt; Extend incrementally to the full LGTM stack with Loki and Tempo. You keep existing dashboards and alert rules; you just add systems gradually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Budget isn't a constraint and you need enterprise SLAs?&lt;/strong&gt; Datadog or Dynatrace cover the most ground with the least operational overhead. Dynatrace wins for auto-instrumentation in hybrid environments; Datadog wins for breadth of integrations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Java-heavy stack with dozens of services?&lt;/strong&gt; SkyWalking deserves a serious evaluation — it doesn't get as much attention in cloud-native conversations, but performs well for its designed use cases.&lt;/p&gt;

&lt;p&gt;One pattern worth avoiding: don't let the decision drag on so long that you end up with no monitoring at all. A working setup with basic RED metrics is more valuable than a perfect tool still being evaluated six months later.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;Most teams land in one of three places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Open source + self-hosted:&lt;/strong&gt; OpenObserve or the Grafana LGTM stack&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commercial SaaS:&lt;/strong&gt; Datadog or Dynatrace&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specialized tracing alongside existing metrics:&lt;/strong&gt; Jaeger or Zipkin with Prometheus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whatever you pick — &lt;strong&gt;instrument with OpenTelemetry from the start&lt;/strong&gt;. It keeps future options open. Switching backends becomes a configuration change, not a project.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://openobserve.ai/blog/microservices-monitoring-tools/" rel="noopener noreferrer"&gt;OpenObserve blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>observability</category>
      <category>microservices</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>What's New: Terraform Support, Kubernetes and AWS Automation, Bring Your Own Bucket, and UX Improvements</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Tue, 19 May 2026 15:23:19 +0000</pubDate>
      <link>https://dev.to/openobserve/whats-new-terraform-support-kubernetes-and-aws-automation-bring-your-own-bucket-and-ux-341m</link>
      <guid>https://dev.to/openobserve/whats-new-terraform-support-kubernetes-and-aws-automation-bring-your-own-bucket-and-ux-341m</guid>
      <description>&lt;h1&gt;
  
  
  What's New in OpenObserve: Terraform Support, Kubernetes and AWS Automation, Bring Your Own Bucket, and UX Improvements
&lt;/h1&gt;

&lt;p&gt;OpenObserve has shipped three major updates that help engineering teams automate observability, keep full control over telemetry data, and troubleshoot incidents faster.&lt;/p&gt;

&lt;p&gt;In this release:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terraform support for managing OpenObserve deployments and resources as code&lt;/li&gt;
&lt;li&gt;Bring Your Own Bucket (BYOB) for Amazon S3 and Azure Blob Storage&lt;/li&gt;
&lt;li&gt;UX and UI improvements for logs, distributed tracing, and root cause analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you run observability on Kubernetes, AWS, Azure, or other cloud environments, these updates simplify deployment, improve governance, and streamline day-to-day troubleshooting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Terraform Support for Observability as Code
&lt;/h2&gt;

&lt;p&gt;OpenObserve now includes a Terraform provider that lets you manage observability resources using infrastructure as code.&lt;/p&gt;

&lt;p&gt;Supported resources include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Streams&lt;/li&gt;
&lt;li&gt;Dashboards&lt;/li&gt;
&lt;li&gt;Users and organizations&lt;/li&gt;
&lt;li&gt;Retention policies&lt;/li&gt;
&lt;li&gt;Indexed fields&lt;/li&gt;
&lt;li&gt;Full-text search settings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;OpenObserve also provides a Kubernetes Terraform module that deploys the platform using the official Helm chart. The module supports both single-node environments and production high-availability deployments with PostgreSQL, NATS, S3, and Ingress.&lt;/p&gt;

&lt;p&gt;For AWS users, the module can optionally provision:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon VPC&lt;/li&gt;
&lt;li&gt;Amazon EKS&lt;/li&gt;
&lt;li&gt;Amazon S3&lt;/li&gt;
&lt;li&gt;IAM roles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes it possible to manage both the observability platform and its configuration through &lt;a href="https://na2.hubs.ly/H05zTH90" rel="noopener noreferrer"&gt;Terraform or OpenTofu&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bring Your Own Bucket (BYOB) for Amazon S3 and Azure Blob Storage
&lt;/h2&gt;

&lt;p&gt;Commercial OpenObserve Cloud customers can now connect their own Amazon S3 bucket or Azure Blob Storage container.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://na2.hubs.ly/H05zVJ40" rel="noopener noreferrer"&gt;Telemetry data remains in your cloud account&lt;/a&gt;, region, and security boundary, while OpenObserve continues to handle ingestion, compaction, and querying.&lt;/p&gt;

&lt;p&gt;Key benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full ownership of logs, metrics, and traces&lt;/li&gt;
&lt;li&gt;Data residency and compliance control&lt;/li&gt;
&lt;li&gt;Better use of existing cloud storage commitments&lt;/li&gt;
&lt;li&gt;No storage lock-in&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  UX and UI Improvements for Logs and Distributed Tracing
&lt;/h2&gt;

&lt;p&gt;This release also includes several improvements to help engineers move from alert to root cause more quickly.&lt;/p&gt;

&lt;p&gt;Highlights include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Service Catalog&lt;/li&gt;
&lt;li&gt;Span details directly in the flame graph&lt;/li&gt;
&lt;li&gt;Better default log columns&lt;/li&gt;
&lt;li&gt;Multi-stream log correlation&lt;/li&gt;
&lt;li&gt;Smarter View Logs filters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These changes reduce the number of clicks required to investigate incidents and correlate logs and traces. &lt;a href="https://na2.hubs.ly/H05zWzP0" rel="noopener noreferrer"&gt;Try it!&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get all the details, features, and how-tos:
&lt;/h2&gt;

&lt;p&gt;This article is a summary of the latest OpenObserve release.&lt;/p&gt;

&lt;p&gt;For screenshots, implementation details, and links to the Terraform provider and Kubernetes module, &lt;a href="https://na2.hubs.ly/H05yVY80" rel="noopener noreferrer"&gt;read the full announcement&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>terraform</category>
      <category>devops</category>
      <category>automation</category>
    </item>
    <item>
      <title>How to Monitor OpenAI API Costs and Token Usage with OpenTelemetry</title>
      <dc:creator>Manas Sharma</dc:creator>
      <pubDate>Fri, 15 May 2026 13:02:47 +0000</pubDate>
      <link>https://dev.to/openobserve/how-to-monitor-openai-api-costs-and-token-usage-with-opentelemetry-4c5o</link>
      <guid>https://dev.to/openobserve/how-to-monitor-openai-api-costs-and-token-usage-with-opentelemetry-4c5o</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Capture &lt;code&gt;gen_ai.*&lt;/code&gt; semantic convention attributes on every OpenAI call: request model, input tokens, output tokens. Add &lt;code&gt;feature&lt;/code&gt;, &lt;code&gt;user_id&lt;/code&gt;, and &lt;code&gt;team&lt;/code&gt; on every span so you can break down cost by who and what is spending.&lt;/li&gt;
&lt;li&gt;Compute &lt;code&gt;gen_ai.usage.cost_usd&lt;/code&gt; from a pricing table you control and emit it as both a span attribute (for per-request drill-down) and a histogram metric (for aggregation and alerting).&lt;/li&gt;
&lt;li&gt;Alert on cost anomalies relative to your historical baseline, not just static budget thresholds. Retry loops and runaway agents show up as deviations before they ever cross a daily spend limit.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why OpenAI bills are impossible to predict without instrumentation
&lt;/h2&gt;

&lt;p&gt;Running an LLM app in production without instrumentation is a slow way to find out your margins are negative. Token consumption is non-obvious: a single user with a verbose system prompt and long chat history can cost 20x more per interaction than an average user. A bug in a retry loop can 10x your daily spend in an hour. A single new feature that adds RAG context to every call can double your input token count overnight.&lt;/p&gt;

&lt;p&gt;The OpenAI dashboard tells you what you spent yesterday. It does not tell you which feature, which user, which prompt template, or which model variant drove the spend. By the time you notice a cost spike in your billing dashboard, you have already paid for it.&lt;/p&gt;

&lt;p&gt;The fix is the same fix you use for any production system: emit structured telemetry at the point of the API call and make it queryable. OpenTelemetry gives you a vendor-neutral way to do this, and a growing set of GenAI-specific conventions means the fields you emit today will still be meaningful in two years.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick start:&lt;/strong&gt; Jump to the Python setup or Node.js setup if you just need the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three signals you actually need to track
&lt;/h2&gt;

&lt;p&gt;For LLM cost monitoring, three signals carry almost all the value:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Token usage&lt;/strong&gt; tells you how much capacity you consumed. Input tokens and output tokens, always separately, because they price differently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt; is the dollar-denominated derivative of token usage. You compute it at emit time using a pricing table you control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency&lt;/strong&gt; tells you how long users waited. For streaming endpoints, split this into time to first token and total duration.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Everything else (error rate, finish reason, response model) is useful context for these three. Start with the three and add context as you need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What OpenTelemetry's GenAI semantic conventions give you
&lt;/h2&gt;

&lt;p&gt;OpenTelemetry has a dedicated set of semantic conventions for generative AI workloads, living under the &lt;code&gt;gen_ai.*&lt;/code&gt; namespace. The point of conventions is that the same attribute names work across providers and observability backends, so your queries do not break when you swap from OpenAI to Anthropic or from one backend to another.&lt;/p&gt;

&lt;p&gt;The attributes you will use most:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.provider.name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Provider name: &lt;code&gt;openai&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.request.model&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Model requested by your code: &lt;code&gt;gpt-4o&lt;/code&gt;, &lt;code&gt;gpt-4o-mini&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.response.model&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Model the provider actually used (can differ if provider routes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.operation.name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;chat&lt;/code&gt;, &lt;code&gt;text_completion&lt;/code&gt;, &lt;code&gt;embeddings&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.usage.input_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Prompt tokens consumed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.usage.output_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Completion tokens generated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.request.temperature&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Temperature parameter (useful when debugging determinism)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.request.max_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Max tokens parameter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gen_ai.response.finish_reasons&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Why the model stopped: &lt;code&gt;stop&lt;/code&gt;, &lt;code&gt;length&lt;/code&gt;, &lt;code&gt;content_filter&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One attribute worth noting: &lt;code&gt;gen_ai.system&lt;/code&gt; has been renamed to &lt;code&gt;gen_ai.provider.name&lt;/code&gt; in the current OTel GenAI spec. Most instrumentation libraries still emit &lt;code&gt;gen_ai.system&lt;/code&gt; today. Your backend should accept both until library adoption catches up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz42cw9al0h7kffykwgu7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz42cw9al0h7kffykwgu7.png" alt="OpenTelemetry GenAI semantic convention attributes" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Instrumenting a Python app with the official OTel OpenAI SDK
&lt;/h2&gt;

&lt;p&gt;This guide uses &lt;code&gt;opentelemetry-instrumentation-openai-v2&lt;/code&gt;, the official OTel package maintained in &lt;code&gt;opentelemetry-python-contrib&lt;/code&gt;. It follows the GenAI semantic conventions closely and is the right choice for OpenAI instrumentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install the three packages
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;opentelemetry-distro
pip &lt;span class="nb"&gt;install &lt;/span&gt;opentelemetry-exporter-otlp
pip &lt;span class="nb"&gt;install &lt;/span&gt;opentelemetry-instrumentation-openai-v2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the bootstrap command once to install auto-instrumentation for any other libraries in your app (Flask, FastAPI, &lt;code&gt;requests&lt;/code&gt;, and so on):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opentelemetry-bootstrap &lt;span class="nt"&gt;--action&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Set the OTLP endpoint for OpenObserve
&lt;/h3&gt;

&lt;p&gt;Grab your OTLP HTTP endpoint and Authorization header from the OpenObserve UI under &lt;strong&gt;Data Sources -&amp;gt; Traces (OpenTelemetry) -&amp;gt; OTLP HTTP&lt;/strong&gt;. Set these environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OTEL_SERVICE_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;my-llm-app
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://api.openobserve.ai/api/&amp;lt;your-org&amp;gt;"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Authorization=Basic &amp;lt;your-auth-token&amp;gt;"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OTEL_EXPORTER_OTLP_PROTOCOL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http/protobuf
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are self-hosting OpenObserve, the endpoint is typically &lt;code&gt;http://localhost:5080/api/&amp;lt;your-org&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run with &lt;code&gt;opentelemetry-instrument&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Wrap your existing run command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opentelemetry-instrument python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No code changes to &lt;code&gt;app.py&lt;/code&gt;. The OpenAI SDK is wrapped at import time, and every &lt;code&gt;chat.completions.create&lt;/code&gt; call emits a span with the &lt;code&gt;gen_ai.*&lt;/code&gt; attributes populated.&lt;/p&gt;

&lt;h3&gt;
  
  
  A minimal example app
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# app.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-4o-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Summarize observability in one sentence.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Input tokens:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Output tokens:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with &lt;code&gt;opentelemetry-instrument python app.py&lt;/code&gt; and check the Traces tab in OpenObserve. You should see a span named &lt;code&gt;chat gpt-4o-mini&lt;/code&gt; with the token counts attached.&lt;/p&gt;

&lt;h3&gt;
  
  
  Capturing message content (and the privacy tradeoff)
&lt;/h3&gt;

&lt;p&gt;The instrumentation does not capture the prompt or completion text by default. To enable it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ships the full prompt and completion as log events. It is useful for debugging but has real privacy implications: you are now logging whatever your users typed, including anything they pasted in. If your app handles regulated data (health, finance, anything under GDPR or HIPAA), do not enable this globally. Enable it per-environment or per-feature flag, and scrub sensitive fields before the exporter sees them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyr73dgxg0j9a2df25cwf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyr73dgxg0j9a2df25cwf.png" alt="OpenObserve Traces view showing LLM spans" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Instrumenting a Node.js app
&lt;/h2&gt;

&lt;p&gt;For Node.js, the pattern is the same. Install the packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @opentelemetry/api &lt;span class="se"&gt;\&lt;/span&gt;
  @opentelemetry/sdk-node &lt;span class="se"&gt;\&lt;/span&gt;
  @opentelemetry/exporter-trace-otlp-http &lt;span class="se"&gt;\&lt;/span&gt;
  @opentelemetry/instrumentation-openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a &lt;code&gt;tracing.js&lt;/code&gt; bootstrap file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// tracing.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NodeSDK&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@opentelemetry/sdk-node&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OTLPTraceExporter&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@opentelemetry/exporter-trace-otlp-http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OpenAIInstrumentation&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@opentelemetry/instrumentation-openai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Resource&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@opentelemetry/resources&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sdk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NodeSDK&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Resource&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;service.name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-llm-app-node&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;deployment.environment&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;development&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="na"&gt;traceExporter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OTLPTraceExporter&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/v1/traces`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="na"&gt;instrumentations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OpenAIInstrumentation&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then preload it when you run your app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;--require&lt;/span&gt; ./tracing.js app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same result: every OpenAI call produces a span in OpenObserve with the GenAI attributes populated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a cost calculation layer
&lt;/h2&gt;

&lt;p&gt;OpenAI's SDK gives you token counts. It does not give you dollars. You have to multiply tokens by a price, and that price changes. Build this as a small, updatable module.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing table as code
&lt;/h3&gt;

&lt;p&gt;Keep this in source control. Review it every quarter, or every time a provider announces a price change.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# pricing.py
# Prices in USD per 1 million tokens, as of April 2026.
# Verify against provider pricing pages before each release.
&lt;/span&gt;
&lt;span class="n"&gt;MODEL_PRICING&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-4o&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;2.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;output&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;10.00&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-4o-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;output&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.60&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;o1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;          &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;15.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;output&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;60.00&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;o1-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;     &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;3.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;output&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;12.00&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_cost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Return the estimated cost in USD for a single LLM call.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;pricing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MODEL_PRICING&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;pricing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Unknown model. Emit 0 and alert separately so you can add pricing.
&lt;/span&gt;        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
    &lt;span class="n"&gt;input_cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_tokens&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1_000_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;pricing&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;output_cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output_tokens&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1_000_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;pricing&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;output&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_cost&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;output_cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Emitting cost as a custom metric
&lt;/h3&gt;

&lt;p&gt;The official &lt;code&gt;-v2&lt;/code&gt; package does not emit cost, only tokens. Add cost yourself with a thin wrapper that runs after each call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# tracked_llm.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;opentelemetry&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;metrics&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pricing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;calculate_cost&lt;/span&gt;

&lt;span class="n"&gt;tracer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_tracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm-cost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;meter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_meter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm-cost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;cost_histogram&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;meter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_histogram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.usage.cost_usd&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Estimated cost of a single LLM call in USD&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;unit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;USD&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;tracked_chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-4o-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;unknown&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;anon&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.provider.name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.request.model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;feature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;feature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;elapsed_ms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;

        &lt;span class="n"&gt;input_tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_tokens&lt;/span&gt;
        &lt;span class="n"&gt;output_tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt;
        &lt;span class="n"&gt;cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;calculate_cost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output_tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Span attributes for per-request investigation
&lt;/span&gt;        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.usage.input_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.usage.output_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output_tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.usage.cost_usd&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.latency.duration_ms&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;elapsed_ms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.response.model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Metric for aggregation
&lt;/span&gt;        &lt;span class="n"&gt;cost_histogram&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.provider.name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.request.model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;feature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;feature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You now have cost on the span (for drill-down) and cost as a metric (for aggregation, alerting, and dashboards). Both are labeled with &lt;code&gt;feature&lt;/code&gt; so you can break them down later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attributing cost to users, features, and teams
&lt;/h2&gt;

&lt;p&gt;This is the section most readers came for. Raw token counts do not answer "who is spending our money." Attribution does.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding attributes on every span
&lt;/h3&gt;

&lt;p&gt;Every LLM call should carry four attribution dimensions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;feature&lt;/code&gt;: which product path triggered the call (&lt;code&gt;document_summary&lt;/code&gt;, &lt;code&gt;chat_reply&lt;/code&gt;, &lt;code&gt;rag_answer&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;user_id&lt;/code&gt;: hashed user identifier for per-user rollups&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;team&lt;/code&gt;: which internal team or product area owns the feature&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;environment&lt;/code&gt;: &lt;code&gt;prod&lt;/code&gt;, &lt;code&gt;staging&lt;/code&gt;, &lt;code&gt;dev&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Wire them through as keyword arguments on your wrapper:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;tracked_chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-4o&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;document_summary&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;hashed_user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building the cost attribution dashboard
&lt;/h2&gt;

&lt;p&gt;A complete LLM cost dashboard covers two concerns: spend attribution and token efficiency. Organize it across two tabs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tab 1: LLM Cost Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Four single-stat tiles at the top give you the headline numbers at a glance: &lt;strong&gt;Total LLM Cost ($)&lt;/strong&gt;, &lt;strong&gt;Total Input Tokens&lt;/strong&gt;, &lt;strong&gt;Total Output Tokens&lt;/strong&gt;, and &lt;strong&gt;Total LLM Calls&lt;/strong&gt;. These are the first things you check when something looks off.&lt;/p&gt;

&lt;p&gt;Below the tiles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LLM Cost Over Time ($)&lt;/strong&gt;: bar chart over the selected time range. Reveals bursty spend patterns and days that are trending above baseline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost by Model&lt;/strong&gt;: pie chart, one slice per &lt;code&gt;gen_ai.request.model&lt;/code&gt;. Shows your model mix and whether a cheaper model is handling the bulk of traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Input vs Output Cost Over Time ($)&lt;/strong&gt;: grouped bar chart with two series, &lt;code&gt;input_cost&lt;/code&gt; and &lt;code&gt;output_cost&lt;/code&gt;. Output tokens cost 3-4x more than input tokens on most models; this panel tells you which side is driving cost growth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token Usage by Model&lt;/strong&gt;: grouped bar chart of &lt;code&gt;input_tokens&lt;/code&gt; and &lt;code&gt;output_tokens&lt;/code&gt; per model. Cross-reference this with Cost by Model to spot models that are expensive relative to their token volume.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token Usage Over Time&lt;/strong&gt;: time series of token counts. Useful for capacity planning and catching prompt inflation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn78rhwv8i09shrgsoo27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn78rhwv8i09shrgsoo27.png" alt="LLM Cost Monitoring dashboard" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Alerting on cost anomalies and rate-limit errors
&lt;/h2&gt;

&lt;p&gt;Static budget thresholds are table stakes. The interesting failures are the ones that do not cross a static threshold until it is too late.&lt;/p&gt;

&lt;h3&gt;
  
  
  Threshold alerts vs anomaly detection
&lt;/h3&gt;

&lt;p&gt;A threshold alert fires when daily spend exceeds $500. It works for the blunt cases. It misses three common failure modes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A retry loop that 3x's a specific feature's token usage in an hour. The daily threshold may still be fine by end of day, but you paid 3x for that hour.&lt;/li&gt;
&lt;li&gt;A prompt injection that triggers a long runaway completion on a single request, burning 100k output tokens in one call.&lt;/li&gt;
&lt;li&gt;Seasonal growth that quietly pushes baseline from $300/day to $600/day over a month, outpacing capacity plans.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Anomaly detection catches all three by comparing current behavior to historical baseline rather than to a fixed number.&lt;/p&gt;

&lt;h3&gt;
  
  
  A daily budget threshold
&lt;/h3&gt;

&lt;p&gt;Set this first. In OpenObserve, create an alert on the &lt;code&gt;gen_ai.usage.cost_usd&lt;/code&gt; metric:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Trigger:&lt;/strong&gt; &lt;code&gt;SUM(gen_ai_usage_cost_usd)&lt;/code&gt; over &lt;code&gt;24h&lt;/code&gt; is greater than &lt;code&gt;500&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluation frequency:&lt;/strong&gt; every 5 minutes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; Slack or PagerDuty, routed to the LLM-platform team&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  An anomaly-based alert for cost spikes
&lt;/h3&gt;

&lt;p&gt;This is more valuable. Create an anomaly alert on &lt;code&gt;gen_ai.usage.cost_usd&lt;/code&gt; grouped by &lt;code&gt;feature&lt;/code&gt;, with a training window of the last 14 days and a sensitivity tuned to catch 3x deviations. A retry loop in the &lt;code&gt;document_summary&lt;/code&gt; feature shows up in minutes, before it hits your daily threshold.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alert on rate-limit errors (HTTP 429)
&lt;/h3&gt;

&lt;p&gt;When OpenAI rate-limits you, downstream calls fail and retries pile up. Fire an alert when &lt;code&gt;gen_ai.response.error.type = rate_limit_exceeded&lt;/code&gt; exceeds a low threshold (say, 5 in 5 minutes). This usually surfaces a runaway loop before a cost anomaly does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reconciling estimated cost with the OpenAI billing API
&lt;/h2&gt;

&lt;p&gt;Your OTel-derived cost is an estimate. It is usually within a couple of percent, but it drifts from the real bill for three reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cached input tokens.&lt;/strong&gt; Repeat prompts are billed at a discount. Your naive pricing math assumes full price.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reasoning tokens.&lt;/strong&gt; &lt;code&gt;o1&lt;/code&gt; and similar models emit internal reasoning tokens that count toward billing but may not appear in the standard &lt;code&gt;usage&lt;/code&gt; object.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch API discounts.&lt;/strong&gt; If you use the async batch endpoint, those requests are priced lower.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Reconcile monthly. Pull the OpenAI usage endpoint and compare total cost for the window against your OTel sum. If the drift is more than 5 percent, dig in and adjust your pricing table. This is the pattern production teams use: OTel for real-time signal, billing API for ground truth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring time to first token for streaming
&lt;/h2&gt;

&lt;p&gt;For chat UIs, users feel time to first token (TTFT), not total duration. If you use streaming responses, capture it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;stream_with_ttft&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-4o&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.provider.name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.request.model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.response.streaming&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;ttft_ms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;

        &lt;span class="n"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;chunks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ttft_ms&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;ttft_ms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
                &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.latency.ttft_ms&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ttft_ms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;total_ms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
        &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gen_ai.latency.duration_ms&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total_ms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;chunks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can alert on TTFT regressions separately from total-duration regressions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Production checklist
&lt;/h2&gt;

&lt;p&gt;Before shipping this to prod:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Retention policy set on your LLM telemetry stream&lt;/li&gt;
&lt;li&gt;✅ PII scrubbing pipeline in place if capturing message content&lt;/li&gt;
&lt;li&gt;✅ Sampling strategy decided (100% for LLM spans is usually fine)&lt;/li&gt;
&lt;li&gt;✅ Pricing table in source control with quarterly review reminder&lt;/li&gt;
&lt;li&gt;✅ Budget threshold alert and anomaly-based alert configured&lt;/li&gt;
&lt;li&gt;✅ Monthly reconciliation against OpenAI billing API scheduled&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Send your LLM telemetry to OpenObserve
&lt;/h2&gt;

&lt;p&gt;OpenObserve is an open-source observability platform that accepts standard OTLP over HTTP and gRPC. There is no proprietary SDK to adopt and no special instrumentation to learn. Point your OTLP exporter at OpenObserve Cloud or a self-hosted instance, and your LLM spans, logs, and metrics land in the same place as your infrastructure telemetry.&lt;/p&gt;

&lt;p&gt;If you want to see this working end to end, spin up a free account at &lt;a href="https://cloud.openobserve.ai/" rel="noopener noreferrer"&gt;OpenObserve Cloud&lt;/a&gt; or check out the &lt;a href="https://openobserve.ai/llm-observability/" rel="noopener noreferrer"&gt;LLM Observability overview&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://openobserve.ai/blog/llm-monitoring-best-practices/" rel="noopener noreferrer"&gt;LLM monitoring best practices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://openobserve.ai/blog/ai-anomaly-detection-guide/" rel="noopener noreferrer"&gt;AI anomaly detection guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://openobserve.ai/blog/llm-observability-tools/" rel="noopener noreferrer"&gt;Top open source LLM observability tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://openobserve.ai/blog/distributed-tracing-basics-to-beyond-guide/" rel="noopener noreferrer"&gt;Distributed tracing guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opentelemetry</category>
      <category>llm</category>
      <category>observability</category>
      <category>openai</category>
    </item>
    <item>
      <title>I Built a Dashboard in 30 Seconds with AI</title>
      <dc:creator>Manas Sharma</dc:creator>
      <pubDate>Thu, 14 May 2026 10:17:29 +0000</pubDate>
      <link>https://dev.to/openobserve/i-built-a-dashboard-in-30-seconds-with-ai-500p</link>
      <guid>https://dev.to/openobserve/i-built-a-dashboard-in-30-seconds-with-ai-500p</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;It's 2 AM. An alert fires. Cart service is throwing errors. You've got five minutes before someone escalates.&lt;/p&gt;

&lt;p&gt;The runbook says: "Check the dashboard. Look at the logs." But which dashboard? What query? You're half-asleep, the alert description tells you nothing useful, and now you're supposed to write SQL from scratch while someone in Slack asks "any update?"&lt;/p&gt;

&lt;p&gt;Most of us have been there. And most runbooks were written by someone who never had to use them under pressure.&lt;/p&gt;

&lt;p&gt;What if you could just type: &lt;strong&gt;"cart is throwing errors. find the root cause."&lt;/strong&gt; and get a real answer?&lt;/p&gt;

&lt;p&gt;That's what I tested with the new AI Assistant in OpenObserve. Here's what happened.&lt;/p&gt;




&lt;h2&gt;
  
  
  It's Not Anomaly Detection. It's Something Simpler.
&lt;/h2&gt;

&lt;p&gt;Most AI + observability discussions jump straight to anomaly detection or ML-powered forecasting. Those are interesting. But the thing that's actually changing how I work right now is simpler: an assistant embedded in the platform that lets me ask questions in plain English and get answers from my own production data.&lt;/p&gt;

&lt;p&gt;No SQL. No PromQL. Just describe what you want.&lt;/p&gt;

&lt;p&gt;I ran four real scenarios against live data from an otel-demo microservices app and a Kubernetes cluster. Here's how each one went.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. The Dashboard Request That Normally Kills Your Afternoon
&lt;/h3&gt;

&lt;p&gt;Someone from the business team asks for a dashboard. They don't know SQL. They don't know PromQL. They just want to see what's happening with nginx — request rate, how fast it's responding, how many errors.&lt;/p&gt;

&lt;p&gt;Normally this kills thirty minutes: finding the right log stream, writing queries, dragging panels, tweaking units.&lt;/p&gt;

&lt;p&gt;Instead, I typed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create a dashboard for my nginx logs showing request rate, latency percentiles, and 4xx vs 5xx errors.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thirty seconds later I had a production-ready dashboard. It picked the right log stream. It listed the relevant fields. It wrote the SQL queries. It chose appropriate visualizations — line chart for request rate, heatmap for latency distribution, stacked bar for status codes. These were real queries against actual data. Not a template.&lt;/p&gt;

&lt;p&gt;Here's what stuck with me: &lt;strong&gt;the person who asked for this could have done it themselves.&lt;/strong&gt; They don't need to know what a PromQL query looks like. They just describe what they want to see.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Same Thing, Different Domain: Infrastructure
&lt;/h3&gt;

&lt;p&gt;Application logs worked. But what about infrastructure?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;build a K8s host metrics dashboard showing CPU, memory, disk per node.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Completely different data source — Kubernetes metrics, not nginx logs. Same experience. The assistant figured out where the data lived, what metrics to pull, and how to visualize them.&lt;/p&gt;

&lt;p&gt;What impressed me was the panel design. Usage per node and cumulative across the cluster. Separate tabs for CPU, memory, and disk. It understood that "CPU per node" implies a time series grouped by host, not a single aggregate gauge. That's the kind of design decision a human SRE makes after looking at the data — and the assistant just did it.&lt;/p&gt;

&lt;p&gt;The assistant had enough context about the infrastructure to know what clusters were running and what hosts were connected. I didn't explain my setup. It already knew.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Proactive: Don't Wait Until Something Breaks
&lt;/h3&gt;

&lt;p&gt;Dashboards are great, but nobody wants to stare at them all day. I wanted to see if I could use the assistant proactively — scan everything, find problems before they escalate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;what's the health of the otel-demo right now? if anything is red, create an alert.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This isn't asking for one dashboard or one service. It's saying: scan all services, tell me how we're doing, and if something looks off, lock in an alert so I'm covered.&lt;/p&gt;

&lt;p&gt;It checked error rates and latencies across every service. Found the ones running green, identified the ones that weren't. And for anything red — it created an alert. Right there. No configuration. No navigating to the alerts page.&lt;/p&gt;

&lt;p&gt;This is the kind of thing most teams only set up &lt;em&gt;after&lt;/em&gt; an incident, during the postmortem, when someone says "we should have caught this earlier." One sentence and you're covered before the page goes off.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Something's Actually Broken: Root Cause Analysis
&lt;/h3&gt;

&lt;p&gt;Now the real test. The cart service in the otel-demo app is throwing errors. Not a synthetic scenario — a real incident.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;otel-demo app cart is throwing errors. find the root cause.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What happened next is worth breaking down step by step:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It searched across &lt;strong&gt;both logs and traces&lt;/strong&gt; — not one or the other, both at once&lt;/li&gt;
&lt;li&gt;It looked for errors in the last six hours and found none&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;automatically widened the search window&lt;/strong&gt; — I didn't tell it to do that&lt;/li&gt;
&lt;li&gt;It identified the pattern: cart service failing on database writes under load&lt;/li&gt;
&lt;li&gt;It showed me the exact traces, the error distribution over time, and the specific downstream call that was failing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every step was visible. I could expand any tool call, see the exact query it ran, and verify the result. It's not a black box. It shows its work — and if I disagreed with where it was going, I could redirect it.&lt;/p&gt;

&lt;p&gt;Once I had the root cause, I stayed in the same conversation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alert me if cart error rate crosses 10 errors in 5 minutes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same context. Same conversation. Investigation to prevention in two sentences.&lt;/p&gt;

&lt;p&gt;That last part is what I keep coming back to. The assistant doesn't just help you find problems — it helps you lock in the fix so you don't get paged for the same thing at 3 AM next week.&lt;/p&gt;




&lt;h2&gt;
  
  
  Beyond the UI: Take It to Your IDE
&lt;/h2&gt;

&lt;p&gt;Here's the part that changes the workflow entirely. You don't have to be inside the OpenObserve UI to get this.&lt;/p&gt;

&lt;p&gt;OpenObserve exposes all of this through an MCP server. Connect your AI coding assistant (Claude Code, Cursor, whatever you use) directly to your production observability data. One command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add o2 https://api.openobserve.ai/api/default/mcp &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-t&lt;/span&gt; http &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Basic &amp;lt;YOUR_TOKEN&amp;gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Under five minutes. Now your IDE can query production logs, metrics, and traces. Debug a deploy from your terminal. Pull up a trace without leaving your editor. Check error rates during a code review.&lt;/p&gt;

&lt;p&gt;The assistant follows you wherever you work — not just inside the observability platform.&lt;/p&gt;




&lt;h2&gt;
  
  
  What This Actually Changes
&lt;/h2&gt;

&lt;p&gt;There's been a lot of noise about AI in observability. Most of it falls into two camps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Anomaly detection&lt;/strong&gt; — useful in theory, unpredictable in practice, hard to trust&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI replaces on-call&lt;/strong&gt; — not happening, and most engineers don't want it to&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The thing that's working right now is neither of those. It's reducing the friction between &lt;em&gt;"something is wrong"&lt;/em&gt; and &lt;em&gt;"here's what I know."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Not replacing your judgment. Not replacing your experience. Just removing the parts of incident response that feel like operating a query builder with one eye open at 2 AM.&lt;/p&gt;

&lt;p&gt;From &lt;em&gt;"I need to see what's happening"&lt;/em&gt; to &lt;em&gt;"I know what happened and we're covered next time"&lt;/em&gt; — in one conversation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://openobserve.ai/docs/integration/ai/mcp/claude/" rel="noopener noreferrer"&gt;OpenObserve MCP Setup Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://openobserve.ai/webinars-videos/integration-with-ai-tools-a-step-by-step-guide-using-mcp/" rel="noopener noreferrer"&gt;Integration with AI Tools Using MCP — Workshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/openobserve/openobserve" rel="noopener noreferrer"&gt;OpenObserve on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Have you tried connecting AI assistants to your observability stack? What's working? What's still painful? Drop a comment — I'm genuinely curious what others are seeing.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>observability</category>
      <category>ai</category>
      <category>devops</category>
      <category>sre</category>
    </item>
    <item>
      <title>OpenObserve Just Raised $10M and Launched Observability 3.0 with New AI Capabilities</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Wed, 29 Apr 2026 14:16:01 +0000</pubDate>
      <link>https://dev.to/openobserve/openobserve-just-raised-10m-and-launched-observability-30-with-new-ai-capabilities-3ibl</link>
      <guid>https://dev.to/openobserve/openobserve-just-raised-10m-and-launched-observability-30-with-new-ai-capabilities-3ibl</guid>
      <description>&lt;p&gt;Today we’re announcing two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A $10M Series A&lt;/li&gt;
&lt;li&gt;The launch of Observability 3.0&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This funding accelerates a shift we’ve been building toward: Observability 3.0.&lt;/p&gt;

&lt;p&gt;Observability is breaking under AI-scale systems.&lt;br&gt;
More data. More tools. More noise.&lt;/p&gt;

&lt;p&gt;Most teams are still:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1. Stitching together 6 – 15 tools&lt;/li&gt;
&lt;li&gt;2. Sampling away critical data&lt;/li&gt;
&lt;li&gt;3. Debugging incidents manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That model doesn’t scale.&lt;/p&gt;

&lt;p&gt;So we built something different.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://na2.hubs.ly/H059Cr60" rel="noopener noreferrer"&gt;Observability 3.0&lt;/a&gt;&lt;/strong&gt; is a shift from dashboards and alerts to systems that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Correlate data automatically&lt;/li&gt;
&lt;li&gt;Detect issues early&lt;/li&gt;
&lt;li&gt;Help resolve incidents without manual digging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI SRE (autonomous incident analysis)&lt;/li&gt;
&lt;li&gt;Anomaly detection (early warning signals)&lt;/li&gt;
&lt;li&gt;LLM observability (visibility into AI systems)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All in a single platform. No fragmentation. No forced tradeoffs.&lt;/p&gt;

&lt;p&gt;This is what the Series A is fueling.&lt;/p&gt;

&lt;p&gt;👉 Full story, vision, and what we’re building next: &lt;a href="https://na2.hubs.ly/H059Cq20" rel="noopener noreferrer"&gt;https://na2.hubs.ly/H059Cq20&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>news</category>
      <category>cloud</category>
      <category>observability</category>
    </item>
    <item>
      <title>AI Agent Monitoring: How to Observe Autonomous AI Agents in Production</title>
      <dc:creator>Simran Kumari</dc:creator>
      <pubDate>Fri, 10 Apr 2026 16:09:26 +0000</pubDate>
      <link>https://dev.to/openobserve/ai-agent-monitoring-how-to-observe-autonomous-ai-agents-in-production-39a8</link>
      <guid>https://dev.to/openobserve/ai-agent-monitoring-how-to-observe-autonomous-ai-agents-in-production-39a8</guid>
      <description>&lt;p&gt;&lt;strong&gt;AI agent monitoring&lt;/strong&gt; — also called &lt;strong&gt;LLM observability&lt;/strong&gt; — is the practice of collecting, analysing, and acting on telemetry data generated by LLM calls and the autonomous agents built on top of them. Think of it as traditional APM, but purpose-built for AI workloads.&lt;/p&gt;

&lt;p&gt;A modern AI agent is not a static API call. It's a dynamic, multi-step reasoning system that may:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plan and decompose subtasks autonomously&lt;/li&gt;
&lt;li&gt;Call external tools (web search, code execution, APIs)&lt;/li&gt;
&lt;li&gt;Retrieve documents via Retrieval-Augmented Generation (RAG)&lt;/li&gt;
&lt;li&gt;Spawn sub-agents for parallel task execution&lt;/li&gt;
&lt;li&gt;Loop and self-correct until a goal is satisfied&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every one of those steps is a potential point of failure, latency spike, or cost explosion. Just as DevOps engineers would never deploy a microservice without metrics, traces, and logs, MLOps and AI engineers need the same rigour for LLM-powered systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why It Matters in Production
&lt;/h2&gt;

&lt;p&gt;The jump from a prototype that "works on my machine" to a reliable production AI agent is enormous. Here's what routinely breaks without proper monitoring:&lt;/p&gt;

&lt;h3&gt;
  
  
  🔴 Runaway Token Costs
&lt;/h3&gt;

&lt;p&gt;An unchecked agentic loop can consume millions of tokens before you notice. A single misbehaving agent session — stuck in a reasoning loop — can exhaust your entire daily token budget in minutes. Token-level telemetry gives you per-request cost visibility and the ability to set budget-based circuit breakers.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔴 Silent Latency Regressions
&lt;/h3&gt;

&lt;p&gt;A new model version, a longer system prompt, or a change in retrieval strategy can quietly double your agent's response time. Without distributed latency traces, you discover this from frustrated users — not from a proactive alert.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔴 Rate-Limit Cascade Failures
&lt;/h3&gt;

&lt;p&gt;LLM API rate limits hit unpredictably under production load. A single rate-limit event can trigger aggressive retries across multiple parallel agent sessions, cascading into a full outage.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔴 Degraded Output Quality
&lt;/h3&gt;

&lt;p&gt;Hallucinations, refusals, and incoherent responses increase as context windows grow or prompts drift. Span-level metadata correlating prompt structure with output quality lets you catch these regressions systematically.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔴 Multi-Step Reasoning Failures
&lt;/h3&gt;

&lt;p&gt;In agentic pipelines, a failure deep in a reasoning chain is nearly impossible to attribute without distributed tracing. Did the agent fail because the web search tool returned bad data, because the LLM misinterpreted the tool output, or because the context window overflowed? Traces answer this.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔴 Compliance &amp;amp; Audit Requirements
&lt;/h3&gt;

&lt;p&gt;Enterprise deployments increasingly require complete audit logs of what the agent decided, why, what data it accessed, and what actions it took.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Four Pillars of LLM Observability
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Distributed Tracing
&lt;/h3&gt;

&lt;p&gt;Every agent action — from receiving a user prompt to returning a final answer — is instrumented as a &lt;strong&gt;trace&lt;/strong&gt; composed of &lt;strong&gt;spans&lt;/strong&gt;. Each span captures a discrete unit of work: an LLM call, a tool invocation, a database retrieval, or a sub-agent call.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tracing answers: &lt;em&gt;"What happened, in what order, and how long did each step take?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. Metrics
&lt;/h3&gt;

&lt;p&gt;Aggregated numerical data over time — token counts, latency percentiles (p50/p95/p99), error rates, throughput, and cost per request. Metrics are cheap to store and fast to query, making them ideal for real-time dashboards and threshold-based alerting.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Structured Logs
&lt;/h3&gt;

&lt;p&gt;Rich, machine-readable event records attached to each agent action — prompt text, model parameters, completion content, tool call arguments, and exception stack traces. Unlike metrics, logs retain the full context needed for post-incident debugging.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Evaluations (Evals)
&lt;/h3&gt;

&lt;p&gt;A layer unique to AI observability: automated or human-assisted scoring of agent outputs for correctness, safety, relevance, and faithfulness. Evals close the loop between operational telemetry and output quality.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;Pro Tip:&lt;/strong&gt; For most teams starting out, &lt;strong&gt;distributed tracing&lt;/strong&gt; delivers the highest immediate value. It reveals exactly where latency and failures originate across multi-step agent pipelines — something neither metrics nor logs alone can show.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Key Metrics to Track
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;What It Tells You&lt;/th&gt;
&lt;th&gt;Typical Alert Threshold&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.usage.prompt_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Input token consumption per request&lt;/td&gt;
&lt;td&gt;&amp;gt; 80% of model context window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.usage.completion_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Output token consumption per request&lt;/td&gt;
&lt;td&gt;Sudden spike &amp;gt; 2× baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.usage.total_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Combined cost proxy per call&lt;/td&gt;
&lt;td&gt;Daily cost budget exceeded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;duration&lt;/code&gt; (end-to-end)&lt;/td&gt;
&lt;td&gt;User-perceived latency&lt;/td&gt;
&lt;td&gt;p95 &amp;gt; 10s for interactive agents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;error.rate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;% of requests that fail or timeout&lt;/td&gt;
&lt;td&gt;&amp;gt; 1% over a 5-minute window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tool_call.count&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tool invocations per session&lt;/td&gt;
&lt;td&gt;&amp;gt; 20 per session (loop indicator)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent.steps&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Depth of reasoning chain&lt;/td&gt;
&lt;td&gt;&amp;gt; configured max steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.request.model&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Which model was invoked&lt;/td&gt;
&lt;td&gt;Unexpected model fallback detected&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  OpenTelemetry: The Standard for AI Observability
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;OpenTelemetry (OTel)&lt;/strong&gt; is the open-source observability framework that has become the industry standard for instrumenting distributed systems. For AI agents, it provides a vendor-neutral way to emit traces, metrics, and logs from any LLM call to any compatible backend — OpenObserve, Prometheus, Jaeger, Grafana, Datadog, and more.&lt;/p&gt;

&lt;p&gt;The ecosystem includes dedicated auto-instrumentation libraries for all major LLM providers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;opentelemetry-instrumentation-openai&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;opentelemetry-instrumentation-anthropic&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;opentelemetry-instrumentation-langchain&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;opentelemetry-instrumentation-llama-index&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;opentelemetry-instrumentation-cohere&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These libraries wrap LLM client calls and automatically attach semantic attributes — token counts, model name, temperature, max tokens, error details — as span attributes, &lt;strong&gt;with no manual instrumentation required&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How OTel Spans Map to Agent Steps
&lt;/h3&gt;

&lt;p&gt;In an agentic pipeline, the OTel trace tree mirrors the agent's reasoning hierarchy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[root trace] user-request
  └── [span] planner-llm-call
        └── [span] tool: web_search
        └── [span] tool: code_executor
              └── [span] sub-agent: summariser-llm-call
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lets you instantly see which step was the bottleneck or failure point in any given agent run.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting Up LLM Monitoring with OpenObserve
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://openobserve.ai/" rel="noopener noreferrer"&gt;OpenObserve&lt;/a&gt; is an open-source observability platform with a native OTLP endpoint — purpose-built for high-volume telemetry at significantly lower cost and resource footprint than alternatives like the Elastic Stack.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.8+&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;uv&lt;/code&gt; package manager (or &lt;code&gt;pip&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;An OpenObserve account — &lt;a href="https://cloud.openobserve.ai/" rel="noopener noreferrer"&gt;cloud&lt;/a&gt; or &lt;a href="https://openobserve.ai/downloads/" rel="noopener noreferrer"&gt;self-hosted&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Your OpenObserve organisation ID and Base64-encoded auth token&lt;/li&gt;
&lt;li&gt;API key for your LLM provider (OpenAI, Anthropic, etc.)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Step 1: Configure Your Environment
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;.env&lt;/code&gt; file in your project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="c"&gt;# OpenObserve instance URL
&lt;/span&gt;&lt;span class="py"&gt;OPENOBSERVE_URL&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;https://api.openobserve.ai/&lt;/span&gt;

&lt;span class="c"&gt;# Your OpenObserve organisation slug or ID
&lt;/span&gt;&lt;span class="py"&gt;OPENOBSERVE_ORG&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;your_org_id&lt;/span&gt;

&lt;span class="c"&gt;# Basic auth token — Base64-encoded "email:password"
&lt;/span&gt;&lt;span class="py"&gt;OPENOBSERVE_AUTH_TOKEN&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Basic &amp;lt;your_base64_token&amp;gt;"&lt;/span&gt;

&lt;span class="c"&gt;# Enable or disable tracing (default: true)
&lt;/span&gt;&lt;span class="py"&gt;OPENOBSERVE_ENABLED&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# LLM provider keys
&lt;/span&gt;&lt;span class="py"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"your-openai-key"&lt;/span&gt;
&lt;span class="py"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"your-anthropic-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 2: Install Dependencies
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Using uv (recommended)&lt;/span&gt;
uv pip &lt;span class="nb"&gt;install &lt;/span&gt;openobserve-telemetry-sdk &lt;span class="se"&gt;\&lt;/span&gt;
               opentelemetry-instrumentation-openai &lt;span class="se"&gt;\&lt;/span&gt;
               opentelemetry-instrumentation-anthropic &lt;span class="se"&gt;\&lt;/span&gt;
               python-dotenv

&lt;span class="c"&gt;# Or with pip&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;openobserve-telemetry-sdk opentelemetry-instrumentation-openai python-dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 3: Instrument Your Application
&lt;/h3&gt;

&lt;h4&gt;
  
  
  OpenAI
&lt;/h4&gt;

&lt;p&gt;Add two lines &lt;strong&gt;before any LLM calls are made&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;opentelemetry.instrumentation.openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAIInstrumentor&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openobserve&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;openobserve_init&lt;/span&gt;

&lt;span class="c1"&gt;# Instrument OpenAI and initialise the OpenObserve exporter
&lt;/span&gt;&lt;span class="nc"&gt;OpenAIInstrumentor&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;instrument&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;openobserve_init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Use the client exactly as normal — traces are captured automatically
&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-4o&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Summarise this document...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Anthropic (Claude)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;opentelemetry.instrumentation.anthropic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AnthropicInstrumentor&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openobserve&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;openobserve_init&lt;/span&gt;

&lt;span class="nc"&gt;AnthropicInstrumentor&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;instrument&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;openobserve_init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Anthropic&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Anthropic&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-opus-4-5&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Analyse this data...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every call is now captured as a trace span and exported to OpenObserve automatically.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The &lt;code&gt;openobserve-telemetry-sdk&lt;/code&gt; is an optional thin wrapper around the standard OTel Python SDK. If you already use OpenTelemetry, you can send telemetry directly to OpenObserve's OTLP endpoint without it.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Step 4: View Traces in OpenObserve
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your OpenObserve instance&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Traces&lt;/strong&gt; in the left sidebar&lt;/li&gt;
&lt;li&gt;Filter by service name, model name, or time range&lt;/li&gt;
&lt;li&gt;Click any span to inspect token counts, latency, parameters, and full request metadata&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  What Gets Captured in Each Trace Span
&lt;/h2&gt;

&lt;p&gt;The OTel instrumentation libraries automatically attach the following attributes — no manual coding needed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;OTel Attribute&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.request.model&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Model identifier&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gpt-4o&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.usage.prompt_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tokens in the prompt&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1,247&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.usage.completion_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tokens in the response&lt;/td&gt;
&lt;td&gt;&lt;code&gt;312&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.usage.total_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Combined token usage&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1,559&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.request.temperature&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sampling temperature&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0.7&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;llm.request.max_tokens&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Max response length&lt;/td&gt;
&lt;td&gt;&lt;code&gt;2048&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;duration&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;End-to-end request latency&lt;/td&gt;
&lt;td&gt;&lt;code&gt;2,340ms&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;error&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Exception details on failure&lt;/td&gt;
&lt;td&gt;&lt;code&gt;RateLimitError: 429&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Adding Custom Span Attributes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;opentelemetry&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;

&lt;span class="n"&gt;tracer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_tracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent-task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user.id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;usr_abc123&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;session.id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sess_xyz789&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent.name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task.type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;document-summarisation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;prompt.version&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v2.3.1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Your LLM call here — child spans are created automatically
&lt;/span&gt;    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Unique Challenges in Agentic Systems
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Non-Determinism
&lt;/h3&gt;

&lt;p&gt;Unlike traditional software, the same input to an agent may produce different execution paths on different runs. Your monitoring must capture the full trace of &lt;strong&gt;each individual run&lt;/strong&gt;, not just aggregated statistics.&lt;/p&gt;

&lt;h3&gt;
  
  
  Long-Horizon Context Windows
&lt;/h3&gt;

&lt;p&gt;As agents maintain conversation history across multiple turns, context windows grow substantially. A single agent session can consume tens of thousands of tokens. Per-turn token tracking is essential.&lt;/p&gt;

&lt;h3&gt;
  
  
  Nested and Parallel Tool Calls
&lt;/h3&gt;

&lt;p&gt;Modern agents call multiple tools — often in parallel. Distributed tracing with proper parent-child span relationships is the only reliable way to reconstruct the true execution timeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Infinite Loop Detection
&lt;/h3&gt;

&lt;p&gt;Agents can get stuck in reasoning loops, repeatedly calling the same tool without making progress. Monitor &lt;code&gt;agent.steps&lt;/code&gt; and &lt;code&gt;tool_call.count&lt;/code&gt; per session, combined with a max-step circuit breaker.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-Agent Coordination
&lt;/h3&gt;

&lt;p&gt;Orchestrator-worker architectures require trace context propagation across agent boundaries. OpenTelemetry's W3C TraceContext standard enables this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;opentelemetry.propagate&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;inject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;extract&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="c1"&gt;# Orchestrator: inject trace context into outgoing request headers
&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="nf"&gt;inject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# adds traceparent, tracestate headers
&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://worker-agent/execute&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;task_payload&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Worker agent: extract and continue the trace
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;extract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;incoming_request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_as_current_span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;worker-task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Appears as child span in orchestrator's trace
&lt;/span&gt;    &lt;span class="bp"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Critical:&lt;/strong&gt; Always propagate the W3C &lt;code&gt;traceparent&lt;/code&gt; header when your orchestrator calls a worker agent. Without this, each agent's activity appears as a disconnected root trace — making end-to-end debugging nearly impossible.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Best Practices for AI Agent Monitoring
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Instrument Early, Not After the Fact
&lt;/h3&gt;

&lt;p&gt;Add observability during development, not after incidents. Retrofitting into a complex agentic system leaves blind spots in the most critical execution paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Separate Evaluation Metrics from Operational Metrics
&lt;/h3&gt;

&lt;p&gt;Don't conflate system health (latency, error rate, tokens) with output quality (correctness, relevance, safety). Keep them in separate pipelines with separate alert policies.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Sample Intelligently, Not Uniformly
&lt;/h3&gt;

&lt;p&gt;Use &lt;strong&gt;head-based sampling&lt;/strong&gt; for normal traffic (e.g., 10%), but configure &lt;strong&gt;tail-based sampling&lt;/strong&gt; to capture 100% of failed or slow requests. Full fidelity where it matters most, without prohibitive storage costs.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Mask Sensitive Data Before Export
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;opentelemetry.sdk.trace&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SpanProcessor&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SensitiveDataRedactor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SpanProcessor&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;SENSITIVE_ATTRS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm.prompts&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm.completions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user.email&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;attr&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SENSITIVE_ATTRS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;attr&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_attribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;attr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[REDACTED]&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Version Your Prompts
&lt;/h3&gt;

&lt;p&gt;Treat prompt templates as software artefacts with version identifiers. Attach &lt;code&gt;prompt.version: v2.3.1&lt;/code&gt; as a span attribute to compare performance across prompt versions — just like canary deployments.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Tag Every Trace with Business Context
&lt;/h3&gt;

&lt;p&gt;Add &lt;code&gt;user.id&lt;/code&gt;, &lt;code&gt;session.id&lt;/code&gt;, &lt;code&gt;agent.name&lt;/code&gt;, &lt;code&gt;task.type&lt;/code&gt;, and &lt;code&gt;feature.flag&lt;/code&gt; to every trace. These transform your observability data from an engineering artefact into a &lt;strong&gt;product intelligence asset&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Build a Feedback Loop from Evals to Prompts
&lt;/h3&gt;

&lt;p&gt;Connect your evaluation pipeline back to your prompt management system. When evaluations detect a quality regression, it should automatically trigger a prompt review workflow — the AI equivalent of failing a CI/CD pipeline on test failures.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As autonomous AI agents take on consequential tasks — writing and executing code, managing business workflows, interacting with customers at scale — the organisations that invest in proper observability will have a decisive operational advantage: faster debugging cycles, lower costs, better output quality, and the confidence to scale reliably.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenTelemetry + OpenObserve&lt;/strong&gt; gives you a vendor-neutral, open-source foundation that scales from a solo developer's project to an enterprise deployment, without lock-in or prohibitive cost at scale.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You cannot improve what you cannot measure. For AI agents, observability is the measurement layer that makes continuous improvement possible.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://openobserve.ai/docs/integration/llm-applications/" rel="noopener noreferrer"&gt;OpenObserve LLM Observability Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://openobserve.ai/docs/opentelemetry/openobserve-python-sdk/" rel="noopener noreferrer"&gt;OpenObserve Python SDK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opentelemetry.io/docs/specs/semconv/gen-ai/" rel="noopener noreferrer"&gt;OpenTelemetry Semantic Conventions for LLMs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opentelemetry.io/docs/languages/python/automatic/" rel="noopener noreferrer"&gt;OpenTelemetry Python Auto-Instrumentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://openobserve.ai/blog/ai-agent-monitoring/" rel="noopener noreferrer"&gt;OpenObserve blog&lt;/a&gt; by Simran Kumari.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aiagents</category>
      <category>observability</category>
      <category>opentelemetry</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
