No description
Find a file
2022-09-08 11:33:31 +05:30
cmd fix main.go 2022-09-05 18:33:20 +05:30
pkg Update tunables2.go 2022-09-08 11:33:31 +05:30
powertop_dockerfile updated docker file 2022-08-21 19:24:21 +05:30
prometheus fixed prometheus.yaml and docker-compose.yml file 2022-09-02 05:50:50 +05:30
sample_csv added powertop in dockerfile 2022-08-22 17:33:07 +05:30
vendor initial commit 2022-08-17 11:29:05 +05:30
docker-compose.yml fixed prometheus.yaml and docker-compose.yml file 2022-09-02 05:50:50 +05:30
Dockerfile Fixes 2022-09-01 16:21:19 +05:30
go.mod initial commit 2022-08-17 11:29:05 +05:30
go.sum initial commit 2022-08-17 11:29:05 +05:30
README.md fixes 2022-09-05 18:30:43 +05:30

PowerTop Monitoring

Using Prometheus and Graphana

PowerTOP is a terminal-based diagnosis tool that helps you to monitor power usage by programs running on a Linux system when it is not plugged on to a power source , which makes it suitable for unreliable power sources For PowerTop to work in Edge Devices easily , this a image was to be required , which is build with help of Docker image and is available at DockerHub registry.

Furthermore the stats can be acquired with the help of Prometheus metrics , and can be stored in internal Prometheus TSDB . These data can be really helpful for alert management or even a visual representation of the stats using tools like grafana etc

While running thousands of application in edge devices the monitoring and optimisation of power consumption is crucial

Local SetUp

Pre-requisite

  1. Linux Environment for running without container

Dev SetUp

for this powertop is needed to be pre installed

open up a terminal

  1. clone the repo

  2. go in the folder cd powertop_monitoring

  3. run using go compiler sudo go run cmd/main.go
    powertop requires sudo permission to access the system stats

  4. bare prometheus metrics can be seen using curl 0.0.0.0:8887/metrics

Running Using Docker

  1. for this you used need --priviledge flag , which would give it access to host energy stats docker run -d -p 8887:8887 --privileged sibseh/powertopcsv:v2
  2. bare prometheus metrics can be seen using curl 0.0.0.0:8887/metrics |grep powertop

These can be run with graphana and prometheus easily with the docker compose file

Monitoring with Graphana and Prometheus using docker compose

  1. Open up a terminal in the same directory docker-compose up

  2. Open your favourite brower with localhost:3000 , it will open up Graphana, login with username and password both as admin

  3. Go to configuration ->Data sources -> Add Prometheus -> set Http as http://prometheus:9090

  4. Go to create -> Dashboard -> Select one

  5. Add powertop_wakeup_count , powertop_baseline_power,powertop_tunable_count,powertop_cpu_usage

6 . Now you can see clearly the parameters of your system calculated !!

The final set up should look like this Screenshot from 2022-09-02 05-41-50

Viewing powertop_baseline_power variation