Skip to content

Improve Documentation and Add Configuration Flexibility #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

federicociro
Copy link

Description:

This pull request aims to make several improvements to the repository:

Changes:

  1. README Update: Enhanced the README to include an introduction, features, and a quick start guide.
  2. Configuration Options: Added documentation on how to configure the script using command-line arguments, environment variables, and hardcoded defaults.
  3. Prometheus Configuration: Included steps to configure Prometheus to scrape metrics from this exporter.
  4. Table of Contents: Added a Table of Contents for easier navigation.
  5. CONTRIBUTING.md: Created a CONTRIBUTING.md file to guide contributors.
  6. Command-Line Arguments: Modified the script to accept command-line arguments for greater flexibility.

Why This Pull Request is Needed:

  1. Enhanced Documentation: Makes it easier for users to understand the project and how to use it.
  2. Flexibility: The added command-line arguments make the script more flexible and easier to use in different environments.
  3. Community Engagement: The CONTRIBUTING.md file provides guidelines for potential contributors, encouraging community involvement.

Checklist:

  • Updated README.md
  • Added CONTRIBUTING.md
  • Modified script to accept command-line arguments
  • Tested changes locally
  • Updated documentation accordingly

Please review the changes and let me know if further modifications are required.

## Configuration Options

The script can be configured using command-line arguments, environment variables, or hardcoded default values. The priority is as follows:

1. **Command-Line Arguments**: Take the highest precedence.
2. **Environment Variables**: Used if no command-line argument is provided for that option.
3. **Hardcoded Defaults**: Used if neither command-line arguments nor environment variables are provided.

### Command-Line Arguments

| 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`  |

### Environment Variables

| 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`   |

### Hardcoded Defaults

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.

### Example Usage

To run the script with custom settings:

```bash
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
@EchterAgo
Copy link
Owner

The changes look good, but I'm not sure why you assume this repository is abandoned. Multiple people and I run this code without issue and there aren't any open issues here. I'd be happy to merge your PR if you remove the part suggesting that this repository is abandoned. Also, if you want to fork it, no need to credit me in the readme, the existing copyright notices / git log are fine.

@federicociro
Copy link
Author

Hello Axel! I am happy to hear the repo is alive.

In that case no fork is needed. I took out that part.-

@EchterAgo
Copy link
Owner

There still is This repository is a fork of the [original Fulcrum Prometheus Exporter](https://github.com/EchterAgo/fulcrum-prometheus-exporter) by Axel Gembe. The original project appears to be abandoned, and this fork aims to continue its development and maintenance. in the introduction.

### Quick Start
1. Clone this repository.
```
git clone https://github.com/federicociro/fulcrum-prometheus-exporter.git
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be changed

We welcome contributions from the community. Please read the [contribution guidelines](CONTRIBUTING.md) for more information.

#### License
This project is licensed under the [BSD 3-Clause License](https://github.com/federicociro/fulcrum-prometheus-exporter/blob/master/LICENSE).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow use relative links for these so it doesn't matter which repo? It seems to work for other markdown files.

@EchterAgo EchterAgo self-assigned this Sep 27, 2023
@EchterAgo EchterAgo added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants