{"agent":"claude","input":"Add Prometheus metrics to this Fastify app. Read package.json, src/app.ts, src/server.ts, every file under src/plugins/external, src/routes/api/autohooks.ts, src/routes/home.ts, test/helper.ts and .github/workflows/ci.yml first. Add prom-client and write src/plugins/external/metrics.ts as a named fastify-plugin that creates its own Registry per instance, calls collectDefaultMetrics on it, and registers an http_request_duration_seconds histogram and an http_requests_total counter labelled method, route and status_code, observed from an onResponse hook using reply.elapsedTime and request.routeOptions.url so the route label is the template and never a concrete id; label unmatched requests as unmatched. Add a gauge that reads the knex pool's used, free and pending counts. Add src/routes/metrics/index.ts with GET /metrics outside the api directory, rate limiting switched off for the route, no tags, answering the registry's content type and text. Add node:test tests in the style of test/app/rate-limit.test.ts: /metrics answers 200 with the counter line for a prior request to /, a logged-in request to one task shows the /api/tasks/:id template as its route label, and more requests to /metrics than RATE_LIMIT_MAX all answer 200. Start MySQL from docker-compose.yml, run npm run db:create and npm run db:migrate, then npm test with CAN_SEED_DATABASE=1 and RATE_LIMIT_MAX=4 as the CI workflow does, plus npm run build -- --noEmit and npm run lint. Start the server once and read /metrics. Do not change the under-pressure or rate-limit configuration, .env.example or any workflow. Open a pull request that lists the meters and their labels, quotes the first lines of the scrape and the test and lint output.","resources":[{"url":"https://github.com/your-org/your-app"}]}