Hi, not sure whether it is possible but there is a...
# help
s
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
Hi @stocky-jackal-58258 how have you set up Infracost and which VCS provider are you using?
s
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
The
infracost.json
file that is passed into
infracost comment
might have what you need
s
so, are you suggesting to access /tmp/infracost-base.json (following your template) and get the "diffTotalMonthlyCost" value
?
Copy code
/tmp/infracost.json I meant
l
Yes, that contains all the same data as the comment. Would that help?
s
I will give it a go, thanks
l
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
@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
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
Right now it’s only available via the dashboard, happy to chat about an API though
s
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
@stocky-jackal-58258 I’ll DM you!