OADA Prometheus client
A high-level Prometheus client using prom-client. It automatically handles initializing a client for you and exposing the metrics over HTTP.
Default metrics recommended by Prometheus are automatically registered. You can, and likely should, register your own additional metrics.
Usage
// See prom-client README for details on available metric types
import { Counter, Gauge, Histogram, Summary } from '@oada/lib-prom';
// Create metric(s) of your own
const counter = new client.Counter({
name: 'metric_name',
help: 'metric_help',
});
// ...Your code here...
// Update your metrics as needed
counter.inc(); // e.g., increment a counter
// ...Your code here...
// Any metrics you create will be exported over HTTP for Prometheus to scrape