Mercurial > code > home > repos > victoriametrics
diff tasks.py @ 60:e3151ab43579
moving scrape target configs in py, and into separate retention classes
author | drewp@bigasterisk.com |
---|---|
date | Sat, 27 Apr 2024 01:31:07 -0700 |
parents | 6a357b483c04 |
children | fb0519859645 |
line wrap: on
line diff
--- a/tasks.py Fri Apr 26 23:37:14 2024 -0700 +++ b/tasks.py Sat Apr 27 01:31:07 2024 -0700 @@ -34,11 +34,30 @@ # hup(ctx, 'deploy/victoriametrics', 'victoria-metrics-prod') +@task +def push_config_2024(ctx): + # plan: + # every discovered service may: + # - be described here as a forever retention - ignore the discovery + # - be blocked here as a no-metrics service - ignore the discovery + # - be scraped as 'recent', with possible overrides of port/path + # all per-node metrics shall be 'recent' (oops, not smartctl!) + map: dict[str, object] = { + 'rules': alert_rules.allRules(ctx), + } + for p in Path('config').glob('*.yaml'): + map[p.name] = scrapeConfig(p) + replaceCmap("next-victoriametrics-config", map) + refreshPodCmaps(firstPodName("app=next-victoriametrics-forever-vmagent")) + + def scrapeConfig(fn): return yaml.load(open(fn), yaml.FullLoader) metricsToMigrate = [ + 'currently_on_wifi', + 'connected', 'house_power_kwh', 'house_power_price', 'house_power_w',