Skip to content

Commit

Permalink
change sql server for fake-cht to fake-postgres, add interface and po…
Browse files Browse the repository at this point in the history
…rt for prometheus
  • Loading branch information
mrjones-plip committed May 13, 2024
1 parent e1b154b commit 7e68ed8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion development/fake-cht/docker-compose.fake-cht.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
sh -c "npm install &&
npm start"
postgres:
fake-postgres:
image: postgres:15
environment:
POSTGRES_DB: cht
Expand Down
2 changes: 1 addition & 1 deletion development/fake-cht/example-config/sql_servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
static_configs:
- targets:
# " same as URL in cht-instances.yml ": 'postgres://USERNAME:PASSWORD@DB_SERVER_IP/DATABASE
"fake-cht:8081": 'postgres://cht_couch2pg:cht_couch2pg_password@postgres:5432/cht?sslmode=disable' # //NOSONAR - password is safe to commit
"db": 'postgres://cht_couch2pg:cht_couch2pg_password@fake-postgres:5432/cht?sslmode=disable' # //NOSONAR - password is safe to commit

4 changes: 2 additions & 2 deletions development/fake-cht/src/postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { randomUUID } = require('crypto');

const POSTGRES_CLIENT_CONFIG = {
user: 'cht_couch2pg',
host: 'postgres',
host: 'fake-postgres',
database: 'cht',
password: 'cht_couch2pg_password',
port: 5432,
Expand All @@ -24,7 +24,7 @@ const insertCouchdbProgress = (seq, dbName) => [
DO
UPDATE SET seq = $1;
`,
[`${seq}-${randomUUID()}`, `fake-cht/${dbName}`]
[`${seq}-${randomUUID()}`, `fake-cht:8081/${dbName}`]
];

const populateCouchdbProcessTable = async (client, metrics) => {
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ volumes:
services:
prometheus:
image: prom/prometheus:${PROMETHEUS_VERSION:-v2.46.0}
ports:
- "${PROMETHEUS_BIND:-127.0.0.1}:${PROMETHEUS_PORT:-9090}:9090"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
Expand Down

0 comments on commit 7e68ed8

Please sign in to comment.