Generative AI · Advanced level

Advanced level · Module 11: AI Application Testing and Observability · Lesson 3 of 3

Tracing and Observability

Learners log every model call with inputs, model version, tokens, latency and outcome (without sensitive data), and build a simple dashboard.

In this lesson you will

  • Trace model calls and pipeline steps
  • Build an observability dashboard

Key concepts

trace and spanmodel versiontoken and cost logginglatency percentilesprivacy in logs

The lesson

Observability means knowing what the application did: for each request, record pipeline steps (spans) with model and version, tokens, cost estimate, latency and outcome. Use structured logs with request IDs.

Do not log secrets or unnecessary personal data; log document IDs rather than full text where possible.

A simple dashboard (daily requests, error rate, p95 latency, cost, user-reported problems) shows when something changes, such as a provider update that alters behaviour.

Step by step

  1. Add structured trace logging to the capstone.
  2. Run 100 requests.
  3. Build a daily summary chart.
  4. Identify the slowest and costliest steps.

Practice activity

Add tracing and a dashboard to the capstone.

Expected result: Complete traces and a dashboard that reveals bottlenecks.

Check your understanding

  1. What should a trace record for each model call?

    Show answer

    Model and version, tokens, cost, latency and outcome.

  2. What should not be logged?

    Show answer

    Secrets and unnecessary personal data.

Further learning

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.