Skip to content

stefan-lange/chia-price-exporter

Repository files navigation

Chia Price Exporter Docker Hub Go Report Card

Chia Price Exporter is a standalone application which exports metrics to a Prometheus compatible /metrics endpoint.

Usage

chia-price-exporter serve will start the metrics exporter on the default port of 9952. Metrics will be available at <hostname>:9952/metrics.

To see further supported commands and flags try chia-price-exporter --help.

Metrics

The following metrics are supported and fully compatible with the great Chia Monitor and the Chia Farm Dashboard.

Metric Description
chia_price_usd_cent USD price
chia_price_eur_cent EUR price
chia_price_btc_satoshi BTC price
chia_price_eth_gwei ETH price

Prometheus configuration

Add this job configuration to the scrape_configs section in your prometheus.yml.

scrape_configs:
    -   job_name: 'chia-price-exporter'
        scrape_interval: 60s
        static_configs:
            -   targets: [ '<<CHIA-PRICE-EXPORTER-HOSTNAME>>:9952' ]

Development (quick start)

using go

# build and run
task build
./bin/chia-price-exporter serve
# test manually
curl -v localhost:9952/metrics

using docker

# build and run
docker run --rm -p "9952:9952" -it $(docker buildx build -q .) serve
# test manually
curl -v localhost:9952/metrics

play with executable

docker run --rm -it $(docker buildx build -q .)

Maintenance

update go dependencies to latest and greatest

go get -u ./...