Chapter 17 Exercises

These exercises help you implement observability patterns for MCP servers.

AI-Guided Exercises

The following exercises are designed for AI-guided learning. Use an AI assistant with the course MCP server to get personalized guidance, hints, and feedback.

  1. Logging Middleware ⭐⭐ Intermediate (35 min)

    • Implement structured logging middleware
    • Configure correlation IDs for request tracing
    • Set up log levels and filtering
    • Integrate with CloudWatch or similar
  2. Metrics Collection ⭐⭐⭐ Advanced (45 min)

    • Add Prometheus-compatible metrics
    • Track request latencies and error rates
    • Implement custom business metrics
    • Configure alerting thresholds

Prerequisites

Before starting these exercises, ensure you have:

  • Completed deployment chapters (ch07-ch10)
  • A deployed MCP server to instrument
  • Basic understanding of observability concepts

Next Steps

After completing these exercises, continue to: