faucet.fctl module
Report state based on FAUCET/Gauge/Prometheus variables.
- faucet.fctl.decode_value(metric_name, value)[source]
Convert values to human readible format based on metric name
- faucet.fctl.get_samples(endpoints, metric_name, label_matches, nonzero_only=False, retries=3)[source]
return a list of Prometheus samples for a given metric
Prometheus Sample objects are named tuples with the fields: name, labels, value, timestamp, exemplar.
- Parameters:
endpoints (list of strings) – the prometheus endpoints to query
metric_name (string) – the metric to retrieve
label_matches (dict) – filters results by label
nonzero_only (bool) – only return samples with non-zero values
retries (int) – number of retries when querying
- Returns:
list of Prometheus Sample objects