Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sth/expand cloud cost properties #2861

Merged

Conversation

Sean-Holcomb
Copy link
Contributor

@Sean-Holcomb Sean-Holcomb commented Aug 5, 2024

What does this PR change?

This PR adds 4 new properties to the Cloud Cost type that can be aggregated or filtered on. These new fields line up with FOCUS Spec fields bringing Cloud Costs closer to the spec The fields are:

To go along with these new properties, each billing integration implementation has been updated to ingest values for them if available. When values are not available for BillingEntityName or AccountName the value from BillingEntityID and AccountID are used respectively. If there is no RegionID or AvailabilityZone value then the properties are left blank.

This Pr also contains fixes for the S3Select integration for AWS.

Does this PR relate to any other PRs?

How will this PR impact users?

Does this PR address any GitHub or Zendesk issues?

  • Closes ...

How was this PR tested?

  • This PR was tested by ingesting CloudCost data from each provider and checking that new fields were populated as they should be. Additional testing was done to ensure that old bingen files were still valid.
  • Unit Tests pending

Does this PR require changes to documentation?

  • This PR requires updates to CloudCost documentation.

Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
@Sean-Holcomb Sean-Holcomb force-pushed the sth/expand-cloud-cost-properties branch from 19b844f to e686b32 Compare August 5, 2024 21:42
Copy link
Contributor

@avrodrigues5 avrodrigues5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need an OC maintainer to approve but this looks good to me apart from maybe a missed string alias.

FieldAccountID CloudCostField = CloudCostField(fieldstrings.FieldAccountID)
FieldAccountName CloudCostField = CloudCostField(fieldstrings.FieldAccountName)
FieldRegionID CloudCostField = CloudCostField(fieldstrings.FieldRegionID)
FieldAvailabilityZone = CloudCostField(fieldstrings.FieldAvailabilityZone)
Copy link
Contributor

@avrodrigues5 avrodrigues5 Aug 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason why FieldAvailabilityZone doesnt have string alias

InvoiceEntityName string `json:"invoiceEntityName,omitempty"` // @bingen:field[version=3]
RegionID string `json:"regionID,omitempty"` // @bingen:field[version=3]
AvailabilityZone string `json:"availabilityZone,omitempty"` // @bingen:field[version=3]
Service string `json:"service,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad you're putting this into practice. I think for years, I've been preaching "add new fields to the end" but realized recently that this wasn't a requirement after the backwards compatibility updates.

Although, once this ordering is established, you can't rearrange afterwards. That's the only remaining nuance.

Copy link
Contributor

@mbolt35 mbolt35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
@Sean-Holcomb Sean-Holcomb merged commit 2078ccf into opencost:develop Aug 6, 2024
3 checks passed
@Sean-Holcomb Sean-Holcomb deleted the sth/expand-cloud-cost-properties branch August 6, 2024 23:25
qixiangyang pushed a commit to qixiangyang/opencost that referenced this pull request Aug 13, 2024
* Update Cloud Cost with new properteis

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>

* Final changes and test

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>

---------

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants