@chatlayer/metrics
Installation
Add "@chatlayer/metrics" to you package.json dependencies
Usage
First you need to cretate a collector
import { createCollector } from '@chatlayer/metrics';
const collector = createCollector({
host: process.env.STATSD_HOST,
port: parseInt(process.env.STATSD_PORT),
service: 'my_service_name',
environment: 'us-east4-gcp',
version: '12234345',
});
then you can report metrics
collector.increment("my_counter")
The collector will be closed automatically when the node process exits.