No description
Find a file
Pieter Hollander d4028d37ec
Some checks failed
Build Docker image / build (push) Failing after 51s
Build Golang packages / release (push) Has been skipped
Add daily filter to events count checker.
2024-02-23 12:12:45 +01:00
.gitea/workflows Add -v. 2024-02-21 20:09:59 +01:00
docker Add example .env 2024-02-21 11:23:47 +01:00
.gitignore Don't include compiled binary 2024-02-21 15:44:44 +01:00
Dockerfile Add Dockerfile 2024-02-21 11:20:59 +01:00
go.mod Upgrade golang 1.21 -> 1.22 2024-02-21 21:55:53 +01:00
go.sum Go init 2024-02-21 11:22:24 +01:00
main.go Add daily filter to events count checker. 2024-02-23 12:12:45 +01:00
README.md Add instructions for PostgreSQL setup. 2024-02-23 12:11:34 +01:00

OpenDTU logger

OpenDTU logger connects to the OpenDTU livedata websocket and captures metrics. These metrics are inserted into a PostgreSQL database. Optionally, TimescaleDB can be used.

PostgreSQL setup

CREATE DATABASE opendtu_logger;
CREATE USER opendtu_logger WITH password 'SECRET';
GRANT ALL privileges ON DATABASE opendtu_logger TO opendtu_logger;
GRANT ALL ON SCHEMA public TO opendtu_logger;

Optional: enable TimescaleDB extension

\c opendtu_logger
CREATE EXTENSION OF NOT EXISTS timescaledb;

Environment variables

REMOTE_URL="opendtu:80"
DB_URL="host=localhost port=5432 user=postgres password=secret dbname=dtu sslmode=disable"
TIMESCALEDB_ENABLED="true"
TZ="Europe/Amsterdam"