MCPcopy
hub / github.com/grafana/tempo / adjustLimit

Function adjustLimit

modules/frontend/search_handlers.go:165–175  ·  view source on GitHub ↗

adjusts the limit based on provided config

(limit, defaultLimit, maxLimit uint32)

Source from the content-addressed store, hash-verified

163
164// adjusts the limit based on provided config
165func adjustLimit(limit, defaultLimit, maxLimit uint32) (uint32, error) {
166 if limit == 0 {
167 return defaultLimit, nil
168 }
169
170 if maxLimit != 0 && limit > maxLimit {
171 return 0, fmt.Errorf("limit %d exceeds max limit %d", limit, maxLimit)
172 }
173
174 return limit, nil
175}
176
177func logResult(ctx context.Context, logger log.Logger, tenantID string, durationSeconds float64, req *tempopb.SearchRequest, resp *tempopb.SearchResponse, httpResp *http.Response, err error) {
178 traceID, _ := tracing.ExtractTraceID(ctx)

Callers 3

TestAdjustLimitFunction · 0.85
newCombinerFunction · 0.85
RoundTripMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestAdjustLimitFunction · 0.68