Skip to content

Commit

Permalink
improve agent shards calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
hervenicol committed Sep 19, 2023
1 parent 75f55c2 commit 7b60aae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- computation of number of shards: rely on max number of series over the last 6h.

## [4.48.0] - 2023-09-19

### Changed
Expand Down
2 changes: 1 addition & 1 deletion pkg/prometheusquerier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func QueryTSDBHeadSeries(cluster string) (float64, error) {
api := v1.NewAPI(c)

ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
val, _, err := api.Query(ctx, "prometheus_tsdb_head_series", time.Now()) // Ignoring warnings for now.
val, _, err := api.Query(ctx, "max_over_time(prometheus_tsdb_head_series[6h])", time.Now()) // Ignoring warnings for now.
cancel()
if err != nil {
return 0, err
Expand Down

0 comments on commit 7b60aae

Please sign in to comment.