Modular Prometheus exporters for GPU, CPU, and I/O insights — designed for Slurm-managed HPC clusters. Built with Python, Go, and Ansible for seamless observability, job-level tracking, and infrastructure automation.
Built with the tools and technologies:
POC_Exporters is a powerful developer tool designed to streamline the collection and monitoring of GPU and I/O metrics in high-performance computing environments. This repository contains proof-of-concept exporters written in Python and Go for collecting GPU and I/O metrics. These exporters are designed to work with Prometheus for monitoring system performance.
Why POC_Exporters?
This project enhances observability and resource management for systems utilizing NVIDIA GPUs. The core features include:
- ⚙️ Automated Setup: Simplifies onboarding with a script that sets up a Python virtual environment and installs dependencies.
- 📊 Comprehensive Metrics Collection: Gathers critical GPU and I/O performance data for effective monitoring and optimization.
- 📈 Prometheus Integration: Seamlessly integrates with Prometheus for real-time system performance tracking.
- 🔧 Ansible Automation: Facilitates consistent deployment and management of metrics exporters through Ansible roles.
- 🌐 Multi-language Support: Offers both Python and Go scripts, catering to diverse developer preferences.
- 📉 Job Metrics Tracking: Enables detailed analysis of job-related metrics for improved resource allocation and performance insights.
nvidia_gpu_exporter.py: A Python script that collects GPU utilization, memory usage, and I/O metrics.gpu_io_exporter.go: A Go script that collects GPU utilization, memory usage, and I/O metrics.
This project requires the following dependencies:
- Programming Language: Python 3.x, Go 1.16+
- Package Manager: Pip, Go modules
- Prometheus
- NVIDIA GPU with nvidia-smi tool
Build POC_Exporters from the source and intsall dependencies:
-
Clone the repository:
❯ git clone https://github.com/mjay-kerberos/POC_Exporters
-
Navigate to the project directory:
❯ cd POC_Exporters -
Install the dependencies:
Using pip:
❯ pip install -r requirements.txtUsing go modules:
❯ go buildRun the project with:
Using pip:
python {entrypoint}Using go modules:
go run {entrypoint}Poc_exporters uses the {test_framework} test framework. Run the test suite with:
Using pip:
pytestUsing go modules:
go test ./...The Exporters collect the following metrics:
- GPU Utilization
- GPU Memory Usage
- I/O Read Bytes
- I/O Write Bytes
| Component | Details | |
|---|---|---|
| ⚙️ | Architecture |
|
| 🔩 | Code Quality |
|
| 📄 | Documentation |
|
| 🔌 | Integrations |
|
| 🧩 | Modularity |
|
| 🧪 | Testing |
|
| ⚡️ | Performance |
|
| 🛡️ | Security |
|
| 📦 | Dependencies |
|
| 🚀 | Scalability |
|
└── POC_Exporters/
├── Ansible
│ ├── install_exporter.yml
│ ├── inventory.cfg
│ └── roles
├── Exporters
│ ├── cpu_usage.py
│ ├── gpu_io_exporter.go
│ ├── gpu_io_exporter.md
│ ├── monitoring.py
│ ├── nvidia_gpu_exporter.md
│ └── nvidia_gpu_exporter.py
├── LICENSE
├── Metrics Exporter
│ ├── Makefile
│ ├── README.md
│ ├── go.mod
│ ├── go.sum
│ ├── gpu_metrics.py
│ ├── job_metrics_exporter.go
│ └── job_metrics_exporter.service
├── ReadME.md
├── requirements.txt
└── setup.shPOC_EXPORTERS/
__root__
⦿ __root__
File Name Summary setup.sh - Facilitates the setup of a development environment by creating and activating a Python virtual environment, upgrading pip, and installing necessary dependencies
- Additionally, it automates the installation of a specified version of Go, ensuring that the required tools are readily available for the project
- This script streamlines the onboarding process for developers, enhancing productivity and consistency across the codebase.LICENSE - Project Summary## License OverviewThe LICENSEfile in this project contains the GNU General Public License (GPL) Version 3, which is a foundational document that governs the use and distribution of the software within this codebase
- The primary purpose of this license is to ensure that the software remains free for all users, allowing them the freedom to share, modify, and distribute the code without restrictions.By adopting the GPL, this project emphasizes its commitment to open-source principles, promoting collaboration and innovation within the community
- The license guarantees that all versions of the software will remain accessible and modifiable, thereby fostering an environment where users can contribute to its evolution and improvement.In summary, theLICENSEfile plays a crucial role in the overall architecture of the project by establishing the legal framework that protects user freedoms and encourages community engagement, ensuring that the software remains a valuable resource for everyone.ReadME.md - POC Exporters serves as a foundational component for monitoring GPU and I/O metrics within a system
- By leveraging Python and Go scripts, it facilitates the collection of critical performance data, including GPU utilization and memory usage, which can be integrated with Prometheus for effective system performance monitoring
- This enhances observability and aids in optimizing resource management in environments utilizing NVIDIA GPUs.requirements.txt - Defines essential dependencies for the project, ensuring a streamlined environment for development and testing
- By incorporating tools like Ansible and Molecule with Docker, it facilitates efficient automation and orchestration processes
- This setup enhances the overall architecture by promoting consistency and reliability in deployment workflows, ultimately supporting the projects goal of simplifying infrastructure management.
Ansible
⦿ Ansible
File Name Summary install_exporter.yml - Facilitates the installation of GPU and IO metrics collection on designated GPU servers within the project architecture
- By leveraging the metrics_exporter role, it ensures that essential performance data is gathered, enabling effective monitoring and analysis of system resources
- This contributes to the overall goal of optimizing resource utilization and enhancing system performance across the infrastructure.roles
⦿ Ansible.rolespython_metrics_exporter
⦿ Ansible.roles.python_metrics_exportertemplates
⦿ Ansible.roles.python_metrics_exporter.templates
File Name Summary job_metrics.service.j2 - Defines a systemd service configuration for the Job Metrics Collection Service, enabling the automated collection and logging of job metrics
- By ensuring the service starts after network initialization and runs continuously, it integrates seamlessly into the overall architecture, facilitating efficient monitoring and performance analysis within the broader project ecosystem
- This enhances observability and operational insights across the deployed applications.meta
⦿ Ansible.roles.python_metrics_exporter.meta
File Name Summary main.yml - Defines metadata for the Python Metrics Exporter role within the Ansible project, facilitating the management and deployment of Python-based metrics collection tools
- This role enhances observability by ensuring that relevant metrics are accurately gathered and exported, contributing to the overall monitoring and performance analysis capabilities of the system architecture
- It plays a crucial role in maintaining operational efficiency and reliability.files
⦿ Ansible.roles.python_metrics_exporter.files
File Name Summary metrics.py - Metrics collection for GPU utilization and memory usage is achieved through the integration of NVIDIAs monitoring tools and job management systems
- By parsing relevant data, it maps GPU metrics to specific jobs, facilitating performance monitoring and resource allocation
- The output is formatted for Prometheus, enabling seamless integration into monitoring dashboards for enhanced visibility into GPU resource usage across jobs.tasks
⦿ Ansible.roles.python_metrics_exporter.tasks
File Name Summary main.yml - Facilitates the setup and management of a metrics collection service within the project architecture
- It ensures the creation of necessary directories, deploys a metrics collection script, and configures a systemd service for continuous operation
- This process enhances the overall monitoring capabilities of the system, allowing for effective tracking and analysis of job metrics.prometheus_metric_exporter
⦿ Ansible.roles.prometheus_metric_exportermeta
⦿ Ansible.roles.prometheus_metric_exporter.meta
File Name Summary main.yml - Facilitates the installation and configuration of a custom GPU/IO metric collection exporter within the Ansible framework
- Designed by Juliet Meza at Data in Science Technologies, this role enhances monitoring capabilities by integrating with Prometheus, ensuring efficient metric collection for improved performance analysis
- It is compatible with Ansible version 2.18.3 and adheres to the MIT license.tasks
⦿ Ansible.roles.prometheus_metric_exporter.tasks
File Name Summary main.yml - Facilitates the deployment of the Job Metrics Exporter by copying the necessary binary, extracting it, and moving it to the appropriate directory
- Additionally, it sets up a systemd service to manage the exporter, ensuring it starts on boot and restarts automatically if it fails
- This integration enhances the overall monitoring capabilities of the architecture by enabling efficient metrics collection.
Exporters
⦿ Exporters
File Name Summary nvidia_gpu_exporter.md - NVIDIA GPU Exporter serves to gather and output critical GPU and I/O metrics from NVIDIA GPUs in a format compatible with Prometheus node exporter
- By leveraging thenvidia-smitool, it enables monitoring of GPU utilization and memory usage, as well as I/O read and write statistics, thereby enhancing the observability and performance management of systems utilizing NVIDIA hardware within the broader project architecture.gpu_io_exporter.go - GPU and IO metrics exporter facilitates the collection and exposure of GPU utilization, memory usage, and IO statistics for jobs managed by Slurm
- By integrating with Prometheus, it enables real-time monitoring of resource usage, helping users optimize performance and resource allocation in GPU-intensive applications
- The exporter serves metrics over HTTP, allowing seamless integration with monitoring systems.cpu_usage.py - Collects and reports CPU utilization metrics for the past week and month, integrating seamlessly with Prometheus for monitoring purposes
- By executing system commands to retrieve utilization data, it generates a formatted output that is saved to a specified Prometheus file
- This functionality enhances the overall architecture by providing essential performance insights, enabling better resource management and optimization within the system.nvidia_gpu_exporter.py - NVIDIA GPU metrics and I/O statistics are gathered and formatted for Prometheus monitoring
- By extracting job IDs from process IDs, collecting GPU utilization and memory usage, and retrieving I/O metrics, the output is structured for compatibility with Prometheus node exporters
- This functionality enhances the observability of GPU resource usage and process performance within a system, facilitating efficient resource management and monitoring.monitoring.py - Monitoring service facilitates the collection and aggregation of GPU, CPU, and storage utilization metrics, storing them in a SQLite database for analysis
- It exposes these metrics via a Prometheus endpoint, enabling real-time monitoring and reporting
- Scheduled tasks ensure continuous data collection and periodic updates, providing insights into resource usage trends over daily, weekly, and monthly intervals.gpu_io_exporter.md - GPU and I/O Exporter serves to gather and expose critical metrics related to GPU performance and I/O operations for monitoring purposes via Prometheus
- By leveraging NVIDIA GPU capabilities, it provides insights into GPU utilization and memory usage, alongside I/O read and write statistics, facilitating efficient resource management and performance optimization within the overall codebase architecture.
Metrics Exporter
⦿ Metrics Exporter
File Name Summary go.mod - Defines the module for the job metrics exporter, establishing dependencies necessary for integrating Prometheus metrics collection within the application
- By leveraging the Prometheus client library and other indirect dependencies, it facilitates the monitoring and exporting of job-related metrics, thereby enhancing observability and performance tracking across the entire codebase architecture.README.md - Collects and exports GPU and I/O metrics from systems utilizing NVIDIA-SMI commands, facilitating integration with Prometheus for monitoring
- The project comprises both a Golang and a Python script, allowing users to choose their preferred language for metrics collection
- By providing a straightforward setup and configuration process, it enables efficient performance tracking and resource management in environments leveraging NVIDIA hardware.Makefile - Facilitates the management of the Metrics Exporter project by providing essential commands for building and cleaning the codebase
- It offers a user-friendly help command that lists available tasks, enhancing usability for developers
- This structure supports efficient development workflows, ensuring that the project remains organized and maintainable while streamlining the build process.gpu_metrics.py - Collects and exports GPU metrics for monitoring purposes within a system utilizing NVIDIA GPUs
- It retrieves GPU utilization and memory usage data from running applications, associates this information with job IDs, and formats it for Prometheus consumption
- This functionality enhances observability and performance tracking in environments leveraging GPU resources, contributing to efficient resource management and workload optimization.job_metrics_exporter.go - Metrics Exporter facilitates the collection and exposure of GPU and I/O metrics for jobs managed by the Slurm workload manager
- By integrating with Prometheus, it monitors GPU utilization, memory usage, and I/O statistics, providing real-time insights into resource allocation and performance
- This enables efficient tracking and management of computational resources across jobs, enhancing overall system observability and performance optimization.go.sum - Facilitating dependency management, the go.sum file ensures the integrity and consistency of module versions used within the Metrics Exporter project
- By maintaining checksums for each dependency, it supports the overall architecture by enabling reliable builds and preventing issues related to version mismatches, thereby enhancing the stability and maintainability of the codebase.job_metrics_exporter.service - Facilitates the operation of the Job Metrics Service, ensuring it starts after the network is available and runs continuously in a multi-user environment
- This service plays a crucial role in the overall architecture by collecting and exporting job-related metrics, thereby enhancing monitoring and performance analysis across the system
- Its integration supports efficient resource management and operational insights.
Poc_exporters is protected under the LICENSE License. For more details, refer to the LICENSE file.