Prometheus IOTA (Iri) Exporter

Intro

A Rust Prometheus exporter for IOTA (Iri) server. This tool exports the information provided by the Iri server API in a format that Prometheus can understand. It's a Rust-only clone of this exporter: https://github.com/crholliday/iota-prom-exporter. While this tool does not currently support all the metrics supported by the aforementioned exporter it does not require NodeJS so it's easier to deploy on servers. Being Rust, the memory/CPU footprint is also small (as it should be for such a simple tool). This library also exports the last snapshotted milestone so you can visually check if the new automatic snapshotting functionality works:

Prerequisites

You need Rust to compile this code. Simply follow the instructions on Rust's website to install the toolchain. If you get wierd errors while compiling please try and update your Rust version first (I have developed it on rustc 1.33.0-nightly (ceb251214 2019-01-16)).

Usage

Start the binary with -h to get the complete syntax. The parameters are:

Parameter

Mandatory

Valid values

Default

Description

-v

no

Enable verbose mode.

-p

no

any valid port number

9978

Specify the serivce port. This is the port your Prometheus instance should point to.

-a

yes

Any valid URI

This is your IRI management port. Right now the tool does not support authentication so localhost is a good choice.

-n

no

If specified, the tool does not query for neighbors information. The output will be less informative but this is useful if you do not need the info.

Once started, the tool will listen on the specified port (or the default one, 9978, if not specified) and return a Prometheus valid response at the url /metrics. So to check if the tool is working properly simply browse the http://localhost:9978 (or whichever port you choose).

Now add the exporter to the Prometheus exporters as usual. I recommend to start it as a service. My systemtd service file is like this one: