Add db-migrations folder.

Add future language metrics to query-exporter.
main
mathan 2024-02-20 15:45:23 -08:00
parent da86ee3a1c
commit fba373f835
5 changed files with 11 additions and 1 deletions

View File

@ -35,4 +35,4 @@ init-db: init.sql
@docker compose up -d --build lister @docker compose up -d --build lister
@sleep 10 @sleep 10
@docker compose stop lister @docker compose stop lister
@cat init.sql | docker exec -i "$$(docker compose ps --format '{{.Names}}' postgres)" psql -U postgres -d bluesky @cat db-migration/init.sql | docker exec -i "$$(docker compose ps --format '{{.Names}}' postgres)" psql -U postgres -d bluesky

View File

@ -12,6 +12,11 @@ metrics:
repos_failed: repos_failed:
type: gauge type: gauge
description: Repositories that we failed to index description: Repositories that we failed to index
# posts_lang:
# type: summary
# description: Posts by language
# labels: [uk, lt, et, lv, pl, ga, fi, sv,
# en, jp, de, fr, pt, es, nl, ko, tr, zh, ru]
queries: queries:
query1: query1:
@ -29,3 +34,8 @@ queries:
databases: [db1] databases: [db1]
metrics: [repos_failed] metrics: [repos_failed]
sql: select count(*) as repos_failed from repos where failed_attempts >= 3; sql: select count(*) as repos_failed from repos where failed_attempts >= 3;
# query4:
# interval: 300
# databases: [db1]
# metrics: [posts_lang]
# sql: select count(*) as uk from records where collection in ('app.bsky.feed.post') and content::text like '%"langs": ["uk"]%';