Python module to emit prefect2 metrics that are scraped by prometheus
Merged PR in Prometheus
Metrics naming convention
Set prefect2 url in values, then:
helm3 upgrade prefect2 . --install --values values.yaml --namespace prefect2
Set env vars:
bash
export PREFECT_UI_API_URL=https://prefect2/api
export EXPORTER_PORT=30042
export EXPORTER_VERSION=1.0.0
Create new Dockerfile and use my as BASE, e.g.:
Dockerfile
FROM pathfinder177/prefect2-prometheus-exporter:tag
ENV PREFECT_UI_API_URL
ENV EXPORTER_PORT 30042
ENV EXPORTER_VERSION 1.0.0 https://prefect2/api
CMD ["python3", "exporter.py"]
It exports on port 30042 by default:
- Flow runs for 1h and 24h in TERMINAL, FAILED, CANCELLED states
- Exporter status as metric
- Healthcheck