Coder Social home page Coder Social logo

luup-prometheus's Introduction

Vera Prometheus exporter

This is a plugin for Vera controllers which adds a Prometheus metrics exporter.

Exported metrics

The plugin currently exports metrics for a few different types of sensors and devices:

Sensors:

  • Temperature sensors: temperature_c
  • Humidity sensors: humidity_relative
  • Light sensors: light_lux
  • Energy/electricity usage sensors: electricity_used_kwh, electricity_usage_w
  • Battery level: battery_level_percent
  • Security/motion sensors: security_sensor_tripped

Devices:

  • Dimmable bulbs: dimmable_load_percent

System:

  • Various system metrics from /proc/stat, attempting to be compatible with the Prometheus node_exporter exporter (node_cpu, node_intr, node_context_switches, node_boot_time, node_forks, node_procs_running, node_procs_blocked)
  • Various system metrics from /proc/meminfo, attempting to be compatible with the Prometheus node_exporter exporter (node_memory_*)
  • Some metrics about the LuaUPnP process itself from /proc/self/stat, attempting to be compatible with the golang Prometheus client library ( process_cpu_seconds_total, process_resident_memory_bytes, process_virtual_memory_bytes)

Installation

Upload all of the .xml and .lua files in this repository to your Vera controller.

In UI7, you can do this by navigating to Apps, Develop apps, Luup files on your controller’s web interface.

Check that the metrics are being properly exported by pointing your browser or a tool like curl to

http://<yourveraip>:49451/data_request?id=lr_prometheus_metrics

TODO: Publish this to the mios app store. Please contact me if you are interested in this plugin and would like me to publish it to the app store.

Configuration

The metrics are not exposed on the default /metrics path that most Prometheus exporters expose their metrics on, so a little extra configuration is needed. An example snippet to add to the scrape_configs section of your prometheus.yml is:

  - job_name: 'vera'
    scrape_interval: 15s
    metrics_path: /data_request?id=lr_prometheus_metrics
    static_configs:
      - targets: ['192.168.8.68:49451']

Of course, you should change the IP address in the example (192.168.8.68) to the IP address of your Vera controller.

License

Licensed under the GPLv3. See the LICENSE file for more details.

Contributing

Pull requests and bug reports welcome!

luup-prometheus's People

Contributors

rcloran avatar bretep avatar salekseev 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.