docker-compose up -d
http://localhost:3000
ログイン画面が表示されるのでログインする(初期アカウントはUsername, Password共にadmin
)
Data Sources > Prometheus
Prometheus server URLにはhttp://prometheus:9090
を設定し、"Save & Test"を押下
Dashboards
からk6 Prometheus Dashboardをimportする
(ダッシュボードID: 19665
)
docker compose run k6 -o experimental-prometheus-rw run /scripts/sample.js
ローカルで起動しているアプリケーションに対して負荷テストを行う場合、localhost
をhost.docker.internal
に置き換える。
let res = http.get("http://host.docker.internal:8080");
https://zenn.dev/nyama39/articles/3ef0d951e2aa30
https://zenn.dev/hal_shu_sato/articles/docker-compose-container-host-connection