Are there any data schemas for the campaign data e...
# help
r
Are there any data schemas for the campaign data export? https://www.infracost.io/docs/infracost_cloud/data_export/ I can see the instructions on how to export data, but what is the structure / schema of the exported data? Sample data would also be fine
a
Hi Erik! We'll get you the CSV headers and explanations for you shortly. Apologies that's not already in the docs!
❤️ 1
w
Hey @rapid-apple-64792! Good to see you here 🙂 What’s your use-case? Here’s the CSV headers. The file
infracost_branch_policy_summary_v1_YYYYMMDD.csv
contains: CSV file headings:
Copy code
date,
infracost_org_id,
infracost_org_name,
infracost_org_url,
repo_url,
repo_name,
comment_enabled,
branch,
policy_slug,
policy_name,
policy_category,
active,
include_in_pr_comments,
block_pr,
pr_trigger_condition,
issues,
applicable_resources
• policy_category: can be one of “compute_and_databases”, “block_storage”, “object_storage”, “logging”, “tagging” • active, include_in_pr_comments, block_pr: can be “true” or “false” • pr_trigger_condition: can be one of “new_resources” or “new_and_existing_resources”. This is configured in Infracost Cloud > FinOps policies so the policy only triggers in PRs when new resources are added, or when existing resources are changed too. • policy_slug: a static string that represents the FinOps or tagging policy. This will not change if the policy name changes. For tagging policies, this will be the policy ID. The file
infracost_merged_prs_summary_YYYYMM.csv
contains: CSV file headings:
Copy code
month,
infracost_org_id,
infracost_org_name,
infracost_org_url,
repo_url,
repo_name,
branch,
merged_pull_requests,
yearly_cost_reduction,
yearly_cost_prevention_pr_comments,
yearly_cost_prevention_guardrails,
currency,
issues_prevented,
new_issues_added,
pre_existing_issues_fixed
• merged_pull_requests: the number of pull requests that were merged in the month. • yearly_cost_reduction: costs reduced due to infrastructure changes (for example, an engineer reduced the instance size). To get the monthly cost reduction, you can divide this number by 12. • yearly_cost_prevention_pr_comments: costs prevented due to changes made by engineers after seeing cost estimates and FinOps policies in pull requests. To get the monthly cost prevention, you can divide this number by 12. • yearly_cost_prevention_guardrails: costs prevented due to changes made by engineers following guardrails being triggered. To get the monthly cost prevention, you can divide this number by 12. The total cost prevention number for a repo = yearly_cost_prevention_pr_comments + yearly_cost_prevention_guardrails.
👀 1
r
Thanks for the quick reply! 🙂