Skip to content

An API wrapper and Prometheus exporter for monitoring the UK carbon intensity API: https://carbonintensity.org.uk/

License

Notifications You must be signed in to change notification settings

bbc/carbon-intensity-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus Carbon Intensity Exporter

An API wrapper and Prometheus exporter for monitoring the GB carbon intensity API: https://carbonintensity.org.uk/

Setup

pip install -e .

pip install -r requirements.txt

Carbon Intensity Exporter

To run the Prometheus exporter server and expose the /metrics endpoint, run:

python3 -m carbon_intensity_exporter

curl localhost:8000/metrics

Metrics

Name Sample Labels Sample Value Description
up 1 or 0 (bool) Boolean set to true if metrics successfully scraped from carbon intensity API
carbon_intensity geohash="gcmm",location="N_WALES" 203.0 gCO2/kWh(float) Carbon intensity of location in gCO2/kWh
carbon_fuel_mix fuel_type="biomass",geohash="gcpv",location="LONDON" 61.3 %(float) Fuel mix percentage of location
carbon_intensity_forecast geohash="gcpv",location="LONDON",time="+00:30" 203.0 gCO2/kWh(float) Forecast of carbon intensity of location in 30min intervals

Testing

To run tests against the Exporter, run:

python3 -m pytest

About

An API wrapper and Prometheus exporter for monitoring the UK carbon intensity API: https://carbonintensity.org.uk/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages