datadog_client/metric
Types
A Datadog series entry. Build with gauge/count/rate and refine via
the with_* / add_* helpers.
pub opaque type Metric
Datadog metric kind.
pub type MetricType {
Gauge
Count
Rate
}
Constructors
-
Gauge -
Count -
Rate
Values
pub fn add_point(
metric: Metric,
at timestamp: Int,
of value: Float,
) -> Metric
Append a single point at the given timestamp.
pub fn rate(name: String, value: Float) -> Metric
Rate metric at the current time. Set the interval with with_interval.
pub fn to_json(metric: Metric) -> json.Json
JSON object for a single metric, matching Datadog’s v1 series schema.
pub fn with_interval(metric: Metric, of seconds: Int) -> Metric
Set the flush interval in seconds (required for Rate).
pub fn with_type(metric: Metric, to kind: MetricType) -> Metric
Set the metric type (gauge/count/rate).