Skip to content

Commit

Permalink
Add timestamp to the grouping key
Browse files Browse the repository at this point in the history
The dimensionsKey contains all dimension fields value we want to use
to group the time series.

We need to add the timestamp to the key, so we only group together time
series with the same timestamp.
  • Loading branch information
zmoog committed Sep 27, 2023
1 parent 8a328c3 commit c405ba5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x-pack/metricbeat/module/gcp/metrics/timeseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func createDimensionsKey(kv KeyValuePoint) string {
provider := getKeyValue(kv.ECS, "cloud.provider")
region := getKeyValue(kv.ECS, "cloud.region")

dimensionsKey := fmt.Sprintf("%s_%s_%s_%s_%s_%s",
dimensionsKey := fmt.Sprintf("%d_%s_%s_%s_%s_%s_%s",
kv.Timestamp.UnixNano(),
accountID,
az,
instanceID,
Expand Down

0 comments on commit c405ba5

Please sign in to comment.