Easily send custom metrics to Watchlog using our lightweight Node.js library.
Custom metrics let you monitor specific data points relevant to your application. With Watchlog's Node.js library, you can track anything from user activity to system performance with just a few lines of code.
With the watchlog-metric
library, sending custom metrics is simple and flexible. Install the package and use one of the following methods to send data:
const watchlog = require("watchlog-metric");
// Increment a metric
watchlog.increment("Your_metric");
watchlog.increment("Your_metric", 75);
// Decrement a metric
watchlog.decrement("Your_metric");
watchlog.decrement("Your_metric", 25);
// Send percentage
watchlog.percentage("Your_metric", 12.23);
// Send gauge
watchlog.gauge("Your_metric", 12.23);
// Send system byte (e.g., memory usage)
watchlog.systembyte("Your_metric", 1024000000); // Example: 1 GB
To start sending custom metrics, install the library and follow the examples above. For detailed setup instructions, visit our documentation.
View Documentation