This is a middleware for nitro, that expose metrics for prometheus.
- Install
npm install nitro-prometheus-middleware
- Add
nitro-prometheus-middleware
to theplugins
section ofnitro.config.ts
import { defineNitroConfig } from 'nitropack'
export default defineNitroConfig({
plugins: [
'node_modules/nitro-prometheus-middleware/dist/index.mjs'
]
})
- Add
nitro-prometheus-middleware
to thenitro.plugins
section ofnuxt.config.ts
import { resolve } from 'path';
export default defineNuxtConfig({
nitro: {
plugins: [
resolve('node_modules/nitro-prometheus-middleware/dist/index.mjs')
]
}
})
- Metrics are available under
/metrics
Metric Name | Description |
---|---|
http_requests_total | Counter for total requests received |
There some default metrics exported from Prom-Client