@faritslv/analytics-nuxt-2
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

GitHub Workflow Status

Cover

📊 Nuxt 2 Analytics

Allows you to better understand what's going on with your application and how to optimize performance and other things in production

Features

  • Default NodeJS metrics exported through the prometheus middleware
  • Custom metrics about pages render time and external request consumption time
  • Health check middleware

Default routes

  • /metrics - prometheus metrics
  • /health - health check

Installation

Install package via a package manager:

# using npm
npm install --save-dev @faritslv/analytics-nuxt-2

# using yarm
yarn add -D @faritslv/analytics-nuxt-2

# using pnpm
pnpm add -D @faritslv/analytics-nuxt-2

Add it to a modules section of your nuxt config:

export default {
  modules: ['@faritslv/analytics-nuxt-2']
}

Grafana sample setup

Once the metrics have been collected by Prometheus, you will want to review them. I use Grafana for this purpose, and my metrics setup looks something like this: Cover

Options

You can pass it through module options and the nuxt config property analytics.

verbose

  • Type: boolean
  • Default: true
  • Description: Additional logs in dev mode, about page rendering time and time of external API requests

Readme

Keywords

none

Package Sidebar

Install

npm i @faritslv/analytics-nuxt-2

Weekly Downloads

0

Version

1.2.1

License

none

Unpacked Size

12.8 kB

Total Files

11

Last publish

Collaborators

  • faritslv