1
0
Fork 0
Export helium blockchain data to prometheus.
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Massaki Archambault a0430b6c1e fix lock value copy bug 2021-12-24 15:58:38 -05:00
contrib/dashboard seplit reward by type 2021-10-14 15:24:06 -04:00
heliumapi configure part of a multi-arch pipeline 2021-12-24 15:45:51 -05:00
.dockerignore add deposit/withdraw 2021-09-25 21:55:26 -04:00
.drone.yml configure part of a multi-arch pipeline 2021-12-24 15:45:51 -05:00
.gitignore export oracle and stats metrics 2021-09-12 23:25:47 -04:00
Dockerfile use buster for build image 2021-09-26 18:34:54 -04:00
LICENSE Initial commit 2021-09-10 02:49:17 +00:00
Makefile fix hnt value factors 2021-09-26 17:37:33 -04:00
README.md readme 2021-09-26 17:37:09 -04:00
exporter.go fix lock value copy bug 2021-12-24 15:58:38 -05:00
go.mod add api rate limiter 2021-11-14 10:44:39 -05:00
go.sum add api rate limiter 2021-11-14 10:44:39 -05:00

README.md

Helium blockchain exporter

Build Status

Export helium blockchain data from the helium blockchain API to prometheus.

If an helium account address is supplied, export metrics from this account and all the hotspots owned by them.

Usage

A docker image is available on badjware/helium-blockchain-exporter. By default, the exporter listen on port 9865.

The address of an account can be supplied with the -accounts flag. If you wish to export metrics from multiple accounts, you can supply a list of accounts by delimiting them with a comma. If no accounts are supplied, only generic blockchain stats will be exported.

Eg:

docker run -p 9865:9865 badjware/helium-blockchain-exporter -accounts=14YeKFGXE23yAdACj6hu5NWEcYzzKxptYbm5jHgzw9A1P1UQfMv

The same, but for docker-compose:

version: "3"
services:
  helium-blockchain-exporter:
  image: badjware/helium-blockchain-exporter
    ports:
      - "9865:9865"
    args:
      - -acounts=14YeKFGXE23yAdACj6hu5NWEcYzzKxptYbm5jHgzw9A1P1UQfMv

Metrics will be available on http://localhost:9865/metrics.

Run the exporter with the -h flag for a full list of available flags.

Scape config considerations

Each time a query is made to the /metrics of the exporter, the data is queried from the helium api. The api can take a few seconds to reply, so it's recommended to set the scrape_timeout in your prometheus configuration to a higher value that the default to avoid timeouts, eg: 30s.

Currently, the block time on the helium blockchain is about 60 seconds per blocks. It's useless to scrape the chain faster than this rate. For this reason, it's recommended to set the scrape_interval in your prometheus configuration to at least 60s.

The helium api might occasionally be unreliable. In the event that the exporter is unable to get a valid answer from the api, the metric will be omitted from the /metrics. The metrics that where successfully queried will still be exposed. This must be kept in mind when creating dashboards and alerts using these metrics.

Gafana dashboard

Alerts

Building for development

Clone this repository and run make. The binary will be in ./bin/. To build and run the exporter:

make && ./bin/helium-blockchain-exporter

To build the docker image:

make docker

Future versions

  • Add validator metrics