@oada/lib-prom

3.8.0 • Public • Published

OADA Prometheus client

code style: prettier License

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

Readme

Keywords

none

Package Sidebar

Install

npm i @oada/lib-prom

Weekly Downloads

19

Version

3.8.0

License

Apache-2.0

Unpacked Size

54.1 kB

Total Files

27

Last publish

Collaborators

  • sanoel
  • serviopalacios
  • aultac
  • awlayton
  • oadao
  • tarakawa
  • cyrusbowman
  • abalmos