Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exporter subcommand #34

Merged
merged 3 commits into from
Jul 13, 2022
Merged

Add exporter subcommand #34

merged 3 commits into from
Jul 13, 2022

Conversation

rossf7
Copy link
Contributor

@rossf7 rossf7 commented Jul 13, 2022

Towards #25

This moves the exporter code from grid-intensity-exporter and adds the WattTime provider.

Also the grid_intensity_carbon_actual metric is renamed to grid_intensity_carbon_average and the units are added.

go run . exporter -r ES
Using provider "ember-climate.org" with region "ES"
Metrics available at :8000/metrics

curl -s http://localhost:8000/metrics | grep grid
# HELP grid_intensity_carbon_average Average carbon intensity for the electricity grid in this region.
# TYPE grid_intensity_carbon_average gauge
grid_intensity_carbon_average{provider="ember-climate.org",region="ES",units="gCO2 per kWh"} 193.737

For the WattTime provider both the marginal and relative metrics are output if they are present.

go run . exporter -p watttime.org -r CAISO_NORTH
Using provider "watttime.org" with region "CAISO_NORTH"
Metrics available at :8000/metrics

curl -s http://localhost:8000/metrics | grep grid
# HELP grid_intensity_carbon_marginal Marginal carbon intensity for the electricity grid in this region.
# TYPE grid_intensity_carbon_marginal gauge
grid_intensity_carbon_marginal{provider="watttime.org",region="CAISO_NORTH",units="lb CO2 per MWh"} 911
# HELP grid_intensity_carbon_relative Relative carbon intensity for the electricity grid in this region.
# TYPE grid_intensity_carbon_relative gauge
grid_intensity_carbon_relative{provider="watttime.org",region="CAISO_NORTH",units="percent"} 71

Otherwise just the relative intensity is output.

go run . exporter -p watttime.org -r ES
Using provider "watttime.org" with region "ES"
Metrics available at :8000/metrics

curl -s http://localhost:8000/metrics | grep grid
# HELP grid_intensity_carbon_relative Relative carbon intensity for the electricity grid in this region.
# TYPE grid_intensity_carbon_relative gauge
grid_intensity_carbon_relative{provider="watttime.org",region="ES",units="percent"} 20

@rossf7 rossf7 marked this pull request as ready for review July 13, 2022 11:06
@rossf7 rossf7 requested a review from mrchrisadams July 13, 2022 11:07
@rossf7
Copy link
Contributor Author

rossf7 commented Jul 13, 2022

@mrchrisadams This is ready for review.

This is already pretty big so the next PR will move the docker, k8s and nomad code along with their integration tests.

@mrchrisadams
Copy link
Member

I'm really happy with this PR Ross, thanks! Please merge in at your convenience 👍

@rossf7 rossf7 merged commit f4f1078 into main Jul 13, 2022
@rossf7 rossf7 deleted the exporter branch July 13, 2022 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants