From 697c814648a7023b3540267162feaca0894df755 Mon Sep 17 00:00:00 2001 From: Snazzah Date: Sat, 22 Jun 2024 17:02:19 -0500 Subject: [PATCH] grafana fixes --- README.md | 4 ++++ grafana-dashboard.json | 2 +- grafana-datasource.json | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 grafana-datasource.json diff --git a/README.md b/README.md index 42e9167..fc8a259 100644 --- a/README.md +++ b/README.md @@ -22,3 +22,7 @@ bun start The provided docker-compose file sets up a PostgreSQL server and a Grafana instance. There is also a Grafana dashboard JSON file for an example use of the data. Make sure to import the `server/schema.sql` into PostgreSQL before using it. +You can import the datasource into grafana with the command: +```sh +curl -X "POST" "http://localhost:3000/api/datasources" -H "Content-Type: application/json" --user admin:admin --data-binary @grafana-datasource.json +``` diff --git a/grafana-dashboard.json b/grafana-dashboard.json index eabe2c7..5f1546f 100644 --- a/grafana-dashboard.json +++ b/grafana-dashboard.json @@ -846,7 +846,7 @@ "timepicker": {}, "timezone": "browser", "title": "Field Day Contest", - "uid": "fdpbhdsbrhs74f", + "uid": "arrlfielddaycontest", "version": 11, "weekStart": "" } diff --git a/grafana-datasource.json b/grafana-datasource.json new file mode 100644 index 0000000..3c8ceac --- /dev/null +++ b/grafana-datasource.json @@ -0,0 +1,26 @@ +{ + "id": 1, + "uid": "edpbbm8hqv9j4e", + "orgId": 1, + "name": "PostgreSQL", + "type": "grafana-postgresql-datasource", + "typeName": "PostgreSQL", + "typeLogoUrl": "public/app/plugins/datasource/grafana-postgresql-datasource/img/postgresql_logo.svg", + "access": "proxy", + "url": "postgres:5432", + "user": "fdlogup", + "secureJsonData": {"password": "fdlogup"}, + "database": "", + "basicAuth": false, + "isDefault": true, + "jsonData": { + "connMaxLifetime": 14400, + "database": "fdlogup", + "maxIdleConns": 100, + "maxIdleConnsAuto": true, + "maxOpenConns": 100, + "postgresVersion": 1600, + "sslmode": "disable" + }, + "readOnly": false +}