instrument a fastify application for consumption by prometheus
npm install --save fastify-prom-client
// use default options
fastify.register(require('fastify-prom-client'))
// or if you wanted to customise the metric
const prometheus = require('prom-client')
fastify.register(require('fastify-prom-client'), {
metric: new prometheus.Histogram({
name: 'http_request_buckets_milliseconds',
help: 'request duration buckets in milliseconds'
})
})
See example.js
for a full example.
Released under the 3-Clause BSD License. See LICENSE
for more information.