Closed aybanda closed 1 month ago
Nice, but this isn't what this project is when for, exactly. Maybe a part of it. So good start.
This is for tracking KPIs across all of my business ideas / apps deployed across GCP, so cloud level metrics.
CPU and memory are a bit too low level.
This project begins once some form of cloud architecture is established.
Forgot to add that to the doc so my bad.
@bellanov
Hey, thank you for specifying. I have updated the code, see if it aligns with your projects need.
Will revisit once infrastructure is deployed. First there will be storage resources, then networking ones, etc. The goal is to actually monitor reality, not just create stubs of reporting scripts and such.
Looking forward to it, I know I was just starting with basic outline or template. Once infrastructure got built it will be more robust.
@bellanov
Summary
This PR introduces monitor_kpis.py, a script that monitors key performance indicators (KPIs) for Google Cloud resources using the Google Cloud Monitoring API.
Features
Fetches metrics for CPU, memory, and disk I/O. Handles errors for missing project ID and invalid metric keys. Logs the number of data points retrieved.
Usage
Set the GCP_PROJECT_ID environment variable and run the script to monitor KPIs:
python monitor_kpis.py
Notes
Future enhancements could include additional metrics and dynamic input options.
Please review and merge!