We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Welcome to Logging and Telemetry

By now you've built a web service (or seven). You've added features, fixed bugs, and felt the thrill of seeing your code in action.

But sometimes... things break.

Servers crash. Users trigger weird edge cases. Bugs sneak through. The difference between junior and senior engineers isn't avoiding failure, it's building systems that handle and detect failure gracefully. In this course, we'll answer two seemingly simple questions:

  • "How do I know when something is going wrong?"
  • "How can I identify the problem as quickly as possible?"

for Windows Users

If you try to complete this course without WSL 2 installed on Windows, you're gonna have a bad time.

Learning Goals

  • Understand observability – what it is, and how it can help you
  • Effective logging using Go's log and log/slog packages
  • Avoid common traps, including missed logs, too many logs, and security leaks
  • Set up actionable alerts without creating noise
  • Collect and visualize metrics with Prometheus and Grafana
  • Trace requests and diagnose performance with pprof and OpenTelemetry

Boot.dev CLI

Throughout this course, you'll be using the Boot.dev CLI to run our tests (which are just CLI commands) against your local environment. Install it now if you don't already have it. All the instructions and troubleshooting info are on the GitHub page.

Make sure the Boot.dev CLI install worked:

bootdev --version

If you're stuck, reach out in the help forums of the Discord.

Once the bootdev command is working, log in and follow the instructions:

bootdev login

Run vs. Submit

Lessons have a series of commands that run on your local machine, and tests that are checked against the results of those commands. There are two ways to run the CLI tests – run and submit:

  1. bootdev run <id>: This will run the commands and show you the results. It's useful for debugging, but it won't tell you explicitly whether or not you've passed the tests.
  2. bootdev run <id> -s: This will run the commands and give you pass/fail feedback. It will also mark the lesson as complete on the website. If you get something wrong, however, you could lose your sharpshooter spree, so be sure to use run first!

You can copy the run/submit commands with the lesson ID ready-to-go from the test panel.

Assignment

Complete your first CLI check.

Run and submit the CLI tests.