feat: collect performance metrics for regenerating cached suggestions#1141
Conversation
Erethon
left a comment
There was a problem hiding this comment.
I've left an early review. Besides the inline comments, can you also fix the python formatting so that CI is happy please?
| EVALUATION_LOGS_DIRECTORY = mkDefault "/var/log/nix-security-tracker/evaluation"; | ||
| LOCAL_NIXPKGS_CHECKOUT = mkDefault "/var/lib/nix-security-tracker/nixpkgs-repo"; | ||
| CVE_CACHE_DIR = mkDefault "/var/lib/nix-security-tracker/cve-cache"; | ||
| METRICS_TEXTFILE_DIR = mkDefault "/var/lib/nix-security-tracker/metrics"; |
There was a problem hiding this comment.
This needs to go to the other settings = -- sorry, this settings jungle is a mess, I'm in the process of cleaning it up so this sort of friction doesn't occur in the future #1166
fricklerhandwerk
left a comment
There was a problem hiding this comment.
LGTM now! @Erethon final words?
1483ae9 to
45202d4
Compare
|
Apart from formatting this seems correct now. I can't merge it yet because I ran into an unrelated problem introduced by #1130, which makes it impossible to regenerate the cache and try it out the metrics locally. |
|
Took a while to debug , but did it : ) The issue was that after @fricklerhandwerk refactored To fix this, the tests now use |
This provides infrastructure and an initial example for collecting metrics from workers, which run in separate, non-persistent processes and therefore can't expose Prometheus exporters. Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
10075b5 to
3f0b19c
Compare
|
Unfortunately I can't test this locally for dumb reasons (related #1045 (comment)), but this is well-tested and I trust it will work and at worst need small fixups in the future. |
Related to #1002
Problem
Performance-sensitive batch jobs (cache regeneration, CVE ingestion, garbage collection etcetra) only log durations and counts to stdout/logs. Operators have no Grafana view of whether these jobs are slowing down or processing less data over time. The existing SQL exporter gives aggregate counts and recency (
sql_delta,sql_matching), but not job durations or throughput.What this PR does
Establishes the end-to-end wiring for application-level metrics from batch jobs to Grafana. Per issue scope, this is wiring + one sample metric, not full instrumentation.
Pipeline
regenerate_cached_suggestions -> cache_regeneration.prom -> node_exporter textfile collector -> Prometheus -> Grafana