Code Monkey home page Code Monkey logo

prometheus_iota_exporter's Introduction

Prometheus IOTA (Iri) Exporter

legal alpha

Crate cratedown cratelastdown

tag release commitssince

๐Ÿšง ๐Ÿšง Note ๐Ÿšง ๐Ÿšง

This project is archived because Iri is no longer used by Iota.

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)).

Compilation

To compile the latest master version:

git clone https://github.com/MindFlavor/prometheus_iota_exporter.git
cd prometheus_iota_exporter
cargo install --path .

If you want the latest release you can simply use:

cargo install prometheus_iota_exporter

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:

[Unit]
Description=Prometheus IOTA Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/prometheus_iota_exporter -a http://localhost:14267 -p 9978

[Install]
WantedBy=multi-user.target

prometheus_iota_exporter's People

Contributors

mindflavor avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

icodein

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.