Skip to content

Commit

Permalink
Graphite scaler should use latest datapoint, not earliest, returned.
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon Pinske <brandon.pinske@crowdstrike.com>
  • Loading branch information
Brandon Pinske committed Nov 29, 2021
1 parent 5c2682e commit ca8a90b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/scalers/graphite_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ func (s *graphiteScaler) ExecuteGrapQuery(ctx context.Context) (float64, error)
}

// https://graphite-api.readthedocs.io/en/latest/api.html#json
datapoint := result[0].Datapoints[0][0]
latestDatapoint := len(result[0].Datapoints) - 1
datapoint := result[0].Datapoints[latestDatapoint][0]

return datapoint, nil
}
Expand Down

0 comments on commit ca8a90b

Please sign in to comment.