Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/bonovoxly/coinmarketcap-exporter

coinmarketcap.com Prometheus Exporter
https://github.com/bonovoxly/coinmarketcap-exporter

Last synced: 4 months ago
JSON representation

coinmarketcap.com Prometheus Exporter

Lists

README

        

# coinmarketcap-exporter

A prometheus exporter for . Provides Prometheus metrics from the API endpoint of Coinmarketcap, such as US price, Bitcoin price, trading volume, etc. [Blog post found here](http://blog.billyc.io/2017/12/02/a-prometheus-exporter-for-cryptocurrency-values-using-the-coinmarketcap-api/).

When running this exporter with both Prometheus and Grafana, [you can create dashboards like](https://grafana.com/dashboards/3890):

![coinmarketcap-single-dashboard](https://github.com/bonovoxly/coinmarketcap-exporter/raw/master/img/coinmarketcap.png "coinmarketcap-exporter with Prometheus and Grafana")

# Developing

- Build the image:

```sh
docker build -t coinmarketcap-exporter:latest .
```

- Run it while listening on localhost:9101:

```sh
docker run --rm -p 127.0.0.1:9101:9101 coinmarketcap-exporter:latest
```

- Run it interactively:

```sh
docker run --rm -it --entrypoint=/bin/sh -p 127.0.0.1:9101:9101 -v ${PWD}:/opt/coinmarketcap-exporter coinmarketcap-exporter:latest
```

- Then to launch:

```sh
python coinmarketcap.py
```

# Testing the Prometheus Grafana Stack

- In the `prometheus-compose` directory, run:

```sh
docker-compose up
```

- Go to . Log in as `admin/admin`.
- To import the dashboard, click the "Home" button at the top, then on the right, click "Import Dashboard".
- Enter `3890` in the "Grafana.com Dashboard" field.
- Select the "prometheus" data source.
- Modify the other settings as preferred. Click "Import".
- The new dashboard should be selectable and found at .
- The Prometheus interface can be accessed at

# Thanks and Links

- Coinmarketcap API link -
- Prometheus exporters -
- Writing JSON exporters in Python from Robust Perception -
- Grafana Dashboard -