Examples using k6 extensions. Some tests require a custom k6 binary built with xk6; others use automatic module resolution and run with the standard k6 binary.
Install xk6:
go install go.k6.io/xk6/cmd/xk6@latestTests pizza recommendations against custom restrictions using a local Go extension (quickpizzaext).
Build the custom k6 binary:
xk6 build --output k6/extensions/k6 \
--with github.com/grafana/quickpizza/extensions/quickpizzaext=./k6/extensions/quickpizzaext \
--replace github.com/grafana/quickpizza=.Run the test:
./k6/extensions/k6 run k6/extensions/01.quickpizzaext.jsLoad-tests a Prometheus remote write endpoint using xk6-client-prometheus-remote.
Build the custom k6 binary:
xk6 build --output k6/extensions/k6 \
--with github.com/grafana/xk6-client-prometheus-remote@latestRun the test:
./k6/extensions/k6 run k6/extensions/02.prometheus-client.jsBy default the test targets http://localhost:9090/api/v1/write. Override with:
./k6/extensions/k6 run k6/extensions/02.prometheus-client.js -e RW_URL=http://your-prometheus:9090/api/v1/writeRuns read and write load scenarios directly against the QuickPizza PostgreSQL database using xk6-sql. This test uses automatic module resolution — no custom binary needed.
Prerequisites: a running PostgreSQL instance seeded with the QuickPizza schema. Start one with:
docker compose -f compose.grafana-local-stack.monolithic.yaml up postgres -dRun the test:
k6 run k6/extensions/03.postgresql.jsBy default the test connects to postgres://postgres:postgres@localhost:5432/quickpizza_db. Override with the PGCONN environment variable by editing the connection string at the top of the file.