Prometheus exporter for Yahoo Finance stock data.
- Python 65.7%
- Makefile 22.8%
- Dockerfile 11.5%
| .gitignore | ||
| Dockerfile | ||
| Makefile | ||
| poetry.lock | ||
| project_vars.mk | ||
| pyproject.toml | ||
| README.md | ||
| yfinance_exporter.py | ||
YFinance Exporter
Metrics served
{
"stocks": [
{"isin": "FR0000120073", "name": "AIR LIQUIDE", "ycode": "AI.PA"}
]
}
Running it
For the next few bits of code, we'll suppose you have a working configuration above in ~/.config/yfinance-exporter.json.
... with python:
pip install yfinance-exporter
python -m yfinance_exporter
... with docker:
docker run -v ~/.config/:/etc/yfinance-exporter/:ro -p 9100:9100 yfinance-exporter:main
You'll then be able retrieve some values:
curl localhost:9100/metrics
# HELP yfinance_exporter
# TYPE yfinance_exporter gauge
yfinance_exporter{status="loop"} 1.0
yfinance_exporter{status="loop-time"} 10.179875
yfinance_exporter{status="ok-stock"} 45.0
yfinance_exporter{status="ko-stock"} 2.0
[...]