-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Webapps/PrometheusDatabaseExporterWar/docker/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
services: | ||
database: | ||
image: ghcr.io/baosystems/postgis:12-3.3 | ||
ports: | ||
- 127.0.0.1:5432:5432 | ||
environment: | ||
POSTGRES_USER: dhis | ||
POSTGRES_DB: dhis | ||
POSTGRES_PASSWORD: &postgres_password dhis | ||
PGPASSWORD: *postgres_password # needed by psql in healthcheck | ||
healthcheck: | ||
test: ["CMD-SHELL", "psql --no-password --quiet --username $$POSTGRES_USER postgres://127.0.0.1/$$POSTGRES_DB -p 5432 --command \"SELECT 'ok'\" > /dev/null"] | ||
start_period: 120s | ||
interval: 1s | ||
timeout: 3s | ||
retries: 5 | ||
|
||
prometheusdbexporter: | ||
build: | ||
context: .. | ||
args: | ||
PROJECT_VERSION: 0.0.0 | ||
ports: | ||
- 127.0.0.1:8080:8080 | ||
environment: | ||
TODO: tada | ||
TIDI: tudu | ||
POSTGRES_PASSWORD: &postgres_password dhis | ||
PGPASSWORD: *postgres_password # needed by psql in healthcheck | ||
volumes: | ||
- ../target/tmp:/tmp | ||
- ./sources:/app/rtsl/prom_db_exporter/sources |
13 changes: 13 additions & 0 deletions
13
Webapps/PrometheusDatabaseExporterWar/docker/sources/heartbeat.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"asynch": false, | ||
"type": "sql", | ||
"name": "dbHeartbeat", | ||
"query": "select 1 as value, 'database' as source;", | ||
"metrics": [{ | ||
"metricName": "postgres_heartbeat", | ||
"metricValueKey": "value", | ||
"labelsKeys": { | ||
"source": "source" | ||
} | ||
}] | ||
} |
13 changes: 13 additions & 0 deletions
13
Webapps/PrometheusDatabaseExporterWar/docker/sources/sessions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"asynch": false, | ||
"type": "sql", | ||
"name": "getSessionInfo", | ||
"query": "select application_name, count(*) as value from pg_stat_activity group by application_name", | ||
"metrics": [{ | ||
"metricName": "postgres_sessions_per_application_count", | ||
"metricValueKey": "value", | ||
"labelsKeys": { | ||
"application_name": "application_name" | ||
} | ||
}] | ||
} |
15 changes: 15 additions & 0 deletions
15
Webapps/PrometheusDatabaseExporterWar/docker/sources/tracked_entities.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"asynch": true, | ||
"type": "sql", | ||
"cron": "* * * * *", | ||
"name": "DHIS2_Trackedentityinstance", | ||
"query": "select trackedentityinstance.trackedentitytypeid, trackedentitytype.name, count(*) as value from trackedentityinstance left outer join trackedentitytype on trackedentityinstance.trackedentitytypeid = trackedentitytype.trackedentitytypeid group by trackedentityinstance.trackedentitytypeid, trackedentitytype.name", | ||
"metrics": [{ | ||
"metricName": "dhis2_trackedentityinstance_count", | ||
"metricValueKey": "value", | ||
"labelsKeys": { | ||
"trackedentitytypeid": "trackedentitytypeid", | ||
"name": "name" | ||
} | ||
}] | ||
} |