-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query Frontend: Expose samples_processed in Server-Timing header (#10103
) * Query Frontend: Expose total_samples in Server-Timing header * Update Changelog * Update integration test * Refactor total_samples to samples_processed * Added stats testing * Reviewed stats_renderer testing * Reset model.NameValidationScheme to model.LegacyValidation as this was affecting other tests and Mimir doesn't support Prometheus' UTF-8 metric/label name scheme yet. * Reorganize imports * Remove unnecessary comment
- Loading branch information
1 parent
45cd8ed
commit a53f79d
Showing
12 changed files
with
282 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
package querier | ||
|
||
import ( | ||
"context" | ||
|
||
promql_stats "github.com/prometheus/prometheus/util/stats" | ||
prom_api "github.com/prometheus/prometheus/web/api/v1" | ||
|
||
"github.com/grafana/mimir/pkg/querier/stats" | ||
) | ||
|
||
func StatsRenderer(ctx context.Context, s *promql_stats.Statistics, param string) promql_stats.QueryStats { | ||
mimirStats := stats.FromContext(ctx) | ||
if mimirStats != nil && s != nil { | ||
mimirStats.AddSamplesProcessed(uint64(s.Samples.TotalSamples)) | ||
} | ||
return prom_api.DefaultStatsRenderer(ctx, s, param) | ||
} |
Oops, something went wrong.