Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMaxSeriesHit = "the query hit the max number of series limit (limit: %d series)" ErrMaxChunkBytesHit = "the query hit the aggregated chunks size limit (limit: %d bytes)" ErrMaxChunksPerQueryLimit = "the query hit the max number of chunks limit (limit: %d chunks)" )
Functions ¶
func AddQueryLimiterToContext ¶
func AddQueryLimiterToContext(ctx context.Context, limiter *QueryLimiter) context.Context
Types ¶
type QueryLimiter ¶
type QueryLimiter struct {
// contains filtered or unexported fields
}
func NewQueryLimiter ¶
func NewQueryLimiter(maxSeriesPerQuery, maxChunkBytesPerQuery int, maxChunksPerQuery int) *QueryLimiter
NewQueryLimiter makes a new per-query limiter. Each query limiter is configured using the `maxSeriesPerQuery` limit.
func QueryLimiterFromContextWithFallback ¶
func QueryLimiterFromContextWithFallback(ctx context.Context) *QueryLimiter
QueryLimiterFromContextWithFallback returns a QueryLimiter from the current context. If there is not a QueryLimiter on the context it will return a new no-op limiter.
func (*QueryLimiter) AddChunkBytes ¶
func (ql *QueryLimiter) AddChunkBytes(chunkSizeInBytes int) error
AddChunkBytes adds the input chunk size in bytes and returns an error if the limit is reached.
func (*QueryLimiter) AddChunks ¶
func (ql *QueryLimiter) AddChunks(count int) error
func (*QueryLimiter) AddSeries ¶
func (ql *QueryLimiter) AddSeries(seriesLabels []logproto.LabelAdapter) error
AddSeries adds the input series and returns an error if the limit is reached.
Click to show internal directories.
Click to hide internal directories.