User-defined Playground

Observability 101 Playground

Observable Cafe with a metrics pipeline: a second cafe, VictoriaMetrics, and vmagent, for the Observability 101 course.

Observability 101 playground: Observable Cafe with a metrics pipeline: a second cafe, VictoriaMetrics, and vmagent, for the Observability 101 course.
Machines & network
1 VM · 2 vCPU · 2GiB RAM
Playground host Internet NAT MASQUERADE local (bridge) 172.16.0.0/24 gw 172.16.0.1/24eth0
VM
vCPU ·
eth0
/
oci://ghcr.io/sagikazarmark/iximiuz-labs/playgrounds/observability-101:cc3a1b49bee6
About

This playground is the lab for the Observability 101 course from Module 3 on. It is Observable Cafe with a metrics pipeline added on top: a second cafe, single-node VictoriaMetrics, and vmagent.

The image is built from the observable-cafe playground image, so everything that playground has is here too. The cafe on port 8080 runs as a systemd service from boot; the pipeline is installed but switched off, and each lesson starts the parts it needs.

The Collection Pipeline

On top of the cafe, the image carries everything needed to collect its metrics, installed but switched off:

ComponentPortPurpose
VictoriaMetrics8428Single-node time series database (victoriametrics.service, data in /var/lib/victoriametrics); scrapes whatever /etc/victoriametrics/scrape.yml lists, nothing by default
vmagent8429Scrapes whatever /etc/vmagent/vmagent.yml lists (nothing by default), accepts pushes, remote-writes to VictoriaMetrics (vmagent.service)
A second cafe8090observable-cafe@riverside.service, port set in /etc/default/observable-cafe-riverside
Caddy18428, 18429VictoriaMetrics' and vmagent's own pages (index, vmui, targets), embeddable in a tab
cafe-stocktakeCounts the beans in /etc/cafe/shelf and pushes the count to vmagent

Lessons that need the pipeline start the services from init tasks. A lesson that wants a scrape job already in place writes the scrape file as a startup file, so either process can be the scraper; otherwise the learner writes it:

sudo systemctl enable --now victoriametrics
/usr/share/observable-cafe/wait.sh http://127.0.0.1:8428/-/ready
sudo systemctl enable --now vmagent observable-cafe@riverside   # vmagent only when the lesson uses it
/usr/share/observable-cafe/open.sh 8080

The cafe's clock only starts when somebody opens it, and scraping doesn't count. open.sh opens a cafe the way a browser would, and the observable-cafe@ units open themselves when they start, since nobody visits them. Both scrapers re-read their scrape file on curl -X POST http://localhost:8428/-/reload (or :8429). api.sh calls any other server function, for example to sell a latte: /usr/share/observable-cafe/api.sh 8080 buy '{"drink":2}'.

Learn More

Happy learning! 🚀

Every playground includes
Learn more about playgrounds
Start
Settings