metrics
- class Metric
A metric of one of the four custom metric types: counter, gauge, rate or trend.
- add(tags)
Add a value to the metric.
- Parameters:
x (
float
|bool
) – The value to add to the metric, either a number or a boolean. The boolean is interpreted as 0 (false) or 1 (true)tags (
dict
) – optional set of tags that will be tagged to the added data point (note that tags are added per data point and not for the entire metric).
- Return type:
Self
- counter(name)
Counter is an object for representing a custom cumulative counter metric.
- gauge(name)
Gauge is an object for representing a custom metric holding only the latest value added.
- rate(name)
Rate is an object for representing a custom metric keeping track of the percentage of added values that are non-zero.