Skip to content

Latest commit

 

History

History

cnb-prometheus-exporter

Prometheus exporter for CNB (Czech National Bank) exchange rates

When called it download exchange rates from CNB and publish them to Prometheus so you can show them in Grafana or set-up alerts.

Part of the code was generated by ChatGPT but with some modification and debugging, it is definitely not cleanest code in the world but works fine.

Logo

Dockerizing app

https://nodejs.org/en/docs/guides/nodejs-docker-webapp

Installation

Just run

kubectl apply -f kubernetes/cnb-exporter.yml

You do not need to compile anything, image is already published. In Prometheus modify configuration to use prometheus/scrape-config.yml

Example output

kubectl exec -it busybox -- curl cnb-exporter-service:9100/metrics
exchange_rate{currency="australie-dolar"} 14.706
exchange_rate{currency="brazilie-real"} 4.469
exchange_rate{currency="bulharsko-lev"} 12.079
exchange_rate{currency="cina-zen-min-pi"} 3.087
exchange_rate{currency="dansko-koruna"} 3.171
exchange_rate{currency="emu-euro"} 23.625
exchange_rate{currency="filipiny-peso"} 39.23
exchange_rate{currency="hongkong-dolar"} 2.809
exchange_rate{currency="indie-rupie"} 26.659
exchange_rate{currency="indonesie-rupie"} 1.477
exchange_rate{currency="island-koruna"} 15.803
exchange_rate{currency="izrael-novy-sekel"} 5.996
exchange_rate{currency="japonsko-jen"} 15.75
exchange_rate{currency="jizni-afrika-rand"} 1.161
exchange_rate{currency="kanada-dolar"} 16.472
exchange_rate{currency="korejska-republika-won"} 1.688
exchange_rate{currency="madarsko-forint"} 6.407
exchange_rate{currency="malajsie-ringgit"} 4.765
exchange_rate{currency="mexiko-peso"} 1.268
exchange_rate{currency="mmf-zpc"} 29.272
exchange_rate{currency="norsko-koruna"} 2.009
exchange_rate{currency="novy-zeland-dolar"} 13.351
exchange_rate{currency="polsko-zloty"} 5.276
exchange_rate{currency="rumunsko-leu"} 4.77
exchange_rate{currency="singapur-dolar"} 16.338
exchange_rate{currency="svedsko-koruna"} 2.028
exchange_rate{currency="svycarsko-frank"} 24.235
exchange_rate{currency="thajsko-baht"} 63.169
exchange_rate{currency="turecko-lira"} 0.941
exchange_rate{currency="usa-dolar"} 22.005
exchange_rate{currency="velka-britanie-libra"} 27.439