Loki: Set Query limits context header (#114112)
* feat(lokiQueryLimitsContext): send full query range & expr on initial split requests
This commit is contained in:
@@ -18,6 +18,17 @@ const (
|
||||
QueryEditorModeBuilder QueryEditorMode = "builder"
|
||||
)
|
||||
|
||||
type LimitsContext struct {
|
||||
Expr string `json:"expr"`
|
||||
From int64 `json:"from"`
|
||||
To int64 `json:"to"`
|
||||
}
|
||||
|
||||
// NewLimitsContext creates a new LimitsContext object.
|
||||
func NewLimitsContext() *LimitsContext {
|
||||
return &LimitsContext{}
|
||||
}
|
||||
|
||||
type LokiQueryType string
|
||||
|
||||
const (
|
||||
@@ -59,6 +70,8 @@ type LokiDataQuery struct {
|
||||
Instant *bool `json:"instant,omitempty"`
|
||||
// Used to set step value for range queries.
|
||||
Step *string `json:"step,omitempty"`
|
||||
// The full query plan for split/shard queries. Encoded and sent to Loki via `X-Loki-Query-Limits-Context` header. Requires "lokiQueryLimitsContext" feature flag
|
||||
LimitsContext *LimitsContext `json:"limitsContext,omitempty"`
|
||||
// A unique identifier for the query within the list of targets.
|
||||
// In server side expressions, the refId is used as a variable name to identify results.
|
||||
// By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
||||
|
||||
Reference in New Issue
Block a user