- Introduction
- Features
- Quick Start
- Configuration Options
- Configuring Prometheus to Scrape Metrics
- Contributing
- License
This repository is a fork of the original Fulcrum Prometheus Exporter by Axel Gembe. The original project appears to be abandoned, and this fork aims to continue its development and maintenance.
- Exports Fulcrum metrics to Prometheus.
- Easy to set up and configure.
- Written in Python.
- Clone this repository.
git clone https://github.com/federicociro/fulcrum-prometheus-exporter.git
- Install the required Python packages.
pip install -r requirements.txt
- Run the exporter.
python fulcrum-monitor.py
The script can be configured using command-line arguments, environment variables, or hardcoded default values. The priority is as follows:
- Command-Line Arguments: Take the highest precedence.
- Environment Variables: Used if no command-line argument is provided for that option.
- Hardcoded Defaults: Used if neither command-line arguments nor environment variables are provided.
Argument | Description | Example |
---|---|---|
--fulcrum-stats-url |
Fulcrum stats URL | http://localhost:8080/stats |
--metrics-addr |
Metrics address | 0.0.0.0 |
--metrics-port |
Metrics port | 8080 |
--retries |
Number of retries | 3 |
--timeout |
Timeout in seconds | 20 |
--log-level |
Log level | DEBUG |
Variable | Description | Default |
---|---|---|
FULCRUM_STATS_URL |
Fulcrum stats URL | http://127.0.0.1:8080/stats |
METRICS_ADDR |
Metrics address | "" (any address) |
METRICS_PORT |
Metrics port | 50039 |
RETRIES |
Number of retries | 5 |
TIMEOUT |
Timeout in seconds | 30 |
LOG_LEVEL |
Log level | INFO |
If neither command-line arguments nor environment variables are provided, the script falls back to hardcoded default values. These are specified in the script and serve as the last-resort configuration options.
To run the script with custom settings:
python fulcrum-monitor.py --fulcrum-stats-url http://localhost:8080/stats --metrics-addr 0.0.0.0 --metrics-port 8080 --retries 3 --timeout 20 --log-level DEBUG
To collect metrics from this exporter, you'll need to configure your Prometheus instance. Below are the steps to do so:
-
Install Prometheus: If you haven't installed Prometheus yet, you can download it from here.
-
Edit Configuration File: Open your
prometheus.yml
file in a text editor. -
Add Scrape Config: Add a new scrape configuration for the Fulcrum Prometheus Exporter.
Here's a sample prometheus.yml
configuration snippet to scrape metrics from this exporter:
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'fulcrum_exporter'
static_configs:
- targets: ['localhost:50039'] # Replace with the METRICS_ADDR and METRICS_PORT you set
We welcome contributions from the community. Please read the contribution guidelines for more information.
This project is licensed under the BSD 3-Clause License.