metrics-accumulator-client
v1.1.3
Published
A nodejs client for metrics accumulator
Downloads
86
Maintainers
Readme
metrics-accumulator-client
The official NodeJs client for metric accumulator.
Get Started
Start an instance of metric-accumulator
Installation
npm install metrics-accumulator-client -S
Start metrics accumulator
docker run \
-p 8080:8080 \
bpoole6/metrics-accumulator
Create main.js file
import {Registry, Counter} from "prom-client"
const registry = new Registry()
new Counter({
name : "counter_example_total",
help: "help",
registers: [registry]
})
let client = new Client("http://localhost:8080", "0d98f65f-074b-4d56-b834-576e15a3bfa5")
client.updateMetrics('default', registry).then(res=> console.log(res.statusCode + " " + res.content))
client.getMetricGroup('default').then(res=> console.log(res.statusCode + " " + res.content))
client.reloadConfigurations().then(res=> console.log(res.statusCode + " " + res.content))
client.resetMetricGroup("default").then(res=> console.log(res.statusCode + " " + res.content))
client.serviceDiscovery().then(res=> console.log(res.statusCode + " " + res.content))
client.currentConfigurations().then(res=> console.log(res.statusCode + " " + res.content))
Please see metric accumulator for official documentation.