larryhan / helium_hotspot_exporter

Prometheus exporter for the Helium hotspots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

helium_hotspot_exporter

Prometheus exporter for Helium hotspots. Using prometheus_client, this code exposes metrics from the helium API to a prometheus compatible server.

This is only the exporter, which still requires a prometheus server for data and grafana for the dashboard.

We need help making a dashboard. For now, import by ID 14470 to see some of the values (though it isn't organized).

Note port 9829 is the 'reserved' port for this specific exporter.

Run options

The list of hotspots you'd like to monitor can be specified several ways: by name, by address, or by account (owner) address. They all expect comma-separated values (or zero/one without a comma). Here are examples:

HOTSPOT_NAMES="angry-purple-tiger,bald cat lace"
HOTSPOT_ADDRESSES=aabbccdd112233XXYY...,bbccddee223344YYZZ...
ACCOUNT_ADDRESSES=Zzyzx0123...

Note hotspot names must be lowercased and hypenated before they hit the API. This code will normalize case and spaces. Names are also not guaranteed unique, the code will attempt to log an error if it isn't found or it isn't unique.

Running via Docker

Using the docker file, you can run this with Docker or docker-compose! Both of these will expose Prometheus on port 9829. The images are hosted on both GHCR and Dockerhub.

Docker client

docker run -p 9829:9829 -e HOTSPOT_NAMES=angry-purple-tiger --name hotspot_exporter ghcr.io/tedder/helium_hotspot_exporter:latest

Docker-Compose

Using your existing docker-compose file, add the section for the exporter (below). When you're done, run docker-compose up -d as usual. That's it!

version: "3"
services:
  hotspot_exporter:
    image: ghcr.io/tedder/helium_hotspot_exporter:latest
    container_name: hotspot_exporter
    ports:
    - "9829:9829"
    env:
      HOTSPOT_NAMES: "angry-purple-tiger"
      HOTSPOT_ADDRESSES: "aabbccdd112233XXYY...,bbccddee223344YYZZ..."
      ACCOUNT_ADDRESSES: "Zzyzx0123..."

About

Prometheus exporter for the Helium hotspots

License:MIT License


Languages

Language:Python 96.4%Language:Dockerfile 3.6%