question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Ambigous/incomplete API response

See original GitHub issue

Contact Details

GitHub/Slack: Willmish

What happened?

The API has a non standardised output for carbon intensity units, since WattTime uses lbs CO2 per MWh, while other providers such as ElectricityMap use grams CO2 per kWh. The response should either provide the units for the reading as well or automatically convert it to a single standard unit (preferred) - ideally using a combination of SI units (grams CO2 per kWh).

Other issue with the output is that the response only contains the WattTime (or other carbon intensity provider) region index, so when querying multiple locations (on the GET /emissions/bylocations or GET /emissions/bylocations/best) it requires additional work to identify which data centre region corresponds to which WattTime region. Instead, the API should provide both the WattTime region and the matching data centre region name in the response.

  • The API response needs a standardised carbon intensity units
  • Double check the unit is actually converted to g CO2 / kWh (cross-reference with electrictyMaps)
  • Add documentation to the WattTime units conversion! (Document the standard)

TO DISCUSS:

  • The API response needs to provide both WattTime region name and data centre region name that maps to it

client

WebAPI (Default)

Relevant log output

No response

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vaughanknightcommented, Aug 9, 2022

Just a note that the WattTime plugin does the conversion already, but we should state it’s in grams per kWh in all the documentation

0reactions
vaughanknightcommented, Sep 5, 2022

Closing as “The API response needs to provide both WattTime region name and data centre region name that maps to it” is an ongoing discussion on how to handle but not needed for this bug/issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Request Method Returning Incomplete Response (Attempts)
Also, the engineering team has a chore task of propagating the error properly. Hope this sheds some light on this ambiguity. cc: @Raviraj...
Read more >
Common API mistakes and how to avoid them
Create a secret endpoint in your application which throws an error. Try to upload a file which is too large, send a payload...
Read more >
googleapis geocode return only one record for incomplete ...
Places Autocomplete API is a web service that returns place predictions in response to an HTTP request, means it may return more than...
Read more >
Param error is incomplete and too ambiguous · Issue #333
The Parameterized instance has instance parameters created using new-style param APIs, which are incompatible with .params.
Read more >
Geocoding Addresses Best Practices
Use cases and API recommendations · Respond, in real time, to user input (includes ambiguous, incomplete, poorly formatted, or misspelled addresses entered by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found