diff --git a/data/hostname/db1.internal.staging.swh.network.yaml b/data/hostname/db1.internal.staging.swh.network.yaml --- a/data/hostname/db1.internal.staging.swh.network.yaml +++ b/data/hostname/db1.internal.staging.swh.network.yaml @@ -50,3 +50,8 @@ - zfs-dkms - zfsutils-linux - zfs-zed + +prometheus::sql::config_snippets: + - swh-scheduler + - swh-storage + diff --git a/site-modules/profile/files/prometheus/sql/config/swh-scheduler.yml b/site-modules/profile/files/prometheus/sql/config/swh-scheduler.yml --- a/site-modules/profile/files/prometheus/sql/config/swh-scheduler.yml +++ b/site-modules/profile/files/prometheus/sql/config/swh-scheduler.yml @@ -1,7 +1,7 @@ - name: swh_scheduler_delay scope: database cluster: secondary - database: ^softwareheritage-scheduler$ + database: ^(swh|softwareheritage)-scheduler$ interval: '1h' help: "Software Heritage Scheduler task delay spread. Positive delay for tasks whose execution is late" query: | @@ -193,3 +193,27 @@ - le values: - sum + +- name: swh_scheduler + scope: database + database: ^(softwareheritage|swh)-scheduler$ + interval: '15m' + help: "Software Heritage Scheduler Metrics" + query: | + select l.name, l.instance_name, sm.visit_type, + extract(epoch from sm.last_update) as last_update, + sm.origins_known, sm.origins_enabled, sm.origins_never_visited, + sm.origins_with_pending_changes + from scheduler_metrics sm + inner join listers l on sm.lister_id=l.id + order by l.name, l.instance_name + labels: + - name + - instance_name + - visit_type + values: + - last_update + - origins_known + - origins_enabled + - origins_never_visited + - origins_with_pending_changes