Guided practice — Add a business metric, rebuild the image, see it in Grafana

Guided practice29 min
Duration
45 to 60 min
Module
3/7
You will build
a counter recherches_catalogue_total{categorie} added to the API's real code, a rebuilt Docker image, and the new metric read in /metrics, in Prometheus, then in Grafana Explore
Deliverable
the output of sum by (categorie) (rate(recherches_catalogue_total[1m])) with eleven categories, and the id_requete of your own search found in Loki

How to read this page. Click each "Show …" to expand a section; the ## headings remain visible even when collapsed. Read in order: Objective, In brief, The dataset, First queries, then The API in the terminal, Prometheus, Grafana and Loki. Open a single appendix: A if you are on Windows (PowerShell), B if you are on Linux, macOS, WSL 2 or Git Bash. Appendix C (If it breaks) is common to both.

Preview — the rest of the lesson is for enrolled readers.

Already enrolled with a code?

Your access is tied to your account, not to this link. Sign in with the same email you used in class: your course is waiting, no need to enter the code again.

Sign inNo account yet? Create one
This lesson is part of the “Instrument the deployed solution” module

The first modules of the course are open to everyone. For the rest you have three options: buy this course once and for all, subscribe, or enter the code handed out in class.

Are you a student on this course?

The code is tied to your account: sign in or create an account and it will be applied automatically when you come back.

No account yet? Create one