Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bcremer/docker-telegraf-influx-grafana-stack
Docker Compose Setup for Telegraf / InfluxDB / Grafana (TIG)
https://github.com/bcremer/docker-telegraf-influx-grafana-stack
docker grafana influxdb metrics monitoring php statsd telegraf tig
Last synced: 3 months ago
JSON representation
Docker Compose Setup for Telegraf / InfluxDB / Grafana (TIG)
- Host: GitHub
- URL: https://github.com/bcremer/docker-telegraf-influx-grafana-stack
- Owner: bcremer
- License: mit
- Created: 2018-09-13T18:33:29.000Z (over 6 years ago)
- Default Branch: latest
- Last Pushed: 2024-07-29T10:06:30.000Z (6 months ago)
- Last Synced: 2024-08-01T15:31:08.115Z (6 months ago)
- Topics: docker, grafana, influxdb, metrics, monitoring, php, statsd, telegraf, tig
- Language: PHP
- Homepage:
- Size: 323 KB
- Stars: 159
- Watchers: 7
- Forks: 102
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example Docker Compose project for Telegraf, InfluxDB and Grafana
This an example project to show the TIG (Telegraf, InfluxDB and Grafana) stack.
![Example Screenshot](./example.png?raw=true "Example Screenshot")
## Start the stack with docker compose
```bash
$ docker-compose up
```## Services and Ports
### Grafana
- URL: http://localhost:3000
- User: admin
- Password: admin### Telegraf
- Port: 8125 UDP (StatsD input)### InfluxDB
- Port: 8086 (HTTP API)
- User: admin
- Password: admin
- Database: influxRun the influx client:
```bash
$ docker-compose exec influxdb influx -execute 'SHOW DATABASES'
```Run the influx interactive console:
```bash
$ docker-compose exec influxdb influxConnected to http://localhost:8086 version 1.8.0
InfluxDB shell version: 1.8.0
>
```[Import data from a file with -import](https://docs.influxdata.com/influxdb/v1.8/tools/shell/#import-data-from-a-file-with-import)
```bash
$ docker-compose exec -w /imports influxdb influx -import -path=data.txt -precision=s
```## Run the PHP Example
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.
```bash
$ 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
```## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.