Skip to content

This is a middleware for nitro, that expose metrics for prometheus.

License

Notifications You must be signed in to change notification settings

Botz/nitro-prometheus-middleware

Repository files navigation

npm

Nitro Prometheus Middleware

This is a middleware for nitro, that expose metrics for prometheus.

🚀 Usage

  1. Install
npm install nitro-prometheus-middleware

Nitro

  1. Add nitro-prometheus-middleware to the plugins section of nitro.config.ts
import { defineNitroConfig } from 'nitropack'

export default defineNitroConfig({
  plugins: [
    'node_modules/nitro-prometheus-middleware/dist/index.mjs'
  ]
})

Nuxt3

  1. Add nitro-prometheus-middleware to the nitro.plugins section of nuxt.config.ts
import { resolve } from 'path';

export default defineNuxtConfig({
  nitro: {
    plugins: [
      resolve('node_modules/nitro-prometheus-middleware/dist/index.mjs')
    ]
  }
})
  1. Metrics are available under /metrics

Metrics

Metric Name Description
http_requests_total Counter for total requests received

There some default metrics exported from Prom-Client

About

This is a middleware for nitro, that expose metrics for prometheus.

Resources

License

Stars

Watchers

Forks

Packages

No packages published