0.1.3 • Published 1 year ago

@open-xchange/metrics v0.1.3

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

Metrics

Fastify based metrics server for node.js projects. It uses prom-client as a peer dependency. Prometheus scrape requests will be responded to on /metrics endpoint, so you can use this with anything that uses prom-client to collect metrics, and uses the global registry by default.

Note: This runs on a separate port (Default: 9090), so that metrics are not exposed on public facing systems.

How to use

Import and run

import { createMetricsServer } from '@open-xchange/metrics'

// Run at top level
const metricsServer = await createMetricsServer()

Add this to your shutdown handler:

// Close on shutdown
metricsServer.close()