Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nitro-prometheus-middleware

Botz15kMIT0.1.1

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

nitro, prometheus, nuxt3, nuxt

readme

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 `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

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

v0.0.3

🚀 Enhancements

  • provide http_requests_total over /metrics endpoint

❤️ Contributors