GithubHelp home page GithubHelp logo

zwerdlds / scaphandre Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hubblo-org/scaphandre

0.0 2.0 0.0 468 KB

Electrical power consumption metrology agent. Let scaph dive and bring back the metrics that will help you make your systems and applications more sustainable !

License: Apache License 2.0

Rust 98.98% Shell 1.02%

scaphandre's Introduction

Scaphandre


Scaphandre [skafɑ̃dʁ] is a metrology agent dedicated to electrical power consumption metrics. The goal of the project is to permit to any company or individual to measure the power consumption of its tech services and get this data in a convenient form, sending it through any monitoring or data analysis toolchain.

Scaphandre means heavy diving suit in 🇫🇷. It comes from the idea that tech related services often don't track their power consumption and thus don't expose it to their clients. Most of the time the reason is a presumed bad ROI. Scaphandre makes, for tech providers and tech users, easier and cheaper to go under the surface to bring back the desired power consumption metrics, take better sustainability focused decisions, and then show the metrics to their clients to allow them to do the same.

This project was born from a deep sense of duty from tech workers. Please refer to the why section for know more about its goals.

Warning: this is still a very early stage project. Any feedback or contribution will be highly appreciated. Please refer to the contribution section.

Fmt+Clippy


Features

  • measuring power consumption on bare metal hosts
  • measuring power consumption of qemu/kvm virtual machines from the host
  • exposing power consumption metrics of a virtual machine in a way that allows to access those metrics in the VM as if it was a bare metal machine (relies on hypervisor features)
  • exposing power consumption metrics as a prometheus HTTP exporter
  • showing basic power consumption metrics in the terminal

Getting started

Installation steps are described here.

Here are some examples.

To show power consumption metrics in your terminal, run:

scaphandre stdout

Details here.

To expose power consumption metrics as a prometheus exporter (as an http endpoint):

scaphandre prometheus

Metrics are now available on http://localhost:8080/metrics. Details here.

To compute metrics of running Qemu/KVM virtual machines on the host, and be able to expose those metrics to the guests, run:

scaphandre qemu

Details here.

General usage is:

scaphandre [-s SENSOR] EXPORTER [OPTIONS]

Available exporters are:

  • stdout: displays metrics on the standard output/on your terminal
  • prometheus: exposes metrics as an http endpoint, the way prometheus understands
  • qemu: computes power consumption of each Qemu/KVM virtual machine running on the host and stores the data in /var/lib/libvirt/scaphandre/VM_NAME

Available sensors are:

Installation

We recommand using this version of the rust toolchain or later:

cargo --version
cargo 1.48.0 (65cbdd2dc 2020-10-14)
rustc --version
rustc 1.48.0 (7eac88abb 2020-11-16)

To be sure to be up to date, you may install rust from the official website instead of your package manager.

Note: On ubuntu 20.04, you may encounter permissions issues. If it is your case you can run the init.sh script that will apply the right permissions first (details). Handling of special permissions accross different distributions will be improved in a near future.

You'll find existing releases and packages here.

To hack scaph, or simply be up to date with latest developments, you can download scaphandre from the main branch:

git clone https://github.com/hubblo-org/scaphandre.git
cd scaphandre
cargo build # binary path is target/debug/scaphandre

To use the latest code for a true use case, build for release instead of debug:

cargo build --release

Binary path is target/release/scaphandre.

Virtual Machines & Cloud

A major pain point in measuring power consumption is doing so inside a virtual machine. A virtual machine usually doesn't have access to power metrics. Scaphandre aims at solving that by enabling a communication between a scaphandre instance on the hypervisor host and another one in the virtual machine. The scaphandre agent on the host will compute the metrics meaningful for that virtual machine and the one on the VM accesses those metrics to allow its user to access the data as if they had access to power metrics in the first place (as if they were on a bare metal machine).

This allows to break opacity in a virtualization context, if you have access to the virtualization hosts and can install this tool, or cloud context if the provider uses scaphandre on their hypervisors. Please refer to the qemu exporter documentation.

Contributing

Feel free to propose pull requests, or open new issues at will. Scaphandre is a collaborative project and all opinions and propositions shall be heard and studied. The contributions will be received with kindness, gratitude and with an open mind. Remember that we are all dwarfs standing on the shoulders of giants. We all have to learn from others and to give back, with due mutual respect.

Discussions and questions about the project are welcome on gitter: gitter or by email.

Here is the code of conduct of the project.

This project intends to use conventionnal commit messages and the gitflow workflow.

Structure

Scaphandre is a not only a tool, but a framework. Modules dedicated to collect energy comsumption data from the host are called Sensors. Modules that are dedicated to send this data to a given channel or remote system are called Exporters. New Sensors and Exporters are going to be created and all contributions are welcome.

Roadmap

The ongoing roadmap can be seen here. Feature requests are welcome, please join us.

Footprint

In opposition to its name, scaphandre aims to be as light and clean as possible. One of the main focus areas of the project is to come as close as possible to a 0 overhead, both about resources consumption and power consumption.

Documentation

Code documentation is here.

Users documentation is here.

scaphandre's People

Contributors

bpetit avatar florimondmanca avatar uggla avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.