Step 2 · run it before you push
Add a line for GET /metrics to tests/smoke.sh, build the image and run it next to a database as the pipeline's test job does. Then look at the answer:
$ curl -s http://127.0.0.1:8000/metrics | grep '^http_' | grep -v bucket
http_requests_total{path="/health",status="200"} 2.0
http_requests_total{path="/info",status="200"} 1.0
http_requests_total{path="/metrics",status="200"} 1.0
http_requests_total{path="/api/boardgames",status="201"} 1.0
http_requests_total{path="/api/boardgames/{gid}",status="200"} 2.0
http_requests_total{path="/api/boardgames",status="200"} 4.0
http_requests_total{path="/api/boardgames",status="400"} 1.0
http_requests_total{path="/api/boardgames/{gid}",status="204"} 1.0
http_requests_total{path="/api/boardgames/{gid}",status="404"} 4.0
http_requests_total{path="unmatched",status="404"} 1.0
http_request_duration_seconds_count{path="/health"} 2.0
http_request_duration_seconds_sum{path="/health"} 0.003713637590408325
…
Without the grep -v the answer holds 15 _bucket lines per path, with le from 0.005 to +Inf. Every path label is a route, every status a number: that is what the check reads. Commit, push; the pipeline builds, tests, scans and deploys to dev.