TIG Stack is an arconym for the following three open source technologoies that seamless work togther to collect, store, analyze and monitor real time data from almost anything such as servers, APIs, IoT devices or even your smart coffee machine!
- Telegraf to collect system metrics and write to InflxDB
- InfluxDB 3 (Core or Enterprise version) as the timeseries database
- Grafana as the data visualization tool that frequently queries metrics from InfluxDB 3 tables.
- Docker should be installed on your local machine. We will rely on the docker-compose.yaml file to configure and install Telegraf, InfluxDB 3 Core/Enteprise and Grafana docker images.
- Git for version control (optional)
- Editor
git clone https://github.com/InfluxCommunity/TIG-Stack-using-InfluxDB-3.git
cd TIG-Stack-using-InfluxDB-3
InfluxDB 3 Core & Generate Opreator Token
docker-compose up -d influxdb3-core
docker-compose exec influxdb3-core influxdb3 create token --admin
Open .env file and paste the token string for "INFLUXDB_TOKEN" enviornment variable.
**First make sure Docker application is up and running on your local machine. **
docker-compose up -d telegraf
docker-compose up -d grafana
Check Telegraf Logs
docker-compose logs telegraf
Check InfluxDB 3 Logs & See Telegraf generated Tables
docker-compose logs influxdb3-core
docker-compose exec influxdb3-core influxdb3 query "SHOW TABLES" --database local_system --token REPLACE_WITH_YOUR_TOKEN_STRING
- Open localhost:3000 from your browser
- Login with credentials from .env (default: admin/admin)
- Add Data Source :
- Type: InfluxDB
- Language : SQL
- Database: Paste the string value for INFLUXDB_BUCKET enviornment variable from your .env file
- URL: http://influxdb3-core:8181 for connecting to InfluxDB 3 Core
- URL: http://influxdb3-enterprise:8181 for connecting to InfluxDB 3 Enterprise
- Token: Paste the string value for INFLUXDB_TOKEN enviornment variable from your .env file
- Add Data Visualization : Dashboards > Create Dashboard - Add Visualization > Select Data Source > InfluxDB_3_Core
- In the query 'builder' paste and run the following SQL query to see the visualization of the data collected via Telegraf, written to InfluxDB 3.
SELECT "cpu", "usage_user", "time" FROM "cpu" WHERE "time" >= $__timeFrom AND "time" <= $__timeTo AND "cpu" = 'cpu0'
docker-compose down
docker-compose down -v