Hands-on task
Level metrics from a worker log
/var/log/worker/worker.log has lines of the form TIME LEVEL text, the level is the second field: INFO, WARN or ERROR. Count the lines of each level and write three Prometheus metrics to /root/worker_levels.prom: worker_log_events_total{severity="info"} N, and the same for warn and error (label value in lowercase).
- prometheus
- awk
- associative array
- tolower
- labels