This an example project to show the TIG (Telegraf, InfluxDB and Grafana) stack.
$ docker-compose up
- URL: http://localhost:5000
- User: admin
- Password: admin
- Port: 8125 UDP (StatsD input)
- Port: 8086 (HTTP API)
- User: test
- Password: test
- Database: geth
Run the influx client:
$ docker-compose exec influxdb influx -execute 'SHOW DATABASES'
Run the influx interactive console:
$ docker-compose exec influxdb influx
Connected to http://localhost:8086 version 1.8.0
InfluxDB shell version: 1.8.0
>
Import data from a file with -import
$ docker-compose exec -w /imports influxdb influx -import -path=data.txt -precision=s
Edit config.toml
file
[-- other configuration --]
[Metrics]
HTTP = "127.0.0.1"
Port = 6060
InfluxDBEndpoint = "http://0.0.0.0:8086"
InfluxDBDatabase = "geth"
InfluxDBUsername = "test"
InfluxDBPassword = "test"
InfluxDBTags = "host=localhost"
InfluxDBToken = "test"
InfluxDBBucket = "geth"
InfluxDBOrganization = "geth"
Start geth
node, which's dumping metrics directly into an influx database
$ geth --config path/to/config.toml <other commands> --metrics --metrics.influxdb --metrics.expensive
For a Geth InfluxDB monitoring dashboard, copy the URL of this dashboard and paste it in the "Import page" in Grafana.
The PHP example generates random example metrics. The random metrics are beeing sent via UDP to the telegraf agent using the StatsD protocol.
The telegraf agents aggregates the incoming data and perodically persists the data into the InfluxDB database.
Grafana connects to the InfluxDB database and is able to visualize the incoming data.
$ cd php-example
$ composer install
$ php example.php
Sending Random metrics. Use Ctrl+C to stop.
..........................^C
Runtime: 0.88382697105408 Seconds
Ops: 27
Ops/s: 30.548965899738
Killed by Ctrl+C
The MIT License (MIT). Please see License File for more information.