48
Show HN: See the carbon impact of your cloud as you code
Hey folks, I’m Hassan, one of the co-founders of Infracost (https://www.infracost.io). Infracost helps engineers see and reduce the cloud cost of each infrastructure change before they merge their code. The way Infracost works is we gather pricing data from Amazon Web Services, Microsoft Azure and Google Cloud. What we call a ‘Pricing Service’, which now holds around 9 million live price points (!!). Then we map these prices to infrastructure code. Once the mapping is done, it enables us to show the cost impact of a code change before it is merged, directly in GitHub, GitLab etc. Kind of like a checkout-screen for cloud infrastructure.
We’ve been building since 2020 (we were part of YC W21 batch), and iterating on the product, building out a team etc. However, back in 2020 one of our users asked if we can also show the carbon impact alongside costs.
It has been itching my brain since then. The biggest challenge has always been the carbon data. The mapping of carbon data to infrastructure is time consuming, but it is possible since we’ve done it with cloud costs. But we need the raw carbon data first. The discussions that have happened in the last few years finally led me to a company called Greenpixie in the UK. A few of our existing customers were using them already, so I immediately connected with the founder, John.
Greenpixie said they have the data (AHA!!) And their data is verified (ISO-14064 & aligned with the Greenhouse Gas Protocol). As soon as I talked to a few of their customers, I asked my team to see if we can actually finally do this, and build it.
My thinking is this: some engineers will care, and some will not (or maybe some will love it and some will hate it!). For those who care, cost and carbon are actually linked; meaning if you reduce the carbon, you usually reduce the cost of the cloud too. It can act as another motivation factor.
And now, it is here, and I’d love your feedback. Try it out by going to https://dashboard.infracost.io/, create an account, set up with the GitHub app or GitLab app, and send a pull request with Terraform changes (you can use our example terraform file). It will then show you the cost impact alongside the carbon impact, and how you can optimize it.
I’d especially love to hear your feedback on if you think carbon is a big driver for engineers within your teams, or if carbon is a big driver for your company (i.e. is there anything top-down about carbon).
AMA - I’ll be monitoring the thread :)
Thanks
You know there's a problem with cloud compute when pricing is so complicated that someone makes a specialized tool to calculate it
I'll go one step further - Ali (my brother and founder), has a PhD in cloud cost modelling! 9 million live prices across AWS, Azure and GCP is pretty insane.
>*Greenpixie said they have the data (AHA!!) And their data is verified (ISO-14064 & aligned with the Greenhouse Gas Protocol)."
What does this say about accuracy, and I guess ultimately the impact of the emissions?
Whenever I have tried to find a meaningful measurement of environmental impact of power use I have gotten into a quagmire of statistics taking past each other, with arbitrary mixing of units and definitions. (Like energy/power/electricity being defined differently but used interchangeably. Similarly water usage being blended regardless of whether it is potable or from an area of scarcity)
The end result has to be what harm is caused, because harmless use of something at any magnitude is still harmless.
How do you figure out what that level is with any degree of accuracy. It's a difficult problem, but it seems that easier answers are not likely to be useful if they are not accurate.
This reminds of me calorie tracking: you cannot perfectly capture the number of calories or macronutrients, but measuring does seem to help people loose weight. There are probably many loop holes where eating large amounts of certain food, with a certain margin of error, can leads to wildly incorrect estimates.
I wonder how much this analogy applies to carbon tracking? Does using a wide variety of foods help make the tracking more accurate because no single bad estimate becomes overrepresented? Can a similar approach be taken via a wide variety of cloud technologies being used?
Yea, I actually saw something similar in the early days of Infracost, when we didn't track that many price points. The % change and the directionality was really helpful for engineers. Then we iterated on the prices, added more coverage etc, and the accuracy increased to a point where people trust the output of Infracost more than the AWS pricing calculator. That was a cool learning moment for me.
>This reminds of me calorie tracking: you cannot perfectly capture the number of calories or macronutrients, but measuring does seem to help people loose weight.
This probably would explain the success of many fad diets if it were the increased awareness of the eating having an effect beyond the decision making about what to eat.
Totally - something I've been thinking a lot about... I got pulled into these diets at one point in my life - I remember doing atkins, then went full vegan for a while, then went only meat lol
The diets were meh. But the cool thing was that I learnt so much about food in general! I honestly didn't know much about food growing up. I feel like I still don't know that much, but I know the basics, and i'm not afraid of digging into some of the details.
Definitely. It's even worse in educational fads - kids thrive when paid special attention to, often despite the methodology-under-test...
There are thousands of ways to calculate carbon that are all valid, that’s why a similar usage amount in AWS and Azure will give you wildly different numbers. We prioritise consistency, coverage, and transparency. If the users understand where the numbers come from, and we are applying the similar data science across all clouds, then you have comparable numbers. We get our numbers audited by 3rd parties regularly to ensure robustness and credibility, but an accurate number for your entire AWS environment isn’t useful if you are just trying to calculate the difference between an AMD instance family, and a Graviton instance family. This is where we focus our methodology and why it works inside of Infracost.
A big focus now is applying this same level of rigorousness to different AI models and their impact. Batching, caching, model size and manufacturer are the choices engineers are making now. We want to ensure that choices being made are cost and carbon efficient.
Curious to know what decision you're making at the moment that's triggered you looking into your own methodology?
While there are thousands of valid ways to do the calculation. Their results, if they are different, denote different consequences.
I take it from what you say here that you specialise in accuracy and consistency of measurement as a service and let the client judge for themselves what meaning to derive from them. It feels like it might be an invitation to Goodhart's law.
I'm in no decision making position myself (that said, had a few face to face conversations with people writing position papers). My interest is primarily in understanding what has the best outcomes and the ability of strategies to affect those outcomes.
To put an absurd case. Imagine adding a gadget to generators to use all of the CO2 as part of a cyanide manufacturing process which is then emitted. It gives you great CO2 emission numbers, but public health outcomes less so.
That's a great question - it is a hard thing to build for sure. We started talking to the CTO office of Google about it, and exactly as you say, it gets into the details. The folks at Greenpixie have been doing a lot of research on this, so when we spoke to a few of their big customers (Like Mastercard), they told us about the process they went through to evaluate the data, and trusted it from their ESG initiatives too.
Let me ask one of the Greenpixie folks to jump in here, maybe they can explain how they do it!
Lerc - they are in the UK, so some of them are offline, but I text their CEO :)
Check this out: https://greenpixie.com/gpx-data Thoughts?
This is of zero use. Sell that to followers of WEF/EU/etc. to busy themselves and feel good.
haha ahh I think it goes in waves in the US, but you got me - I grew up in Scotland, and recently moved to the US full time. So the EU mindset is still here :)
[dead]
does it include the breaths you take during coding? best if you can specify your lung volume and breaths per minute!
hahaha we could also track if you typed too fast! ... actually, this is an actual idea, if you use AI to generate the code ... hmmm; that would then be a fun project vs a cloud cost saving one
This is really exciting! Discussions of our resource impact have come up a lot in my org's informal spaces, it's really exciting to see someone making a concerted effort to raise visibility into how much we spend in money or energy in what seem like benign actions.
I really like the emphasis you place that reducing environmental impact is reducing cost as well. Tying civic mindedness to pragmatism is essential in dollar-hungry spaces.
I appreciate the love. Yea, that was the cool thing during the research - if we reduce from a large to a medium, it both saves money and reduces carbon. Win - Win! Company can save money at the same time as reducing the environmental impact.
[flagged]