Open tianbiao opened 2 months ago
Great - this would definitely be a useful plugin! Have you looked into what usage metrics are available from GCP APIs?
Agreed very excited about this plugin!
One thing I might suggest in terms of approach is to have the plugin return data as a flat set of observations and then allow users to use the group-by plugin to group the data how they want, see this as an example: https://github.com/Green-Software-Foundation/if/blob/main/examples/manifests/group-by.yml
Also load any credentials via environment variables rather than embedded in the manifest file ;) see here for an example https://github.com/Green-Software-Foundation/if-unofficial-plugins/blob/8ddefffd4af0fc89f5763e31d46a887aeda314a6/src/lib/watt-time/watt-time-api.ts#L30C1-L33C11
Great - this would definitely be a useful plugin! Have you looked into what usage metrics are available from GCP APIs?
Hi @jmcook1186 there are a lot of usage metrics are available, I am going to start with Google compute engine usage metrics https://cloud.google.com/monitoring/api/metrics_gcp#gcp-compute
Prize category
Best Plugin
Overview
Story
As a user of a Google Cloud Platform, I want to be able to retrieve usage metrics for my application. Right now, IF only enables me to do this for Azure VMs.
Rationale
We have implemented an Azure importer in IF, but no such model exists for Google Cloud Platform. This will address the current limitation of IF having a Azure-only importer and enable GCP users to retrieve observations of GCP resources via Google Monitor (or similar APIs) and pipeline that utilisation data into other IF models. As suggested here (https://github.com/Green-Software-Foundation/hack/discussions/30)
Scope
This should be a model plugin that conforms to the IF model plugin interface.
Implementation guidelines
This model MUST conform to the IF model plugin interface The model MUST return metadata about the application and usage data (e.g. CPU-util, RAM-used, etc) similar to the azure importer The model must return data in the expected units (kWh, seconds, GB...) The model must accept duration in units of seconds an input. The model SHOULD be written in Typescript The model MUST have unit tests that demonstrate correct execution The model MUST have documentation in the form of a README that explains how to use.
Questions to be answered
No
Have you got a project team yet?
I am working on this project alone
Project team
No response
Terms of Participation
Project Submission
Summary
As a user of Google Cloud Platform, I want to be able to retrieve usage metrics for my application. GCP importer Plugin enables GCP users to retrieve observations of GCP resources via Google Monitor APIs and automatically populate your manifest with usage metrics that can then be passed along a plugin pipeline to calculate energy and carbon impacts.
Problems
To enable GCP users to retrieve observations of GCP resources, below problems has been addressed
Application
GcpImporter
to retrieve CPU utilization and memory data from GCP, the method is aexecute
type.timestamp
andduration
as the input.timestamp
is the start time of usage data andduration
is the seconds that the usage data covers.ConfigValidationError
error will be raised if validation not passedPrize category
Best Plugin
Judging criteria
Overall Impact
GCP is the world's Top3 cloud provide, the GCP importer plugin can enable GCP uses to use the Impact Framework
Opportunity
The GCP importer is easy to use for systems hosted in Google Compute engine VMs. And the GCP importer plugin is easy to be extended to support more GCP services such as App engine, Cloud Run
Modular
The plugin is built based on the arch of Azure importer, and it works well with other plugins such as CCF
Video
https://youtu.be/q4mPejLqj-A
Artefacts
https://github.com/tianbiao/if-unofficial-plugins/tree/gcp-importer
Usage
https://github.com/tianbiao/if-unofficial-plugins/blob/gcp-importer/src/lib/gcp-importer/README.md
Process
Inspiration
Challenges
Accomplishments
The GCP importer plugin can response enough details of the usage data for Carbon calculations.
Learnings
What's next?