Your LLM App Returned 200 OK. It Was Still Wrong. — Marina Petzel, Datadog

summarized

TLDR

Traditional golden signals (latency, error, traffic, saturation) are no longer sufficient for generative AI applications, which require additional monitoring layers for cost, safety, and quality. The talk identifies specific metrics like token creep, model drift, redundant spend, prompt injection rate, PII detection, hallucination rate, and relevance scores, and recommends tagging everything for cost attribution. It's a practical framework for engineers building LLM apps, though it doubles as a pitch for Datadog's AI observability product.

Key points

Generative AI apps need new monitoring metrics beyond the traditional golden signals.

Token creep from increasing context windows can cause up to 8x cost increases.

Switching to a more powerful model like Opus can be 15 times more expensive per request.

Up to 70% of LLM spend can be redundant due to repeated identical API calls.

The speaker recommends tagging features, users, models, and endpoints for cost attribution.

Tools mentioned

Techniques

  • Cost attribution via tagging
  • Prompt injection detection
  • PII detection using regex or named entity recognition
  • Content moderation scoring
  • Hallucination rate measurement
  • Relevance scoring using embedding similarity
  • LLM-as-a-judge for answer completeness
  • RAG quality metrics like top-K accuracy and normalized discounted cumulative gain
Transcript (captions)

0:01 [music] >> Hello everyone. Thank you for joining me today. It's time to begin. And for years, many of us monitored our

0:23 applications with the golden signals, which is was latency, error, traffic, and saturation. And shortly we call them lads. And they were and still they are and

0:36 will be remain sufficient and critical for determine the health of our applications. However, today when we enter the new era era of generative AI, it's becoming not

0:47 enough. And today we going to talk about what are the new metrics we need to look if we want to build the healthy gen AI application. Very shortly, my name is Marina Petzel.

1:00 I am gen AI advocate here in DataDog. And today I will walk you through the metrics that we need to look for. So, when we talk about traditional

1:10 applications, the main specific of them is that the same input always yield the same output, right? It's predictable. But with generative AI applications, we all know

1:22 that the same prompt can generate different responses every time we run it. And which means we cannot rely on the standard regression testing alone. And you must constantly evaluate quality

1:37 in the live environment. The second difference between traditional applications and gen AI applications, it's variable cost structure. Traditional compute cost are

1:48 predictable, right? We pay for machine that is running our code. But for gen AI, this this is dynamic variable here. They might They vary from the number of tokens, the model that we are using, or

2:03 the size of the context window that you have. And it's become essential to do the real-time granular course cost to prevent the spending out of control.

2:16 The third problem is that we face the new attack vectors. We used to worry about SQL injection or cross-site scripting before, but today we must defend against the prompt injection,

2:30 jailbreaking, or PII outage in our output. And that's becoming a big problem, and this are security issue, not a simple 500 error code can will never catch, and demanded entirely new

2:45 forms of security monitoring. And finally, quality is very subjective for GenAI applications. The traditional systems either work or do not work, right? But

2:58 generative AI output is judged on the spectrum. Is it relevant? Is it accurate? Is it complete or not? And the problem is that 200 okay response from your server doesn't necessarily mean

3:12 that the answer was helpful or correct for your final user. And we must now integrate the continuous quality evaluation directly in your monitoring stack.

3:25 And at the beginning we all were thinking that these golden signals will be enough for our systems, but unfortunately they are not. Traditional metrics will tell you if your system is

3:38 up and running, but it won't tell you how well it's running. And established metrics lets will be still essential, but we going to talk

3:49 about what else on addition to that we need to implement into our systems? And first I want to start with the cost monitoring. How we can track the spending before it

4:01 uh spirals out of control? And I think we all know the financial implications of GenAI, and a lot of companies are facing the huge outage of the uh cost per their monthly usage. And

4:17 while the same is true as for traditional applications, there were more linear scale between the throughput and the uh the cost. If the user loads um load goes up, our resources uh usage

4:31 goes up, and sequentially the cost goes up. But the cost structure for LLM is highly dynamic and unpredictable, which means we can we don't have this visibility, and we need to really pay

4:47 attention how we track that. And what are the problems you might encounter with the cost? And here we talk about the three major way for cost tracking, uh and so you can

4:59 track them um to prevent the cost outage. So, the first is a token creep. Uh this happens when engineers or product managers trying to improve the

5:11 quality quietly increasing the context window. And let's say the context window was 4,000 tokens, and then it's like blow to 132

5:22 without any financial review. And what it can cost like the the cost is depends very uh significantly to the context count, and that might result up to eight x cost increased. And

5:36 and a month it might cost you thousands of dollars. Second is the model drift. Uh that is also the pretty typical problem when the team switches from cheaper and faster

5:46 model, like let's say Hi Cool 4.5, to the more powerful and more expensive model, like Opus 4.8. And which promise you obviously the better quality. But at the same time,

6:00 Opus, for example, uh can be higher 15 times higher uh per the cost request. And this change in model, even with the same usage volume,

6:12 might blow your cost significantly within a month, too. And finally, it's on hash code. In generative AI, the same query can hit the API repeatedly if you haven't

6:26 implemented the effective caching layer. And what you will see from um our uh own research that 70% of the spend sometimes are redundant because the system is paying for exactly the same

6:41 expensive model completion uh over and over again. And with this granular visibility into these three layers, you would be able to escalate your cost rapidly. And now,

6:55 let's talk about how you can prevent that and get more granular data. And when we um talk about that, we uh try to think about the implementation

7:08 of cost attribution strategy, which is you must tag absolutely everything. For example, uh tagging uh can help you to uh Why it's important, right? You receive a lot of uh interactions with

7:23 your agents, and but all of these uh interactions are undifferentiated. You don't know what's blow your actual cost. That is why first layer what you can implement is

7:34 the feature level level. By tagging the intention of the feature, like it was a chat or summarization, you can attribute the cost for the specific product areas. And this data is crucial not only for

7:48 engineering your cost management, but also for the product road map decisions, like knowing which features are actually the budget hawks. The second level is the use user level.

8:01 Using the tags like the user ID or your org name is essential for chargebacks, accurate billing, but also quickly identify by the patterns of abusive usage before they drain your budget.

8:16 Third is the model level. Also tag your models like GPT-5.5 or the provider, OpenAI or Tropic. It will give you visibility into the high-level areas of cost optimization.

8:33 And you can benchmark the true expenses of using one model versus another. And the finally, endpoint level tagging. Attributing cost to regions or to your

8:46 production or like to your environment like production or staging helps your infrastructure planning. And you can see how regional distribution or staging versus production environment can impact

8:59 your total spend. And by making this tagging mandatory practice, you gain the essential visibility to understand exactly where your money is going and how important

9:13 to control it. Well, but now let's talk if like let's let's imagine that we handle all the cost issues, right? We took that under control.

9:24 And your finance team is obviously get very happy, but the next one problem is the safety. And your AI can be cheap, but still leak some of the

9:37 sensitive or personal information, which is not great. And even though like your let scores can be perfect, it cannot tell you if there are some

9:49 metrics went wrong. So, what we can track here in the safety metrics to First is the prompt injection rate, which has become the very crucial problem. This metrics detects the

10:01 manipulation attempts into your user prompts. There are It's infrastructure If the infrastructure design doesn't have any guardrails. And this can be um

10:15 prevent by using some advanced techniques like a pattern matching or specialized classifier models. And for this, we usually need to target for very aggressive thresholds.

10:29 The second is PII detection rate. Um PII So, which is a crucial and zero tolerance issue here. We can scan all the model outputs for sensitive data

10:42 like social security, like credit cards, or personal information. And you can use some um methods like regex or named entity recognition here. And only

10:56 acceptable target should be 0% of your production outputs. The third is the content moderation score. How you can determine if your content is

11:08 toxic, harmful, or biased uh towards some of the topics. And by running all outputs through toxicity classifier can give give you a scores uh how what is the risk of your

11:23 output for being exposed to this uh toxic uh output. And this allows you to set some clear thresholds, and we always target to uh

11:35 minimize that as much as we can. And then finally, the jailbreak attempts. And there are persistent attempts by users to bypass the safety guardrails

11:47 and often um through the elaborate scenarios. And tracking tracking patterns to indicate the system prompt overrides,

11:57 you should design and become so it become the absolute blocker for you. So, ideally, we should block all the 100% of the attempts of that. Now, let's imagine that cost is checked,

12:12 security is checked, but now you arrive to arguably the most crucial dimension and the quality monitor that at least the most crucial for our final

12:24 users. And even though your let's metrics showing that your service is up and running and running, your cost and safety tells you that

12:37 your service is budget compliant and also secure, but ultimately for any application, but more for generative application, it's whenever output is good. But

12:50 we all know that 200 okay response from your server sometimes can be a lie if the answer is hallucination. And I'm sure many of you got some response from modern AI applications,

13:04 right? But like we know that it's can confidently by like but lie to you. And now let's understand what type of metrics you can apply implement to your application right now to prevent it from

13:18 being unsafe for your final user. We recommend to focus on these five metrics. One of them is hallucination rate.

13:27 Um, this measures the percentage of respondent contain claims unsupported by the grounded data. Um, we need to mix that with the manual review as well as with automated fact

13:41 checks to achieve the aggressive targets here, too. The final The next one is the relevance scores, which helps you to understand if the

13:52 response actually address the user question. Um, that techniques like that you can use here is similarity using bird or embedding similarity that can score you

14:06 um, how relevant is the final answer was to the user. The next one is user satisfaction, which directly falls into your end user.

14:16 Uh, you must implement You can implement some mechanisms like thumbs up, thumbs down, or some of the stars ranking, and also NPS scores um, to capture the subjective data, but also

14:30 you should target that you get more than 80 85% of the positive feedback, at least. Next one is the answer completeness, and this metric is often evaluated by LLM as

14:45 a judge, answering whenever the response was fully or holistically addressed um, the user intent. Um, and final one, the fifth one, um, if you are using rag, retrieval

14:59 augmented generation system, you should always track the quality of your rag. What's if all the documents that were fetched were relevant to the user query? And here you have a lot of metrics and

15:12 mechanisms how you can calculate that. For example, top K accuracy or normalized discounted gains, and that is uh, essential to track because whenever like you contacts is explode is getting

15:26 harder and harder to pick the most relevant one. And by implementing this metrics, you can gain some understanding of like more

15:35 dimensional view of the quality that necessary you need to optimize to improve your journey application. Well, and now let's summarize um

15:47 what we need to implement to make sure that our journey application is healthy, right? We are not saying that we need to get rid of traditional understanding. We always need to look into our metrics,

16:00 lay let's latency error traffic and saturation, but also on top of that, we need to put another layer. Layer of which is more relevant to generative applications. And in this case, we

16:14 talked about the cost, safety, and also quality. And I know that for us as an engineer is becoming more and more critical right now to track it all not be don't need

16:26 just build application and make sure that it's running in production, but now we also need to care about additional layer of complexity. And thankfully, Datadog has your back here since we are

16:40 working in observability and monitoring space for for really long time. So, we do have our agent observability uh product which allows you to quickly and easy understand if your AI

16:53 application is healthy, if it's running, or there is any problem that you need to fix. And we do have a lot of different way things that you can track inside of

17:05 that. And um if you want to hear more about that, please feel free to see me afterwards. We also do have the booth here uh which you can check it out. We do

17:16 have a really good um offers for you if you want to just try it out and see how agent observability can help your application. We have some

17:27 QR codes for the free trials. And with that, I want to thank everyone. Again, my name is Marina Betzel. If you want to contact me, please feel free to use this QR code. And yeah, thank you

17:40 for being here today. >> [music]

Frontier News · by Hyperjump Technology