Grafonix is a Grafana integration service for the SONIX project.
This Flask application fetches and modifies JSON data from an external API, providing a simple interface for integration with Grafana.
- Python 3.9 or higher with virtualenv support
- poetry for running tests locally
- mypy for type checking
-
Clone the repository:
git clone https://github.com/sonix-network/grafonix.git cd grafonix
-
Install the package in a venv and execute:
./run.sh
Using SONIX internal ansible, you can deploy changes like this:
./ansible/bin/ansible-playbook site.yml -l prometheus.local.sonix.network -t grafana
You can run the Grafonix application using the installed command-line binary:
grafonix
This will start the Flask application, listening on all IPv6 addresses (::
) at port 3001.
The codebase uses Python type hints to ensure type safety. To verify type correctness:
poetry run mypy --install-types grafonix.py tests/
This will check all Python files for type correctness. Make sure to run type checking before submitting any pull requests.
-
Run the tests:
poetry run pytest tests/
This will execute the tests located in the tests
directory and provide you with a summary of the results.
grafonix/
├── grafonix.py # Main application file
├── pyproject.toml # Project configuration and dependencies
├── tests/ # Directory containing unit tests
│ └── test_grafonix.py # Unit tests for the application
Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.