Skip to content

Commit 712b0c2

Browse files
committed
logging sharding stats
Signed-off-by: Alan Protasio <approtas@amazon.com>
1 parent 8cf2583 commit 712b0c2

File tree

12 files changed

+425
-146
lines changed

12 files changed

+425
-146
lines changed

pkg/frontend/transport/handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func NewHandler(cfg HandlerConfig, roundTripper http.RoundTripper, log log.Logge
112112

113113
func (f *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
114114
var (
115-
stats *querier_stats.Stats
115+
stats *querier_stats.QueryStats
116116
queryString url.Values
117117
)
118118

@@ -185,7 +185,7 @@ func (f *Handler) reportSlowQuery(r *http.Request, queryString url.Values, query
185185
level.Info(util_log.WithContext(r.Context(), f.log)).Log(logMessage...)
186186
}
187187

188-
func (f *Handler) reportQueryStats(r *http.Request, queryString url.Values, queryResponseTime time.Duration, stats *querier_stats.Stats, error error) {
188+
func (f *Handler) reportQueryStats(r *http.Request, queryString url.Values, queryResponseTime time.Duration, stats *querier_stats.QueryStats, error error) {
189189
tenantIDs, err := tenant.TenantIDs(r.Context())
190190
if err != nil {
191191
return
@@ -264,7 +264,7 @@ func writeError(w http.ResponseWriter, err error) {
264264
server.WriteError(w, err)
265265
}
266266

267-
func writeServiceTimingHeader(queryResponseTime time.Duration, headers http.Header, stats *querier_stats.Stats) {
267+
func writeServiceTimingHeader(queryResponseTime time.Duration, headers http.Header, stats *querier_stats.QueryStats) {
268268
if stats != nil {
269269
parts := make([]string, 0)
270270
parts = append(parts, statsValue("querier_wall_time", stats.LoadWallTime()))

pkg/frontend/v1/frontendv1pb/frontend.pb.go

Lines changed: 50 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/frontend/v1/frontendv1pb/frontend.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ message FrontendToClient {
3939
message ClientToFrontend {
4040
httpgrpc.HTTPResponse httpResponse = 1;
4141
string clientID = 2;
42-
stats.Stats stats = 3;
42+
stats.Stats stats = 3[(gogoproto.customtype) = "github.com/cortexproject/cortex/pkg/querier/stats.QueryStats"];
4343
}
4444

4545
message NotifyClientShutdownRequest {

pkg/frontend/v2/frontendv2pb/frontend.pb.go

Lines changed: 40 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)