A Node.js application that collects Lavalink server statistics and stores them in a SQLite database every minute.
- Fetches stats from multiple Lavalink servers
- Stores data in SQLite database with structured schema
- Configurable collection intervals
- Authentication support for Lavalink servers
- Error handling and logging
- Graceful shutdown handling
- Node.js 20.x
- Yarn 4.x
- This application is only compatible with Lavalink 3.x (SiruBOT production using legacy Lavalink 3.x), in future support for Lavalink 4.x will be added
- Clone the repository:
git clone https://github.com/SiruBOT/lavalink-stats.git
cd lavalink-stats- Install dependencies:
yarn install- Build the application:
yarn build- Start the application:
yarn startEdit the .env file to configure your Lavalink hosts:
# host:port:password[:name];host:port:password[:name]
LL_HOSTS=10.0.0.201:2333:youshallnotpass:KOR 1;10.0.0.202:2333:youshallnotpass:KOR 2;
# Collection interval
COLLECTION_INTERVAL_MS=60000
# Request timeout
REQUEST_TIMEOUT_MS=10000
# Database path
DB_PATH=/app/data/lavalink_stats.db
# Dashboard port
PORT=3000
# API password
API_PASSWORD=youshallnotpass
Start the application:
yarn build && yarn start