Object -
observe
:
Counter
This represents the metric type - counter, that can be only increased by an integer number.
Constructor
__init
(string name, string? desc, map? tags)
- name string
-
Name of the Counter instance.
- desc string?
-
Description of the Counter instance. If no description is provided, the the default empty string will be used.
- tags map? ()
-
The key/value pair of Tags. If no tags are provided, the default nil value will be used.
Methods
Fields
- name string
-
Name of the counter metric.
- description string
-
Description of the counter metric.
- metricTags map
-
Tags associated with the counter metric.
-
Return Type
(error?) Returns error if there is any metric registered already with the same name but different parameters or in a different kind.
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.