MCPcopy
hub / github.com/ray-project/ray / fetch_prometheus

Function fetch_prometheus

python/ray/_common/test_utils.py:463–479  ·  view source on GitHub ↗
(prom_addresses, timeout=None)

Source from the content-addressed store, hash-verified

461
462
463def fetch_prometheus(prom_addresses, timeout=None):
464 components_dict = {}
465 metric_descriptors = {}
466 metric_samples = []
467
468 for address in prom_addresses:
469 if address not in components_dict:
470 components_dict[address] = set()
471
472 for address, response in fetch_raw_prometheus(prom_addresses, timeout=timeout):
473 for metric in text_string_to_metric_families(response):
474 for sample in metric.samples:
475 metric_descriptors[sample.name] = metric
476 metric_samples.append(sample)
477 if "Component" in sample.labels:
478 components_dict[address].add(sample.labels["Component"])
479 return components_dict, metric_descriptors, metric_samples
480
481
482def fetch_prometheus_timeseries(

Callers 6

test_case_stats_existFunction · 0.90
test_case_ip_correctFunction · 0.90
test_worker_statsFunction · 0.90
fetch_prometheus_metricsFunction · 0.85

Calls 4

fetch_raw_prometheusFunction · 0.85
appendMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…