0.1.1 • Published 1 year ago

nitro-prometheus-middleware v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

npm.io 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 NameDescription
http_requests_totalCounter for total requests received

There some default metrics exported from Prom-Client

0.1.1

1 year ago

0.0.2

1 year ago

0.1.0

1 year ago

0.0.3

1 year ago