@mollitia/prometheus
v0.0.9
Published
Prometheus Mollitia Addon
Downloads
3,381
Readme
Mollitia
Mollitia - Prometheus Addon
The Mollitia
Prometheus addon adds metrics on every circuit and module so that you can monitor and analyze your applications.
📄 Documentation
Please check out the official documentation to get started using Mollitia, visit genesys.github.io/mollitia.
⚙️ Installation
npm install --save @mollitia/prometheus
🚀 Usage
// Imports the library
import * as Mollitia from 'mollitia';
import { PrometheusAddon } from '@mollitia/prometheus';
// Adds the prometheus addon to Mollitia
Mollitia.use(new PrometheusAddon());
// Creates a circuit
const myCircuit = new Mollitia.Circuit({
func: yourFunction
});
// This will execute yourFunction('dummy')
await myCircuit.execute('dummy');
// Get metrics and scrap from Prometheus
const metrics = Mollitia.metrics(); // Will return an object containing all metrics from all circuits and modules
const scrap = Mollitia.scrap(); // Will return the Prometheus scrap