Skip to content

Commit

Permalink
logging sharding stats
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Protasio <approtas@amazon.com>
  • Loading branch information
alanprot committed Dec 13, 2022
1 parent 8cf2583 commit 712b0c2
Show file tree
Hide file tree
Showing 12 changed files with 425 additions and 146 deletions.
6 changes: 3 additions & 3 deletions pkg/frontend/transport/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func NewHandler(cfg HandlerConfig, roundTripper http.RoundTripper, log log.Logge

func (f *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
var (
stats *querier_stats.Stats
stats *querier_stats.QueryStats
queryString url.Values
)

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

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

func writeServiceTimingHeader(queryResponseTime time.Duration, headers http.Header, stats *querier_stats.Stats) {
func writeServiceTimingHeader(queryResponseTime time.Duration, headers http.Header, stats *querier_stats.QueryStats) {
if stats != nil {
parts := make([]string, 0)
parts = append(parts, statsValue("querier_wall_time", stats.LoadWallTime()))
Expand Down
102 changes: 50 additions & 52 deletions pkg/frontend/v1/frontendv1pb/frontend.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/frontend/v1/frontendv1pb/frontend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ message FrontendToClient {
message ClientToFrontend {
httpgrpc.HTTPResponse httpResponse = 1;
string clientID = 2;
stats.Stats stats = 3;
stats.Stats stats = 3[(gogoproto.customtype) = "github.com/cortexproject/cortex/pkg/querier/stats.QueryStats"];
}

message NotifyClientShutdownRequest {
Expand Down
83 changes: 40 additions & 43 deletions pkg/frontend/v2/frontendv2pb/frontend.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 712b0c2

Please sign in to comment.