Python GCP Compute Monitoring
Budget: $14 – $30 NZD
I need a fast-turnaround Python script that connects to Google Cloud Platform’s Compute Engine and continuously gathers key performance metrics—CPU, memory, disk, and network—across multiple instances. The goal is to surface near-real-time insights that can be fed into dashboards or alerts so I can react quickly when workloads spike.
The solution should authenticate through a service account, call the Cloud Monitoring API (formerly Stackdriver) or the Compute Engine API where relevant, and output data in a JSON structure that’s easy to forward to Pub/Sub or store in BigQuery later. Lightweight dependency on google-cloud-monitoring / google-api-python-client is fine; please keep the setup straightforward via requirements.txt.
Deliverables
• Clean, well-documented Python 3.x script (or module) that runs from the command line
• README covering setup, service-account configuration, and example execution
• Sample output file showing collected metrics for at least one instance
• Brief note on how to extend the script to add custom metrics in the future
Acceptance Criteria
The script must authenticate successfully with a provided service account, list active Compute Engine instances in a given project, pull the latest five minutes of CPU, memory, disk read/write, and network in/out metrics, then print or write them to JSON without errors. A short screen recording or log snippet demonstrating this end-to-end flow will confirm completion.
The solution should authenticate through a service account, call the Cloud Monitoring API (formerly Stackdriver) or the Compute Engine API where relevant, and output data in a JSON structure that’s easy to forward to Pub/Sub or store in BigQuery later. Lightweight dependency on google-cloud-monitoring / google-api-python-client is fine; please keep the setup straightforward via requirements.txt.
Deliverables
• Clean, well-documented Python 3.x script (or module) that runs from the command line
• README covering setup, service-account configuration, and example execution
• Sample output file showing collected metrics for at least one instance
• Brief note on how to extend the script to add custom metrics in the future
Acceptance Criteria
The script must authenticate successfully with a provided service account, list active Compute Engine instances in a given project, pull the latest five minutes of CPU, memory, disk read/write, and network in/out metrics, then print or write them to JSON without errors. A short screen recording or log snippet demonstrating this end-to-end flow will confirm completion.