CertSafari
    Databricks Certified Generative AI Engineer Associate· Lessons

    Domain 3 · Lesson 26/56

    Evaluation vs monitoring in the Gen AI application life cycle

    Compare the evaluation and monitoring phases of the Gen AI application life cycle

    16 min read
    2.31% of exam
    9 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Tell apart the evaluation phase (pre-release, curated dataset, labels available) and the monitoring phase (post-deployment, sampled live traces, no labels), and say which one a given scenario calls for
    • Pick judges that each phase can run, based on whether they need ground truth
    • Explain how the same MLflow scorers carry over from offline evaluation to production monitoring, and when they do not
    • Set sampling rates and filters for monitoring scorers to balance coverage and cost

    Key concept

    Evaluation phase vs monitoring phase — Evaluation scores an app version before release, against a curated dataset that can carry ground-truth expectations. Monitoring scores a sample of live production traces after deployment, where there are no labels. Both phases use the same scorers, so quality is measured the same way before and after release.

    1.Two phases that answer one quality question

    Evaluation and monitoring both ask whether a Gen AI app gives answers that are correct, grounded and safe. They ask it at different times, on different data. Evaluation happens before release. You run an app version against a fixed, curated dataset and compare the result with the previous version. Monitoring happens after deployment. Scorers run continuously on real user traffic that nobody picked in advance. The scoring machinery is mostly the same in both phases, so the real choice is about timing and data: do you have a known set of test cases and a change you haven't shipped yet, or a live app and traffic you can't predict?

    The evaluation phase is built around a dataset. That means a curated set of queries, ideally with expected outputs, that represents how the app is meant to be used and includes hard and varied cases. The mlflow.genai.evaluate() harness runs the app on every record and applies scorers. It is the tool for checks that must finish before something ships: validating a prompt or model change across app versions, nightly or weekly regression runs, and gating a release or PR. Because every version is scored against the same records, the runs can be compared directly. A drop in one judge's pass rate after a prompt edit is a regression you catch before any user sees it.

    The monitoring phase starts once the app is live. In production you need to score far more requests than any curated set holds, and you need to know how each response was produced. If a bad answer came from the retrieval step and not from a hallucination, the trace has to show it. So monitoring depends on production tracing: the app must log inputs, outputs and intermediate steps such as document retrieval. Agent Monitoring: scheduled scorers on production traces then runs scorers on a sample of those traces and attaches the results as feedback, and dashboards show quality trends over time.

    How the two phases differ
    AspectEvaluation phaseMonitoring phase
    When it runsDuring development: before a release, on a PR, nightly or weeklyAfter deployment, continuously in the background
    Data scoredA curated evaluation dataset of representative, challenging inputsA sample of live production traces
    Ground truthRecords can carry optional expectationsLive traces arrive with inputs and outputs only
    What triggers itA prompt, model or logic change to validateIncoming traffic, at a configured sample_rate
    Typical questionDid this version regress against the last one?Is quality drifting, or are safety violations appearing now?

    Monitoring can't stand in for evaluation when the goal is to stop a regression before release. Monitoring only sees traffic that has already reached the changed version, so by the time it flags a problem, users have already hit it. Two other substitutes fail for different reasons. A version history of prompts records what changed but doesn't score anything. Watching endpoint latency measures speed, which is a separate requirement from response quality. Only scoring outputs against a dataset tells you whether the new version is better or worse.

    An evaluation run: a fixed set of inputs, the app passed as predict_fn, and scorers applied to every resultpython
    results = mlflow.genai.evaluate(
        data=[
            {"inputs": {"question": "What is MLflow?"}},
            {"inputs": {"question": "How do I get started?"}}
        ],
        predict_fn=my_chatbot_app,
        scorers=[RelevanceToQuery(), Safety()]
    )

    Checkpoint 1 of 8· Check yourself

    A team has edited the system prompt of its deployed RAG assistant. They want to find out whether the edit lowers answer quality before any user gets the new version. What should they do?

    Checkpoint 2 of 8· Exam question

    A team building a customer support RAG agent on Databricks has just finished revising a prompt template. Before shipping the change to production, they want to systematically compare the new version's response quality against a curated set of question-answer pairs and flag regressions relative to the prior version. Which approach best fits this need?

    Sources1234

    2.Ground truth decides which judges each phase can run

    Labels are the clearest practical difference between the two phases. In an evaluation dataset, each record has required inputs and an optional expectations field, which holds ground truth for scorers. Expectations get there on purpose: someone curates traces into a dataset and enriches them with expected outputs, often labels from domain experts. A production trace has none of this when it arrives. It records what the user asked and what the app did, not what the right answer was.

    Built-in judges split cleanly on this point, and the split tells you where each one can run. Reference-free judges need only the inputs and outputs, so they work on a curated dataset and on unlabeled production traffic alike. Judges that need ground truth also take expectations, so they belong to the evaluation phase, where a labeled benchmark exists. The full taxonomy is covered in judges that require ground truth. What matters here is the consequence for each phase.

    Built-in judges by ground-truth requirement
    JudgeRequires ground truthWhat it evaluatesRuns on unlabeled live traffic?
    RelevanceToQueryNoIs the response directly relevant to the user's request?Yes
    RetrievalRelevanceNoIs the retrieved context directly relevant to the user's request?Yes
    SafetyNoIs the content free from harmful, offensive, or toxic material?Yes
    RetrievalGroundednessNoIs the response grounded in the context, or is the agent hallucinating?Yes
    CorrectnessYesIs the response correct as compared to the provided ground truth?No: needs expectations
    RetrievalSufficiencyYesDoes the context provide all the information needed for a response that includes the ground truth facts?No: needs expectations

    Take a small internal benchmark of question and expected-answer pairs for a RAG agent. If the question is whether the retrieved passages actually contain the facts the expected answer needs, the judge has to read the label, and RetrievalSufficiency does exactly that. RetrievalRelevance sounds similar but answers a weaker question: whether the context is on topic for the query. A passage can be relevant and still leave out the fact the answer depends on. Safety checks for harmful content and says nothing about coverage. A judge built for tool calls looks at the wrong part of the trace. The benchmark's labels make this an evaluation-phase task.

    Checkpoint 3 of 8· Check yourself

    Your deployed RAG assistant logs each request's query, retrieved documents and response as a trace. No one adds expected answers to these traces. Which set of built-in judges can a monitoring job run on these traces as they arrive?

    Checkpoint 4 of 8· Exam question

    An engineer wants to evaluate whether a RAG agent's retrieved context actually contains the facts needed to produce a labeled expected answer, using a small internal benchmark of question/expected-answer pairs. Which type of judge is appropriate, and why?

    Sources156

    3.The same scorers connect the two phases

    A scorer is written once and used in both phases. The interface is the same either way: a scorer receives a Trace from either evaluate() or the monitoring service, pulls out the fields it needs, makes its assessment, and returns Feedback that gets attached to the trace. Because the input is always a trace, a judge you tuned on the evaluation dataset can be registered against the experiment and left to run on production traffic. Quality before release and quality after release are then measured the same way.

    Monitoring setup: register a scorer with the experiment, then start it with a sampling configurationpython
    from mlflow.genai.scorers import Safety, ScorerSamplingConfig
    
    # Register a built-in scorer against your experiment, then start monitoring
    safety = Safety().register(name="safety")
    safety = safety.start(sampling_config=ScorerSamplingConfig(sample_rate=1.0))

    Scorers carry over most reliably when evaluation runs the real app. In direct evaluation, MLflow calls your app through predict_fn (or a serving endpoint wrapped with to_predict_fn) and captures traces. Those traces have the same shape as the ones production logs. If you used your production app as the predict_fn during development, your scorers are likely already compatible with monitoring.

    Answer-sheet evaluation is where reuse can fail. In that mode you hand evaluate() pre-computed outputs or existing traces from batch jobs, external systems or history, and it builds or scores traces without calling your app. If those traces look different from what production logs, a scorer that parses fields from the trace may not find them in production. Then you need to rewrite the scorer before it can monitor anything.

    Checkpoint 5 of 8· Check yourself

    Which development-time evaluation setup makes it most likely that your custom scorers, which parse fields from the trace, can be registered for production monitoring without being rewritten?

    Sources7183

    4.Monitoring live traffic: sampling, filters and closing the loop

    An evaluation dataset has a fixed size. Production traffic doesn't, so monitoring trades coverage against cost through a sample rate for each scorer. This is what keeps monitoring cheap: you track quality trends from a fraction of requests without scoring every one, and you can still score every request for the checks that can't miss anything.

    Sample rate guidance for monitoring scorers
    Scorer kindsample_rateReason
    Critical checks (safety, security)1.0Every trace is scored, so violations show up close to real time
    Expensive scorers (complex LLM judges)0.05–0.2Enough to show the quality trend at a fraction of the compute cost
    Iterative improvement during development0.3–0.5Moderate coverage while you iterate

    Sampling decides how many traces a scorer sees. filter_string decides which ones, using the same syntax as mlflow.search_traces(). There are a few limits to plan around. At most 20 scorers can be attached to an experiment for monitoring at once. The first results take 15–20 minutes to appear after you schedule scorers. Monitoring only sees apps that log traces with MLflow Tracing.

    Restricting a monitoring scorer to traces that completed successfullypython
    from mlflow.genai.scorers import Safety, ScorerSamplingConfig
    
    # Only evaluate traces that completed successfully
    safety_judge = Safety().register(name="safety")
    safety_judge = safety_judge.start(
        sampling_config=ScorerSamplingConfig(
            sample_rate=1.0,
            filter_string="attributes.status = 'OK'"
        ),
    )

    Monitoring also feeds the next round of evaluation. Improving an agent is a loop: you find an issue, curate a dataset, write a scorer, fix the agent, re-run evaluation, then monitor production so the issue doesn't come back. Monitoring then surfaces the next issue. Production traces that scored poorly can be pulled with search_traces() and merged into the evaluation dataset. Once domain experts add expectations, they become labeled cases that every future version is tested against before release. Synthetic data generated from your documents can also seed an evaluation set, but it fills that dataset. It doesn't replace scoring real traffic.

    Pulling successful production traces into an evaluation datasetpython
    traces = mlflow.search_traces(
        filter_string="attributes.status = 'OK' AND tags.environment = 'production'",
        order_by=["attributes.timestamp_ms DESC"],
        max_results=10
    )
    
    print(f"Found {len(traces)} successful traces")
    
    # 3. Add the traces to the evaluation dataset
    eval_dataset = eval_dataset.merge_records(traces)

    Checkpoint 6 of 8· Fill the gap

    This monitoring scorer should only score production traces that finished successfully. Which ScorerSamplingConfig parameter completes the setup?

    from mlflow.genai.scorers import Safety, ScorerSamplingConfig
    
    # Only evaluate traces that completed successfully
    safety_judge = Safety().register(name="safety")
    safety_judge = safety_judge.start(
        sampling_config=ScorerSamplingConfig(
            sample_rate=1.0,
             ? ="attributes.status = 'OK'"
        ),
    )

    Checkpoint 7 of 8· Check yourself

    Monitoring shows that a group of production traces scored poorly on RetrievalGroundedness. How do these failures become test cases that every future version must pass before release?

    Checkpoint 8 of 8· Exam question

    A GenAI agent has been serving live customer traffic for three months. The team wants an ongoing, low-overhead way to track response quality trends without evaluating every single request, and to get near-real-time visibility into safety violations. What should they configure?

    Sources895

    Sources

    (9)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Validating prompt or model changes across app versions”
      ↩︎ Two phases that answer one quality question
      “this mode enables you to reuse the scorers defined for offline evaluation in production monitoring since the resulting traces will be identical.”
      ↩︎ The same scorers connect the two phases
      “Before a release or PR to prevent quality regressions”
      ↩︎ Exam trap 1
      “If you use an answer sheet with different traces than your production environment, you may need to re-write your scorer functions”
      ↩︎ Exam trap 3
      “Before a release or PR to prevent quality regressions”
      ↩︎ Checkpoint
    2. 2.
      “you need a curated set of evaluation queries (and ideally outputs) that are representative of the application's intended use.”
      ↩︎ Two phases that answer one quality question
      “Once in production, you need to evaluate a significantly higher quantity of requests/responses and how each response was generated.”
      ↩︎ Two phases that answer one quality question
      “Technically, evaluation happens during development and monitoring happens once the application is deployed to production, but the fundamental components are similar.”
      ↩︎ Key concept
    3. 3.
      “Production monitoring continuously runs MLflow scorers on a sample of your live production traces and attaches the results as feedback”
      ↩︎ Two phases that answer one quality question
      “the same scorers you built during evaluation now watch production.”
      ↩︎ The same scorers connect the two phases
    4. 4.
      “Evaluation measures whether your agent is actually good”
      ↩︎ Two phases that answer one quality question
    5. 5.
      “Enrich your traces with expected outputs or quality indicators to enable ground truth comparison.”
      ↩︎ Ground truth decides which judges each phase can run
      “Synthetic data. Databricks can automatically generate a representative evaluation set from your documents”
      ↩︎ Monitoring live traffic: sampling, filters and closing the loop
    6. 6.
      “Does the context provide all necessary information to generate a response that includes the ground truth facts?”
      ↩︎ Ground truth decides which judges each phase can run
      “Is the retrieved context directly relevant to the user's request?”
      ↩︎ Ground truth decides which judges each phase can run
      “Is the response correct as compared to the provided ground truth?”
      ↩︎ Exam trap 2
      “Is the response correct as compared to the provided ground truth?”
      ↩︎ Prediction
    7. 7.
      “You can use the same scorer for evaluation in development and monitoring in production to keep evaluation consistent throughout the application lifecycle.”
      ↩︎ The same scorers connect the two phases
      “A scorer receives a Trace from either evaluate() or the monitoring service.”
      ↩︎ The same scorers connect the two phases
    8. 8.
      “If you used your production app as the predict_fn in mlflow.genai.evaluate() during development, your scorers are likely already compatible.”
      ↩︎ The same scorers connect the two phases
      “Configurable sampling rates so you can control the tradeoff between coverage and computational cost.”
      ↩︎ Monitoring live traffic: sampling, filters and closing the loop
      “At any given time, at most 20 scorers can be associated with an experiment for continuous quality monitoring.”
      ↩︎ Monitoring live traffic: sampling, filters and closing the loop
      “After scheduling scorers, allow 15-20 minutes for initial processing.”
      ↩︎ Monitoring live traffic: sampling, filters and closing the loop
      “Instrumented production application: Your agent must log traces using MLflow Tracing.”
      ↩︎ Monitoring live traffic: sampling, filters and closing the loop
      “For expensive scorers, such as complex LLM judges, use lower sample rates (0.05-0.2).”
      ↩︎ Exam trap 4
      “For critical scorers such as safety and security checks, use sample_rate=1.0.”
      ↩︎ Prediction
    9. 9.
      “Monitor production. Run your scorers against live traffic so the issue doesn't recur — which surfaces the next one to fix.”
      ↩︎ Monitoring live traffic: sampling, filters and closing the loop
      “Build evaluation and golden datasets from representative production failures.”
      ↩︎ Checkpoint

    Spotted a mistake, or was something unclear? Tell us.