Skip to content

Commit

Permalink
improve agent shards calculation (#1373)
Browse files Browse the repository at this point in the history
Co-authored-by: Herve Nicol <[email protected]>
  • Loading branch information
hervenicol and hervenicol authored Sep 20, 2023
1 parent 0313bca commit 9ad013e
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.

### Fixed

- Support absolute Grafana dashboard URLs.
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 9ad013e

Please sign in to comment.