@qonfucius/nuxt-prometheus-module
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

Nuxt Prometheus module

Use this module to expose metrics to another port (you need to use nuxt start or nuxt dev) Documentation

Compatibility

For NuxtJS < 3, use <= 0.1.x (latest 0.1.1) ; For Nuxt >= 3, use >= 0.2.x ;

Setup

  • Add @qonfucius/nuxt-prometheus-module dependency using yarn or npm to your project
  • Add @qonfucius/nuxt-prometheus-module to modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    '@qonfucius/nuxt-prometheus-module',
    
    // With options
    [
        '@qonfucius/nuxt-prometheus-module',
         { 
            port: 9091, 
            host: '0.0.0.0', 
            metrics: {
                collectDefault: true,
                requestDuration: true,
            },
        },
    ],
  ]
}

Options

port

Default: 9091

Port where metrics will be available

host

Default: 127.0.0.1

Host to bind. Use 0.0.0.0 to be available everywhere, 127.0.0.1 mean "only available on the current host"

metrics

Enable/Disable some metrics

collectDefault

Default: true

Send default metrics about nodejs itself. Pass object to send options to Prometheus.collectDefaultMetrics.

requestDuration

Default: true

Send request duration tile with routes.

Demo

Clone repository.

$ npm run dev

Readme

Keywords

none

Package Sidebar

Install

npm i @qonfucius/nuxt-prometheus-module

Weekly Downloads

120

Version

0.2.2

License

MIT

Unpacked Size

8.12 kB

Total Files

13

Last publish

Collaborators

  • nainterceptor
  • rodrive