aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-02-02 15:04:20 +0100
committerChristopher Baines <mail@cbaines.net>2023-02-02 15:04:20 +0100
commit9e9fc1ba04add1ceea28e1889058049cf564f2f1 (patch)
tree5836c34ec4b14b38d306dbdf469243259b968e2a /guix-data-service
parentd29ef3ed9b004b609b0166a4cfc63cbbe209ea3c (diff)
downloaddata-service-9e9fc1ba04add1ceea28e1889058049cf564f2f1.tar
data-service-9e9fc1ba04add1ceea28e1889058049cf564f2f1.tar.gz
Skip some metrics that apply for each branch
As data.qa.guix.gnu.org has lots of branches and 100,000+ metrics, and this is causing Prometheus to time out fetching the metrics. I'm not sure there's much value in these metrics, so cut them out for now.
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/metrics.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix-data-service/metrics.scm b/guix-data-service/metrics.scm
index 7ec6b8e..ca1d97a 100644
--- a/guix-data-service/metrics.scm
+++ b/guix-data-service/metrics.scm
@@ -96,7 +96,8 @@ SELECT relname, seq_scan, seq_tup_read,
COALESCE(extract(epoch from last_analyze), 0),
COALESCE(extract(epoch from last_autoanalyze), 0),
vacuum_count, autovacuum_count, analyze_count, autoanalyze_count
- FROM pg_stat_user_tables")
+FROM pg_stat_user_tables
+WHERE relname NOT LIKE 'package_derivations_by_guix_revision_range_git_branch_%'")
(map (match-lambda
((relname seq-scan seq-tup-read
@@ -141,7 +142,8 @@ FROM pg_stat_user_indexes
LEFT JOIN pg_indexes
ON pg_stat_user_indexes.indexrelname = pg_indexes.indexname
AND pg_stat_user_indexes.schemaname = pg_indexes.schemaname
-WHERE pg_stat_user_indexes.schemaname = 'guix_data_service'")
+WHERE pg_stat_user_indexes.schemaname = 'guix_data_service'
+ AND pg_indexes.tablename NOT LIKE 'package_derivations_by_guix_revision_range_git_branch_%'")
(map
(match-lambda
@@ -162,7 +164,8 @@ WHERE pg_stat_user_indexes.schemaname = 'guix_data_service'")
"
SELECT tablename, attname, null_frac, n_distinct, correlation
FROM pg_stats
-WHERE schemaname = 'guix_data_service'")
+WHERE schemaname = 'guix_data_service'
+ AND tablename NOT LIKE 'package_derivations_by_guix_revision_range_git_branch_%'")
(map
(match-lambda