@open-xchange/metrics
v0.1.3
Published
@open-xchange/metrics
Downloads
584
Maintainers
Keywords
Readme
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()