https://infracost.io logo
Title
s

stocky-jackal-58258

12/19/2022, 12:17 PM
Hi, not sure whether it is possible but there is any direct way to extrct the cost (in terms of delta) data point after each pull request? It might be potentially also through some API of the backend. I just want to be able to save the delta in a DB for plotting also in my own graph some stats. I did not find any direct way to do that (besides starting to consider to parse the text. thank you!
l

little-author-61621

12/19/2022, 12:20 PM
Hi @stocky-jackal-58258 how have you set up Infracost and which VCS provider are you using?
s

stocky-jackal-58258

12/19/2022, 12:20 PM
Hi, is integrated with GitHub through github actions
I don't need all the action to happen in github through.
I could even think to batch the API layer once a day to get out the data points (eventually)
l

little-author-61621

12/19/2022, 12:22 PM
The
infracost.json
file that is passed into
infracost comment
might have what you need
s

stocky-jackal-58258

12/19/2022, 12:26 PM
so, are you suggesting to access /tmp/infracost-base.json (following your template) and get the "diffTotalMonthlyCost" value
?
/tmp/infracost.json I meant
l

little-author-61621

12/19/2022, 12:27 PM
Yes, that contains all the same data as the comment. Would that help?
s

stocky-jackal-58258

12/19/2022, 12:28 PM
I will give it a go, thanks
l

little-author-61621

12/19/2022, 12:30 PM
Cool, let me know if it works for you. We also have Infracost Cloud which plots the each PR for you automatically on a chart.
w

white-airport-8778

01/12/2023, 4:00 PM
@stocky-jackal-58258 I’m curious if using the Infracost JSON format solved your problem? Did you try the CSV Export from Infracost Cloud dashboard (you can goto Org Setting and start a trial, to use the Github App as that’s what makes it super-quick to use the Infracost Cloud features.)
s

stocky-jackal-58258

01/13/2023, 4:12 PM
Ciao Ali, I will give the GitHub App a go
I will let you know how it goes
the CSV would make it. Is there any way to automate the retrieve of that CSV?
or it is only available through the dashboard?
w

white-airport-8778

01/13/2023, 4:50 PM
Right now it’s only available via the dashboard, happy to chat about an API though
s

stocky-jackal-58258

01/13/2023, 7:47 PM
Ideally, I need to retrieve previous_monthly_cost and new_monthly_cost or..at the very least new_monthly_cost. Is there any way I can intercept that after a pull merge? it could be through anything I can intercept as event and I can trigger a business logic...My use case is to write those into a CSV file that becomes part of the repository. Any suggestion?
w

white-airport-8778

01/13/2023, 7:54 PM
@stocky-jackal-58258 I’ll DM you!