Represents a Prometheus counter metric.
This class is used to build and register counter metrics in Prometheus format.
const counter = new Counter('requests_total', 5, 'Total number of requests', 'my-service');const metric = counter.registry(); Copy
const counter = new Counter('requests_total', 5, 'Total number of requests', 'my-service');const metric = counter.registry();
The name of the metric.
The value of the counter.
An optional description or label for the metric. Defaults to an empty string.
The name of the service reporting the metric. Defaults to 'unknown'.
The prefix for the metric name. Defaults to 'nodejs_'.
Readonly
Represents a Prometheus counter metric.
Remarks
This class is used to build and register counter metrics in Prometheus format.
Example
Param: name
The name of the metric.
Param: value
The value of the counter.
Param: label
An optional description or label for the metric. Defaults to an empty string.
Param: service
The name of the service reporting the metric. Defaults to 'unknown'.
Param: prefix
The prefix for the metric name. Defaults to 'nodejs_'.