|
| 1 | +# Methodology |
| 2 | + |
| 3 | +Spruce uses third-party resources and models to estimate the environmental impact of cloud services. It enriches cost usage reports (CUR) with additional columns, allowing users to do GreenOps and build dashboards and reports. |
| 4 | + |
| 5 | +Unlike the information provided by CSPs (Cloud Service Providers), Spruce gives total transparency on how the estimates are built. |
| 6 | + |
| 7 | +The overall approach is as follows: |
| 8 | +1. Estimate the energy used per activity (e.g for X GB of data transferred, usage of an EC2 instance, storage etc...) |
| 9 | +2. Add overheads (e.g. PUE, WUE) |
| 10 | +3. Apply accurate carbon intensity factors - ideally for a specific location at a specific time |
| 11 | +4. Where possible, estimate the embodied carbon related to the activity |
| 12 | + |
| 13 | +This is compliant with the [SCI specification](https://sci.greensoftware.foundation/) from the GreenSoftware Foundation. |
| 14 | + |
| 15 | +## Enrichment modules |
| 16 | + |
| 17 | +Spruce generates the estimates above by chaining **EnrichmentModules**, each of them relying on columns found in the usage reports or produced by preceding modules. |
| 18 | + |
| 19 | +For instance, the [AverageCarbonIntensity.java](https://github.com/DigitalPebble/spruce/blob/main/src/main/java/com/digitalpebble/spruce/modules/electricitymaps/AverageCarbonIntensity.java) module applies average carbon intensity factors to energy estimates based on the region in order to generate _operational emissions_. |
| 20 | + |
| 21 | +The list of columns generated by the modules can be found in the [SpruceColumn](https://github.com/DigitalPebble/spruce/blob/main/src/main/java/com/digitalpebble/spruce/SpruceColumn.java) class. |
| 22 | + |
| 23 | +The enrichment modules are listed and configured in a configuration file. If no configuration is specified, the [default one](https://github.com/DigitalPebble/spruce/blob/main/src/main/resources/default-config.json) is used. |
| 24 | + |
| 25 | + |
| 26 | +### ccf.Storage |
| 27 | + |
| 28 | +Provides an estimate of energy used for storage by applying a flat coefficient per Gb, following the approach used by the [Cloud Carbon Footprint](https://www.cloudcarbonfootprint.org/) project. |
| 29 | +See [methodology](https://www.cloudcarbonfootprint.org/docs/methodology#storage) for more details. |
| 30 | + |
| 31 | +Populates the column `energy_usage_kwh`. |
| 32 | + |
| 33 | +### ccf.Networking |
| 34 | + |
| 35 | +Provides an estimate of energy used for networking in and out of data centres. Applies a flat coefficient per Gb, following the approach used by the [Cloud Carbon Footprint](https://www.cloudcarbonfootprint.org/) project. |
| 36 | +See [methodology](https://www.cloudcarbonfootprint.org/docs/methodology#storage) for more details. |
| 37 | + |
| 38 | +Populates the column `energy_usage_kwh`. |
| 39 | + |
| 40 | +### boavizta.BoaviztAPI |
| 41 | + |
| 42 | +Provides an estimate of [final energy](https://www.eea.europa.eu/en/analysis/indicators/primary-and-final-energy-consumption) used for computation (EC2, OpenSearch, RDS) as well as the related embodied emissions using the [BoaviztAPI](https://doc.api.boavizta.org/). |
| 43 | + |
| 44 | +Populates the column `energy_usage_kwh` and `embodied_emissions_co2eq_g`. |
| 45 | + |
| 46 | +### boavizta.BoaviztAPIstatic |
| 47 | + |
| 48 | +Similar to the previous module but does not get the information from an instance of the BoaviztAPI but from a static file generated from it. This makes it simpler to use Spruce. |
| 49 | + |
| 50 | +### ccf.PUE |
| 51 | + |
| 52 | +Applies a fixed ratio for [Power Usage_Effectiveness](https://en.wikipedia.org/wiki/Power_usage_effectiveness) to row for which energy usage has been estimated, following the approach used by the [Cloud Carbon Footprint](https://www.cloudcarbonfootprint.org/) project. |
| 53 | +See [CCF methodology](https://www.cloudcarbonfootprint.org/docs/methodology/#pue) for more details. |
| 54 | + |
| 55 | +Populates the column `power_usage_effectiveness`. |
| 56 | + |
| 57 | +### electricitymaps.AverageCarbonIntensity |
| 58 | + |
| 59 | +Adds average carbon intensity factors generated from [ElectricityMaps](https://www.electricitymaps.com/)' 2024 datasets. |
| 60 | +The [life-cycle](https://portal.electricitymaps.com/developer-hub/api/getting-started#emission-factors) emission factors are used. |
| 61 | + |
| 62 | +Populates the columns `carbon_intensity`. |
| 63 | + |
| 64 | +### OperationalEmissions |
| 65 | + |
| 66 | +Computes operational emissions based on the energy usage, average carbon intensity factors and `power_usage_effectiveness` estimated by the preceding modules. |
| 67 | + |
| 68 | +Populates the columns `operational_emissions_co2eq_g`. |
| 69 | + |
| 70 | +`operational_emissions_co2eq_g` is equal to `energy_usage_kwh` * `carbon_intensity` * 'power_usage_effectiveness'. |
0 commit comments