Class
-
observe
:
Counter
This represents the metric type - counter, that can be only increased by an integer number.
Methods
Register the counter metric instance with the Metric Registry.
Unregister the counter metric instance with the Metric Registry.
Increment the counter's value by an amount.
Resets the counter's value to zero.
Retrieves the counter's current value.
Fields
- name string
-
Name of the counter metric.
- description string
-
Description of the counter metric.
- metricTags map<string>
-
Tags associated with the counter metric.
Register the counter metric instance with the Metric Registry.
-
Return Type
(error?) Returns error if there is any metric registered already with the same name but different parameters or in a different kind.
Increment the counter's value by an amount.
Parameters
- amount int (default 1)
-
The amount by which the value needs to be increased. The amount is defaulted as 1 and will be used if there is no amount passed in.