Mercurial > code > home > repos > victoriametrics
annotate next/create_scrape_configs.py @ 62:8134cd480817
make next/ a complete standalone setup dir- no deps on ./
author | drewp@bigasterisk.com |
---|---|
date | Thu, 02 May 2024 20:33:29 -0700 |
parents | config/create_scrape_configs.py@fb0519859645 |
children | def1aa2bfa3f |
rev | line source |
---|---|
60
e3151ab43579
moving scrape target configs in py, and into separate retention classes
drewp@bigasterisk.com
parents:
diff
changeset
|
1 from pathlib import Path |
e3151ab43579
moving scrape target configs in py, and into separate retention classes
drewp@bigasterisk.com
parents:
diff
changeset
|
2 |
61 | 3 from scrape_job import jobConfig, scrape_deployments, writeJobConfigs |
4 import private | |
5 | |
6 | |
7 | |
8 | |
9 # previously this used `kubernetes_sd_configs: [{ role: node }]` | |
10 all_hosts = [ | |
11 'dash', | |
12 'ditto', | |
13 # 'ws-printer', | |
14 #todo: | |
15 ] | |
16 | |
17 smartctl_hosts = [ | |
18 # ideally, all nodes with disks, but many turn off and on | |
19 'dash', | |
20 'ditto', | |
21 ] | |
22 | |
23 ping_hosts = [ | |
24 # printer, since it falls out of ntop with no traffic at all. Or, we could poll ink status at http://printer/general/status.html?pageid=1 | |
25 'printer', | |
26 # wireguard connection test | |
27 'prime5', | |
28 # after pyinfra or reboot, seems to lose wg0 address | |
29 'garage5', | |
60
e3151ab43579
moving scrape target configs in py, and into separate retention classes
drewp@bigasterisk.com
parents:
diff
changeset
|
30 ] |
e3151ab43579
moving scrape target configs in py, and into separate retention classes
drewp@bigasterisk.com
parents:
diff
changeset
|
31 |
61 | 32 deploy_doesnt_serve_metrics = [ |
33 'apprise', | |
34 'bitwarden', | |
35 'digi-files', | |
36 'digi-pose-predict', | |
37 'digi-tts-mimic', | |
38 'dovecot', | |
39 'front-door-display', | |
40 'hass', | |
41 'homepage', | |
42 'itch150', | |
43 'kallithea', | |
44 'kube-web-view', | |
45 'magma', | |
46 'megasecond', | |
47 'minecraft-build-world', | |
48 'minecraft-lake-world', | |
49 'minecraft-smp-world', | |
50 'mongodb', | |
51 'mqtt1', | |
52 'mqtt2', | |
53 'nodered', | |
54 'photoprism', | |
55 'plik', | |
56 'projects', | |
57 'registry', | |
58 'registry-ui', | |
59 'speakerphone', | |
60 'video', | |
61 'video-files', | |
62 'zigbee2mqtt', | |
63 ] | |
60
e3151ab43579
moving scrape target configs in py, and into separate retention classes
drewp@bigasterisk.com
parents:
diff
changeset
|
64 |
61 | 65 forever_jobs = [ |
66 jobConfig(name='maildir-count', targets=['prime:2500']), | |
67 jobConfig(name='mongodb', targets=['mongodb:9216']), | |
68 jobConfig(name='net-traffic', targets=['pipe:8080']), | |
69 jobConfig(name='ping', targets=ping_hosts, scrape_interval='2m', ping_job=True), | |
70 jobConfig(name='power-eagle', targets=['power-eagle:80'], scrape_interval='8s'), # from powerEagle/private_config.periodSec | |
71 jobConfig(name='powermeter-exporter', targets=['powermeter-exporter'], scrape_interval='10s'), | |
72 jobConfig(name='smartctl', targets=[f'{h}:9633' for h in smartctl_hosts]), | |
73 jobConfig(name='wifi', targets=['wifi:80']), | |
74 jobConfig(name='zfs-exporter', targets=['ditto:9634']), | |
75 jobConfig(name='zigbee2mqtt-exporter', targets=['zigbee2mqtt-exporter:80']), | |
76 jobConfig(name='zpool-exporter', targets=['ditto:9986']), | |
77 jobConfig(name='octoprint', targets=['octoprint'], | |
78 metrics_path='/plugin/prometheus_exporter/metrics', | |
79 params={'apikey' : [private.octoprint_apikey]}, | |
80 ), | |
81 ] # yapf: disable | |
60
e3151ab43579
moving scrape target configs in py, and into separate retention classes
drewp@bigasterisk.com
parents:
diff
changeset
|
82 |
61 | 83 recent_jobs = [ |
84 jobConfig( name="telegraf", targets=[f'{h}:9273' for h in all_hosts]), | |
85 jobConfig( name="filebeat", targets=[f'{h}:5067' for h in all_hosts]), | |
86 jobConfig( name="net-routes", targets=['pipe:9999']), | |
87 jobConfig( name="net-traffic", targets=['pipe:8080']), | |
88 jobConfig( name="dnsmasq-log", targets=['pipe:9991']), | |
89 jobConfig( | |
90 name="racc", | |
91 scrape_interval='30s', | |
92 targets=[ | |
93 # - dash:5150 | |
94 # - dot:5150 | |
95 # - squib:5150 | |
96 # - ashermac:5150 | |
97 ], | |
98 ), | |
99 ] # yapf: disable | |
100 recent_jobs.extend(scrape_deployments(deploy_doesnt_serve_metrics, forever_jobs)) | |
60
e3151ab43579
moving scrape target configs in py, and into separate retention classes
drewp@bigasterisk.com
parents:
diff
changeset
|
101 |
62
8134cd480817
make next/ a complete standalone setup dir- no deps on ./
drewp@bigasterisk.com
parents:
61
diff
changeset
|
102 top = Path('build/scrape_config') |
8134cd480817
make next/ a complete standalone setup dir- no deps on ./
drewp@bigasterisk.com
parents:
61
diff
changeset
|
103 writeJobConfigs(top, forever_jobs, 'forever') |
8134cd480817
make next/ a complete standalone setup dir- no deps on ./
drewp@bigasterisk.com
parents:
61
diff
changeset
|
104 writeJobConfigs(top, recent_jobs, 'recent') |