A Prometheus exporter for Prefect.io metrics, written in Python.
By default prometheus-prefect-exporter
will listen on port 8000
.
docker run -d \
-p 8000:8000 \
-e PREFECT_API_URL=<PREFECT_ENDPOINT> \
devopsia/prometheus-prefect-exporter:latest
Can modify environment variables to change the behavior of the exporter. An API Key is necessary specifically for auth-enabled, on-prem, self-hosted solutions. An API key is not necessary for open-source or Prefect Server to function.
Environment Variable | Description | Default |
---|---|---|
LOG_LEVEL |
Logging level | INFO |
MAX_RETRIES |
Number of retries to attempt when fetching metrics from Prefect API | 3 |
METRICS_PORT |
Port to expose metrics on | 8000 |
OFFSET_MINUTES |
Number of minutes to offset the start time when fetching metrics from Prefect API | 5 |
PREFECT_API_URL |
Prefect API URL | https://localhost/api |
PREFECT_API_KEY |
Prefect API KEY (Optional) | "" |
Pre-requisites:
- Python 3.11
- Pipenv
Running:
git clone https://github.com/devops-ia/prometheus-prefect-exporter.git
cd prometheus-prefect-exporter
pipenv sync
pipenv shell
python main.py