From 482eccf3f66fbd73c0ec09bfcb21de04876e72f7 Mon Sep 17 00:00:00 2001 From: Giacomo Sanchietti Date: Fri, 11 Oct 2024 14:24:53 +0200 Subject: [PATCH] update: add timescale datasource --- imageroot/update-module.d/10allocate_ports | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/imageroot/update-module.d/10allocate_ports b/imageroot/update-module.d/10allocate_ports index 1f6ead5..a0d964f 100755 --- a/imageroot/update-module.d/10allocate_ports +++ b/imageroot/update-module.d/10allocate_ports @@ -45,5 +45,23 @@ with open('db.env', 'w') as db_fp: db_fp.write(f"POSTGRES_PORT={db_port}\n") db_fp.write(f"POSTGRES_PASSWORD={db_secret}\n") db_fp.write(f"GRAFANA_POSTGRES_PASSWORD={grafana_postgres_password}\n") - db_fp.write(f"REPORT_DB_URI=postgres://report:{db_secret}@127.0.0.1:{db_port}/report") - db_fp.write(f"TS_TUNE_MAX_BG_WORKERS=100") \ No newline at end of file + db_fp.write(f"REPORT_DB_URI=postgres://report:{db_secret}@127.0.0.1:{db_port}/report\n") + db_fp.write(f"TS_TUNE_MAX_BG_WORKERS=100") + +with open('grafana.yml', 'a') as fp: + fp.write(' - name: Local Timescale\n') + fp.write(' type: postgres\n') + fp.write(' uid: timescale\n') + fp.write(f' url: 127.0.0.1:{db_port}\n') + fp.write(f' user: grafana\n') + fp.write(' secureJsonData:\n') + fp.write(f' password: {grafana_postgres_password}\n') + fp.write(' jsonData:\n') + fp.write(' database: report\n') + fp.write(' sslmode: disable\n') + fp.write(' maxOpenConns: 100\n') + fp.write(' maxIdleConns: 100\n') + fp.write(' maxIdleConnsAuto: true\n') + fp.write(' connMaxLifetime: 14400\n') + fp.write(' postgresVersion: 1500\n') + fp.write(' timescaledb: true\n') \ No newline at end of file