class documentation

Counter metric created by a metric meter.

Method add Add a value to the counter.
Method with_additional_attributes Create a new counter with the given attributes appended to the current set.
Property description Description for the metric if any.
Property name Name for the metric.
Property unit Unit for the metric if any.
@abstractmethod
def add(self, value: int, additional_attributes: Optional[MetricAttributes] = None): (source)

Add a value to the counter.

Parameters
value:intA non-negative integer to add.
additional_attributes:Optional[MetricAttributes]Additional attributes to append to the current set.
Raises
ValueErrorValue is negative.
TypeErrorAttribute values are not the expected type.
@abstractmethod
def with_additional_attributes(self, additional_attributes: MetricAttributes) -> MetricCounter: (source)

Create a new counter with the given attributes appended to the current set.

Parameters
additional_attributes:MetricAttributesAdditional attributes to append to the current set.
Returns
MetricCounterNew counter.
Raises
TypeErrorAttribute values are not the expected type.