Skip to content

Monitor host, Docker, and applications resource metrics with Grafana, InfluxDB, Telegraf

License

Notifications You must be signed in to change notification settings

mlf4aiur/Metrics

Repository files navigation

Metrics

Monitor host, Docker, and applications resource metrics with Grafana, InfluxDB, and Telegraf.

Urls:

Getting started

Setup this metrics stack needs to do something manually on the first time.

Clone the repository on GitHub:

git clone https://github.com/mlf4aiur/Metrics.git

Create and start docker containers:

cd Metrics
docker-compose up -d

Create Grafana "admin" api_key

api_key

Create new telegraf Datasource

grafana_host="localhost"
token="Bearer your_api_key"

curl -s \
  -XPOST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: ${token}" \
  http://${grafana_host}:3000/api/datasources \
  -d @grafana/datasources/telegraf.json | python -m json.tool

Create dashboard

ls grafana/dashboards/*.json | while read dashboard
do
  echo ${dashboard}
  curl -s \
    -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: ${token}" \
  http://${grafana_host}:3000/api/dashboards/db \
  -d @${dashboard} | python -m json.tool
done

Install Grafana Pie Chart plugin

docker exec -t -i $(docker ps | awk /grafana/'{print $1}') grafana-cli plugins install grafana-piechart-panel
docker exec -t -i $(docker ps | awk /grafana/'{print $1}') chown -R grafana:grafana /var/lib/grafana/plugins

# Restart Grafana to enable new plugin
docker-compose restart grafana

Dashboard screenshots

Telegraf Templated Container: telegraf-templated-container

Telegraf Templated Docker: telegraf-templated-docker

Telegraf Templated Host: telegraf-templated-host

Zookeeper: zookeeper

Kafka: kafka

About

Monitor host, Docker, and applications resource metrics with Grafana, InfluxDB, Telegraf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published