A collection of timeseries from multiple addresses. Each timeseries is a collection of samples with the same metric name and labels. Concretely: - components_dict: a dictionary of addresses to the Component labels - metric_descriptors: a dictionary of metric names to the Metric object
| 428 | |
| 429 | @dataclass |
| 430 | class PrometheusTimeseries: |
| 431 | """A collection of timeseries from multiple addresses. Each timeseries is a |
| 432 | collection of samples with the same metric name and labels. Concretely: |
| 433 | - components_dict: a dictionary of addresses to the Component labels |
| 434 | - metric_descriptors: a dictionary of metric names to the Metric object |
| 435 | - metric_samples: the latest value of each label |
| 436 | """ |
| 437 | |
| 438 | components_dict: Dict[str, Set[str]] = field(default_factory=dict) |
| 439 | metric_descriptors: Dict[str, "Metric"] = field(default_factory=dict) |
| 440 | metric_samples: Dict[frozenset, "Sample"] = field(default_factory=dict) |
| 441 | |
| 442 | def flush(self): |
| 443 | self.components_dict.clear() |
| 444 | self.metric_descriptors.clear() |
| 445 | self.metric_samples.clear() |
| 446 | |
| 447 | |
| 448 | def fetch_raw_prometheus(prom_addresses, timeout=None): |
no outgoing calls
searching dependent graphs…