Lesson 3 of 4 Quotas, Cost and Monitoring for AI Workloads

Monitoring Model Quality, Drift and Safety in Production

This lesson explains what to monitor, and with which tools, in a generative system that can become slower, more expensive, less accurate or less safe without any code change: operational metrics, quality evaluation and safety signals.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the operational metrics Azure Monitor records for deployments.
  • Explain how continuous evaluation detects quality and grounding drift.
  • Describe how to monitor guardrail safety events.

Operational metrics

Conventional applications fail visibly: they throw errors or slow down. A generative system can also fail silently. Its answers can become less accurate after a model version change, less grounded after the index is updated, more expensive after a prompt edit, or less safe when users discover a new way to manipulate it, while every request still returns HTTP 200. Monitoring therefore has three layers. Operational metrics show whether the system is available, fast and within quota. Quality evaluation shows whether its answers are still good. Safety signals show whether it is being attacked or producing harmful content. Each layer uses different tools, and a healthy dashboard in one layer says nothing about the others.

Azure Monitor records metrics for each Foundry resource and deployment, including request counts split by status code (which reveals 429 and 5xx errors), processed prompt tokens, generated completion tokens, time to response and, for provisioned deployments, utilization. Metric alerts notify the team when, for example, the error rate or utilization exceeds a threshold. Diagnostic settings send resource logs to a Log Analytics workspace for longer retention and Kusto Query Language (KQL) analysis.

Scenario questions

Monitor the deployment

Exam skills 1.3.2 · 2.3.3

Practise using Azure Monitor for Foundry deployments.

Log in to try this activity Interactive activities are free with an account.

Quality, grounding and drift

Metrics do not show whether answers are correct. Continuous evaluation runs evaluators on a sample of production traces, for example groundedness, relevance, coherence and, for agents, task adherence and intent resolution, and plots the scores over time in the Foundry portal and Application Insights. Drift appears as a sustained change in these scores or in input patterns. Common causes are a model version change, changes in source content or the index, new kinds of user questions, and prompt edits.

Grounding quality deserves its own signal: a fall in groundedness with stable relevance usually means the model is adding unsupported content, while a fall in both often means retrieval is returning the wrong chunks. User feedback, such as thumbs-up and thumbs-down ratings logged with the trace ID, complements automated evaluation.

Safety events

Guardrails annotate or block requests and responses, and the annotations show which risk was detected at which intervention point. Monitoring the count of blocked requests by category reveals attack campaigns (a rise in user prompt attacks), problems with content sources (indirect attacks detected in retrieved documents) and overly strict settings (many blocks of legitimate content). Abuse monitoring by Microsoft also detects patterns of misuse; customers review their own safety events and adjust guardrails and application logic.

Sort into groups

Read the safety signal

Exam skills 1.3.2

Decide what each pattern of guardrail events suggests.

Log in to try this activity Interactive activities are free with an account.
Worked example

Finding the cause of declining answers

Two weeks after a quarterly update of the policy library, users report wrong answers. Continuous evaluation shows that relevance and groundedness both fell, while latency and error rates are unchanged.

Falling relevance and groundedness together point to retrieval rather than the model: the update may have added documents that failed to index, changed document structure so that chunks lost context, or left superseded versions in the index. The next step is to check indexer execution history and run the labelled retrieval query set, not to change the model.

Check yourself

Which signals come from Azure Monitor metrics, and which need continuous evaluation?

Show answer

Latency, errors and token counts come from Azure Monitor metrics. Correctness and grounding need continuous evaluation of the outputs.

Exam Tips

Remember for the exam

  • Latency, errors and tokens: Azure Monitor metrics. Correctness and grounding: continuous evaluation.
  • Relevance and groundedness falling together usually indicates a retrieval problem.
  • Track blocked requests by risk category to detect attacks and overly strict settings.