comparison tasks.py @ 61:fb0519859645

better py configs
author drewp@bigasterisk.com
date Thu, 02 May 2024 18:35:46 -0700
parents e3151ab43579
children 8134cd480817
comparison
equal deleted inserted replaced
60:e3151ab43579 61:fb0519859645
43 # - be scraped as 'recent', with possible overrides of port/path 43 # - be scraped as 'recent', with possible overrides of port/path
44 # all per-node metrics shall be 'recent' (oops, not smartctl!) 44 # all per-node metrics shall be 'recent' (oops, not smartctl!)
45 map: dict[str, object] = { 45 map: dict[str, object] = {
46 'rules': alert_rules.allRules(ctx), 46 'rules': alert_rules.allRules(ctx),
47 } 47 }
48 for p in Path('config').glob('*.yaml'): 48 top=Path('config/build/scrape_jobs')
49 map[p.name] = scrapeConfig(p) 49 for p in top.glob('**/*.yaml'):
50 map[str(p.relative_to(top))] = scrapeConfig(p)
50 replaceCmap("next-victoriametrics-config", map) 51 replaceCmap("next-victoriametrics-config", map)
51 refreshPodCmaps(firstPodName("app=next-victoriametrics-forever-vmagent")) 52 refreshPodCmaps(firstPodName("app=next-victoriametrics-forever-vmagent"))
53 refreshPodCmaps(firstPodName("app=next-victoriametrics-recent-vmagent"))
52 54
53 55
54 def scrapeConfig(fn): 56 def scrapeConfig(fn):
55 return yaml.load(open(fn), yaml.FullLoader) 57 return yaml.load(open(fn), yaml.FullLoader)
56 58