Skip to content

Commit

Permalink
add sku and service ids in hash
Browse files Browse the repository at this point in the history
  • Loading branch information
gpop63 committed Oct 23, 2023
1 parent 8ae9e9f commit a0f7d14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/metricbeat/module/gcp/billing/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func getCurrentDate() string {
func generateEventID(currentDate string, row row) string {
// create eventID using hash of current_date + invoice.month + project.id + project.name
// This will prevent more than one billing metric getting collected in the same day.
eventID := currentDate + row.InvoiceMonth + row.ProjectId + row.ProjectName
eventID := currentDate + row.InvoiceMonth + row.ProjectId + row.ProjectName + row.SkuId + row.ServiceId
h := sha256.New()
h.Write([]byte(eventID))
prefix := hex.EncodeToString(h.Sum(nil))
Expand Down

0 comments on commit a0f7d14

Please sign in to comment.