plc-mirror/metrics/prometheus/exporters/query-exporter/config.yaml

32 lines
886 B
YAML
Raw Normal View History

2024-02-18 21:00:39 +01:00
databases:
db1:
dsn: env:POSTGRES_URL
2024-02-18 21:00:39 +01:00
metrics:
repos_fully_indexed:
type: gauge
description: Repositories fully indexed
repos_seen:
type: gauge
description: Repositories seen
repos_failed:
type: gauge
description: Repositories that we failed to index
2024-02-18 21:00:39 +01:00
queries:
query1:
interval: 30
databases: [db1]
metrics: [repos_fully_indexed]
sql: select count(*) as repos_fully_indexed from repos where failed_attempts < 3 and last_indexed_rev <> '' and (last_indexed_rev >= first_rev_since_reset or first_rev_since_reset is null or first_rev_since_reset = '');
2024-02-18 21:00:39 +01:00
query2:
interval: 30
databases: [db1]
metrics: [repos_seen]
sql: select count(*) as repos_seen from repos;
query3:
interval: 30
databases: [db1]
metrics: [repos_failed]
sql: select count(*) as repos_failed from repos where failed_attempts >= 3;