From 014a277e4496b357c6dacca4025f4960ca12cccf Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Tue, 22 Oct 2024 11:01:36 -0600 Subject: [PATCH 1/7] feat: add variants() to LogQL --- pkg/logql/engine.go | 3 + pkg/logql/syntax/ast.go | 115 ++++ pkg/logql/syntax/ast_test.go | 63 +++ pkg/logql/syntax/expr.y | 29 +- pkg/logql/syntax/expr.y.go | 988 +++++++++++++++++---------------- pkg/logql/syntax/lex.go | 4 + pkg/logql/syntax/lex_test.go | 43 ++ pkg/logql/syntax/parser.go | 18 + pkg/logql/syntax/test_utils.go | 7 +- 9 files changed, 803 insertions(+), 467 deletions(-) diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index 3d7cb541bb9dc..03943b64d84a4 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -323,6 +323,9 @@ func (q *query) Eval(ctx context.Context) (promql_parser.Value, error) { defer util.LogErrorWithContext(ctx, "closing iterator", itr.Close) streams, err := readStreams(itr, q.params.Limit(), q.params.Direction(), q.params.Interval()) return streams, err + case syntax.VariantsExpr: + // TODO(twhitney) + panic("TODO(twhitney): not implemeneted") default: return nil, fmt.Errorf("unexpected type (%T): cannot evaluate", e) } diff --git a/pkg/logql/syntax/ast.go b/pkg/logql/syntax/ast.go index 29cb5e548ddd6..f3d2655ee7bdf 100644 --- a/pkg/logql/syntax/ast.go +++ b/pkg/logql/syntax/ast.go @@ -1301,6 +1301,10 @@ const ( OpStrict = "--strict" OpKeepEmpty = "--keep-empty" + // variants + OpVariants = "variants" + VariantsOf = "of" + // internal expressions not represented in LogQL. These are used to // evaluate expressions differently resulting in intermediate formats // that are not consumable by LogQL clients but are used for sharding. @@ -2431,3 +2435,114 @@ func groupingReducesLabels(grp *Grouping) bool { return false } + +// VariantsExpr is a LogQL expression that can produce multiple streams, defined by a set of variants, +// over a single log selector. +// +//sumtype:decl +type VariantsExpr interface { + LogSelector() LogSelectorExpr + Matchers() []*labels.Matcher + Variants() []SampleExpr + Expr +} + +type MultiVariantExpr struct { + logSelector LogSelectorExpr + variants []SampleExpr + implicit +} + +func (m *MultiVariantExpr) LogSelector() LogSelectorExpr { + return m.logSelector +} + +func (m *MultiVariantExpr) Matchers() []*labels.Matcher { + return m.logSelector.Matchers() +} + +func (m *MultiVariantExpr) Variants() []SampleExpr { + return m.variants +} + +func (m *MultiVariantExpr) Shardable(topLevel bool) bool { + if !m.logSelector.Shardable(topLevel) { + return false + } + + for _, v := range m.variants { + if !v.Shardable(topLevel) { + return false + } + } + + return true +} + +func (m *MultiVariantExpr) Walk(f WalkFn) { + f(m) +} + +func (m *MultiVariantExpr) String() string { + var sb strings.Builder + sb.WriteString(OpVariants) + sb.WriteString("(") + for i, v := range m.variants { + sb.WriteString(v.String()) + if i+1 != len(m.variants) { + sb.WriteString(", ") + } + } + sb.WriteString(") ") + + sb.WriteString(VariantsOf) + sb.WriteString(" (") + sb.WriteString(m.logSelector.String()) + sb.WriteString(")") + + return sb.String() +} + +// TDOO(twhitney): do the sample expressions also need to accept the root vistor? +// is there a way to test this? +func (m *MultiVariantExpr) Accept(v RootVisitor) { + for _, variant := range m.variants { + variant.Accept(v) + } + + m.logSelector.Accept(v) +} + +// Pretty prettyfies any LogQL expression at given `level` of the whole LogQL query. +func (m *MultiVariantExpr) Pretty(level int) string { + s := Indent(level) + + s += OpVariants + "(\n" + + variants := make([]string, 0, len(m.variants)) + for _, v := range m.variants { + variants = append(variants, v.Pretty(level+1)) + } + + for i, v := range variants { + s += v + // LogQL doesn't allow `,` at the end of last argument. + if i < len(variants)-1 { + s += "," + } + s += "\n" + } + + s += Indent(level) + ") of (\n" + s += m.logSelector.Pretty(level + 1) + s += Indent(level) + "\n)" + + return s +} + +func newVariantsExpr(variants []SampleExpr, selector LogSelectorExpr) VariantsExpr { + return &MultiVariantExpr{ + variants: variants, + logSelector: selector, + } +} diff --git a/pkg/logql/syntax/ast_test.go b/pkg/logql/syntax/ast_test.go index 88fc0021eb33f..f6c5cf975dd74 100644 --- a/pkg/logql/syntax/ast_test.go +++ b/pkg/logql/syntax/ast_test.go @@ -2,6 +2,7 @@ package syntax import ( "fmt" + "strings" "testing" "time" @@ -1143,3 +1144,65 @@ func TestCombineFilters(t *testing.T) { } } } + +func Test_VariantsExpr_String(t *testing.T) { + t.Parallel() + tests := []struct { + expr string + }{ + {`variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"})`}, + { + `variants(count_over_time({baz="qux", foo=~"bar"}[5m]), bytes_over_time({baz="qux", foo=~"bar"}[5m])) of ({baz="qux", foo=~"bar"} | logfmt | this = "that")`, + }, + { + `variants(count_over_time({baz="qux", foo!="bar"}[5m]),rate({baz="qux", foo!="bar"}[5m])) of ({baz="qux", foo!="bar"} |= "that")`, + }, + } + + for _, tt := range tests { + t.Run(tt.expr, func(t *testing.T) { + t.Parallel() + expr, err := ParseExpr(tt.expr) + require.NoError(t, err) + + expr2, err := ParseExpr(expr.String()) + require.Nil(t, err) + + AssertExpressions(t, expr, expr2) + }) + } +} + +func Test_VariantsExpr_Pretty(t *testing.T) { + t.Parallel() + tests := []struct { + expr string + pretty string + }{ + {`variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"})`, ` +variants( + count_over_time({foo="bar"}[5m]) +) of ( + {foo="bar"} +)`}, + { + `variants(count_over_time({baz="qux", foo=~"bar"}[5m]), bytes_over_time({baz="qux", foo=~"bar"}[5m])) of ({baz="qux", foo=~"bar"} | logfmt | this = "that")`, + `variants( + count_over_time({baz="qux", foo=~"bar"}[5m]), + bytes_over_time({baz="qux", foo=~"bar"}[5m]) +) of ( + {baz="qux", foo=~"bar"} | logfmt | this="that" +)`, + }, + } + + for _, tt := range tests { + t.Run(tt.expr, func(t *testing.T) { + t.Parallel() + expr, err := ParseExpr(tt.expr) + require.NoError(t, err) + + require.Equal(t, strings.TrimSpace(tt.pretty), strings.TrimSpace(expr.Pretty(0))) + }) + } +} diff --git a/pkg/logql/syntax/expr.y b/pkg/logql/syntax/expr.y index b32366d65e37e..2b20575623acc 100644 --- a/pkg/logql/syntax/expr.y +++ b/pkg/logql/syntax/expr.y @@ -71,6 +71,11 @@ import ( KeepLabel log.KeepLabel KeepLabels []log.KeepLabel KeepLabelsExpr *KeepLabelsExpr + + VariantsExpr VariantsExpr + VariantsList []SampleExpr + VariantsOp string + VariantsOf string } %start root @@ -131,6 +136,11 @@ import ( %type ipLabelFilter %type offsetExpr +%type variantsExpr +%type variantsList +%type variantsOp +%type variantsOf + %token BYTES %token IDENTIFIER STRING NUMBER PARSER_FLAG %token DURATION RANGE @@ -140,7 +150,7 @@ import ( BYTES_OVER_TIME BYTES_RATE BOOL JSON REGEXP LOGFMT PIPE LINE_FMT LABEL_FMT UNWRAP AVG_OVER_TIME SUM_OVER_TIME MIN_OVER_TIME MAX_OVER_TIME STDVAR_OVER_TIME STDDEV_OVER_TIME QUANTILE_OVER_TIME BYTES_CONV DURATION_CONV DURATION_SECONDS_CONV FIRST_OVER_TIME LAST_OVER_TIME ABSENT_OVER_TIME VECTOR LABEL_REPLACE UNPACK OFFSET PATTERN IP ON IGNORING GROUP_LEFT GROUP_RIGHT - DECOLORIZE DROP KEEP + DECOLORIZE DROP KEEP VARIANTS OF // Operators are listed with increasing precedence. %left OR @@ -157,6 +167,7 @@ root: expr { exprlex.(*parser).expr = $1 }; expr: logExpr { $$ = $1 } | metricExpr { $$ = $1 } + | variantsExpr { $$ = $1 } ; metricExpr: @@ -175,6 +186,22 @@ logExpr: | OPEN_PARENTHESIS logExpr CLOSE_PARENTHESIS { $$ = $2 } ; +variantsExpr: + variantsOp OPEN_PARENTHESIS variantsList CLOSE_PARENTHESIS variantsOf OPEN_PARENTHESIS logExpr CLOSE_PARENTHESIS { $$ = newVariantsExpr($3, $7) } + ; + +variantsOp: + VARIANTS { $$ = OpVariants } + ; +variantsOf: + OF { $$ = VariantsOf } + ; + +variantsList: + metricExpr { $$ = []SampleExpr{$1} } + | variantsList COMMA metricExpr { $$ = append($1, $3) } + ; + logRangeExpr: selector RANGE { $$ = newLogRange(newMatcherExpr($1), $2, nil, nil ) } | selector RANGE offsetExpr { $$ = newLogRange(newMatcherExpr($1), $2, nil, $3 ) } diff --git a/pkg/logql/syntax/expr.y.go b/pkg/logql/syntax/expr.y.go index 85070b1c2b501..bd849842dac15 100644 --- a/pkg/logql/syntax/expr.y.go +++ b/pkg/logql/syntax/expr.y.go @@ -74,6 +74,11 @@ type exprSymType struct { KeepLabel log.KeepLabel KeepLabels []log.KeepLabel KeepLabelsExpr *KeepLabelsExpr + + VariantsExpr VariantsExpr + VariantsList []SampleExpr + VariantsOp string + VariantsOf string } const BYTES = 57346 @@ -153,21 +158,23 @@ const GROUP_RIGHT = 57419 const DECOLORIZE = 57420 const DROP = 57421 const KEEP = 57422 -const OR = 57423 -const AND = 57424 -const UNLESS = 57425 -const CMP_EQ = 57426 -const NEQ = 57427 -const LT = 57428 -const LTE = 57429 -const GT = 57430 -const GTE = 57431 -const ADD = 57432 -const SUB = 57433 -const MUL = 57434 -const DIV = 57435 -const MOD = 57436 -const POW = 57437 +const VARIANTS = 57423 +const OF = 57424 +const OR = 57425 +const AND = 57426 +const UNLESS = 57427 +const CMP_EQ = 57428 +const NEQ = 57429 +const LT = 57430 +const LTE = 57431 +const GT = 57432 +const GTE = 57433 +const ADD = 57434 +const SUB = 57435 +const MUL = 57436 +const DIV = 57437 +const MOD = 57438 +const POW = 57439 var exprToknames = [...]string{ "$end", @@ -250,6 +257,8 @@ var exprToknames = [...]string{ "DECOLORIZE", "DROP", "KEEP", + "VARIANTS", + "OF", "OR", "AND", "UNLESS", @@ -277,266 +286,285 @@ var exprExca = [...]int{ -1, 1, 1, -1, -2, 0, + -1, 151, + 21, 18, + 27, 18, + -2, 3, + -1, 298, + 21, 19, + 27, 19, + -2, 3, } const exprPrivate = 57344 -const exprLast = 644 +const exprLast = 663 var exprAct = [...]int{ - 290, 229, 85, 4, 215, 65, 183, 127, 205, 190, - 76, 201, 198, 64, 238, 5, 153, 188, 78, 2, - 57, 81, 49, 50, 51, 58, 59, 62, 63, 60, - 61, 52, 53, 54, 55, 56, 57, 284, 10, 50, - 51, 58, 59, 62, 63, 60, 61, 52, 53, 54, - 55, 56, 57, 58, 59, 62, 63, 60, 61, 52, - 53, 54, 55, 56, 57, 54, 55, 56, 57, 218, - 110, 137, 140, 216, 116, 52, 53, 54, 55, 56, - 57, 267, 293, 222, 16, 141, 266, 185, 157, 149, - 151, 152, 131, 263, 162, 221, 16, 68, 262, 155, - 73, 75, 167, 168, 165, 166, 298, 217, 70, 71, - 72, 164, 208, 151, 152, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 282, - 340, 367, 16, 294, 281, 295, 231, 137, 195, 367, - 143, 192, 95, 203, 207, 86, 87, 186, 184, 340, - 265, 293, 143, 185, 279, 387, 220, 16, 131, 278, - 382, 150, 261, 236, 111, 294, 370, 17, 18, 230, - 74, 295, 232, 233, 295, 307, 241, 142, 375, 17, - 18, 357, 347, 214, 209, 212, 213, 210, 211, 307, - 295, 249, 250, 251, 276, 356, 307, 16, 273, 275, - 341, 16, 355, 272, 270, 253, 295, 16, 84, 269, - 86, 87, 374, 296, 184, 17, 18, 364, 73, 75, - 225, 380, 328, 286, 372, 307, 70, 71, 72, 288, - 291, 354, 297, 240, 300, 360, 110, 303, 116, 304, - 17, 18, 292, 155, 289, 332, 301, 264, 268, 271, - 274, 277, 280, 283, 231, 317, 137, 343, 344, 345, - 311, 313, 316, 318, 319, 350, 137, 203, 207, 326, - 321, 325, 185, 331, 240, 305, 244, 131, 256, 240, - 17, 18, 185, 240, 17, 18, 225, 131, 74, 329, - 17, 18, 333, 307, 335, 337, 315, 339, 110, 309, - 307, 314, 338, 349, 334, 312, 308, 110, 296, 240, - 351, 302, 240, 73, 75, 234, 145, 225, 154, 144, - 13, 70, 71, 72, 137, 348, 327, 285, 13, 156, - 385, 242, 186, 184, 239, 361, 362, 156, 248, 247, - 110, 363, 226, 246, 245, 131, 219, 365, 366, 231, - 161, 160, 159, 371, 91, 90, 83, 381, 353, 254, - 228, 16, 306, 147, 260, 73, 75, 377, 259, 378, - 379, 13, 257, 70, 71, 72, 243, 299, 235, 146, - 6, 383, 148, 74, 21, 22, 23, 36, 45, 46, - 37, 39, 40, 38, 41, 42, 43, 44, 47, 24, - 25, 231, 227, 82, 258, 255, 369, 368, 336, 26, - 27, 28, 29, 30, 31, 32, 80, 346, 163, 33, - 34, 35, 48, 19, 237, 228, 191, 323, 324, 252, - 73, 75, 89, 191, 13, 74, 189, 88, 70, 71, - 72, 386, 384, 6, 17, 18, 373, 21, 22, 23, - 36, 45, 46, 37, 39, 40, 38, 41, 42, 43, - 44, 47, 24, 25, 3, 359, 231, 358, 330, 320, - 310, 77, 26, 27, 28, 29, 30, 31, 32, 287, - 73, 75, 33, 34, 35, 48, 19, 158, 70, 71, - 72, 224, 322, 73, 75, 199, 376, 13, 223, 222, - 74, 70, 71, 72, 221, 196, 6, 17, 18, 137, - 21, 22, 23, 36, 45, 46, 37, 39, 40, 38, - 41, 42, 43, 44, 47, 24, 25, 194, 193, 67, - 131, 352, 206, 202, 191, 26, 27, 28, 29, 30, - 31, 32, 82, 137, 199, 33, 34, 35, 48, 19, - 74, 128, 123, 124, 122, 129, 132, 134, 298, 73, - 75, 114, 115, 74, 131, 197, 119, 70, 71, 72, - 17, 18, 204, 121, 125, 200, 126, 120, 118, 92, - 117, 187, 133, 135, 136, 66, 123, 124, 122, 138, - 132, 134, 130, 139, 112, 231, 113, 94, 93, 11, - 9, 20, 12, 15, 8, 342, 14, 7, 125, 79, - 126, 69, 1, 0, 0, 293, 133, 135, 136, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, + 301, 237, 3, 189, 89, 68, 4, 221, 131, 211, + 80, 67, 207, 204, 79, 246, 194, 6, 196, 159, + 81, 2, 60, 292, 85, 52, 53, 54, 61, 62, + 65, 66, 63, 64, 55, 56, 57, 58, 59, 60, + 224, 11, 53, 54, 61, 62, 65, 66, 63, 64, + 55, 56, 57, 58, 59, 60, 61, 62, 65, 66, + 63, 64, 55, 56, 57, 58, 59, 60, 57, 58, + 59, 60, 144, 114, 120, 55, 56, 57, 58, 59, + 60, 275, 297, 230, 18, 304, 274, 223, 271, 151, + 229, 18, 222, 270, 145, 163, 173, 174, 171, 172, + 309, 168, 352, 290, 306, 161, 18, 353, 289, 381, + 352, 214, 157, 158, 305, 287, 381, 170, 18, 384, + 286, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 284, 304, 71, 18, 201, + 283, 99, 281, 306, 198, 18, 141, 280, 209, 213, + 273, 306, 155, 157, 158, 306, 248, 269, 141, 147, + 146, 147, 191, 228, 355, 356, 357, 135, 378, 19, + 20, 403, 244, 238, 191, 398, 19, 20, 328, 135, + 240, 305, 241, 249, 220, 215, 218, 219, 216, 217, + 233, 19, 20, 318, 257, 258, 259, 278, 359, 369, + 18, 149, 277, 19, 20, 390, 88, 115, 90, 91, + 261, 76, 78, 90, 91, 344, 389, 388, 386, 73, + 74, 75, 306, 19, 20, 190, 156, 318, 372, 318, + 19, 20, 294, 368, 298, 367, 192, 190, 302, 299, + 308, 248, 311, 120, 114, 318, 248, 314, 303, 233, + 315, 366, 312, 161, 362, 300, 272, 276, 279, 282, + 285, 288, 291, 326, 342, 316, 141, 233, 325, 322, + 324, 327, 329, 248, 313, 141, 209, 213, 337, 332, + 336, 330, 191, 77, 307, 19, 20, 135, 264, 76, + 78, 191, 234, 15, 252, 323, 135, 73, 74, 75, + 340, 360, 374, 345, 248, 347, 349, 242, 351, 114, + 350, 318, 248, 346, 361, 236, 318, 320, 114, 141, + 76, 78, 319, 148, 363, 239, 250, 227, 73, 74, + 75, 160, 310, 226, 247, 343, 339, 338, 15, 293, + 135, 15, 256, 255, 192, 190, 373, 162, 376, 375, + 162, 254, 114, 377, 253, 225, 239, 167, 166, 379, + 380, 77, 165, 95, 94, 87, 82, 385, 401, 397, + 365, 262, 317, 268, 307, 18, 267, 391, 265, 76, + 78, 393, 251, 394, 395, 15, 243, 73, 74, 75, + 235, 266, 77, 263, 7, 396, 383, 399, 24, 25, + 26, 39, 48, 49, 40, 42, 43, 41, 44, 45, + 46, 47, 50, 27, 28, 239, 382, 86, 358, 348, + 334, 335, 153, 29, 30, 31, 32, 33, 34, 35, + 84, 169, 93, 36, 37, 38, 51, 21, 152, 236, + 245, 154, 92, 197, 76, 78, 260, 76, 78, 23, + 15, 77, 73, 74, 75, 73, 74, 75, 402, 7, + 19, 20, 400, 24, 25, 26, 39, 48, 49, 40, + 42, 43, 41, 44, 45, 46, 47, 50, 27, 28, + 239, 197, 392, 239, 195, 387, 371, 370, 29, 30, + 31, 32, 33, 34, 35, 341, 331, 321, 36, 37, + 38, 51, 21, 304, 333, 164, 295, 205, 296, 232, + 231, 230, 76, 78, 23, 15, 77, 229, 202, 77, + 73, 74, 75, 200, 7, 19, 20, 199, 24, 25, + 26, 39, 48, 49, 40, 42, 43, 41, 44, 45, + 46, 47, 50, 27, 28, 364, 212, 208, 239, 197, + 14, 86, 205, 29, 30, 31, 32, 33, 34, 35, + 76, 78, 141, 36, 37, 38, 51, 21, 73, 74, + 75, 150, 5, 141, 132, 133, 118, 119, 203, 23, + 123, 210, 125, 135, 77, 206, 124, 122, 121, 193, + 19, 20, 69, 142, 135, 96, 70, 134, 143, 116, + 117, 98, 97, 12, 10, 127, 128, 126, 22, 136, + 138, 309, 13, 17, 9, 354, 127, 128, 126, 16, + 136, 138, 8, 83, 72, 1, 0, 129, 0, 130, + 0, 0, 77, 0, 0, 137, 139, 140, 129, 0, + 130, 0, 0, 0, 0, 0, 137, 139, 140, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, } var exprPact = [...]int{ - 354, -1000, -59, -1000, -1000, 478, 354, -1000, -1000, -1000, - -1000, -1000, -1000, 398, 330, 182, -1000, 430, 425, 329, - 328, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + 368, -1000, -58, -1000, -1000, -1000, 545, 368, -1000, -1000, + -1000, -1000, -1000, -1000, 340, 412, 339, 180, -1000, 435, + 425, 338, 337, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 478, -1000, 465, 538, -9, 79, - -1000, -1000, -1000, -1000, -1000, -1000, 292, 289, -59, 361, - -1000, -1000, 76, 311, 480, 326, 325, 324, -1000, -1000, - 354, 411, 354, 30, 26, -1000, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - -1000, -1000, -1000, -1000, -1000, -1000, 66, -1000, -1000, -1000, - -1000, -1000, 428, 529, 522, -1000, 521, -1000, -1000, -1000, - -1000, 319, 499, -1000, 539, 528, 527, 99, -1000, -1000, - 67, -12, 320, -1000, -1000, -1000, -1000, -1000, 537, 498, - 493, 492, 485, 315, 381, 415, 303, 288, 357, 417, - 307, 304, 355, 249, -43, 318, 317, 313, 312, -31, - -31, -27, -27, -75, -75, -75, -75, -15, -15, -15, - -15, -15, -15, 66, 319, 319, 319, 421, 338, -1000, - -1000, 392, 338, -1000, -1000, 251, -1000, 351, -1000, 391, - 347, -1000, 76, -1000, 343, -1000, 76, -1000, 89, 77, - 200, 194, 190, 150, 125, -1000, -44, 301, 67, 473, - -1000, -1000, -1000, -1000, -1000, -1000, 117, 303, 544, 123, - 203, 504, 350, 284, 117, 354, 248, 341, 279, -1000, - -1000, 272, -1000, 464, -1000, 278, 274, 269, 228, 261, - 66, 132, -1000, 338, 529, 463, -1000, 490, 422, 528, - 527, 300, -1000, -1000, -1000, 196, -1000, -1000, -1000, -1000, + -1000, -1000, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 545, -1000, 196, + 568, -11, 88, -1000, -1000, -1000, -1000, -1000, -1000, 296, + 174, -58, 368, 420, -1000, -1000, 139, 324, 498, 336, + 332, 331, -1000, -1000, 368, 424, 368, 24, 20, -1000, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, -1000, -1000, -1000, -1000, -1000, -1000, + 153, -1000, -1000, -1000, -1000, -1000, 476, 544, 521, -1000, + 517, -1000, -1000, -1000, -1000, 314, 512, -1000, 547, 542, + 541, 98, -1000, -1000, 86, -43, 329, -1000, -1000, -1000, + 306, -1000, -1000, -1000, 546, 511, 505, 504, 503, 265, + 369, 429, 321, 280, 365, 433, 307, 299, 361, 267, + -42, 328, 325, 317, 316, -30, -30, -26, -26, -75, + -75, -75, -75, -17, -17, -17, -17, -17, -17, 153, + 314, 314, 314, 438, 350, -1000, -1000, 380, 350, -1000, + -1000, 261, -1000, 357, -1000, 378, 355, -1000, 139, -1000, + 352, -1000, 139, -1000, 84, 77, 193, 138, 131, 111, + 99, -1000, -60, 313, 86, 500, 0, 368, -1000, -1000, + -1000, -1000, -1000, -1000, 185, 321, 432, 104, 364, 557, + 305, 247, 185, 368, 238, 351, 295, -1000, -1000, 290, + -1000, 491, -1000, 268, 241, 236, 151, 270, 153, 141, + -1000, 350, 544, 490, -1000, 502, 415, 542, 541, 311, + -1000, -1000, -1000, 310, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 67, 462, -1000, 246, -1000, 218, - 85, 84, 85, 399, 11, 319, 11, 120, 195, 407, - 155, 298, -1000, -1000, 238, -1000, 354, 526, -1000, -1000, - 337, 204, -1000, 175, -1000, -1000, 168, -1000, 154, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, 461, 459, -1000, - 208, -1000, 117, 84, 85, 84, -1000, -1000, 66, -1000, - 11, -1000, 191, -1000, -1000, -1000, 80, 397, 396, 139, - 117, 197, -1000, 440, -1000, -1000, -1000, -1000, 185, 151, - -1000, -1000, 84, -1000, 491, 88, 84, 52, 11, 11, - 211, -1000, -1000, 336, -1000, -1000, 133, 84, -1000, -1000, - 11, 436, -1000, -1000, 309, 435, 128, -1000, + -1000, -1000, 86, 489, -1000, 237, 309, -1000, -1000, -1000, + 188, 497, 53, 497, 410, 14, 314, 14, 100, 102, + 408, 171, 274, -1000, -1000, 227, -1000, 368, 540, -1000, + -1000, 349, 224, -1000, 208, -1000, -1000, 206, -1000, 172, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 481, 480, + -1000, 201, -1000, 276, 185, 53, 497, 53, -1000, -1000, + 153, -1000, 14, -1000, 142, -1000, -1000, -1000, 65, 406, + 386, 92, 185, 191, -1000, 479, -1000, -1000, -1000, -1000, + 190, 189, -1000, 178, 276, -1000, 53, -1000, 477, 58, + 53, 46, 14, 14, 385, -1000, -1000, 348, -1000, -1000, + -1000, 174, 148, 53, -1000, -1000, 14, 456, -1000, -1000, + 347, 452, 144, -1000, } var exprPgo = [...]int{ - 0, 612, 18, 611, 2, 14, 464, 3, 16, 7, - 609, 607, 606, 605, 15, 604, 603, 602, 601, 107, - 600, 38, 599, 579, 598, 597, 596, 594, 13, 5, - 593, 592, 589, 6, 585, 97, 4, 581, 580, 578, - 577, 575, 11, 573, 572, 8, 566, 12, 565, 9, - 17, 562, 561, 1, 555, 551, 0, + 0, 625, 20, 624, 4, 15, 2, 6, 19, 8, + 623, 622, 619, 615, 17, 614, 613, 612, 608, 87, + 604, 41, 603, 595, 602, 601, 600, 599, 11, 5, + 598, 597, 593, 3, 592, 137, 7, 589, 588, 587, + 586, 585, 12, 582, 581, 9, 580, 13, 578, 18, + 16, 577, 576, 1, 575, 574, 0, 572, 571, 550, + 508, } var exprR1 = [...]int{ - 0, 1, 2, 2, 7, 7, 7, 7, 7, 7, - 7, 6, 6, 6, 8, 8, 8, 8, 8, 8, + 0, 1, 2, 2, 2, 7, 7, 7, 7, 7, + 7, 7, 6, 6, 6, 57, 59, 60, 58, 58, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 53, 53, 53, 13, 13, 13, 11, 11, 11, 11, - 15, 15, 15, 15, 15, 15, 22, 3, 3, 3, - 3, 3, 3, 14, 14, 14, 10, 10, 9, 9, - 9, 9, 28, 28, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 19, 36, 36, 36, 35, - 35, 35, 34, 34, 34, 37, 37, 27, 27, 26, - 26, 26, 26, 52, 51, 51, 38, 39, 47, 47, - 48, 48, 48, 46, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 49, 49, 50, 50, 55, 55, 54, - 54, 32, 32, 32, 32, 32, 32, 32, 30, 30, - 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, - 31, 31, 42, 42, 41, 41, 40, 45, 45, 44, - 44, 43, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 24, 24, 25, - 25, 25, 25, 23, 23, 23, 23, 23, 23, 23, - 23, 21, 21, 21, 17, 18, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 56, 5, 5, 4, 4, 4, 4, + 8, 8, 8, 8, 8, 8, 53, 53, 53, 13, + 13, 13, 11, 11, 11, 11, 15, 15, 15, 15, + 15, 15, 22, 3, 3, 3, 3, 3, 3, 14, + 14, 14, 10, 10, 9, 9, 9, 9, 28, 28, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 19, 36, 36, 36, 35, 35, 35, 34, 34, + 34, 37, 37, 27, 27, 26, 26, 26, 26, 52, + 51, 51, 38, 39, 47, 47, 48, 48, 48, 46, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 49, + 49, 50, 50, 55, 55, 54, 54, 32, 32, 32, + 32, 32, 32, 32, 30, 30, 30, 30, 30, 30, + 30, 31, 31, 31, 31, 31, 31, 31, 42, 42, + 41, 41, 40, 45, 45, 44, 44, 43, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 24, 24, 25, 25, 25, 25, 23, + 23, 23, 23, 23, 23, 23, 23, 21, 21, 21, + 17, 18, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 56, + 5, 5, 4, 4, 4, 4, } var exprR2 = [...]int{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 1, 2, 3, 2, 3, 4, 5, 3, 4, - 5, 6, 3, 4, 5, 6, 3, 4, 5, 6, - 4, 5, 6, 7, 3, 4, 4, 5, 3, 2, - 3, 6, 3, 1, 1, 1, 4, 6, 5, 7, - 4, 5, 5, 6, 7, 7, 12, 1, 1, 1, - 1, 1, 1, 3, 3, 2, 1, 3, 3, 3, - 3, 3, 1, 2, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 1, 4, 3, 2, - 5, 4, 1, 3, 2, 1, 2, 1, 2, 1, - 2, 1, 2, 2, 3, 2, 2, 1, 3, 3, - 1, 3, 3, 2, 1, 1, 1, 1, 3, 2, - 3, 3, 3, 3, 1, 1, 3, 6, 6, 1, - 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 1, 3, 1, 2, 3, 8, 1, 1, 1, 3, + 2, 3, 4, 5, 3, 4, 5, 6, 3, 4, + 5, 6, 3, 4, 5, 6, 4, 5, 6, 7, + 3, 4, 4, 5, 3, 2, 3, 6, 3, 1, + 1, 1, 4, 6, 5, 7, 4, 5, 5, 6, + 7, 7, 12, 1, 1, 1, 1, 1, 1, 3, + 3, 2, 1, 3, 3, 3, 3, 3, 1, 2, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 1, 1, 4, 3, 2, 5, 4, 1, 3, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, + 3, 2, 2, 1, 3, 3, 1, 3, 3, 2, + 1, 1, 1, 1, 3, 2, 3, 3, 3, 3, + 1, 1, 3, 6, 6, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 1, 1, 1, 3, 2, 1, 1, 1, - 3, 2, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 0, 1, 5, - 4, 5, 4, 1, 1, 2, 4, 5, 2, 4, - 5, 1, 2, 2, 4, 1, 1, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, + 1, 3, 2, 1, 1, 1, 3, 2, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 0, 1, 5, 4, 5, 4, 1, + 1, 2, 4, 5, 2, 4, 5, 1, 2, 2, + 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 3, 4, 4, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 3, 4, 4, 3, 3, } var exprChk = [...]int{ - -1000, -1, -2, -6, -7, -14, 26, -11, -15, -20, - -21, -22, -17, 17, -12, -16, 7, 90, 91, 69, - -18, 30, 31, 32, 45, 46, 55, 56, 57, 58, - 59, 60, 61, 65, 66, 67, 33, 36, 39, 37, - 38, 40, 41, 42, 43, 34, 35, 44, 68, 81, - 82, 83, 90, 91, 92, 93, 94, 95, 84, 85, - 88, 89, 86, 87, -28, -29, -34, 51, -35, -3, - 23, 24, 25, 15, 85, 16, -7, -6, -2, -10, - 18, -9, 5, 26, 26, -4, 28, 29, 7, 7, - 26, 26, -23, -24, -25, 47, -23, -23, -23, -23, + -1000, -1, -2, -6, -7, -57, -14, 26, -11, -15, + -20, -21, -22, -17, -59, 17, -12, -16, 7, 92, + 93, 69, -18, 81, 30, 31, 32, 45, 46, 55, + 56, 57, 58, 59, 60, 61, 65, 66, 67, 33, + 36, 39, 37, 38, 40, 41, 42, 43, 34, 35, + 44, 68, 83, 84, 85, 92, 93, 94, 95, 96, + 97, 86, 87, 90, 91, 88, 89, -28, -29, -34, + 51, -35, -3, 23, 24, 25, 15, 87, 16, -7, + -6, -2, 26, -10, 18, -9, 5, 26, 26, -4, + 28, 29, 7, 7, 26, 26, -23, -24, -25, 47, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -29, -35, -27, -26, -52, -51, -33, -38, -39, -46, - -40, -43, 50, 48, 49, 70, 72, -9, -55, -54, - -31, 26, 52, 78, 53, 79, 80, 5, -32, -30, - 81, 6, -19, 73, 27, 27, 18, 2, 21, 13, - 85, 14, 15, -8, 7, -14, 26, -7, 7, 26, - 26, 26, -7, 7, -2, 74, 75, 76, 77, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -33, 82, 21, 81, -37, -50, 8, - -49, 5, -50, 6, 6, -33, 6, -48, -47, 5, - -41, -42, 5, -9, -44, -45, 5, -9, 13, 85, - 88, 89, 86, 87, 84, -36, 6, -19, 81, 26, - -9, 6, 6, 6, 6, 2, 27, 21, 10, -53, - -28, 51, -14, -8, 27, 21, -7, 7, -5, 27, - 5, -5, 27, 21, 27, 26, 26, 26, 26, -33, - -33, -33, 8, -50, 21, 13, 27, 21, 13, 21, - 21, 73, 9, 4, -21, 73, 9, 4, -21, 9, - 4, -21, 9, 4, -21, 9, 4, -21, 9, 4, - -21, 9, 4, -21, 81, 26, -36, 6, -4, -8, - -56, -53, -28, 71, 10, 51, 10, -53, 54, 27, - -53, -28, 27, -4, -7, 27, 21, 21, 27, 27, - 6, -5, 27, -5, 27, 27, -5, 27, -5, -49, - 6, -47, 2, 5, 6, -42, -45, 26, 26, -36, - 6, 27, 27, -53, -28, -53, 9, -56, -33, -56, - 10, 5, -13, 62, 63, 64, 10, 27, 27, -53, - 27, -7, 5, 21, 27, 27, 27, 27, 6, 6, - 27, -4, -53, -56, 26, -56, -53, 51, 10, 10, - 27, -4, 27, 6, 27, 27, 5, -53, -56, -56, - 10, 21, 27, -56, 6, 21, 6, 27, + -23, -23, -23, -23, -29, -35, -27, -26, -52, -51, + -33, -38, -39, -46, -40, -43, 50, 48, 49, 70, + 72, -9, -55, -54, -31, 26, 52, 78, 53, 79, + 80, 5, -32, -30, 83, 6, -19, 73, 27, 27, + -58, -7, 18, 2, 21, 13, 87, 14, 15, -8, + 7, -14, 26, -7, 7, 26, 26, 26, -7, 7, + -2, 74, 75, 76, 77, -2, -2, -2, -2, -2, + -2, -2, -2, -2, -2, -2, -2, -2, -2, -33, + 84, 21, 83, -37, -50, 8, -49, 5, -50, 6, + 6, -33, 6, -48, -47, 5, -41, -42, 5, -9, + -44, -45, 5, -9, 13, 87, 90, 91, 88, 89, + 86, -36, 6, -19, 83, 26, 27, 21, -9, 6, + 6, 6, 6, 2, 27, 21, 10, -53, -28, 51, + -14, -8, 27, 21, -7, 7, -5, 27, 5, -5, + 27, 21, 27, 26, 26, 26, 26, -33, -33, -33, + 8, -50, 21, 13, 27, 21, 13, 21, 21, 73, + 9, 4, -21, 73, 9, 4, -21, 9, 4, -21, + 9, 4, -21, 9, 4, -21, 9, 4, -21, 9, + 4, -21, 83, 26, -36, 6, -60, 82, -7, -4, + -8, -56, -53, -28, 71, 10, 51, 10, -53, 54, + 27, -53, -28, 27, -4, -7, 27, 21, 21, 27, + 27, 6, -5, 27, -5, 27, 27, -5, 27, -5, + -49, 6, -47, 2, 5, 6, -42, -45, 26, 26, + -36, 6, 27, 26, 27, -53, -28, -53, 9, -56, + -33, -56, 10, 5, -13, 62, 63, 64, 10, 27, + 27, -53, 27, -7, 5, 21, 27, 27, 27, 27, + 6, 6, 27, -6, 26, -4, -53, -56, 26, -56, + -53, 51, 10, 10, 27, -4, 27, 6, 27, 27, + 27, -6, 5, -53, -56, -56, 10, 21, 27, -56, + 6, 21, 6, 27, } var exprDef = [...]int{ - 0, -2, 1, 2, 3, 11, 0, 4, 5, 6, - 7, 8, 9, 0, 0, 0, 191, 0, 0, 0, - 0, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 195, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 12, 72, 74, 0, 92, 0, - 57, 58, 59, 60, 61, 62, 3, 2, 0, 0, - 65, 66, 0, 0, 0, 0, 0, 0, 192, 193, - 0, 0, 0, 183, 184, 178, 0, 0, 0, 0, + 0, -2, 1, 2, 3, 4, 12, 0, 5, 6, + 7, 8, 9, 10, 0, 0, 0, 0, 197, 0, + 0, 0, 0, 16, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 201, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 13, 78, 80, + 0, 98, 0, 63, 64, 65, 66, 67, 68, 3, + 2, 0, 0, 0, 71, 72, 0, 0, 0, 0, + 0, 0, 198, 199, 0, 0, 0, 189, 190, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 73, 94, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 97, 99, 0, 101, 0, 114, 115, 116, - 117, 0, 0, 107, 0, 0, 0, 0, 129, 130, - 0, 89, 0, 85, 10, 13, 63, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 191, 0, - 0, 0, 3, 0, 162, 0, 0, 185, 188, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 119, 0, 0, 0, 98, 105, 95, - 125, 124, 103, 100, 102, 0, 106, 113, 110, 0, - 156, 154, 152, 153, 161, 159, 157, 158, 0, 0, - 0, 0, 0, 0, 0, 93, 86, 0, 0, 0, - 67, 68, 69, 70, 71, 39, 46, 0, 14, 0, - 0, 0, 0, 0, 50, 0, 3, 191, 0, 228, - 224, 0, 229, 0, 194, 0, 0, 0, 0, 120, - 121, 122, 96, 104, 0, 0, 118, 0, 0, 0, - 0, 0, 136, 143, 150, 0, 135, 142, 149, 131, - 138, 145, 132, 139, 146, 133, 140, 147, 134, 141, - 148, 137, 144, 151, 0, 0, 91, 0, 48, 0, - 15, 18, 34, 0, 22, 0, 26, 0, 0, 0, - 0, 0, 38, 52, 3, 51, 0, 0, 226, 227, - 0, 0, 180, 0, 182, 186, 0, 189, 0, 126, - 123, 111, 112, 108, 109, 155, 160, 0, 0, 88, - 0, 90, 47, 19, 35, 36, 223, 23, 42, 27, - 30, 40, 0, 43, 44, 45, 16, 0, 0, 0, - 53, 3, 225, 0, 179, 181, 187, 190, 0, 0, - 87, 49, 37, 31, 0, 17, 20, 0, 24, 28, - 0, 54, 55, 0, 127, 128, 0, 21, 25, 29, - 32, 0, 41, 33, 0, 0, 0, 56, + 0, 0, 0, 0, 79, 100, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 103, 105, 0, 107, + 0, 120, 121, 122, 123, 0, 0, 113, 0, 0, + 0, 0, 135, 136, 0, 95, 0, 91, 11, 14, + 0, -2, 69, 70, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 197, 0, 0, 0, 3, 0, + 168, 0, 0, 191, 194, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 125, + 0, 0, 0, 104, 111, 101, 131, 130, 109, 106, + 108, 0, 112, 119, 116, 0, 162, 160, 158, 159, + 167, 165, 163, 164, 0, 0, 0, 0, 0, 0, + 0, 99, 92, 0, 0, 0, 0, 0, 73, 74, + 75, 76, 77, 45, 52, 0, 20, 0, 0, 0, + 0, 0, 56, 0, 3, 197, 0, 234, 230, 0, + 235, 0, 200, 0, 0, 0, 0, 126, 127, 128, + 102, 110, 0, 0, 124, 0, 0, 0, 0, 0, + 142, 149, 156, 0, 141, 148, 155, 137, 144, 151, + 138, 145, 152, 139, 146, 153, 140, 147, 154, 143, + 150, 157, 0, 0, 97, 0, 0, 17, -2, 54, + 0, 21, 24, 40, 0, 28, 0, 32, 0, 0, + 0, 0, 0, 44, 58, 3, 57, 0, 0, 232, + 233, 0, 0, 186, 0, 188, 192, 0, 195, 0, + 132, 129, 117, 118, 114, 115, 161, 166, 0, 0, + 94, 0, 96, 0, 53, 25, 41, 42, 229, 29, + 48, 33, 36, 46, 0, 49, 50, 51, 22, 0, + 0, 0, 59, 3, 231, 0, 185, 187, 193, 196, + 0, 0, 93, 0, 0, 55, 43, 37, 0, 23, + 26, 0, 30, 34, 0, 60, 61, 0, 133, 134, + 15, 0, 0, 27, 31, 35, 38, 0, 47, 39, + 0, 0, 0, 62, } var exprTok1 = [...]int{ @@ -553,7 +581,7 @@ var exprTok2 = [...]int{ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, + 92, 93, 94, 95, 96, 97, } var exprTok3 = [...]int{ 0, @@ -913,1130 +941,1160 @@ exprdefault: case 4: exprDollar = exprS[exprpt-1 : exprpt+1] { - exprVAL.MetricExpr = exprDollar[1].RangeAggregationExpr + exprVAL.Expr = exprDollar[1].VariantsExpr } case 5: exprDollar = exprS[exprpt-1 : exprpt+1] { - exprVAL.MetricExpr = exprDollar[1].VectorAggregationExpr + exprVAL.MetricExpr = exprDollar[1].RangeAggregationExpr } case 6: exprDollar = exprS[exprpt-1 : exprpt+1] { - exprVAL.MetricExpr = exprDollar[1].BinOpExpr + exprVAL.MetricExpr = exprDollar[1].VectorAggregationExpr } case 7: exprDollar = exprS[exprpt-1 : exprpt+1] { - exprVAL.MetricExpr = exprDollar[1].LiteralExpr + exprVAL.MetricExpr = exprDollar[1].BinOpExpr } case 8: exprDollar = exprS[exprpt-1 : exprpt+1] { - exprVAL.MetricExpr = exprDollar[1].LabelReplaceExpr + exprVAL.MetricExpr = exprDollar[1].LiteralExpr } case 9: exprDollar = exprS[exprpt-1 : exprpt+1] { - exprVAL.MetricExpr = exprDollar[1].VectorExpr + exprVAL.MetricExpr = exprDollar[1].LabelReplaceExpr } case 10: + exprDollar = exprS[exprpt-1 : exprpt+1] + { + exprVAL.MetricExpr = exprDollar[1].VectorExpr + } + case 11: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.MetricExpr = exprDollar[2].MetricExpr } - case 11: + case 12: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LogExpr = newMatcherExpr(exprDollar[1].Selector) } - case 12: + case 13: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LogExpr = newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr) } - case 13: + case 14: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogExpr = exprDollar[2].LogExpr } - case 14: + case 15: + exprDollar = exprS[exprpt-8 : exprpt+1] + { + exprVAL.VariantsExpr = newVariantsExpr(exprDollar[3].VariantsList, exprDollar[7].LogExpr) + } + case 16: + exprDollar = exprS[exprpt-1 : exprpt+1] + { + exprVAL.VariantsOp = OpVariants + } + case 17: + exprDollar = exprS[exprpt-1 : exprpt+1] + { + exprVAL.VariantsOf = VariantsOf + } + case 18: + exprDollar = exprS[exprpt-1 : exprpt+1] + { + exprVAL.VariantsList = []SampleExpr{exprDollar[1].MetricExpr} + } + case 19: + exprDollar = exprS[exprpt-3 : exprpt+1] + { + exprVAL.VariantsList = append(exprDollar[1].VariantsList, exprDollar[3].MetricExpr) + } + case 20: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, nil, nil) } - case 15: + case 21: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, nil, exprDollar[3].OffsetExpr) } - case 16: + case 22: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, nil, nil) } - case 17: + case 23: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, nil, exprDollar[5].OffsetExpr) } - case 18: + case 24: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, exprDollar[3].UnwrapExpr, nil) } - case 19: + case 25: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, exprDollar[4].UnwrapExpr, exprDollar[3].OffsetExpr) } - case 20: + case 26: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, exprDollar[5].UnwrapExpr, nil) } - case 21: + case 27: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, exprDollar[6].UnwrapExpr, exprDollar[5].OffsetExpr) } - case 22: + case 28: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].duration, exprDollar[2].UnwrapExpr, nil) } - case 23: + case 29: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].duration, exprDollar[2].UnwrapExpr, exprDollar[4].OffsetExpr) } - case 24: + case 30: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[5].duration, exprDollar[3].UnwrapExpr, nil) } - case 25: + case 31: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[5].duration, exprDollar[3].UnwrapExpr, exprDollar[6].OffsetExpr) } - case 26: + case 32: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[3].duration, nil, nil) } - case 27: + case 33: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[3].duration, nil, exprDollar[4].OffsetExpr) } - case 28: + case 34: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[5].duration, nil, nil) } - case 29: + case 35: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[5].duration, nil, exprDollar[6].OffsetExpr) } - case 30: + case 36: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[4].duration, exprDollar[3].UnwrapExpr, nil) } - case 31: + case 37: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[4].duration, exprDollar[3].UnwrapExpr, exprDollar[5].OffsetExpr) } - case 32: + case 38: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[6].duration, exprDollar[4].UnwrapExpr, nil) } - case 33: + case 39: exprDollar = exprS[exprpt-7 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[6].duration, exprDollar[4].UnwrapExpr, exprDollar[7].OffsetExpr) } - case 34: + case 40: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].PipelineExpr), exprDollar[2].duration, nil, nil) } - case 35: + case 41: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[4].PipelineExpr), exprDollar[2].duration, nil, exprDollar[3].OffsetExpr) } - case 36: + case 42: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].PipelineExpr), exprDollar[2].duration, exprDollar[4].UnwrapExpr, nil) } - case 37: + case 43: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[4].PipelineExpr), exprDollar[2].duration, exprDollar[5].UnwrapExpr, exprDollar[3].OffsetExpr) } - case 38: + case 44: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = exprDollar[2].LogRangeExpr } - case 40: + case 46: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.UnwrapExpr = newUnwrapExpr(exprDollar[3].str, "") } - case 41: + case 47: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.UnwrapExpr = newUnwrapExpr(exprDollar[5].str, exprDollar[3].ConvOp) } - case 42: + case 48: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.UnwrapExpr = exprDollar[1].UnwrapExpr.addPostFilter(exprDollar[3].LabelFilter) } - case 43: + case 49: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.ConvOp = OpConvBytes } - case 44: + case 50: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.ConvOp = OpConvDuration } - case 45: + case 51: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.ConvOp = OpConvDurationSeconds } - case 46: + case 52: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.RangeAggregationExpr = newRangeAggregationExpr(exprDollar[3].LogRangeExpr, exprDollar[1].RangeOp, nil, nil) } - case 47: + case 53: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.RangeAggregationExpr = newRangeAggregationExpr(exprDollar[5].LogRangeExpr, exprDollar[1].RangeOp, nil, &exprDollar[3].str) } - case 48: + case 54: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.RangeAggregationExpr = newRangeAggregationExpr(exprDollar[3].LogRangeExpr, exprDollar[1].RangeOp, exprDollar[5].Grouping, nil) } - case 49: + case 55: exprDollar = exprS[exprpt-7 : exprpt+1] { exprVAL.RangeAggregationExpr = newRangeAggregationExpr(exprDollar[5].LogRangeExpr, exprDollar[1].RangeOp, exprDollar[7].Grouping, &exprDollar[3].str) } - case 50: + case 56: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[3].MetricExpr, exprDollar[1].VectorOp, nil, nil) } - case 51: + case 57: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[4].MetricExpr, exprDollar[1].VectorOp, exprDollar[2].Grouping, nil) } - case 52: + case 58: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[3].MetricExpr, exprDollar[1].VectorOp, exprDollar[5].Grouping, nil) } - case 53: + case 59: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[5].MetricExpr, exprDollar[1].VectorOp, nil, &exprDollar[3].str) } - case 54: + case 60: exprDollar = exprS[exprpt-7 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[5].MetricExpr, exprDollar[1].VectorOp, exprDollar[7].Grouping, &exprDollar[3].str) } - case 55: + case 61: exprDollar = exprS[exprpt-7 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[6].MetricExpr, exprDollar[1].VectorOp, exprDollar[2].Grouping, &exprDollar[4].str) } - case 56: + case 62: exprDollar = exprS[exprpt-12 : exprpt+1] { exprVAL.LabelReplaceExpr = mustNewLabelReplaceExpr(exprDollar[3].MetricExpr, exprDollar[5].str, exprDollar[7].str, exprDollar[9].str, exprDollar[11].str) } - case 57: + case 63: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchRegexp } - case 58: + case 64: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchEqual } - case 59: + case 65: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchPattern } - case 60: + case 66: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchNotRegexp } - case 61: + case 67: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchNotEqual } - case 62: + case 68: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchNotPattern } - case 63: + case 69: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Selector = exprDollar[2].Matchers } - case 64: + case 70: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Selector = exprDollar[2].Matchers } - case 65: + case 71: exprDollar = exprS[exprpt-2 : exprpt+1] { } - case 66: + case 72: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Matchers = []*labels.Matcher{exprDollar[1].Matcher} } - case 67: + case 73: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matchers = append(exprDollar[1].Matchers, exprDollar[3].Matcher) } - case 68: + case 74: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matcher = mustNewMatcher(labels.MatchEqual, exprDollar[1].str, exprDollar[3].str) } - case 69: + case 75: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matcher = mustNewMatcher(labels.MatchNotEqual, exprDollar[1].str, exprDollar[3].str) } - case 70: + case 76: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matcher = mustNewMatcher(labels.MatchRegexp, exprDollar[1].str, exprDollar[3].str) } - case 71: + case 77: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matcher = mustNewMatcher(labels.MatchNotRegexp, exprDollar[1].str, exprDollar[3].str) } - case 72: + case 78: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.PipelineExpr = MultiStageExpr{exprDollar[1].PipelineStage} } - case 73: + case 79: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineExpr = append(exprDollar[1].PipelineExpr, exprDollar[2].PipelineStage) } - case 74: + case 80: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.PipelineStage = exprDollar[1].LineFilters } - case 75: + case 81: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LogfmtParser } - case 76: + case 82: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LabelParser } - case 77: + case 83: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].JSONExpressionParser } - case 78: + case 84: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LogfmtExpressionParser } - case 79: + case 85: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = &LabelFilterExpr{LabelFilterer: exprDollar[2].LabelFilter} } - case 80: + case 86: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LineFormatExpr } - case 81: + case 87: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].DecolorizeExpr } - case 82: + case 88: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LabelFormatExpr } - case 83: + case 89: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].DropLabelsExpr } - case 84: + case 90: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].KeepLabelsExpr } - case 85: + case 91: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.FilterOp = OpFilterIP } - case 86: + case 92: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.OrFilter = newLineFilterExpr(log.LineMatchEqual, "", exprDollar[1].str) } - case 87: + case 93: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.OrFilter = newLineFilterExpr(log.LineMatchEqual, exprDollar[1].FilterOp, exprDollar[3].str) } - case 88: + case 94: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.OrFilter = newOrLineFilter(newLineFilterExpr(log.LineMatchEqual, "", exprDollar[1].str), exprDollar[3].OrFilter) } - case 89: + case 95: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LineFilter = newLineFilterExpr(exprDollar[1].Filter, "", exprDollar[2].str) } - case 90: + case 96: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LineFilter = newLineFilterExpr(exprDollar[1].Filter, exprDollar[2].FilterOp, exprDollar[4].str) } - case 91: + case 97: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LineFilter = newOrLineFilter(newLineFilterExpr(exprDollar[1].Filter, "", exprDollar[2].str), exprDollar[4].OrFilter) } - case 92: + case 98: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LineFilters = exprDollar[1].LineFilter } - case 93: + case 99: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LineFilters = newOrLineFilter(exprDollar[1].LineFilter, exprDollar[3].OrFilter) } - case 94: + case 100: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LineFilters = newNestedLineFilterExpr(exprDollar[1].LineFilters, exprDollar[2].LineFilter) } - case 95: + case 101: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.ParserFlags = []string{exprDollar[1].str} } - case 96: + case 102: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.ParserFlags = append(exprDollar[1].ParserFlags, exprDollar[2].str) } - case 97: + case 103: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LogfmtParser = newLogfmtParserExpr(nil) } - case 98: + case 104: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LogfmtParser = newLogfmtParserExpr(exprDollar[2].ParserFlags) } - case 99: + case 105: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelParser = newLabelParserExpr(OpParserTypeJSON, "") } - case 100: + case 106: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LabelParser = newLabelParserExpr(OpParserTypeRegexp, exprDollar[2].str) } - case 101: + case 107: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelParser = newLabelParserExpr(OpParserTypeUnpack, "") } - case 102: + case 108: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LabelParser = newLabelParserExpr(OpParserTypePattern, exprDollar[2].str) } - case 103: + case 109: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.JSONExpressionParser = newJSONExpressionParser(exprDollar[2].LabelExtractionExpressionList) } - case 104: + case 110: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogfmtExpressionParser = newLogfmtExpressionParser(exprDollar[3].LabelExtractionExpressionList, exprDollar[2].ParserFlags) } - case 105: + case 111: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LogfmtExpressionParser = newLogfmtExpressionParser(exprDollar[2].LabelExtractionExpressionList, nil) } - case 106: + case 112: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LineFormatExpr = newLineFmtExpr(exprDollar[2].str) } - case 107: + case 113: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.DecolorizeExpr = newDecolorizeExpr() } - case 108: + case 114: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFormat = log.NewRenameLabelFmt(exprDollar[1].str, exprDollar[3].str) } - case 109: + case 115: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFormat = log.NewTemplateLabelFmt(exprDollar[1].str, exprDollar[3].str) } - case 110: + case 116: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelsFormat = []log.LabelFmt{exprDollar[1].LabelFormat} } - case 111: + case 117: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelsFormat = append(exprDollar[1].LabelsFormat, exprDollar[3].LabelFormat) } - case 113: + case 119: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LabelFormatExpr = newLabelFmtExpr(exprDollar[2].LabelsFormat) } - case 114: + case 120: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelFilter = log.NewStringLabelFilter(exprDollar[1].Matcher) } - case 115: + case 121: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelFilter = exprDollar[1].IPLabelFilter } - case 116: + case 122: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelFilter = exprDollar[1].UnitFilter } - case 117: + case 123: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelFilter = exprDollar[1].NumberFilter } - case 118: + case 124: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFilter = exprDollar[2].LabelFilter } - case 119: + case 125: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LabelFilter = log.NewAndLabelFilter(exprDollar[1].LabelFilter, exprDollar[2].LabelFilter) } - case 120: + case 126: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFilter = log.NewAndLabelFilter(exprDollar[1].LabelFilter, exprDollar[3].LabelFilter) } - case 121: + case 127: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFilter = log.NewAndLabelFilter(exprDollar[1].LabelFilter, exprDollar[3].LabelFilter) } - case 122: + case 128: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFilter = log.NewOrLabelFilter(exprDollar[1].LabelFilter, exprDollar[3].LabelFilter) } - case 123: + case 129: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelExtractionExpression = log.NewLabelExtractionExpr(exprDollar[1].str, exprDollar[3].str) } - case 124: + case 130: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelExtractionExpression = log.NewLabelExtractionExpr(exprDollar[1].str, exprDollar[1].str) } - case 125: + case 131: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelExtractionExpressionList = []log.LabelExtractionExpr{exprDollar[1].LabelExtractionExpression} } - case 126: + case 132: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelExtractionExpressionList = append(exprDollar[1].LabelExtractionExpressionList, exprDollar[3].LabelExtractionExpression) } - case 127: + case 133: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.IPLabelFilter = log.NewIPLabelFilter(exprDollar[5].str, exprDollar[1].str, log.LabelFilterEqual) } - case 128: + case 134: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.IPLabelFilter = log.NewIPLabelFilter(exprDollar[5].str, exprDollar[1].str, log.LabelFilterNotEqual) } - case 129: + case 135: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.UnitFilter = exprDollar[1].DurationFilter } - case 130: + case 136: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.UnitFilter = exprDollar[1].BytesFilter } - case 131: + case 137: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterGreaterThan, exprDollar[1].str, exprDollar[3].duration) } - case 132: + case 138: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterGreaterThanOrEqual, exprDollar[1].str, exprDollar[3].duration) } - case 133: + case 139: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterLesserThan, exprDollar[1].str, exprDollar[3].duration) } - case 134: + case 140: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterLesserThanOrEqual, exprDollar[1].str, exprDollar[3].duration) } - case 135: + case 141: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterNotEqual, exprDollar[1].str, exprDollar[3].duration) } - case 136: + case 142: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].duration) } - case 137: + case 143: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].duration) } - case 138: + case 144: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterGreaterThan, exprDollar[1].str, exprDollar[3].bytes) } - case 139: + case 145: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterGreaterThanOrEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 140: + case 146: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterLesserThan, exprDollar[1].str, exprDollar[3].bytes) } - case 141: + case 147: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterLesserThanOrEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 142: + case 148: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterNotEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 143: + case 149: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 144: + case 150: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 145: + case 151: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterGreaterThan, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 146: + case 152: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterGreaterThanOrEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 147: + case 153: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterLesserThan, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 148: + case 154: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterLesserThanOrEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 149: + case 155: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterNotEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 150: + case 156: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 151: + case 157: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 152: + case 158: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.DropLabel = log.NewDropLabel(nil, exprDollar[1].str) } - case 153: + case 159: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.DropLabel = log.NewDropLabel(exprDollar[1].Matcher, "") } - case 154: + case 160: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.DropLabels = []log.DropLabel{exprDollar[1].DropLabel} } - case 155: + case 161: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DropLabels = append(exprDollar[1].DropLabels, exprDollar[3].DropLabel) } - case 156: + case 162: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.DropLabelsExpr = newDropLabelsExpr(exprDollar[2].DropLabels) } - case 157: + case 163: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.KeepLabel = log.NewKeepLabel(nil, exprDollar[1].str) } - case 158: + case 164: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.KeepLabel = log.NewKeepLabel(exprDollar[1].Matcher, "") } - case 159: + case 165: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.KeepLabels = []log.KeepLabel{exprDollar[1].KeepLabel} } - case 160: + case 166: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.KeepLabels = append(exprDollar[1].KeepLabels, exprDollar[3].KeepLabel) } - case 161: + case 167: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.KeepLabelsExpr = newKeepLabelsExpr(exprDollar[2].KeepLabels) } - case 162: + case 168: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("or", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 163: + case 169: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("and", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 164: + case 170: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("unless", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 165: + case 171: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("+", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 166: + case 172: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("-", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 167: + case 173: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("*", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 168: + case 174: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("/", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 169: + case 175: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("%", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 170: + case 176: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("^", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 171: + case 177: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("==", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 172: + case 178: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("!=", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 173: + case 179: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr(">", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 174: + case 180: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr(">=", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 175: + case 181: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("<", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 176: + case 182: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("<=", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 177: + case 183: exprDollar = exprS[exprpt-0 : exprpt+1] { exprVAL.BoolModifier = &BinOpOptions{VectorMatching: &VectorMatching{Card: CardOneToOne}} } - case 178: + case 184: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.BoolModifier = &BinOpOptions{VectorMatching: &VectorMatching{Card: CardOneToOne}, ReturnBool: true} } - case 179: + case 185: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.OnOrIgnoringModifier = exprDollar[1].BoolModifier exprVAL.OnOrIgnoringModifier.VectorMatching.On = true exprVAL.OnOrIgnoringModifier.VectorMatching.MatchingLabels = exprDollar[4].Labels } - case 180: + case 186: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.OnOrIgnoringModifier = exprDollar[1].BoolModifier exprVAL.OnOrIgnoringModifier.VectorMatching.On = true } - case 181: + case 187: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.OnOrIgnoringModifier = exprDollar[1].BoolModifier exprVAL.OnOrIgnoringModifier.VectorMatching.MatchingLabels = exprDollar[4].Labels } - case 182: + case 188: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.OnOrIgnoringModifier = exprDollar[1].BoolModifier } - case 183: + case 189: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].BoolModifier } - case 184: + case 190: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier } - case 185: + case 191: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardManyToOne } - case 186: + case 192: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardManyToOne } - case 187: + case 193: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardManyToOne exprVAL.BinOpModifier.VectorMatching.Include = exprDollar[4].Labels } - case 188: + case 194: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardOneToMany } - case 189: + case 195: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardOneToMany } - case 190: + case 196: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardOneToMany exprVAL.BinOpModifier.VectorMatching.Include = exprDollar[4].Labels } - case 191: + case 197: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LiteralExpr = mustNewLiteralExpr(exprDollar[1].str, false) } - case 192: + case 198: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LiteralExpr = mustNewLiteralExpr(exprDollar[2].str, false) } - case 193: + case 199: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LiteralExpr = mustNewLiteralExpr(exprDollar[2].str, true) } - case 194: + case 200: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.VectorExpr = NewVectorExpr(exprDollar[3].str) } - case 195: + case 201: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Vector = OpTypeVector } - case 196: + case 202: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeSum } - case 197: + case 203: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeAvg } - case 198: + case 204: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeCount } - case 199: + case 205: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeMax } - case 200: + case 206: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeMin } - case 201: + case 207: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeStddev } - case 202: + case 208: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeStdvar } - case 203: + case 209: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeBottomK } - case 204: + case 210: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeTopK } - case 205: + case 211: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeSort } - case 206: + case 212: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeSortDesc } - case 207: + case 213: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeApproxTopK } - case 208: + case 214: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeCount } - case 209: + case 215: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeRate } - case 210: + case 216: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeRateCounter } - case 211: + case 217: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeBytes } - case 212: + case 218: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeBytesRate } - case 213: + case 219: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeAvg } - case 214: + case 220: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeSum } - case 215: + case 221: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeMin } - case 216: + case 222: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeMax } - case 217: + case 223: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeStdvar } - case 218: + case 224: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeStddev } - case 219: + case 225: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeQuantile } - case 220: + case 226: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeFirst } - case 221: + case 227: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeLast } - case 222: + case 228: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeAbsent } - case 223: + case 229: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.OffsetExpr = newOffsetExpr(exprDollar[2].duration) } - case 224: + case 230: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Labels = []string{exprDollar[1].str} } - case 225: + case 231: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Labels = append(exprDollar[1].Labels, exprDollar[3].str) } - case 226: + case 232: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.Grouping = &Grouping{Without: false, Groups: exprDollar[3].Labels} } - case 227: + case 233: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.Grouping = &Grouping{Without: true, Groups: exprDollar[3].Labels} } - case 228: + case 234: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Grouping = &Grouping{Without: false, Groups: nil} } - case 229: + case 235: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Grouping = &Grouping{Without: true, Groups: nil} diff --git a/pkg/logql/syntax/lex.go b/pkg/logql/syntax/lex.go index 4175682efa5cf..5d6a5737dc748 100644 --- a/pkg/logql/syntax/lex.go +++ b/pkg/logql/syntax/lex.go @@ -80,6 +80,10 @@ var tokens = map[string]int{ // keep labels OpKeep: KEEP, + + // variants + OpVariants: VARIANTS, + VariantsOf: OF, } var parserFlags = map[string]struct{}{ diff --git a/pkg/logql/syntax/lex_test.go b/pkg/logql/syntax/lex_test.go index 08878186bd89b..e0c3bfaddae71 100644 --- a/pkg/logql/syntax/lex_test.go +++ b/pkg/logql/syntax/lex_test.go @@ -130,6 +130,49 @@ func TestLex(t *testing.T) { } } +func TestLex_Variatns(t *testing.T) { + for _, tc := range []struct { + input string + expected []int + }{ + // {`count_over_time({foo="bar"}[5m])`, []int{COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS}}, + { + `variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"})`, + []int{VARIANTS, OPEN_PARENTHESIS, COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, OF, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, CLOSE_PARENTHESIS}, + }, + { + `variants(bytes_over_time({foo="bar"}[5m]), count_over_time({foo="bar"}[5m])) of ({foo="bar"})`, + []int{VARIANTS, OPEN_PARENTHESIS, BYTES_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, COMMA, + COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, OF, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, CLOSE_PARENTHESIS}, + }, + { + `variants(count_over_time({foo="bar"}[5m]), rate({foo="bar"}[5m])) of ({foo="bar"} | logfmt | number="42")`, + []int{VARIANTS, OPEN_PARENTHESIS, COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, COMMA, + RATE, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, OF, + OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, PIPE, LOGFMT, PIPE, IDENTIFIER, EQ, STRING, CLOSE_PARENTHESIS}, + }, + } { + t.Run(tc.input, func(t *testing.T) { + actual := []int{} + l := lexer{ + Scanner: Scanner{ + Mode: scanner.SkipComments | scanner.ScanStrings, + }, + } + l.Init(strings.NewReader(tc.input)) + var lval exprSymType + for { + tok := l.Lex(&lval) + if tok == 0 { + break + } + actual = append(actual, tok) + } + require.Equal(t, tc.expected, actual) + }) + } +} + func Test_isFunction(t *testing.T) { tests := []struct { next string diff --git a/pkg/logql/syntax/parser.go b/pkg/logql/syntax/parser.go index 524c86109afb4..cfafd3bc9c28b 100644 --- a/pkg/logql/syntax/parser.go +++ b/pkg/logql/syntax/parser.go @@ -119,11 +119,29 @@ func validateExpr(expr Expr) error { return validateSampleExpr(e) case LogSelectorExpr: return validateLogSelectorExpression(e) + case VariantsExpr: + return validateVariantsExpr(e) default: return logqlmodel.NewParseError(fmt.Sprintf("unexpected expression type: %v", e), 0, 0) } } +func validateVariantsExpr(e VariantsExpr) error { + err := validateLogSelectorExpression(e.LogSelector()) + if err != nil { + return err + } + + for _, variant := range e.Variants() { + err = validateSampleExpr(variant) + if err != nil { + return err + } + } + + return nil +} + // validateMatchers checks whether a query would touch all the streams in the query range or uses at least one matcher to select specific streams. func validateMatchers(matchers []*labels.Matcher) error { _, matchers = util.SplitFiltersAndMatchers(matchers) diff --git a/pkg/logql/syntax/test_utils.go b/pkg/logql/syntax/test_utils.go index 2083cec0ac43b..4aff08dbbd343 100644 --- a/pkg/logql/syntax/test_utils.go +++ b/pkg/logql/syntax/test_utils.go @@ -12,7 +12,7 @@ import ( // AssertExpressions function removes FastRegexMatchers from all Regexp matchers to allow simple objects comparison. // See removeFastRegexMatcherFromExpr function for the details. func AssertExpressions(t *testing.T, expected, actual Expr) { - require.Equal(t, removeFastRegexMatcherFromExpr(expected), removeFastRegexMatcherFromExpr(actual)) + require.Equal(t, removeFastRegexMatcherFromExpr(expected), removeFastRegexMatcherFromExpr(actual), "%s\n!=\n%s", expected, actual) } // AssertMatchers function removes FastRegexMatchers from all Regexp matchers to allow simple objects comparison. @@ -53,6 +53,11 @@ func removeFastRegexMatcherFromExpr(expr Expr) Expr { cleaned = append(cleaned, removeFastRegexMatcherFromLabelFilterer(filter)) } typed.Unwrap.PostFilters = cleaned + case *MultiVariantExpr: + typed.logSelector = removeFastRegexMatcherFromExpr(typed.logSelector).(LogSelectorExpr) + for i, variant := range typed.variants { + typed.variants[i] = removeFastRegexMatcherFromExpr(variant).(SampleExpr) + } default: return } From 133b76d533f71d47dd1ed11b42cd742237c21bfa Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Wed, 23 Oct 2024 16:57:07 -0600 Subject: [PATCH 2/7] wip: plumbed multi-variant queriers down to querier --- pkg/ingester/ingester.go | 5 + pkg/iter/iterator.go | 5 +- pkg/logcli/client/file.go | 4 + pkg/logproto/logproto.pb.go | 2060 ++++++++++++++++++---- pkg/logproto/logproto.proto | 43 + pkg/logql/downstream.go | 8 + pkg/logql/engine.go | 66 +- pkg/logql/engine_test.go | 28 +- pkg/logql/evaluator.go | 98 + pkg/logql/syntax/ast.go | 54 +- pkg/logql/syntax/ast_test.go | 6 +- pkg/logql/syntax/clone.go | 4 + pkg/logql/syntax/expr.y | 49 +- pkg/logql/syntax/expr.y.go | 960 +++++----- pkg/logql/syntax/parser.go | 2 +- pkg/logql/syntax/serialize.go | 70 + pkg/logql/syntax/serialize_test.go | 85 + pkg/logql/syntax/test_utils.go | 2 +- pkg/logql/syntax/visit.go | 9 + pkg/logql/test_utils.go | 4 + pkg/querier-rf1/querier.go | 935 ++++++++++ pkg/querier-rf1/wal/querier.go | 205 +++ pkg/querier/plan/plan_test.go | 19 + pkg/querier/querier.go | 4 + pkg/querier/querier_mock_test.go | 4 + pkg/querier/queryrange/roundtrip.go | 130 +- pkg/querier/queryrange/roundtrip_test.go | 1 + pkg/ruler/compat_test.go | 4 + pkg/storage/store.go | 4 + 29 files changed, 4084 insertions(+), 784 deletions(-) create mode 100644 pkg/querier-rf1/querier.go create mode 100644 pkg/querier-rf1/wal/querier.go diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index 17089efbbf63b..dfdb3ac043b26 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -1651,3 +1651,8 @@ func (i *Ingester) getDetectedLabels(ctx context.Context, req *logproto.Detected } return &logproto.LabelToValuesResponse{Labels: result}, nil } + +// QuerySample the ingesters for series from logs matching a set of matchers. +func (i *Ingester) QueryVariants(req *logproto.VariantsQueryRequest, queryServer logproto.Querier_QueryVariantsServer) error { + panic("TODO(twhitney): QueryVariants not implemented on Ingester") +} diff --git a/pkg/iter/iterator.go b/pkg/iter/iterator.go index 970acaa30a925..9ff3a91bc4647 100644 --- a/pkg/iter/iterator.go +++ b/pkg/iter/iterator.go @@ -8,7 +8,7 @@ import ( ) type logprotoType interface { - logproto.Entry | logproto.Sample + logproto.Entry | logproto.Sample | logproto.Variants } type StreamIterator[T logprotoType] interface { @@ -22,6 +22,7 @@ type StreamIterator[T logprotoType] interface { type EntryIterator StreamIterator[logproto.Entry] type SampleIterator StreamIterator[logproto.Sample] +type VariantsIterator StreamIterator[logproto.Variants] // noOpIterator implements StreamIterator type noOpIterator[T logprotoType] struct{} @@ -35,6 +36,7 @@ func (noOpIterator[T]) Close() error { return nil } var NoopEntryIterator = noOpIterator[logproto.Entry]{} var NoopSampleIterator = noOpIterator[logproto.Sample]{} +var NoopVariantsIterator = noOpIterator[logproto.Variants]{} // errorIterator implements StreamIterator type errorIterator[T logprotoType] struct{} @@ -48,3 +50,4 @@ func (errorIterator[T]) Close() error { return errors.New("close") } var ErrorEntryIterator = errorIterator[logproto.Entry]{} var ErrorSampleIterator = errorIterator[logproto.Sample]{} +var ErrorVariantsIterator = errorIterator[logproto.Variants]{} diff --git a/pkg/logcli/client/file.go b/pkg/logcli/client/file.go index b1b97fd57b08a..7e3f6db0c764e 100644 --- a/pkg/logcli/client/file.go +++ b/pkg/logcli/client/file.go @@ -246,6 +246,10 @@ type querier struct { labels labels.Labels } +func (q *querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on logcli client.Querier") // TODO: Implement +} + func (q *querier) SelectLogs(_ context.Context, params logql.SelectLogParams) (iter.EntryIterator, error) { expr, err := params.LogSelector() if err != nil { diff --git a/pkg/logproto/logproto.pb.go b/pkg/logproto/logproto.pb.go index 011d0b28f6c01..7fe00455e2535 100644 --- a/pkg/logproto/logproto.pb.go +++ b/pkg/logproto/logproto.pb.go @@ -3099,6 +3099,212 @@ func (m *DetectedLabel) GetSketch() []byte { return nil } +type VariantsQueryRequest struct { + Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` + Variants []string `protobuf:"bytes,2,rep,name=variants,proto3" json:"variants,omitempty"` + Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` + Start time.Time `protobuf:"bytes,4,opt,name=start,proto3,stdtime" json:"start"` + End time.Time `protobuf:"bytes,5,opt,name=end,proto3,stdtime" json:"end"` + Direction Direction `protobuf:"varint,6,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` + Shards []string `protobuf:"bytes,7,rep,name=shards,proto3" json:"shards,omitempty"` + Deletes []*Delete `protobuf:"bytes,8,rep,name=deletes,proto3" json:"deletes,omitempty"` + Plan *github_com_grafana_loki_v3_pkg_querier_plan.QueryPlan `protobuf:"bytes,9,opt,name=plan,proto3,customtype=github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan" json:"plan,omitempty"` + // If populated, these represent the chunk references that the querier should + // use to fetch the data, plus any other chunks reported by ingesters. + StoreChunks *ChunkRefGroup `protobuf:"bytes,10,opt,name=storeChunks,proto3" json:"storeChunks"` +} + +func (m *VariantsQueryRequest) Reset() { *m = VariantsQueryRequest{} } +func (*VariantsQueryRequest) ProtoMessage() {} +func (*VariantsQueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c28a5f14f1f4c79a, []int{54} +} +func (m *VariantsQueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VariantsQueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VariantsQueryRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VariantsQueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_VariantsQueryRequest.Merge(m, src) +} +func (m *VariantsQueryRequest) XXX_Size() int { + return m.Size() +} +func (m *VariantsQueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_VariantsQueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_VariantsQueryRequest proto.InternalMessageInfo + +func (m *VariantsQueryRequest) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *VariantsQueryRequest) GetVariants() []string { + if m != nil { + return m.Variants + } + return nil +} + +func (m *VariantsQueryRequest) GetLimit() uint32 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *VariantsQueryRequest) GetStart() time.Time { + if m != nil { + return m.Start + } + return time.Time{} +} + +func (m *VariantsQueryRequest) GetEnd() time.Time { + if m != nil { + return m.End + } + return time.Time{} +} + +func (m *VariantsQueryRequest) GetDirection() Direction { + if m != nil { + return m.Direction + } + return FORWARD +} + +func (m *VariantsQueryRequest) GetShards() []string { + if m != nil { + return m.Shards + } + return nil +} + +func (m *VariantsQueryRequest) GetDeletes() []*Delete { + if m != nil { + return m.Deletes + } + return nil +} + +func (m *VariantsQueryRequest) GetStoreChunks() *ChunkRefGroup { + if m != nil { + return m.StoreChunks + } + return nil +} + +type VariantsQueryResponse struct { + Variants []*Variants `protobuf:"bytes,1,rep,name=variants,proto3" json:"variants,omitempty"` + Stats stats.Ingester `protobuf:"bytes,3,opt,name=stats,proto3" json:"stats"` + Warnings []string `protobuf:"bytes,4,rep,name=warnings,proto3" json:"warnings,omitempty"` +} + +func (m *VariantsQueryResponse) Reset() { *m = VariantsQueryResponse{} } +func (*VariantsQueryResponse) ProtoMessage() {} +func (*VariantsQueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c28a5f14f1f4c79a, []int{55} +} +func (m *VariantsQueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VariantsQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VariantsQueryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VariantsQueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_VariantsQueryResponse.Merge(m, src) +} +func (m *VariantsQueryResponse) XXX_Size() int { + return m.Size() +} +func (m *VariantsQueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_VariantsQueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_VariantsQueryResponse proto.InternalMessageInfo + +func (m *VariantsQueryResponse) GetVariants() []*Variants { + if m != nil { + return m.Variants + } + return nil +} + +func (m *VariantsQueryResponse) GetStats() stats.Ingester { + if m != nil { + return m.Stats + } + return stats.Ingester{} +} + +func (m *VariantsQueryResponse) GetWarnings() []string { + if m != nil { + return m.Warnings + } + return nil +} + +type Variants struct { + Streams []github_com_grafana_loki_pkg_push.Stream `protobuf:"bytes,1,rep,name=streams,proto3,customtype=github.com/grafana/loki/pkg/push.Stream" json:"streams,omitempty"` + Series []Series `protobuf:"bytes,2,rep,name=series,proto3,customtype=Series" json:"series,omitempty"` +} + +func (m *Variants) Reset() { *m = Variants{} } +func (*Variants) ProtoMessage() {} +func (*Variants) Descriptor() ([]byte, []int) { + return fileDescriptor_c28a5f14f1f4c79a, []int{56} +} +func (m *Variants) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Variants) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Variants.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Variants) XXX_Merge(src proto.Message) { + xxx_messageInfo_Variants.Merge(m, src) +} +func (m *Variants) XXX_Size() int { + return m.Size() +} +func (m *Variants) XXX_DiscardUnknown() { + xxx_messageInfo_Variants.DiscardUnknown(m) +} + +var xxx_messageInfo_Variants proto.InternalMessageInfo + func init() { proto.RegisterEnum("logproto.Direction", Direction_name, Direction_value) proto.RegisterType((*LabelToValuesResponse)(nil), "logproto.LabelToValuesResponse") @@ -3157,186 +3363,196 @@ func init() { proto.RegisterType((*DetectedLabelsRequest)(nil), "logproto.DetectedLabelsRequest") proto.RegisterType((*DetectedLabelsResponse)(nil), "logproto.DetectedLabelsResponse") proto.RegisterType((*DetectedLabel)(nil), "logproto.DetectedLabel") + proto.RegisterType((*VariantsQueryRequest)(nil), "logproto.VariantsQueryRequest") + proto.RegisterType((*VariantsQueryResponse)(nil), "logproto.VariantsQueryResponse") + proto.RegisterType((*Variants)(nil), "logproto.Variants") } func init() { proto.RegisterFile("pkg/logproto/logproto.proto", fileDescriptor_c28a5f14f1f4c79a) } var fileDescriptor_c28a5f14f1f4c79a = []byte{ - // 2774 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x3a, 0xcd, 0x6f, 0x1b, 0xc7, - 0xf5, 0x5c, 0x7e, 0xf3, 0x91, 0x92, 0xe5, 0x11, 0x6d, 0x13, 0xb2, 0xc3, 0x55, 0x06, 0xbf, 0x5f, - 0xa2, 0xc4, 0x8e, 0x68, 0x3b, 0x4d, 0x9a, 0x38, 0x4d, 0x53, 0x53, 0x8a, 0x1d, 0x3b, 0x8a, 0xed, - 0x8c, 0x1c, 0x27, 0x2d, 0x1a, 0x04, 0x6b, 0x72, 0x44, 0x2e, 0x4c, 0xee, 0xd2, 0xbb, 0xc3, 0x38, - 0xbc, 0xf5, 0x1f, 0x28, 0x1a, 0xa0, 0x28, 0xda, 0x5e, 0x0a, 0x14, 0x28, 0xd0, 0xa2, 0x40, 0x2e, - 0x45, 0x0f, 0x3d, 0x14, 0xed, 0xa5, 0x40, 0xd3, 0x5b, 0x8e, 0x41, 0x0e, 0x6c, 0xa3, 0x5c, 0x0a, - 0x01, 0x05, 0x72, 0x6a, 0x81, 0x9c, 0x8a, 0xf9, 0xda, 0x9d, 0x5d, 0x51, 0x55, 0xe8, 0xba, 0x48, - 0x72, 0x21, 0x67, 0xde, 0xbc, 0x79, 0x33, 0xef, 0x63, 0xde, 0x17, 0x09, 0x27, 0x47, 0x77, 0x7a, - 0xad, 0x81, 0xdf, 0x1b, 0x05, 0x3e, 0xf3, 0xa3, 0xc1, 0xba, 0xf8, 0x44, 0x65, 0x3d, 0x5f, 0xa9, - 0xf7, 0xfc, 0x9e, 0x2f, 0x71, 0xf8, 0x48, 0xae, 0xaf, 0xd8, 0x3d, 0xdf, 0xef, 0x0d, 0x68, 0x4b, - 0xcc, 0x6e, 0x8f, 0x77, 0x5a, 0xcc, 0x1d, 0xd2, 0x90, 0x39, 0xc3, 0x91, 0x42, 0x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, 0x0c, 0xbf, 0x02, 0xcb, 0x09, 0xa8, 0x62, 0xfb, 0x69, 0xa8, 0x86, - 0x31, 0x58, 0xf1, 0x5e, 0x8f, 0xaf, 0x15, 0xef, 0x21, 0x26, 0x22, 0xfe, 0x99, 0x05, 0x10, 0xaf, - 0xa1, 0x26, 0x80, 0x5c, 0x7d, 0xc9, 0x09, 0xfb, 0x82, 0xe1, 0x3c, 0x31, 0x20, 0xe8, 0x0c, 0x1c, - 0x8d, 0x67, 0xd7, 0xfc, 0xed, 0xbe, 0x13, 0x74, 0x85, 0x0c, 0xf2, 0x64, 0xff, 0x02, 0x42, 0x90, - 0x0f, 0x1c, 0x46, 0x1b, 0xb9, 0x55, 0x6b, 0x2d, 0x47, 0xc4, 0x98, 0x73, 0xcb, 0xa8, 0xe7, 0x78, - 0xac, 0x91, 0x17, 0xe2, 0x54, 0x33, 0x0e, 0xe7, 0x16, 0x41, 0xc3, 0x46, 0x61, 0xd5, 0x5a, 0x5b, - 0x20, 0x6a, 0x86, 0xff, 0x99, 0x83, 0xda, 0xab, 0x63, 0x1a, 0x4c, 0x94, 0x00, 0x50, 0x13, 0xca, - 0x21, 0x1d, 0xd0, 0x0e, 0xf3, 0x03, 0xa9, 0x91, 0x76, 0xb6, 0x61, 0x91, 0x08, 0x86, 0xea, 0x50, - 0x18, 0xb8, 0x43, 0x97, 0x89, 0x6b, 0x2d, 0x10, 0x39, 0x41, 0x17, 0xa0, 0x10, 0x32, 0x27, 0x60, - 0xe2, 0x2e, 0xd5, 0xf3, 0x2b, 0xeb, 0xd2, 0x94, 0xd7, 0xb5, 0x29, 0xaf, 0xdf, 0xd4, 0xa6, 0xdc, - 0x2e, 0xbf, 0x3f, 0xb5, 0x33, 0xef, 0xfe, 0xd5, 0xb6, 0x88, 0xdc, 0x82, 0x9e, 0x86, 0x1c, 0xf5, - 0xba, 0xe2, 0xbe, 0x9f, 0x77, 0x27, 0xdf, 0x80, 0xce, 0x41, 0xa5, 0xeb, 0x06, 0x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0xd6, 0xdf, 0x77, 0x9b, 0x99, 0x4f, 0x77, 0x9b, 0xd6, - 0xbb, 0x9f, 0x34, 0x33, 0x1f, 0x7c, 0xd2, 0xcc, 0x7c, 0xf8, 0x49, 0x33, 0xf3, 0x9d, 0x47, 0x0f, - 0x2f, 0xc5, 0xa5, 0x5b, 0x2c, 0x8a, 0xaf, 0x27, 0xff, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xc9, - 0x6a, 0x9e, 0x47, 0x24, 0x00, 0x00, + // 2891 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x1a, 0x4b, 0x6f, 0x1b, 0xc7, + 0x99, 0x4b, 0x2e, 0x5f, 0x1f, 0x29, 0x59, 0x1e, 0xd1, 0x36, 0x21, 0x3b, 0x5c, 0x65, 0xd1, 0x26, + 0x4e, 0xec, 0x88, 0xb6, 0xf3, 0x68, 0xe2, 0x34, 0x4d, 0x4d, 0x29, 0x76, 0xec, 0x28, 0xb6, 0x33, + 0x52, 0x9c, 0xb4, 0x68, 0x10, 0xac, 0xc9, 0x11, 0xb5, 0x30, 0xb9, 0x4b, 0xef, 0x0e, 0xed, 0xf0, + 0x96, 0x3f, 0x50, 0x34, 0x40, 0xd1, 0xd7, 0xa5, 0x40, 0x81, 0x02, 0xcd, 0x25, 0x97, 0xa2, 0x87, + 0x1e, 0x8a, 0xf6, 0x52, 0xa0, 0xe9, 0x2d, 0xc7, 0x20, 0x07, 0xb6, 0x51, 0x2e, 0x85, 0x80, 0x02, + 0x39, 0xb5, 0x40, 0x4e, 0xc5, 0xbc, 0x76, 0x67, 0x97, 0x64, 0x6c, 0x3a, 0x6e, 0x93, 0x00, 0xbd, + 0x48, 0x3b, 0xdf, 0x7c, 0xf3, 0xcd, 0x7c, 0x8f, 0xf9, 0x5e, 0x43, 0x38, 0x3a, 0xb8, 0xd1, 0x6d, + 0xf6, 0xfc, 0xee, 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0x26, 0x02, 0x60, 0x81, 0xff, 0x7b, 0xfc, 0x3f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x7f, 0x5f, 0x5f, 0x35, 0xf4, 0x27, 0x00, 0x00, } func (x Direction) String() string { @@ -5153,102 +5369,249 @@ func (this *DetectedLabel) Equal(that interface{}) bool { } return true } -func (this *LabelToValuesResponse) GoString() string { - if this == nil { - return "nil" +func (this *VariantsQueryRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 5) - s = append(s, "&logproto.LabelToValuesResponse{") - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) + + that1, ok := that.(*VariantsQueryRequest) + if !ok { + that2, ok := that.(VariantsQueryRequest) + if ok { + that1 = &that2 + } else { + return false + } } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]*UniqueLabelValues{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%#v: %#v,", k, this.Labels[k]) + if that1 == nil { + return this == nil + } else if this == nil { + return false } - mapStringForLabels += "}" - if this.Labels != nil { - s = append(s, "Labels: "+mapStringForLabels+",\n") + if this.Selector != that1.Selector { + return false } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UniqueLabelValues) GoString() string { - if this == nil { - return "nil" + if len(this.Variants) != len(that1.Variants) { + return false } - s := make([]string, 0, 5) - s = append(s, "&logproto.UniqueLabelValues{") - s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StreamRatesRequest) GoString() string { - if this == nil { - return "nil" + for i := range this.Variants { + if this.Variants[i] != that1.Variants[i] { + return false + } } - s := make([]string, 0, 4) - s = append(s, "&logproto.StreamRatesRequest{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StreamRatesResponse) GoString() string { - if this == nil { - return "nil" + if this.Limit != that1.Limit { + return false } - s := make([]string, 0, 5) - s = append(s, "&logproto.StreamRatesResponse{") - if this.StreamRates != nil { - s = append(s, "StreamRates: "+fmt.Sprintf("%#v", this.StreamRates)+",\n") + if !this.Start.Equal(that1.Start) { + return false } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StreamRate) GoString() string { - if this == nil { - return "nil" + if !this.End.Equal(that1.End) { + return false } - s := make([]string, 0, 9) - s = append(s, "&logproto.StreamRate{") - s = append(s, "StreamHash: "+fmt.Sprintf("%#v", this.StreamHash)+",\n") - s = append(s, "StreamHashNoShard: "+fmt.Sprintf("%#v", this.StreamHashNoShard)+",\n") - s = append(s, "Rate: "+fmt.Sprintf("%#v", this.Rate)+",\n") - s = append(s, "Tenant: "+fmt.Sprintf("%#v", this.Tenant)+",\n") - s = append(s, "Pushes: "+fmt.Sprintf("%#v", this.Pushes)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *QueryRequest) GoString() string { - if this == nil { - return "nil" + if this.Direction != that1.Direction { + return false } - s := make([]string, 0, 13) - s = append(s, "&logproto.QueryRequest{") - s = append(s, "Selector: "+fmt.Sprintf("%#v", this.Selector)+",\n") - s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") - s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") - s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") - s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") - s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") - if this.Deletes != nil { - s = append(s, "Deletes: "+fmt.Sprintf("%#v", this.Deletes)+",\n") + if len(this.Shards) != len(that1.Shards) { + return false } - s = append(s, "Plan: "+fmt.Sprintf("%#v", this.Plan)+",\n") - if this.StoreChunks != nil { - s = append(s, "StoreChunks: "+fmt.Sprintf("%#v", this.StoreChunks)+",\n") + for i := range this.Shards { + if this.Shards[i] != that1.Shards[i] { + return false + } } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SampleQueryRequest) GoString() string { - if this == nil { - return "nil" + if len(this.Deletes) != len(that1.Deletes) { + return false } - s := make([]string, 0, 11) - s = append(s, "&logproto.SampleQueryRequest{") - s = append(s, "Selector: "+fmt.Sprintf("%#v", this.Selector)+",\n") + for i := range this.Deletes { + if !this.Deletes[i].Equal(that1.Deletes[i]) { + return false + } + } + if that1.Plan == nil { + if this.Plan != nil { + return false + } + } else if !this.Plan.Equal(*that1.Plan) { + return false + } + if !this.StoreChunks.Equal(that1.StoreChunks) { + return false + } + return true +} +func (this *VariantsQueryResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*VariantsQueryResponse) + if !ok { + that2, ok := that.(VariantsQueryResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Variants) != len(that1.Variants) { + return false + } + for i := range this.Variants { + if !this.Variants[i].Equal(that1.Variants[i]) { + return false + } + } + if !this.Stats.Equal(&that1.Stats) { + return false + } + if len(this.Warnings) != len(that1.Warnings) { + return false + } + for i := range this.Warnings { + if this.Warnings[i] != that1.Warnings[i] { + return false + } + } + return true +} +func (this *Variants) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Variants) + if !ok { + that2, ok := that.(Variants) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Streams) != len(that1.Streams) { + return false + } + for i := range this.Streams { + if !this.Streams[i].Equal(that1.Streams[i]) { + return false + } + } + if len(this.Series) != len(that1.Series) { + return false + } + for i := range this.Series { + if !this.Series[i].Equal(that1.Series[i]) { + return false + } + } + return true +} +func (this *LabelToValuesResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&logproto.LabelToValuesResponse{") + keysForLabels := make([]string, 0, len(this.Labels)) + for k, _ := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]*UniqueLabelValues{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%#v: %#v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + if this.Labels != nil { + s = append(s, "Labels: "+mapStringForLabels+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *UniqueLabelValues) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&logproto.UniqueLabelValues{") + s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *StreamRatesRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&logproto.StreamRatesRequest{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *StreamRatesResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&logproto.StreamRatesResponse{") + if this.StreamRates != nil { + s = append(s, "StreamRates: "+fmt.Sprintf("%#v", this.StreamRates)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *StreamRate) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&logproto.StreamRate{") + s = append(s, "StreamHash: "+fmt.Sprintf("%#v", this.StreamHash)+",\n") + s = append(s, "StreamHashNoShard: "+fmt.Sprintf("%#v", this.StreamHashNoShard)+",\n") + s = append(s, "Rate: "+fmt.Sprintf("%#v", this.Rate)+",\n") + s = append(s, "Tenant: "+fmt.Sprintf("%#v", this.Tenant)+",\n") + s = append(s, "Pushes: "+fmt.Sprintf("%#v", this.Pushes)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QueryRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 13) + s = append(s, "&logproto.QueryRequest{") + s = append(s, "Selector: "+fmt.Sprintf("%#v", this.Selector)+",\n") + s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") + s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") + s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") + s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") + s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") + if this.Deletes != nil { + s = append(s, "Deletes: "+fmt.Sprintf("%#v", this.Deletes)+",\n") + } + s = append(s, "Plan: "+fmt.Sprintf("%#v", this.Plan)+",\n") + if this.StoreChunks != nil { + s = append(s, "StoreChunks: "+fmt.Sprintf("%#v", this.StoreChunks)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *SampleQueryRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 11) + s = append(s, "&logproto.SampleQueryRequest{") + s = append(s, "Selector: "+fmt.Sprintf("%#v", this.Selector)+",\n") s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") @@ -5870,6 +6233,54 @@ func (this *DetectedLabel) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func (this *VariantsQueryRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 14) + s = append(s, "&logproto.VariantsQueryRequest{") + s = append(s, "Selector: "+fmt.Sprintf("%#v", this.Selector)+",\n") + s = append(s, "Variants: "+fmt.Sprintf("%#v", this.Variants)+",\n") + s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") + s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") + s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") + s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") + s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") + if this.Deletes != nil { + s = append(s, "Deletes: "+fmt.Sprintf("%#v", this.Deletes)+",\n") + } + s = append(s, "Plan: "+fmt.Sprintf("%#v", this.Plan)+",\n") + if this.StoreChunks != nil { + s = append(s, "StoreChunks: "+fmt.Sprintf("%#v", this.StoreChunks)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *VariantsQueryResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&logproto.VariantsQueryResponse{") + if this.Variants != nil { + s = append(s, "Variants: "+fmt.Sprintf("%#v", this.Variants)+",\n") + } + s = append(s, "Stats: "+strings.Replace(this.Stats.GoString(), `&`, ``, 1)+",\n") + s = append(s, "Warnings: "+fmt.Sprintf("%#v", this.Warnings)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Variants) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&logproto.Variants{") + s = append(s, "Streams: "+fmt.Sprintf("%#v", this.Streams)+",\n") + s = append(s, "Series: "+fmt.Sprintf("%#v", this.Series)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} func valueToGoStringLogproto(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -5906,6 +6317,7 @@ type QuerierClient interface { GetVolume(ctx context.Context, in *VolumeRequest, opts ...grpc.CallOption) (*VolumeResponse, error) GetDetectedFields(ctx context.Context, in *DetectedFieldsRequest, opts ...grpc.CallOption) (*DetectedFieldsResponse, error) GetDetectedLabels(ctx context.Context, in *DetectedLabelsRequest, opts ...grpc.CallOption) (*LabelToValuesResponse, error) + QueryVariants(ctx context.Context, in *VariantsQueryRequest, opts ...grpc.CallOption) (Querier_QueryVariantsClient, error) } type querierClient struct { @@ -6084,6 +6496,38 @@ func (c *querierClient) GetDetectedLabels(ctx context.Context, in *DetectedLabel return out, nil } +func (c *querierClient) QueryVariants(ctx context.Context, in *VariantsQueryRequest, opts ...grpc.CallOption) (Querier_QueryVariantsClient, error) { + stream, err := c.cc.NewStream(ctx, &_Querier_serviceDesc.Streams[3], "/logproto.Querier/QueryVariants", opts...) + if err != nil { + return nil, err + } + x := &querierQueryVariantsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Querier_QueryVariantsClient interface { + Recv() (*VariantsQueryResponse, error) + grpc.ClientStream +} + +type querierQueryVariantsClient struct { + grpc.ClientStream +} + +func (x *querierQueryVariantsClient) Recv() (*VariantsQueryResponse, error) { + m := new(VariantsQueryResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // QuerierServer is the server API for Querier service. type QuerierServer interface { Query(*QueryRequest, Querier_QueryServer) error @@ -6101,6 +6545,7 @@ type QuerierServer interface { GetVolume(context.Context, *VolumeRequest) (*VolumeResponse, error) GetDetectedFields(context.Context, *DetectedFieldsRequest) (*DetectedFieldsResponse, error) GetDetectedLabels(context.Context, *DetectedLabelsRequest) (*LabelToValuesResponse, error) + QueryVariants(*VariantsQueryRequest, Querier_QueryVariantsServer) error } // UnimplementedQuerierServer can be embedded to have forward compatible implementations. @@ -6140,6 +6585,9 @@ func (*UnimplementedQuerierServer) GetDetectedFields(ctx context.Context, req *D func (*UnimplementedQuerierServer) GetDetectedLabels(ctx context.Context, req *DetectedLabelsRequest) (*LabelToValuesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDetectedLabels not implemented") } +func (*UnimplementedQuerierServer) QueryVariants(req *VariantsQueryRequest, srv Querier_QueryVariantsServer) error { + return status.Errorf(codes.Unimplemented, "method QueryVariants not implemented") +} func RegisterQuerierServer(s *grpc.Server, srv QuerierServer) { s.RegisterService(&_Querier_serviceDesc, srv) @@ -6352,18 +6800,39 @@ func _Querier_GetDetectedLabels_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } -var _Querier_serviceDesc = grpc.ServiceDesc{ - ServiceName: "logproto.Querier", - HandlerType: (*QuerierServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Label", - Handler: _Querier_Label_Handler, - }, - { - MethodName: "Series", - Handler: _Querier_Series_Handler, - }, +func _Querier_QueryVariants_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(VariantsQueryRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(QuerierServer).QueryVariants(m, &querierQueryVariantsServer{stream}) +} + +type Querier_QueryVariantsServer interface { + Send(*VariantsQueryResponse) error + grpc.ServerStream +} + +type querierQueryVariantsServer struct { + grpc.ServerStream +} + +func (x *querierQueryVariantsServer) Send(m *VariantsQueryResponse) error { + return x.ServerStream.SendMsg(m) +} + +var _Querier_serviceDesc = grpc.ServiceDesc{ + ServiceName: "logproto.Querier", + HandlerType: (*QuerierServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Label", + Handler: _Querier_Label_Handler, + }, + { + MethodName: "Series", + Handler: _Querier_Series_Handler, + }, { MethodName: "TailersCount", Handler: _Querier_TailersCount_Handler, @@ -6405,6 +6874,11 @@ var _Querier_serviceDesc = grpc.ServiceDesc{ Handler: _Querier_Tail_Handler, ServerStreams: true, }, + { + StreamName: "QueryVariants", + Handler: _Querier_QueryVariants_Handler, + ServerStreams: true, + }, }, Metadata: "pkg/logproto/logproto.proto", } @@ -8994,6 +9468,225 @@ func (m *DetectedLabel) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *VariantsQueryRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VariantsQueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VariantsQueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.StoreChunks != nil { + { + size, err := m.StoreChunks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.Plan != nil { + { + size := m.Plan.Size() + i -= size + if _, err := m.Plan.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLogproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if len(m.Deletes) > 0 { + for iNdEx := len(m.Deletes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deletes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.Shards) > 0 { + for iNdEx := len(m.Shards) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Shards[iNdEx]) + copy(dAtA[i:], m.Shards[iNdEx]) + i = encodeVarintLogproto(dAtA, i, uint64(len(m.Shards[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if m.Direction != 0 { + i = encodeVarintLogproto(dAtA, i, uint64(m.Direction)) + i-- + dAtA[i] = 0x30 + } + n32, err32 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.End):]) + if err32 != nil { + return 0, err32 + } + i -= n32 + i = encodeVarintLogproto(dAtA, i, uint64(n32)) + i-- + dAtA[i] = 0x2a + n33, err33 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Start):]) + if err33 != nil { + return 0, err33 + } + i -= n33 + i = encodeVarintLogproto(dAtA, i, uint64(n33)) + i-- + dAtA[i] = 0x22 + if m.Limit != 0 { + i = encodeVarintLogproto(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x18 + } + if len(m.Variants) > 0 { + for iNdEx := len(m.Variants) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Variants[iNdEx]) + copy(dAtA[i:], m.Variants[iNdEx]) + i = encodeVarintLogproto(dAtA, i, uint64(len(m.Variants[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Selector) > 0 { + i -= len(m.Selector) + copy(dAtA[i:], m.Selector) + i = encodeVarintLogproto(dAtA, i, uint64(len(m.Selector))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *VariantsQueryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VariantsQueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VariantsQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = encodeVarintLogproto(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + { + size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Variants) > 0 { + for iNdEx := len(m.Variants) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Variants[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Variants) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Variants) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Variants) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Series) > 0 { + for iNdEx := len(m.Series) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Series[iNdEx].Size() + i -= size + if _, err := m.Series[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLogproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Streams) > 0 { + for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Streams[iNdEx].Size() + i -= size + if _, err := m.Streams[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLogproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintLogproto(dAtA []byte, offset int, v uint64) int { offset -= sovLogproto(v) base := offset @@ -10106,34 +10799,127 @@ func (m *DetectedLabel) Size() (n int) { return n } -func sovLogproto(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozLogproto(x uint64) (n int) { - return sovLogproto(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *LabelToValuesResponse) String() string { - if this == nil { - return "nil" +func (m *VariantsQueryRequest) Size() (n int) { + if m == nil { + return 0 } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) + var l int + _ = l + l = len(m.Selector) + if l > 0 { + n += 1 + l + sovLogproto(uint64(l)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]*UniqueLabelValues{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + if len(m.Variants) > 0 { + for _, s := range m.Variants { + l = len(s) + n += 1 + l + sovLogproto(uint64(l)) + } } - mapStringForLabels += "}" - s := strings.Join([]string{`&LabelToValuesResponse{`, - `Labels:` + mapStringForLabels + `,`, - `}`, - }, "") - return s -} -func (this *UniqueLabelValues) String() string { - if this == nil { + if m.Limit != 0 { + n += 1 + sovLogproto(uint64(m.Limit)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Start) + n += 1 + l + sovLogproto(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.End) + n += 1 + l + sovLogproto(uint64(l)) + if m.Direction != 0 { + n += 1 + sovLogproto(uint64(m.Direction)) + } + if len(m.Shards) > 0 { + for _, s := range m.Shards { + l = len(s) + n += 1 + l + sovLogproto(uint64(l)) + } + } + if len(m.Deletes) > 0 { + for _, e := range m.Deletes { + l = e.Size() + n += 1 + l + sovLogproto(uint64(l)) + } + } + if m.Plan != nil { + l = m.Plan.Size() + n += 1 + l + sovLogproto(uint64(l)) + } + if m.StoreChunks != nil { + l = m.StoreChunks.Size() + n += 1 + l + sovLogproto(uint64(l)) + } + return n +} + +func (m *VariantsQueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Variants) > 0 { + for _, e := range m.Variants { + l = e.Size() + n += 1 + l + sovLogproto(uint64(l)) + } + } + l = m.Stats.Size() + n += 1 + l + sovLogproto(uint64(l)) + if len(m.Warnings) > 0 { + for _, s := range m.Warnings { + l = len(s) + n += 1 + l + sovLogproto(uint64(l)) + } + } + return n +} + +func (m *Variants) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Streams) > 0 { + for _, e := range m.Streams { + l = e.Size() + n += 1 + l + sovLogproto(uint64(l)) + } + } + if len(m.Series) > 0 { + for _, e := range m.Series { + l = e.Size() + n += 1 + l + sovLogproto(uint64(l)) + } + } + return n +} + +func sovLogproto(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLogproto(x uint64) (n int) { + return sovLogproto(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *LabelToValuesResponse) String() string { + if this == nil { + return "nil" + } + keysForLabels := make([]string, 0, len(this.Labels)) + for k, _ := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]*UniqueLabelValues{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + s := strings.Join([]string{`&LabelToValuesResponse{`, + `Labels:` + mapStringForLabels + `,`, + `}`, + }, "") + return s +} +func (this *UniqueLabelValues) String() string { + if this == nil { return "nil" } s := strings.Join([]string{`&UniqueLabelValues{`, @@ -10848,6 +11634,58 @@ func (this *DetectedLabel) String() string { }, "") return s } +func (this *VariantsQueryRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForDeletes := "[]*Delete{" + for _, f := range this.Deletes { + repeatedStringForDeletes += strings.Replace(f.String(), "Delete", "Delete", 1) + "," + } + repeatedStringForDeletes += "}" + s := strings.Join([]string{`&VariantsQueryRequest{`, + `Selector:` + fmt.Sprintf("%v", this.Selector) + `,`, + `Variants:` + fmt.Sprintf("%v", this.Variants) + `,`, + `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, + `Start:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Start), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `End:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.End), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Direction:` + fmt.Sprintf("%v", this.Direction) + `,`, + `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, + `Deletes:` + repeatedStringForDeletes + `,`, + `Plan:` + fmt.Sprintf("%v", this.Plan) + `,`, + `StoreChunks:` + strings.Replace(this.StoreChunks.String(), "ChunkRefGroup", "ChunkRefGroup", 1) + `,`, + `}`, + }, "") + return s +} +func (this *VariantsQueryResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForVariants := "[]*Variants{" + for _, f := range this.Variants { + repeatedStringForVariants += strings.Replace(f.String(), "Variants", "Variants", 1) + "," + } + repeatedStringForVariants += "}" + s := strings.Join([]string{`&VariantsQueryResponse{`, + `Variants:` + repeatedStringForVariants + `,`, + `Stats:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Stats), "Ingester", "stats.Ingester", 1), `&`, ``, 1) + `,`, + `Warnings:` + fmt.Sprintf("%v", this.Warnings) + `,`, + `}`, + }, "") + return s +} +func (this *Variants) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Variants{`, + `Streams:` + fmt.Sprintf("%v", this.Streams) + `,`, + `Series:` + fmt.Sprintf("%v", this.Series) + `,`, + `}`, + }, "") + return s +} func valueToStringLogproto(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -18323,6 +19161,638 @@ func (m *DetectedLabel) Unmarshal(dAtA []byte) error { } return nil } +func (m *VariantsQueryRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VariantsQueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VariantsQueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Selector = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Variants", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Variants = append(m.Variants, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Direction", wireType) + } + m.Direction = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Direction |= Direction(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deletes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deletes = append(m.Deletes, &Delete{}) + if err := m.Deletes[len(m.Deletes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Plan == nil { + m.Plan = &github_com_grafana_loki_v3_pkg_querier_plan.QueryPlan{} + } + if err := m.Plan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreChunks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StoreChunks == nil { + m.StoreChunks = &ChunkRefGroup{} + } + if err := m.StoreChunks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLogproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthLogproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VariantsQueryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VariantsQueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VariantsQueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Variants", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Variants = append(m.Variants, &Variants{}) + if err := m.Variants[len(m.Variants)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Stats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLogproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthLogproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Variants) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Variants: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Variants: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Streams = append(m.Streams, github_com_grafana_loki_pkg_push.Stream{}) + if err := m.Streams[len(m.Streams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogproto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogproto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Series = append(m.Series, Series{}) + if err := m.Series[len(m.Series)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogproto(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLogproto + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthLogproto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipLogproto(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/pkg/logproto/logproto.proto b/pkg/logproto/logproto.proto index 543a346cc5c7d..94baf635d3f66 100644 --- a/pkg/logproto/logproto.proto +++ b/pkg/logproto/logproto.proto @@ -35,6 +35,8 @@ service Querier { rpc GetDetectedFields(DetectedFieldsRequest) returns (DetectedFieldsResponse) {} rpc GetDetectedLabels(DetectedLabelsRequest) returns (LabelToValuesResponse) {} + + rpc QueryVariants(VariantsQueryRequest) returns (stream VariantsQueryResponse) {} } message LabelToValuesResponse { @@ -503,3 +505,44 @@ message DetectedLabel { uint64 cardinality = 2; bytes sketch = 3 [(gogoproto.jsontag) = "sketch,omitempty"]; } + + +message VariantsQueryRequest { + string selector = 1; // mark as reserved once we've fully migrated to plan. + repeated string variants = 2; // mark as reserved once we've fully migrated to plan. + uint32 limit = 3; // for log lines + google.protobuf.Timestamp start = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp end = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + Direction direction = 6; // for log lines + repeated string shards = 7 [(gogoproto.jsontag) = "shards,omitempty"]; + repeated Delete deletes = 8; + Plan plan = 9 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"]; + // If populated, these represent the chunk references that the querier should + // use to fetch the data, plus any other chunks reported by ingesters. + ChunkRefGroup storeChunks = 10 [(gogoproto.jsontag) = "storeChunks"]; +} + +message VariantsQueryResponse { + repeated Variants variants = 1 [(gogoproto.nullable) = true]; + stats.Ingester stats = 3 [(gogoproto.nullable) = false]; + repeated string warnings = 4; +} + +message Variants { + repeated StreamAdapter streams = 1 [ + (gogoproto.customtype) = "github.com/grafana/loki/pkg/push.Stream", + (gogoproto.nullable) = true + ]; + + repeated Series series = 2 [ + (gogoproto.customtype) = "Series", + (gogoproto.nullable) = true + ]; + +} diff --git a/pkg/logql/downstream.go b/pkg/logql/downstream.go index 6a577026a49b2..d57f53c59187c 100644 --- a/pkg/logql/downstream.go +++ b/pkg/logql/downstream.go @@ -417,6 +417,10 @@ type DownstreamEvaluator struct { defaultEvaluator EvaluatorFactory } +func (d *DownstreamEvaluator) NewVariantsStepEvaluator(ctx context.Context, expr syntax.VariantsExpr, p Params) (StepEvaluator, error) { + panic("TODO(twhitney): NewVariantStepEvaluator hasn't been implemented on DownstreamEvaluator") // TODO: Implement +} + // Downstream runs queries and collects stats from the embedded Downstreamer func (ev DownstreamEvaluator) Downstream(ctx context.Context, queries []DownstreamQuery, acc Accumulator) ([]logqlmodel.Result, error) { results, err := ev.Downstreamer.Downstream(ctx, queries, acc) @@ -452,6 +456,10 @@ func (ev DownstreamEvaluator) Downstream(ctx context.Context, queries []Downstre type errorQuerier struct{} +func (e *errorQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectorVariants not implemented on errorQuerier") // TODO: Implement +} + func (errorQuerier) SelectLogs(_ context.Context, _ SelectLogParams) (iter.EntryIterator, error) { return nil, errors.New("SelectLogs unimplemented: the query-frontend cannot evaluate an expression that selects logs. this is likely a bug in the query engine. please contact your system operator") } diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index 03943b64d84a4..f118c599c8e28 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -136,6 +136,7 @@ func (s SelectSampleParams) LogSelector() (syntax.LogSelectorExpr, error) { type Querier interface { SelectLogs(context.Context, SelectLogParams) (iter.EntryIterator, error) SelectSamples(context.Context, SelectSampleParams) (iter.SampleIterator, error) + SelectVariants(context.Context, SelectVariantsParams) (iter.VariantsIterator, error) } // EngineOpts is the list of options to use with the LogQL query engine. @@ -324,8 +325,9 @@ func (q *query) Eval(ctx context.Context) (promql_parser.Value, error) { streams, err := readStreams(itr, q.params.Limit(), q.params.Direction(), q.params.Interval()) return streams, err case syntax.VariantsExpr: - // TODO(twhitney) - panic("TODO(twhitney): not implemeneted") + value, err := q.evalVariant(ctx, e) + return value, err + default: return nil, fmt.Errorf("unexpected type (%T): cannot evaluate", e) } @@ -615,3 +617,63 @@ type groupedAggregation struct { heap vectorByValueHeap reverseHeap vectorByReverseValueHeap } + +// evalSample evaluate a sampleExpr +func (q *query) evalVariant( + ctx context.Context, + expr syntax.VariantsExpr, +) (promql_parser.Value, error) { + tenantIDs, err := tenant.TenantIDs(ctx) + if err != nil { + return nil, err + } + + maxIntervalCapture := func(id string) time.Duration { return q.limits.MaxQueryRange(ctx, id) } + maxQueryInterval := validation.SmallestPositiveNonZeroDurationPerTenant( + tenantIDs, + maxIntervalCapture, + ) + if maxQueryInterval != 0 { + for i, v := range expr.Variants() { + err = q.checkIntervalLimit(v, maxQueryInterval) + if err != nil { + return nil, err + } + + vExpr, err := optimizeSampleExpr(v) + if err != nil { + return nil, err + } + + expr.SetVariant(i, vExpr) + if err != nil { + return nil, err + } + } + } + + stepEvaluator, err := q.evaluator.NewVariantsStepEvaluator(ctx, expr, q.params) + if err != nil { + return nil, err + } + defer util.LogErrorWithContext(ctx, "closing VariantsExpr", stepEvaluator.Close) + + next, _, r := stepEvaluator.Next() + if stepEvaluator.Error() != nil { + return nil, stepEvaluator.Error() + } + + if next && r != nil { + switch vec := r.(type) { + //TODO(twhitney): need case for a log query + case SampleVector: + return nil, fmt.Errorf("unsupported result type: %T", vec) + default: + return nil, fmt.Errorf("unsupported result type: %T", r) + } + } + return nil, errors.New("unexpected empty result") +} +type SelectVariantsParams struct { + *logproto.VariantsQueryRequest +} diff --git a/pkg/logql/engine_test.go b/pkg/logql/engine_test.go index 889d06344ddbe..249cd7d66729f 100644 --- a/pkg/logql/engine_test.go +++ b/pkg/logql/engine_test.go @@ -2273,6 +2273,10 @@ func TestEngine_RangeQuery(t *testing.T) { type statsQuerier struct{} +func (s *statsQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on statsQuerier") // TODO: Implement +} + func (statsQuerier) SelectLogs(ctx context.Context, _ SelectLogParams) (iter.EntryIterator, error) { st := stats.FromContext(ctx) st.AddDecompressedBytes(1) @@ -2303,6 +2307,10 @@ func TestEngine_Stats(t *testing.T) { type metaQuerier struct{} +func (m *metaQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelecttVariants not implemented on metaQuerier") // TODO: Implement +} + func (metaQuerier) SelectLogs(ctx context.Context, _ SelectLogParams) (iter.EntryIterator, error) { _ = metadata.JoinHeaders(ctx, []*definitions.PrometheusResponseHeader{ { @@ -2365,6 +2373,10 @@ type errorIteratorQuerier struct { entries func() []iter.EntryIterator } +func (e *errorIteratorQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on errorIteratorQuerier") // TODO: Implement +} + func (e errorIteratorQuerier) SelectLogs(_ context.Context, p SelectLogParams) (iter.EntryIterator, error) { return iter.NewSortEntryIterator(e.entries(), p.Direction), nil } @@ -2627,9 +2639,14 @@ func TestHashingStability(t *testing.T) { func TestUnexpectedEmptyResults(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "fake") - mock := &mockEvaluatorFactory{SampleEvaluatorFunc(func(context.Context, SampleEvaluatorFactory, syntax.SampleExpr, Params) (StepEvaluator, error) { - return EmptyEvaluator[SampleVector]{value: nil}, nil - })} + mock := &mockEvaluatorFactory{ + SampleEvaluatorFunc(func(context.Context, SampleEvaluatorFactory, syntax.SampleExpr, Params) (StepEvaluator, error) { + return EmptyEvaluator[SampleVector]{value: nil}, nil + }), + VariantsEvaluatorFunc(func(context.Context, syntax.VariantsExpr, Params) (StepEvaluator, error) { + panic("TODO(twhitney): unimplemented mock VariantsEvaluatorFactory") + }), + } eng := NewEngine(EngineOpts{}, nil, NoLimits, log.NewNopLogger()) params, err := NewLiteralParams(`first_over_time({a=~".+"} | logfmt | unwrap value [1s])`, time.Now(), time.Now(), 0, 0, logproto.BACKWARD, 0, nil, nil) @@ -2643,6 +2660,7 @@ func TestUnexpectedEmptyResults(t *testing.T) { type mockEvaluatorFactory struct { SampleEvaluatorFactory + VariantEvaluatorFactory } func (*mockEvaluatorFactory) NewIterator(context.Context, syntax.LogSelectorExpr, Params) (iter.EntryIterator, error) { @@ -2684,6 +2702,10 @@ type querierRecorder struct { match bool } +func (q *querierRecorder) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on querierRecorder") // TODO: Implement +} + func newQuerierRecorder(t *testing.T, data interface{}, params interface{}) *querierRecorder { t.Helper() streams := map[string][]logproto.Stream{} diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index c9b0340f6e102..02f526d3088b9 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -257,6 +257,7 @@ func Sortable(q Params) (bool, error) { type EvaluatorFactory interface { SampleEvaluatorFactory EntryEvaluatorFactory + VariantEvaluatorFactory } type SampleEvaluatorFactory interface { @@ -319,6 +320,24 @@ func (ev *DefaultEvaluator) NewIterator(ctx context.Context, expr syntax.LogSele return ev.querier.SelectLogs(ctx, params) } +type VariantEvaluatorFactory interface { + NewVariantsStepEvaluator( + ctx context.Context, + expr syntax.VariantsExpr, + p Params, + ) (StepEvaluator, error) +} + +type VariantsEvaluatorFunc func(ctx context.Context, expr syntax.VariantsExpr, p Params) (StepEvaluator, error) + +func (s VariantsEvaluatorFunc) NewVariantsStepEvaluator( + ctx context.Context, + expr syntax.VariantsExpr, + p Params, +) (StepEvaluator, error) { + return s(ctx, expr, p) +} + func (ev *DefaultEvaluator) NewStepEvaluator( ctx context.Context, nextEvFactory SampleEvaluatorFactory, @@ -388,6 +407,48 @@ func (ev *DefaultEvaluator) NewStepEvaluator( } } +func (ev *DefaultEvaluator) NewVariantsStepEvaluator( + ctx context.Context, + expr syntax.VariantsExpr, + q Params, +) (StepEvaluator, error) { + switch e := expr.(type) { + //TODO(twhitney): how do we handle range aggregations?? + //TODO(twhitney): do we need to enforce that the variants have the same range? + //TODO(twhitney): going to need to handle merging aggregations (ie sum() by) + case *syntax.MultiVariantExpr: + logRange := e.LogRange() + variants := make([]string, 0, len(e.Variants())) + for _, variant := range e.Variants() { + variants = append(variants, variant.String()) + } + + it, err := ev.querier.SelectVariants(ctx, SelectVariantsParams{ + &logproto.VariantsQueryRequest{ + // extend startTs backwards by step + Start: q.Start().Add(-logRange.Interval).Add(-logRange.Offset), + // add leap nanosecond to endTs to include lines exactly at endTs. range iterators work on start exclusive, end inclusive ranges + End: q.End().Add(-logRange.Offset).Add(time.Nanosecond), + // intentionally send the vector for reducing labels. + Selector: logRange.String(), + Variants: variants, + Shards: q.Shards(), + Plan: &plan.QueryPlan{ + AST: expr, + }, + StoreChunks: q.GetStoreChunks(), + }, + }) + if err != nil { + return nil, err + } + //TODO(twhitney): do we need a peeking iterator here? + return newVariantsEvaluator(it, e, q, e.LogRange().Offset) + default: + return nil, EvaluatorUnsupportedType(e, ev) + } +} + func newVectorAggEvaluator( ctx context.Context, evFactory SampleEvaluatorFactory, @@ -1337,3 +1398,40 @@ func absentLabels(expr syntax.SampleExpr) (labels.Labels, error) { } return m, nil } + +type VariantsEvaluator struct { + iter iter.VariantsIterator + + err error +} + +// while Next returns a promql.Value, the only acceptable types are Scalar and Vector. +func (v *VariantsEvaluator) Next() (ok bool, ts int64, r StepResult) { + panic("not implemented") // TODO: Implement +} + +// Close all resources used. +func (v *VariantsEvaluator) Close() error { + panic("not implemented") // TODO: Implement +} + +// Reports any error +func (v *VariantsEvaluator) Error() error { + panic("not implemented") // TODO: Implement +} + +// Explain returns a print of the step evaluation tree +func (v *VariantsEvaluator) Explain(_ Node) { + panic("not implemented") // TODO: Implement +} + +func newVariantsEvaluator( + it iter.VariantsIterator, + expr *syntax.MultiVariantExpr, + q Params, + o time.Duration, +) (StepEvaluator, error) { + return &VariantsEvaluator{ + iter: it, + }, nil +} diff --git a/pkg/logql/syntax/ast.go b/pkg/logql/syntax/ast.go index f3d2655ee7bdf..447cb33efa790 100644 --- a/pkg/logql/syntax/ast.go +++ b/pkg/logql/syntax/ast.go @@ -2441,32 +2441,60 @@ func groupingReducesLabels(grp *Grouping) bool { // //sumtype:decl type VariantsExpr interface { - LogSelector() LogSelectorExpr + LogRange() *LogRange Matchers() []*labels.Matcher Variants() []SampleExpr + SetVariant(i int, e SampleExpr) error + Interval() time.Duration + Offset() time.Duration Expr } type MultiVariantExpr struct { - logSelector LogSelectorExpr + logRange *LogRange variants []SampleExpr implicit } -func (m *MultiVariantExpr) LogSelector() LogSelectorExpr { - return m.logSelector +func (m *MultiVariantExpr) LogRange() *LogRange { + return m.logRange +} + +func (m *MultiVariantExpr) SetLogSelector(e *LogRange) { + m.logRange = e } func (m *MultiVariantExpr) Matchers() []*labels.Matcher { - return m.logSelector.Matchers() + return m.logRange.Left.Matchers() +} + +func (m *MultiVariantExpr) Interval() time.Duration { + return m.logRange.Interval +} + +func (m *MultiVariantExpr) Offset() time.Duration { + return m.logRange.Offset } func (m *MultiVariantExpr) Variants() []SampleExpr { return m.variants } +func (m *MultiVariantExpr) AddVariant(v SampleExpr) { + m.variants = append(m.variants, v) +} + +func (m *MultiVariantExpr) SetVariant(i int, v SampleExpr) error { + if i >= len(m.variants) { + return fmt.Errorf("variant index out of range") + } + + m.variants[i] = v + return nil +} + func (m *MultiVariantExpr) Shardable(topLevel bool) bool { - if !m.logSelector.Shardable(topLevel) { + if !m.logRange.Shardable(topLevel) { return false } @@ -2497,7 +2525,7 @@ func (m *MultiVariantExpr) String() string { sb.WriteString(VariantsOf) sb.WriteString(" (") - sb.WriteString(m.logSelector.String()) + sb.WriteString(m.logRange.String()) sb.WriteString(")") return sb.String() @@ -2506,11 +2534,7 @@ func (m *MultiVariantExpr) String() string { // TDOO(twhitney): do the sample expressions also need to accept the root vistor? // is there a way to test this? func (m *MultiVariantExpr) Accept(v RootVisitor) { - for _, variant := range m.variants { - variant.Accept(v) - } - - m.logSelector.Accept(v) + v.VisitVariants(m) } // Pretty prettyfies any LogQL expression at given `level` of the whole LogQL query. @@ -2534,15 +2558,15 @@ func (m *MultiVariantExpr) Pretty(level int) string { } s += Indent(level) + ") of (\n" - s += m.logSelector.Pretty(level + 1) + s += m.logRange.Pretty(level + 1) s += Indent(level) + "\n)" return s } -func newVariantsExpr(variants []SampleExpr, selector LogSelectorExpr) VariantsExpr { +func newVariantsExpr(variants []SampleExpr, logRange *LogRange) VariantsExpr { return &MultiVariantExpr{ variants: variants, - logSelector: selector, + logRange: logRange, } } diff --git a/pkg/logql/syntax/ast_test.go b/pkg/logql/syntax/ast_test.go index f6c5cf975dd74..9435997e3dff6 100644 --- a/pkg/logql/syntax/ast_test.go +++ b/pkg/logql/syntax/ast_test.go @@ -1150,12 +1150,12 @@ func Test_VariantsExpr_String(t *testing.T) { tests := []struct { expr string }{ - {`variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"})`}, + {`variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"}[5m])`}, { - `variants(count_over_time({baz="qux", foo=~"bar"}[5m]), bytes_over_time({baz="qux", foo=~"bar"}[5m])) of ({baz="qux", foo=~"bar"} | logfmt | this = "that")`, + `variants(count_over_time({baz="qux", foo=~"bar"}[5m]), bytes_over_time({baz="qux", foo=~"bar"}[5m])) of ({baz="qux", foo=~"bar"} | logfmt | this = "that"[5m])`, }, { - `variants(count_over_time({baz="qux", foo!="bar"}[5m]),rate({baz="qux", foo!="bar"}[5m])) of ({baz="qux", foo!="bar"} |= "that")`, + `variants(count_over_time({baz="qux", foo!="bar"}[5m]),rate({baz="qux", foo!="bar"}[5m])) of ({baz="qux", foo!="bar"} |= "that" [5m])`, }, } diff --git a/pkg/logql/syntax/clone.go b/pkg/logql/syntax/clone.go index d047218b0b607..02dccdd683396 100644 --- a/pkg/logql/syntax/clone.go +++ b/pkg/logql/syntax/clone.go @@ -10,6 +10,10 @@ type cloneVisitor struct { cloned Expr } +func (c *cloneVisitor) VisitVariants(_ *MultiVariantExpr) { + panic("not implemented") // TODO: Implement +} + var _ RootVisitor = &cloneVisitor{} func cloneGrouping(g *Grouping) *Grouping { diff --git a/pkg/logql/syntax/expr.y b/pkg/logql/syntax/expr.y index 2b20575623acc..2323701dd8133 100644 --- a/pkg/logql/syntax/expr.y +++ b/pkg/logql/syntax/expr.y @@ -76,6 +76,7 @@ import ( VariantsList []SampleExpr VariantsOp string VariantsOf string + VariantsRangeExpr *LogRange } %start root @@ -140,6 +141,7 @@ import ( %type variantsList %type variantsOp %type variantsOf +%type variantsRangeExpr %token BYTES %token IDENTIFIER STRING NUMBER PARSER_FLAG @@ -186,22 +188,6 @@ logExpr: | OPEN_PARENTHESIS logExpr CLOSE_PARENTHESIS { $$ = $2 } ; -variantsExpr: - variantsOp OPEN_PARENTHESIS variantsList CLOSE_PARENTHESIS variantsOf OPEN_PARENTHESIS logExpr CLOSE_PARENTHESIS { $$ = newVariantsExpr($3, $7) } - ; - -variantsOp: - VARIANTS { $$ = OpVariants } - ; -variantsOf: - OF { $$ = VariantsOf } - ; - -variantsList: - metricExpr { $$ = []SampleExpr{$1} } - | variantsList COMMA metricExpr { $$ = append($1, $3) } - ; - logRangeExpr: selector RANGE { $$ = newLogRange(newMatcherExpr($1), $2, nil, nil ) } | selector RANGE offsetExpr { $$ = newLogRange(newMatcherExpr($1), $2, nil, $3 ) } @@ -608,4 +594,35 @@ grouping: | BY OPEN_PARENTHESIS CLOSE_PARENTHESIS { $$ = &Grouping{ Without: false , Groups: nil } } | WITHOUT OPEN_PARENTHESIS CLOSE_PARENTHESIS { $$ = &Grouping{ Without: true , Groups: nil } } ; + +variantsExpr: + variantsOp OPEN_PARENTHESIS variantsList CLOSE_PARENTHESIS variantsOf OPEN_PARENTHESIS variantsRangeExpr CLOSE_PARENTHESIS { $$ = newVariantsExpr($3, $7) } + ; + +variantsOp: + VARIANTS { $$ = OpVariants } + ; +variantsOf: + OF { $$ = VariantsOf } + ; + +variantsList: + metricExpr { $$ = []SampleExpr{$1} } + | variantsList COMMA metricExpr { $$ = append($1, $3) } + ; + +variantsRangeExpr: + selector RANGE { $$ = newLogRange(newMatcherExpr($1), $2, nil, nil ) } + | selector RANGE offsetExpr { $$ = newLogRange(newMatcherExpr($1), $2, nil, $3 ) } + | OPEN_PARENTHESIS selector CLOSE_PARENTHESIS RANGE { $$ = newLogRange(newMatcherExpr($2), $4, nil, nil ) } + | OPEN_PARENTHESIS selector CLOSE_PARENTHESIS RANGE offsetExpr { $$ = newLogRange(newMatcherExpr($2), $4, nil, $5 ) } + | selector pipelineExpr RANGE { $$ = newLogRange(newPipelineExpr(newMatcherExpr($1), $2), $3, nil, nil ) } + | selector pipelineExpr RANGE offsetExpr { $$ = newLogRange(newPipelineExpr(newMatcherExpr($1), $2), $3, nil, $4 ) } + | OPEN_PARENTHESIS selector pipelineExpr CLOSE_PARENTHESIS RANGE { $$ = newLogRange(newPipelineExpr(newMatcherExpr($2), $3), $5, nil, nil ) } + | OPEN_PARENTHESIS selector pipelineExpr CLOSE_PARENTHESIS RANGE offsetExpr { $$ = newLogRange(newPipelineExpr(newMatcherExpr($2), $3), $5, nil, $6 ) } + | selector RANGE pipelineExpr { $$ = newLogRange(newPipelineExpr(newMatcherExpr($1), $3), $2, nil, nil) } + | selector RANGE offsetExpr pipelineExpr { $$ = newLogRange(newPipelineExpr(newMatcherExpr($1), $4), $2, nil, $3 ) } + | OPEN_PARENTHESIS variantsRangeExpr CLOSE_PARENTHESIS { $$ = $2 } + | variantsRangeExpr error + ; %% diff --git a/pkg/logql/syntax/expr.y.go b/pkg/logql/syntax/expr.y.go index bd849842dac15..daa848d382a5a 100644 --- a/pkg/logql/syntax/expr.y.go +++ b/pkg/logql/syntax/expr.y.go @@ -75,10 +75,11 @@ type exprSymType struct { KeepLabels []log.KeepLabel KeepLabelsExpr *KeepLabelsExpr - VariantsExpr VariantsExpr - VariantsList []SampleExpr - VariantsOp string - VariantsOf string + VariantsExpr VariantsExpr + VariantsList []SampleExpr + VariantsOp string + VariantsOf string + VariantsRangeExpr *LogRange } const BYTES = 57346 @@ -287,196 +288,208 @@ var exprExca = [...]int{ 1, -1, -2, 0, -1, 151, - 21, 18, - 27, 18, + 21, 234, + 27, 234, -2, 3, -1, 298, - 21, 19, - 27, 19, + 21, 235, + 27, 235, -2, 3, } const exprPrivate = 57344 -const exprLast = 663 +const exprLast = 747 var exprAct = [...]int{ - 301, 237, 3, 189, 89, 68, 4, 221, 131, 211, - 80, 67, 207, 204, 79, 246, 194, 6, 196, 159, - 81, 2, 60, 292, 85, 52, 53, 54, 61, 62, - 65, 66, 63, 64, 55, 56, 57, 58, 59, 60, - 224, 11, 53, 54, 61, 62, 65, 66, 63, 64, - 55, 56, 57, 58, 59, 60, 61, 62, 65, 66, - 63, 64, 55, 56, 57, 58, 59, 60, 57, 58, - 59, 60, 144, 114, 120, 55, 56, 57, 58, 59, - 60, 275, 297, 230, 18, 304, 274, 223, 271, 151, - 229, 18, 222, 270, 145, 163, 173, 174, 171, 172, - 309, 168, 352, 290, 306, 161, 18, 353, 289, 381, - 352, 214, 157, 158, 305, 287, 381, 170, 18, 384, - 286, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 284, 304, 71, 18, 201, - 283, 99, 281, 306, 198, 18, 141, 280, 209, 213, - 273, 306, 155, 157, 158, 306, 248, 269, 141, 147, - 146, 147, 191, 228, 355, 356, 357, 135, 378, 19, - 20, 403, 244, 238, 191, 398, 19, 20, 328, 135, - 240, 305, 241, 249, 220, 215, 218, 219, 216, 217, - 233, 19, 20, 318, 257, 258, 259, 278, 359, 369, - 18, 149, 277, 19, 20, 390, 88, 115, 90, 91, - 261, 76, 78, 90, 91, 344, 389, 388, 386, 73, - 74, 75, 306, 19, 20, 190, 156, 318, 372, 318, - 19, 20, 294, 368, 298, 367, 192, 190, 302, 299, - 308, 248, 311, 120, 114, 318, 248, 314, 303, 233, - 315, 366, 312, 161, 362, 300, 272, 276, 279, 282, - 285, 288, 291, 326, 342, 316, 141, 233, 325, 322, - 324, 327, 329, 248, 313, 141, 209, 213, 337, 332, - 336, 330, 191, 77, 307, 19, 20, 135, 264, 76, - 78, 191, 234, 15, 252, 323, 135, 73, 74, 75, - 340, 360, 374, 345, 248, 347, 349, 242, 351, 114, - 350, 318, 248, 346, 361, 236, 318, 320, 114, 141, - 76, 78, 319, 148, 363, 239, 250, 227, 73, 74, - 75, 160, 310, 226, 247, 343, 339, 338, 15, 293, - 135, 15, 256, 255, 192, 190, 373, 162, 376, 375, - 162, 254, 114, 377, 253, 225, 239, 167, 166, 379, - 380, 77, 165, 95, 94, 87, 82, 385, 401, 397, - 365, 262, 317, 268, 307, 18, 267, 391, 265, 76, - 78, 393, 251, 394, 395, 15, 243, 73, 74, 75, - 235, 266, 77, 263, 7, 396, 383, 399, 24, 25, - 26, 39, 48, 49, 40, 42, 43, 41, 44, 45, - 46, 47, 50, 27, 28, 239, 382, 86, 358, 348, - 334, 335, 153, 29, 30, 31, 32, 33, 34, 35, - 84, 169, 93, 36, 37, 38, 51, 21, 152, 236, - 245, 154, 92, 197, 76, 78, 260, 76, 78, 23, - 15, 77, 73, 74, 75, 73, 74, 75, 402, 7, - 19, 20, 400, 24, 25, 26, 39, 48, 49, 40, - 42, 43, 41, 44, 45, 46, 47, 50, 27, 28, - 239, 197, 392, 239, 195, 387, 371, 370, 29, 30, - 31, 32, 33, 34, 35, 341, 331, 321, 36, 37, - 38, 51, 21, 304, 333, 164, 295, 205, 296, 232, - 231, 230, 76, 78, 23, 15, 77, 229, 202, 77, - 73, 74, 75, 200, 7, 19, 20, 199, 24, 25, - 26, 39, 48, 49, 40, 42, 43, 41, 44, 45, - 46, 47, 50, 27, 28, 364, 212, 208, 239, 197, - 14, 86, 205, 29, 30, 31, 32, 33, 34, 35, - 76, 78, 141, 36, 37, 38, 51, 21, 73, 74, - 75, 150, 5, 141, 132, 133, 118, 119, 203, 23, - 123, 210, 125, 135, 77, 206, 124, 122, 121, 193, - 19, 20, 69, 142, 135, 96, 70, 134, 143, 116, - 117, 98, 97, 12, 10, 127, 128, 126, 22, 136, - 138, 309, 13, 17, 9, 354, 127, 128, 126, 16, - 136, 138, 8, 83, 72, 1, 0, 129, 0, 130, - 0, 0, 77, 0, 0, 137, 139, 140, 129, 0, - 130, 0, 0, 0, 0, 0, 137, 139, 140, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, + 301, 6, 373, 68, 4, 221, 189, 131, 237, 89, + 211, 204, 79, 67, 207, 196, 246, 159, 194, 81, + 2, 60, 292, 85, 52, 53, 54, 61, 62, 65, + 66, 63, 64, 55, 56, 57, 58, 59, 60, 224, + 11, 53, 54, 61, 62, 65, 66, 63, 64, 55, + 56, 57, 58, 59, 60, 61, 62, 65, 66, 63, + 64, 55, 56, 57, 58, 59, 60, 57, 58, 59, + 60, 114, 144, 297, 222, 141, 223, 120, 55, 56, + 57, 58, 59, 60, 145, 290, 304, 151, 18, 161, + 289, 191, 309, 163, 173, 174, 135, 306, 275, 168, + 230, 18, 271, 274, 229, 18, 287, 270, 382, 18, + 99, 286, 284, 171, 172, 18, 170, 283, 71, 352, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 421, 281, 382, 409, 18, 248, + 280, 147, 201, 214, 157, 158, 198, 209, 213, 146, + 278, 147, 305, 18, 190, 277, 304, 155, 157, 158, + 306, 328, 228, 405, 240, 90, 91, 273, 76, 78, + 244, 269, 15, 19, 20, 238, 73, 74, 75, 318, + 241, 375, 379, 392, 249, 369, 19, 20, 115, 141, + 19, 20, 248, 306, 19, 20, 318, 257, 258, 259, + 19, 20, 368, 318, 70, 191, 141, 353, 408, 367, + 135, 264, 261, 390, 326, 389, 220, 215, 218, 219, + 216, 217, 191, 19, 20, 76, 78, 135, 416, 248, + 294, 156, 298, 73, 74, 75, 387, 161, 19, 20, + 77, 372, 114, 362, 299, 302, 120, 308, 315, 311, + 303, 325, 314, 300, 312, 272, 276, 279, 282, 285, + 288, 291, 342, 352, 355, 356, 357, 192, 190, 316, + 322, 324, 327, 329, 252, 209, 213, 332, 330, 337, + 385, 242, 336, 248, 192, 190, 405, 88, 141, 90, + 91, 76, 78, 392, 305, 233, 318, 77, 340, 73, + 74, 75, 366, 415, 306, 323, 349, 114, 351, 135, + 345, 359, 347, 350, 149, 346, 114, 318, 391, 393, + 344, 361, 363, 320, 76, 78, 141, 70, 148, 76, + 78, 233, 73, 74, 75, 306, 406, 73, 74, 75, + 318, 343, 191, 233, 248, 374, 319, 135, 248, 15, + 114, 227, 160, 378, 376, 377, 313, 226, 162, 380, + 70, 339, 15, 77, 338, 70, 250, 381, 234, 418, + 247, 162, 386, 293, 256, 255, 254, 395, 396, 253, + 225, 167, 166, 165, 399, 400, 95, 94, 394, 398, + 87, 82, 402, 365, 403, 262, 77, 317, 114, 268, + 267, 77, 410, 18, 153, 265, 413, 404, 114, 407, + 251, 114, 243, 15, 235, 417, 114, 412, 266, 420, + 152, 263, 7, 154, 414, 401, 24, 25, 26, 39, + 48, 49, 40, 42, 43, 41, 44, 45, 46, 47, + 50, 27, 28, 384, 383, 86, 358, 348, 334, 335, + 419, 29, 30, 31, 32, 33, 34, 35, 84, 169, + 93, 36, 37, 38, 51, 21, 92, 307, 245, 411, + 388, 197, 76, 78, 260, 3, 197, 23, 15, 195, + 73, 74, 75, 80, 360, 371, 370, 7, 19, 20, + 341, 24, 25, 26, 39, 48, 49, 40, 42, 43, + 41, 44, 45, 46, 47, 50, 27, 28, 239, 333, + 331, 321, 205, 296, 295, 232, 29, 30, 31, 32, + 33, 34, 35, 231, 230, 229, 36, 37, 38, 51, + 21, 202, 236, 164, 200, 199, 397, 76, 78, 364, + 212, 208, 23, 15, 77, 73, 74, 75, 197, 310, + 86, 205, 7, 19, 20, 14, 24, 25, 26, 39, + 48, 49, 40, 42, 43, 41, 44, 45, 46, 47, + 50, 27, 28, 239, 150, 5, 132, 133, 118, 119, + 203, 29, 30, 31, 32, 33, 34, 35, 76, 78, + 123, 36, 37, 38, 51, 21, 73, 74, 75, 393, + 210, 125, 206, 124, 76, 78, 122, 23, 121, 77, + 193, 69, 73, 74, 75, 307, 142, 134, 19, 20, + 76, 78, 143, 116, 70, 76, 78, 117, 73, 74, + 75, 98, 236, 73, 74, 75, 97, 76, 78, 12, + 70, 76, 78, 141, 304, 73, 74, 75, 10, 73, + 74, 75, 22, 13, 17, 9, 239, 141, 354, 16, + 77, 239, 8, 83, 135, 72, 1, 0, 0, 0, + 0, 0, 0, 239, 0, 0, 77, 239, 135, 96, + 0, 304, 0, 0, 0, 0, 127, 128, 126, 0, + 136, 138, 77, 0, 0, 0, 0, 77, 0, 0, + 127, 128, 126, 0, 136, 138, 309, 0, 129, 77, + 130, 0, 0, 77, 0, 0, 137, 139, 140, 0, + 0, 0, 129, 0, 130, 0, 0, 0, 0, 0, + 137, 139, 140, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, } var exprPact = [...]int{ - 368, -1000, -58, -1000, -1000, -1000, 545, 368, -1000, -1000, - -1000, -1000, -1000, -1000, 340, 412, 339, 180, -1000, 435, - 425, 338, 337, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + 396, -1000, -59, -1000, -1000, -1000, 314, 396, -1000, -1000, + -1000, -1000, -1000, -1000, 365, 440, 364, 261, -1000, 459, + 453, 361, 360, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 545, -1000, 196, - 568, -11, 88, -1000, -1000, -1000, -1000, -1000, -1000, 296, - 174, -58, 368, 420, -1000, -1000, 139, 324, 498, 336, - 332, 331, -1000, -1000, 368, 424, 368, 24, 20, -1000, - 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, -1000, -1000, -1000, -1000, -1000, -1000, - 153, -1000, -1000, -1000, -1000, -1000, 476, 544, 521, -1000, - 517, -1000, -1000, -1000, -1000, 314, 512, -1000, 547, 542, - 541, 98, -1000, -1000, 86, -43, 329, -1000, -1000, -1000, - 306, -1000, -1000, -1000, 546, 511, 505, 504, 503, 265, - 369, 429, 321, 280, 365, 433, 307, 299, 361, 267, - -42, 328, 325, 317, 316, -30, -30, -26, -26, -75, - -75, -75, -75, -17, -17, -17, -17, -17, -17, 153, - 314, 314, 314, 438, 350, -1000, -1000, 380, 350, -1000, - -1000, 261, -1000, 357, -1000, 378, 355, -1000, 139, -1000, - 352, -1000, 139, -1000, 84, 77, 193, 138, 131, 111, - 99, -1000, -60, 313, 86, 500, 0, 368, -1000, -1000, - -1000, -1000, -1000, -1000, 185, 321, 432, 104, 364, 557, - 305, 247, 185, 368, 238, 351, 295, -1000, -1000, 290, - -1000, 491, -1000, 268, 241, 236, 151, 270, 153, 141, - -1000, 350, 544, 490, -1000, 502, 415, 542, 541, 311, - -1000, -1000, -1000, 310, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 314, -1000, 210, + 638, -11, 78, -1000, -1000, -1000, -1000, -1000, -1000, 301, + 287, -59, 396, 402, -1000, -1000, 144, 345, 526, 357, + 356, 355, -1000, -1000, 396, 452, 396, 39, 18, -1000, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, -1000, -1000, -1000, -1000, -1000, -1000, + 201, -1000, -1000, -1000, -1000, -1000, 471, 543, 529, -1000, + 528, -1000, -1000, -1000, -1000, 283, 525, -1000, 546, 536, + 535, 130, -1000, -1000, 68, -44, 354, -1000, -1000, -1000, + 330, -1000, -1000, -1000, 545, 519, 518, 517, 509, 341, + 393, 622, 332, 254, 391, 461, 343, 339, 389, 247, + -43, 353, 350, 349, 348, -31, -31, -27, -27, -76, + -76, -76, -76, -14, -14, -14, -14, -14, -14, 201, + 283, 283, 283, 466, 374, -1000, -1000, 408, 374, -1000, + -1000, 184, -1000, 384, -1000, 405, 379, -1000, 144, -1000, + 378, -1000, 144, -1000, 98, 94, 146, 131, 108, 102, + 81, -1000, -61, 347, 68, 508, -9, 396, -1000, -1000, + -1000, -1000, -1000, -1000, 137, 332, 610, 142, 605, 652, + 522, 329, 137, 396, 242, 376, 319, -1000, -1000, 296, + -1000, 505, -1000, 278, 224, 187, 134, 321, 201, 70, + -1000, 374, 543, 504, -1000, 507, 443, 536, 535, 338, + -1000, -1000, -1000, 335, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, 86, 489, -1000, 237, 309, -1000, -1000, -1000, - 188, 497, 53, 497, 410, 14, 314, 14, 100, 102, - 408, 171, 274, -1000, -1000, 227, -1000, 368, 540, -1000, - -1000, 349, 224, -1000, 208, -1000, -1000, 206, -1000, 172, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 481, 480, - -1000, 201, -1000, 276, 185, 53, 497, 53, -1000, -1000, - 153, -1000, 14, -1000, 142, -1000, -1000, -1000, 65, 406, - 386, 92, 185, 191, -1000, 479, -1000, -1000, -1000, -1000, - 190, 189, -1000, 178, 276, -1000, 53, -1000, 477, 58, - 53, 46, 14, 14, 385, -1000, -1000, 348, -1000, -1000, - -1000, 174, 148, 53, -1000, -1000, 14, 456, -1000, -1000, - 347, 452, 144, -1000, + -1000, -1000, 68, 484, -1000, 235, 315, -1000, -1000, -1000, + 293, 626, 46, 626, 438, 15, 283, 15, 109, 202, + 436, 284, 457, -1000, -1000, 216, -1000, 396, 534, -1000, + -1000, 372, 275, -1000, 182, -1000, -1000, 175, -1000, 158, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 480, 479, + -1000, 214, -1000, 155, 137, 46, 626, 46, -1000, -1000, + 201, -1000, 15, -1000, 156, -1000, -1000, -1000, 85, 434, + 433, 253, 137, 209, -1000, 464, -1000, -1000, -1000, -1000, + 188, 186, -1000, 291, 589, 155, -1000, 46, -1000, 531, + 57, 46, 38, 15, 15, 415, -1000, -1000, 371, -1000, + -1000, -1000, -1000, 573, 153, 309, 181, 110, 46, -1000, + -1000, 15, 463, 314, 314, 15, 414, 276, -1000, -1000, + -1000, 207, 314, -1000, 15, 359, 444, -1000, 15, 107, + -1000, -1000, } var exprPgo = [...]int{ - 0, 625, 20, 624, 4, 15, 2, 6, 19, 8, - 623, 622, 619, 615, 17, 614, 613, 612, 608, 87, - 604, 41, 603, 595, 602, 601, 600, 599, 11, 5, - 598, 597, 593, 3, 592, 137, 7, 589, 588, 587, - 586, 585, 12, 582, 581, 9, 580, 13, 578, 18, - 16, 577, 576, 1, 575, 574, 0, 572, 571, 550, - 508, + 0, 666, 19, 665, 9, 16, 475, 4, 17, 7, + 663, 662, 659, 658, 1, 655, 654, 653, 652, 76, + 648, 40, 639, 679, 636, 631, 627, 623, 13, 3, + 622, 617, 616, 6, 611, 118, 5, 610, 608, 606, + 603, 602, 14, 601, 600, 10, 590, 11, 580, 15, + 18, 579, 578, 8, 577, 576, 0, 575, 574, 555, + 513, 2, } var exprR1 = [...]int{ 0, 1, 2, 2, 2, 7, 7, 7, 7, 7, - 7, 7, 6, 6, 6, 57, 59, 60, 58, 58, + 7, 7, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 53, 53, 53, 13, - 13, 13, 11, 11, 11, 11, 15, 15, 15, 15, - 15, 15, 22, 3, 3, 3, 3, 3, 3, 14, - 14, 14, 10, 10, 9, 9, 9, 9, 28, 28, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 19, 36, 36, 36, 35, 35, 35, 34, 34, - 34, 37, 37, 27, 27, 26, 26, 26, 26, 52, - 51, 51, 38, 39, 47, 47, 48, 48, 48, 46, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 49, - 49, 50, 50, 55, 55, 54, 54, 32, 32, 32, - 32, 32, 32, 32, 30, 30, 30, 30, 30, 30, - 30, 31, 31, 31, 31, 31, 31, 31, 42, 42, - 41, 41, 40, 45, 45, 44, 44, 43, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 24, 24, 25, 25, 25, 25, 23, - 23, 23, 23, 23, 23, 23, 23, 21, 21, 21, - 17, 18, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 56, - 5, 5, 4, 4, 4, 4, + 8, 53, 53, 53, 13, 13, 13, 11, 11, 11, + 11, 15, 15, 15, 15, 15, 15, 22, 3, 3, + 3, 3, 3, 3, 14, 14, 14, 10, 10, 9, + 9, 9, 9, 28, 28, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 19, 36, 36, 36, + 35, 35, 35, 34, 34, 34, 37, 37, 27, 27, + 26, 26, 26, 26, 52, 51, 51, 38, 39, 47, + 47, 48, 48, 48, 46, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 49, 49, 50, 50, 55, 55, + 54, 54, 32, 32, 32, 32, 32, 32, 32, 30, + 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, + 31, 31, 31, 42, 42, 41, 41, 40, 45, 45, + 44, 44, 43, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 24, 24, + 25, 25, 25, 25, 23, 23, 23, 23, 23, 23, + 23, 23, 21, 21, 21, 17, 18, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 56, 5, 5, 4, 4, 4, + 4, 57, 59, 60, 58, 58, 61, 61, 61, 61, + 61, 61, 61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 2, 4, 5, 2, 4, 5, 1, 2, 2, - 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 3, 3, 1, 1, 1, 3, 2, 1, 1, + 1, 3, 2, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 0, 1, + 5, 4, 5, 4, 1, 1, 2, 4, 5, 2, + 4, 5, 1, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 3, 4, 4, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 1, 3, 4, 4, 3, + 3, 8, 1, 1, 1, 3, 2, 3, 4, 5, + 3, 4, 5, 6, 3, 4, 3, 2, } var exprChk = [...]int{ @@ -517,54 +530,58 @@ var exprChk = [...]int{ -36, 6, 27, 26, 27, -53, -28, -53, 9, -56, -33, -56, 10, 5, -13, 62, 63, 64, 10, 27, 27, -53, 27, -7, 5, 21, 27, 27, 27, 27, - 6, 6, 27, -6, 26, -4, -53, -56, 26, -56, - -53, 51, 10, 10, 27, -4, 27, 6, 27, 27, - 27, -6, 5, -53, -56, -56, 10, 21, 27, -56, - 6, 21, 6, 27, + 6, 6, 27, -61, -14, 26, -4, -53, -56, 26, + -56, -53, 51, 10, 10, 27, -4, 27, 6, 27, + 27, 27, 2, 10, -28, -14, -61, 5, -53, -56, + -56, 10, 21, -56, -28, 10, 27, -28, 27, 27, + -56, 6, -28, -56, 10, 27, 21, -56, 10, 6, + -56, 27, } var exprDef = [...]int{ 0, -2, 1, 2, 3, 4, 12, 0, 5, 6, - 7, 8, 9, 10, 0, 0, 0, 0, 197, 0, - 0, 0, 0, 16, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 201, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 13, 78, 80, - 0, 98, 0, 63, 64, 65, 66, 67, 68, 3, - 2, 0, 0, 0, 71, 72, 0, 0, 0, 0, - 0, 0, 198, 199, 0, 0, 0, 189, 190, 184, + 7, 8, 9, 10, 0, 0, 0, 0, 192, 0, + 0, 0, 0, 232, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 196, 178, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 13, 73, 75, + 0, 93, 0, 58, 59, 60, 61, 62, 63, 3, + 2, 0, 0, 0, 66, 67, 0, 0, 0, 0, + 0, 0, 193, 194, 0, 0, 0, 184, 185, 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 100, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 103, 105, 0, 107, - 0, 120, 121, 122, 123, 0, 0, 113, 0, 0, - 0, 0, 135, 136, 0, 95, 0, 91, 11, 14, - 0, -2, 69, 70, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 197, 0, 0, 0, 3, 0, - 168, 0, 0, 191, 194, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 125, - 0, 0, 0, 104, 111, 101, 131, 130, 109, 106, - 108, 0, 112, 119, 116, 0, 162, 160, 158, 159, - 167, 165, 163, 164, 0, 0, 0, 0, 0, 0, - 0, 99, 92, 0, 0, 0, 0, 0, 73, 74, - 75, 76, 77, 45, 52, 0, 20, 0, 0, 0, - 0, 0, 56, 0, 3, 197, 0, 234, 230, 0, - 235, 0, 200, 0, 0, 0, 0, 126, 127, 128, - 102, 110, 0, 0, 124, 0, 0, 0, 0, 0, - 142, 149, 156, 0, 141, 148, 155, 137, 144, 151, - 138, 145, 152, 139, 146, 153, 140, 147, 154, 143, - 150, 157, 0, 0, 97, 0, 0, 17, -2, 54, - 0, 21, 24, 40, 0, 28, 0, 32, 0, 0, - 0, 0, 0, 44, 58, 3, 57, 0, 0, 232, - 233, 0, 0, 186, 0, 188, 192, 0, 195, 0, - 132, 129, 117, 118, 114, 115, 161, 166, 0, 0, - 94, 0, 96, 0, 53, 25, 41, 42, 229, 29, - 48, 33, 36, 46, 0, 49, 50, 51, 22, 0, - 0, 0, 59, 3, 231, 0, 185, 187, 193, 196, - 0, 0, 93, 0, 0, 55, 43, 37, 0, 23, - 26, 0, 30, 34, 0, 60, 61, 0, 133, 134, - 15, 0, 0, 27, 31, 35, 38, 0, 47, 39, - 0, 0, 0, 62, + 0, 0, 0, 0, 74, 95, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 98, 100, 0, 102, + 0, 115, 116, 117, 118, 0, 0, 108, 0, 0, + 0, 0, 130, 131, 0, 90, 0, 86, 11, 14, + 0, -2, 64, 65, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 192, 0, 0, 0, 3, 0, + 163, 0, 0, 186, 189, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 120, + 0, 0, 0, 99, 106, 96, 126, 125, 104, 101, + 103, 0, 107, 114, 111, 0, 157, 155, 153, 154, + 162, 160, 158, 159, 0, 0, 0, 0, 0, 0, + 0, 94, 87, 0, 0, 0, 0, 0, 68, 69, + 70, 71, 72, 40, 47, 0, 15, 0, 0, 0, + 0, 0, 51, 0, 3, 192, 0, 229, 225, 0, + 230, 0, 195, 0, 0, 0, 0, 121, 122, 123, + 97, 105, 0, 0, 119, 0, 0, 0, 0, 0, + 137, 144, 151, 0, 136, 143, 150, 132, 139, 146, + 133, 140, 147, 134, 141, 148, 135, 142, 149, 138, + 145, 152, 0, 0, 92, 0, 0, 233, -2, 49, + 0, 16, 19, 35, 0, 23, 0, 27, 0, 0, + 0, 0, 0, 39, 53, 3, 52, 0, 0, 227, + 228, 0, 0, 181, 0, 183, 187, 0, 190, 0, + 127, 124, 112, 113, 109, 110, 156, 161, 0, 0, + 89, 0, 91, 0, 48, 20, 36, 37, 224, 24, + 43, 28, 31, 41, 0, 44, 45, 46, 17, 0, + 0, 0, 54, 3, 226, 0, 180, 182, 188, 191, + 0, 0, 88, 0, 0, 0, 50, 38, 32, 0, + 18, 21, 0, 25, 29, 0, 55, 56, 0, 128, + 129, 231, 247, 236, 0, 0, 0, 0, 22, 26, + 30, 33, 0, 237, 244, 240, 0, 0, 246, 42, + 34, 0, 245, 241, 238, 0, 0, 239, 242, 0, + 243, 57, } var exprTok1 = [...]int{ @@ -994,1111 +1011,1166 @@ exprdefault: exprVAL.LogExpr = exprDollar[2].LogExpr } case 15: - exprDollar = exprS[exprpt-8 : exprpt+1] - { - exprVAL.VariantsExpr = newVariantsExpr(exprDollar[3].VariantsList, exprDollar[7].LogExpr) - } - case 16: - exprDollar = exprS[exprpt-1 : exprpt+1] - { - exprVAL.VariantsOp = OpVariants - } - case 17: - exprDollar = exprS[exprpt-1 : exprpt+1] - { - exprVAL.VariantsOf = VariantsOf - } - case 18: - exprDollar = exprS[exprpt-1 : exprpt+1] - { - exprVAL.VariantsList = []SampleExpr{exprDollar[1].MetricExpr} - } - case 19: - exprDollar = exprS[exprpt-3 : exprpt+1] - { - exprVAL.VariantsList = append(exprDollar[1].VariantsList, exprDollar[3].MetricExpr) - } - case 20: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, nil, nil) } - case 21: + case 16: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, nil, exprDollar[3].OffsetExpr) } - case 22: + case 17: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, nil, nil) } - case 23: + case 18: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, nil, exprDollar[5].OffsetExpr) } - case 24: + case 19: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, exprDollar[3].UnwrapExpr, nil) } - case 25: + case 20: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, exprDollar[4].UnwrapExpr, exprDollar[3].OffsetExpr) } - case 26: + case 21: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, exprDollar[5].UnwrapExpr, nil) } - case 27: + case 22: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, exprDollar[6].UnwrapExpr, exprDollar[5].OffsetExpr) } - case 28: + case 23: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].duration, exprDollar[2].UnwrapExpr, nil) } - case 29: + case 24: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].duration, exprDollar[2].UnwrapExpr, exprDollar[4].OffsetExpr) } - case 30: + case 25: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[5].duration, exprDollar[3].UnwrapExpr, nil) } - case 31: + case 26: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[5].duration, exprDollar[3].UnwrapExpr, exprDollar[6].OffsetExpr) } - case 32: + case 27: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[3].duration, nil, nil) } - case 33: + case 28: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[3].duration, nil, exprDollar[4].OffsetExpr) } - case 34: + case 29: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[5].duration, nil, nil) } - case 35: + case 30: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[5].duration, nil, exprDollar[6].OffsetExpr) } - case 36: + case 31: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[4].duration, exprDollar[3].UnwrapExpr, nil) } - case 37: + case 32: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[4].duration, exprDollar[3].UnwrapExpr, exprDollar[5].OffsetExpr) } - case 38: + case 33: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[6].duration, exprDollar[4].UnwrapExpr, nil) } - case 39: + case 34: exprDollar = exprS[exprpt-7 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[6].duration, exprDollar[4].UnwrapExpr, exprDollar[7].OffsetExpr) } - case 40: + case 35: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].PipelineExpr), exprDollar[2].duration, nil, nil) } - case 41: + case 36: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[4].PipelineExpr), exprDollar[2].duration, nil, exprDollar[3].OffsetExpr) } - case 42: + case 37: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].PipelineExpr), exprDollar[2].duration, exprDollar[4].UnwrapExpr, nil) } - case 43: + case 38: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LogRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[4].PipelineExpr), exprDollar[2].duration, exprDollar[5].UnwrapExpr, exprDollar[3].OffsetExpr) } - case 44: + case 39: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogRangeExpr = exprDollar[2].LogRangeExpr } - case 46: + case 41: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.UnwrapExpr = newUnwrapExpr(exprDollar[3].str, "") } - case 47: + case 42: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.UnwrapExpr = newUnwrapExpr(exprDollar[5].str, exprDollar[3].ConvOp) } - case 48: + case 43: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.UnwrapExpr = exprDollar[1].UnwrapExpr.addPostFilter(exprDollar[3].LabelFilter) } - case 49: + case 44: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.ConvOp = OpConvBytes } - case 50: + case 45: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.ConvOp = OpConvDuration } - case 51: + case 46: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.ConvOp = OpConvDurationSeconds } - case 52: + case 47: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.RangeAggregationExpr = newRangeAggregationExpr(exprDollar[3].LogRangeExpr, exprDollar[1].RangeOp, nil, nil) } - case 53: + case 48: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.RangeAggregationExpr = newRangeAggregationExpr(exprDollar[5].LogRangeExpr, exprDollar[1].RangeOp, nil, &exprDollar[3].str) } - case 54: + case 49: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.RangeAggregationExpr = newRangeAggregationExpr(exprDollar[3].LogRangeExpr, exprDollar[1].RangeOp, exprDollar[5].Grouping, nil) } - case 55: + case 50: exprDollar = exprS[exprpt-7 : exprpt+1] { exprVAL.RangeAggregationExpr = newRangeAggregationExpr(exprDollar[5].LogRangeExpr, exprDollar[1].RangeOp, exprDollar[7].Grouping, &exprDollar[3].str) } - case 56: + case 51: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[3].MetricExpr, exprDollar[1].VectorOp, nil, nil) } - case 57: + case 52: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[4].MetricExpr, exprDollar[1].VectorOp, exprDollar[2].Grouping, nil) } - case 58: + case 53: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[3].MetricExpr, exprDollar[1].VectorOp, exprDollar[5].Grouping, nil) } - case 59: + case 54: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[5].MetricExpr, exprDollar[1].VectorOp, nil, &exprDollar[3].str) } - case 60: + case 55: exprDollar = exprS[exprpt-7 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[5].MetricExpr, exprDollar[1].VectorOp, exprDollar[7].Grouping, &exprDollar[3].str) } - case 61: + case 56: exprDollar = exprS[exprpt-7 : exprpt+1] { exprVAL.VectorAggregationExpr = mustNewVectorAggregationExpr(exprDollar[6].MetricExpr, exprDollar[1].VectorOp, exprDollar[2].Grouping, &exprDollar[4].str) } - case 62: + case 57: exprDollar = exprS[exprpt-12 : exprpt+1] { exprVAL.LabelReplaceExpr = mustNewLabelReplaceExpr(exprDollar[3].MetricExpr, exprDollar[5].str, exprDollar[7].str, exprDollar[9].str, exprDollar[11].str) } - case 63: + case 58: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchRegexp } - case 64: + case 59: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchEqual } - case 65: + case 60: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchPattern } - case 66: + case 61: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchNotRegexp } - case 67: + case 62: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchNotEqual } - case 68: + case 63: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Filter = log.LineMatchNotPattern } - case 69: + case 64: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Selector = exprDollar[2].Matchers } - case 70: + case 65: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Selector = exprDollar[2].Matchers } - case 71: + case 66: exprDollar = exprS[exprpt-2 : exprpt+1] { } - case 72: + case 67: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Matchers = []*labels.Matcher{exprDollar[1].Matcher} } - case 73: + case 68: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matchers = append(exprDollar[1].Matchers, exprDollar[3].Matcher) } - case 74: + case 69: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matcher = mustNewMatcher(labels.MatchEqual, exprDollar[1].str, exprDollar[3].str) } - case 75: + case 70: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matcher = mustNewMatcher(labels.MatchNotEqual, exprDollar[1].str, exprDollar[3].str) } - case 76: + case 71: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matcher = mustNewMatcher(labels.MatchRegexp, exprDollar[1].str, exprDollar[3].str) } - case 77: + case 72: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Matcher = mustNewMatcher(labels.MatchNotRegexp, exprDollar[1].str, exprDollar[3].str) } - case 78: + case 73: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.PipelineExpr = MultiStageExpr{exprDollar[1].PipelineStage} } - case 79: + case 74: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineExpr = append(exprDollar[1].PipelineExpr, exprDollar[2].PipelineStage) } - case 80: + case 75: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.PipelineStage = exprDollar[1].LineFilters } - case 81: + case 76: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LogfmtParser } - case 82: + case 77: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LabelParser } - case 83: + case 78: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].JSONExpressionParser } - case 84: + case 79: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LogfmtExpressionParser } - case 85: + case 80: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = &LabelFilterExpr{LabelFilterer: exprDollar[2].LabelFilter} } - case 86: + case 81: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LineFormatExpr } - case 87: + case 82: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].DecolorizeExpr } - case 88: + case 83: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].LabelFormatExpr } - case 89: + case 84: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].DropLabelsExpr } - case 90: + case 85: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.PipelineStage = exprDollar[2].KeepLabelsExpr } - case 91: + case 86: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.FilterOp = OpFilterIP } - case 92: + case 87: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.OrFilter = newLineFilterExpr(log.LineMatchEqual, "", exprDollar[1].str) } - case 93: + case 88: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.OrFilter = newLineFilterExpr(log.LineMatchEqual, exprDollar[1].FilterOp, exprDollar[3].str) } - case 94: + case 89: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.OrFilter = newOrLineFilter(newLineFilterExpr(log.LineMatchEqual, "", exprDollar[1].str), exprDollar[3].OrFilter) } - case 95: + case 90: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LineFilter = newLineFilterExpr(exprDollar[1].Filter, "", exprDollar[2].str) } - case 96: + case 91: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.LineFilter = newLineFilterExpr(exprDollar[1].Filter, exprDollar[2].FilterOp, exprDollar[4].str) } - case 97: + case 92: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.LineFilter = newOrLineFilter(newLineFilterExpr(exprDollar[1].Filter, "", exprDollar[2].str), exprDollar[4].OrFilter) } - case 98: + case 93: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LineFilters = exprDollar[1].LineFilter } - case 99: + case 94: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LineFilters = newOrLineFilter(exprDollar[1].LineFilter, exprDollar[3].OrFilter) } - case 100: + case 95: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LineFilters = newNestedLineFilterExpr(exprDollar[1].LineFilters, exprDollar[2].LineFilter) } - case 101: + case 96: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.ParserFlags = []string{exprDollar[1].str} } - case 102: + case 97: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.ParserFlags = append(exprDollar[1].ParserFlags, exprDollar[2].str) } - case 103: + case 98: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LogfmtParser = newLogfmtParserExpr(nil) } - case 104: + case 99: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LogfmtParser = newLogfmtParserExpr(exprDollar[2].ParserFlags) } - case 105: + case 100: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelParser = newLabelParserExpr(OpParserTypeJSON, "") } - case 106: + case 101: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LabelParser = newLabelParserExpr(OpParserTypeRegexp, exprDollar[2].str) } - case 107: + case 102: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelParser = newLabelParserExpr(OpParserTypeUnpack, "") } - case 108: + case 103: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LabelParser = newLabelParserExpr(OpParserTypePattern, exprDollar[2].str) } - case 109: + case 104: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.JSONExpressionParser = newJSONExpressionParser(exprDollar[2].LabelExtractionExpressionList) } - case 110: + case 105: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LogfmtExpressionParser = newLogfmtExpressionParser(exprDollar[3].LabelExtractionExpressionList, exprDollar[2].ParserFlags) } - case 111: + case 106: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LogfmtExpressionParser = newLogfmtExpressionParser(exprDollar[2].LabelExtractionExpressionList, nil) } - case 112: + case 107: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LineFormatExpr = newLineFmtExpr(exprDollar[2].str) } - case 113: + case 108: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.DecolorizeExpr = newDecolorizeExpr() } - case 114: + case 109: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFormat = log.NewRenameLabelFmt(exprDollar[1].str, exprDollar[3].str) } - case 115: + case 110: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFormat = log.NewTemplateLabelFmt(exprDollar[1].str, exprDollar[3].str) } - case 116: + case 111: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelsFormat = []log.LabelFmt{exprDollar[1].LabelFormat} } - case 117: + case 112: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelsFormat = append(exprDollar[1].LabelsFormat, exprDollar[3].LabelFormat) } - case 119: + case 114: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LabelFormatExpr = newLabelFmtExpr(exprDollar[2].LabelsFormat) } - case 120: + case 115: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelFilter = log.NewStringLabelFilter(exprDollar[1].Matcher) } - case 121: + case 116: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelFilter = exprDollar[1].IPLabelFilter } - case 122: + case 117: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelFilter = exprDollar[1].UnitFilter } - case 123: + case 118: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelFilter = exprDollar[1].NumberFilter } - case 124: + case 119: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFilter = exprDollar[2].LabelFilter } - case 125: + case 120: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LabelFilter = log.NewAndLabelFilter(exprDollar[1].LabelFilter, exprDollar[2].LabelFilter) } - case 126: + case 121: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFilter = log.NewAndLabelFilter(exprDollar[1].LabelFilter, exprDollar[3].LabelFilter) } - case 127: + case 122: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFilter = log.NewAndLabelFilter(exprDollar[1].LabelFilter, exprDollar[3].LabelFilter) } - case 128: + case 123: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelFilter = log.NewOrLabelFilter(exprDollar[1].LabelFilter, exprDollar[3].LabelFilter) } - case 129: + case 124: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelExtractionExpression = log.NewLabelExtractionExpr(exprDollar[1].str, exprDollar[3].str) } - case 130: + case 125: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelExtractionExpression = log.NewLabelExtractionExpr(exprDollar[1].str, exprDollar[1].str) } - case 131: + case 126: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LabelExtractionExpressionList = []log.LabelExtractionExpr{exprDollar[1].LabelExtractionExpression} } - case 132: + case 127: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.LabelExtractionExpressionList = append(exprDollar[1].LabelExtractionExpressionList, exprDollar[3].LabelExtractionExpression) } - case 133: + case 128: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.IPLabelFilter = log.NewIPLabelFilter(exprDollar[5].str, exprDollar[1].str, log.LabelFilterEqual) } - case 134: + case 129: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.IPLabelFilter = log.NewIPLabelFilter(exprDollar[5].str, exprDollar[1].str, log.LabelFilterNotEqual) } - case 135: + case 130: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.UnitFilter = exprDollar[1].DurationFilter } - case 136: + case 131: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.UnitFilter = exprDollar[1].BytesFilter } - case 137: + case 132: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterGreaterThan, exprDollar[1].str, exprDollar[3].duration) } - case 138: + case 133: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterGreaterThanOrEqual, exprDollar[1].str, exprDollar[3].duration) } - case 139: + case 134: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterLesserThan, exprDollar[1].str, exprDollar[3].duration) } - case 140: + case 135: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterLesserThanOrEqual, exprDollar[1].str, exprDollar[3].duration) } - case 141: + case 136: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterNotEqual, exprDollar[1].str, exprDollar[3].duration) } - case 142: + case 137: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].duration) } - case 143: + case 138: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DurationFilter = log.NewDurationLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].duration) } - case 144: + case 139: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterGreaterThan, exprDollar[1].str, exprDollar[3].bytes) } - case 145: + case 140: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterGreaterThanOrEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 146: + case 141: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterLesserThan, exprDollar[1].str, exprDollar[3].bytes) } - case 147: + case 142: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterLesserThanOrEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 148: + case 143: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterNotEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 149: + case 144: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 150: + case 145: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.BytesFilter = log.NewBytesLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].bytes) } - case 151: + case 146: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterGreaterThan, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 152: + case 147: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterGreaterThanOrEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 153: + case 148: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterLesserThan, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 154: + case 149: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterLesserThanOrEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 155: + case 150: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterNotEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 156: + case 151: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 157: + case 152: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.NumberFilter = log.NewNumericLabelFilter(log.LabelFilterEqual, exprDollar[1].str, exprDollar[3].LiteralExpr.Val) } - case 158: + case 153: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.DropLabel = log.NewDropLabel(nil, exprDollar[1].str) } - case 159: + case 154: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.DropLabel = log.NewDropLabel(exprDollar[1].Matcher, "") } - case 160: + case 155: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.DropLabels = []log.DropLabel{exprDollar[1].DropLabel} } - case 161: + case 156: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.DropLabels = append(exprDollar[1].DropLabels, exprDollar[3].DropLabel) } - case 162: + case 157: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.DropLabelsExpr = newDropLabelsExpr(exprDollar[2].DropLabels) } - case 163: + case 158: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.KeepLabel = log.NewKeepLabel(nil, exprDollar[1].str) } - case 164: + case 159: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.KeepLabel = log.NewKeepLabel(exprDollar[1].Matcher, "") } - case 165: + case 160: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.KeepLabels = []log.KeepLabel{exprDollar[1].KeepLabel} } - case 166: + case 161: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.KeepLabels = append(exprDollar[1].KeepLabels, exprDollar[3].KeepLabel) } - case 167: + case 162: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.KeepLabelsExpr = newKeepLabelsExpr(exprDollar[2].KeepLabels) } - case 168: + case 163: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("or", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 169: + case 164: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("and", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 170: + case 165: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("unless", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 171: + case 166: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("+", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 172: + case 167: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("-", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 173: + case 168: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("*", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 174: + case 169: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("/", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 175: + case 170: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("%", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 176: + case 171: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("^", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 177: + case 172: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("==", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 178: + case 173: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("!=", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 179: + case 174: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr(">", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 180: + case 175: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr(">=", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 181: + case 176: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("<", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 182: + case 177: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpExpr = mustNewBinOpExpr("<=", exprDollar[3].BinOpModifier, exprDollar[1].Expr, exprDollar[4].Expr) } - case 183: + case 178: exprDollar = exprS[exprpt-0 : exprpt+1] { exprVAL.BoolModifier = &BinOpOptions{VectorMatching: &VectorMatching{Card: CardOneToOne}} } - case 184: + case 179: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.BoolModifier = &BinOpOptions{VectorMatching: &VectorMatching{Card: CardOneToOne}, ReturnBool: true} } - case 185: + case 180: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.OnOrIgnoringModifier = exprDollar[1].BoolModifier exprVAL.OnOrIgnoringModifier.VectorMatching.On = true exprVAL.OnOrIgnoringModifier.VectorMatching.MatchingLabels = exprDollar[4].Labels } - case 186: + case 181: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.OnOrIgnoringModifier = exprDollar[1].BoolModifier exprVAL.OnOrIgnoringModifier.VectorMatching.On = true } - case 187: + case 182: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.OnOrIgnoringModifier = exprDollar[1].BoolModifier exprVAL.OnOrIgnoringModifier.VectorMatching.MatchingLabels = exprDollar[4].Labels } - case 188: + case 183: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.OnOrIgnoringModifier = exprDollar[1].BoolModifier } - case 189: + case 184: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].BoolModifier } - case 190: + case 185: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier } - case 191: + case 186: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardManyToOne } - case 192: + case 187: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardManyToOne } - case 193: + case 188: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardManyToOne exprVAL.BinOpModifier.VectorMatching.Include = exprDollar[4].Labels } - case 194: + case 189: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardOneToMany } - case 195: + case 190: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardOneToMany } - case 196: + case 191: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.BinOpModifier = exprDollar[1].OnOrIgnoringModifier exprVAL.BinOpModifier.VectorMatching.Card = CardOneToMany exprVAL.BinOpModifier.VectorMatching.Include = exprDollar[4].Labels } - case 197: + case 192: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.LiteralExpr = mustNewLiteralExpr(exprDollar[1].str, false) } - case 198: + case 193: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LiteralExpr = mustNewLiteralExpr(exprDollar[2].str, false) } - case 199: + case 194: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.LiteralExpr = mustNewLiteralExpr(exprDollar[2].str, true) } - case 200: + case 195: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.VectorExpr = NewVectorExpr(exprDollar[3].str) } - case 201: + case 196: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Vector = OpTypeVector } - case 202: + case 197: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeSum } - case 203: + case 198: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeAvg } - case 204: + case 199: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeCount } - case 205: + case 200: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeMax } - case 206: + case 201: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeMin } - case 207: + case 202: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeStddev } - case 208: + case 203: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeStdvar } - case 209: + case 204: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeBottomK } - case 210: + case 205: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeTopK } - case 211: + case 206: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeSort } - case 212: + case 207: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeSortDesc } - case 213: + case 208: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VectorOp = OpTypeApproxTopK } - case 214: + case 209: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeCount } - case 215: + case 210: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeRate } - case 216: + case 211: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeRateCounter } - case 217: + case 212: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeBytes } - case 218: + case 213: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeBytesRate } - case 219: + case 214: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeAvg } - case 220: + case 215: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeSum } - case 221: + case 216: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeMin } - case 222: + case 217: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeMax } - case 223: + case 218: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeStdvar } - case 224: + case 219: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeStddev } - case 225: + case 220: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeQuantile } - case 226: + case 221: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeFirst } - case 227: + case 222: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeLast } - case 228: + case 223: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.RangeOp = OpRangeTypeAbsent } - case 229: + case 224: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.OffsetExpr = newOffsetExpr(exprDollar[2].duration) } - case 230: + case 225: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.Labels = []string{exprDollar[1].str} } - case 231: + case 226: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Labels = append(exprDollar[1].Labels, exprDollar[3].str) } - case 232: + case 227: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.Grouping = &Grouping{Without: false, Groups: exprDollar[3].Labels} } - case 233: + case 228: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.Grouping = &Grouping{Without: true, Groups: exprDollar[3].Labels} } - case 234: + case 229: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Grouping = &Grouping{Without: false, Groups: nil} } - case 235: + case 230: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.Grouping = &Grouping{Without: true, Groups: nil} } + case 231: + exprDollar = exprS[exprpt-8 : exprpt+1] + { + exprVAL.VariantsExpr = newVariantsExpr(exprDollar[3].VariantsList, exprDollar[7].VariantsRangeExpr) + } + case 232: + exprDollar = exprS[exprpt-1 : exprpt+1] + { + exprVAL.VariantsOp = OpVariants + } + case 233: + exprDollar = exprS[exprpt-1 : exprpt+1] + { + exprVAL.VariantsOf = VariantsOf + } + case 234: + exprDollar = exprS[exprpt-1 : exprpt+1] + { + exprVAL.VariantsList = []SampleExpr{exprDollar[1].MetricExpr} + } + case 235: + exprDollar = exprS[exprpt-3 : exprpt+1] + { + exprVAL.VariantsList = append(exprDollar[1].VariantsList, exprDollar[3].MetricExpr) + } + case 236: + exprDollar = exprS[exprpt-2 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, nil, nil) + } + case 237: + exprDollar = exprS[exprpt-3 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, nil, exprDollar[3].OffsetExpr) + } + case 238: + exprDollar = exprS[exprpt-4 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, nil, nil) + } + case 239: + exprDollar = exprS[exprpt-5 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, nil, exprDollar[5].OffsetExpr) + } + case 240: + exprDollar = exprS[exprpt-3 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[3].duration, nil, nil) + } + case 241: + exprDollar = exprS[exprpt-4 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[3].duration, nil, exprDollar[4].OffsetExpr) + } + case 242: + exprDollar = exprS[exprpt-5 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[5].duration, nil, nil) + } + case 243: + exprDollar = exprS[exprpt-6 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[5].duration, nil, exprDollar[6].OffsetExpr) + } + case 244: + exprDollar = exprS[exprpt-3 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].PipelineExpr), exprDollar[2].duration, nil, nil) + } + case 245: + exprDollar = exprS[exprpt-4 : exprpt+1] + { + exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[4].PipelineExpr), exprDollar[2].duration, nil, exprDollar[3].OffsetExpr) + } + case 246: + exprDollar = exprS[exprpt-3 : exprpt+1] + { + exprVAL.VariantsRangeExpr = exprDollar[2].VariantsRangeExpr + } } goto exprstack /* stack new state and value */ } diff --git a/pkg/logql/syntax/parser.go b/pkg/logql/syntax/parser.go index cfafd3bc9c28b..da5700ff4ea7e 100644 --- a/pkg/logql/syntax/parser.go +++ b/pkg/logql/syntax/parser.go @@ -127,7 +127,7 @@ func validateExpr(expr Expr) error { } func validateVariantsExpr(e VariantsExpr) error { - err := validateLogSelectorExpression(e.LogSelector()) + err := validateLogSelectorExpression(e.LogRange().Left) if err != nil { return err } diff --git a/pkg/logql/syntax/serialize.go b/pkg/logql/syntax/serialize.go index 4e4362683543e..82276d3312784 100644 --- a/pkg/logql/syntax/serialize.go +++ b/pkg/logql/syntax/serialize.go @@ -77,6 +77,8 @@ const ( VectorAgg = "vector_agg" VectorMatchingField = "vector_matching" Without = "without" + Variants = "variants" + Of = "of" ) func DecodeJSON(raw string) (Expr, error) { @@ -98,6 +100,8 @@ func DecodeJSON(raw string) (Expr, error) { return decodeLabelReplace(iter) case LogSelector: return decodeLogSelector(iter) + case Variants: + return decodeVariants(iter) default: return nil, fmt.Errorf("unknown expression type: %s", key) } @@ -304,6 +308,45 @@ func (v *JSONSerializer) VisitPipeline(e *PipelineExpr) { v.Flush() } +func (v *JSONSerializer) VisitVariants(e *MultiVariantExpr) { + v.WriteObjectStart() + + v.WriteObjectField(Variants) + v.WriteObjectStart() + + v.WriteObjectField(LogSelector) + + // Serialize log range as string. + v.WriteObjectStart() + v.WriteObjectField(IntervalNanos) + + logRange := e.LogRange() + v.WriteInt64(int64(logRange.Interval)) + v.WriteMore() + v.WriteObjectField(OffsetNanos) + v.WriteInt64(int64(logRange.Offset)) + + // Serialize log selector pipeline as string. + v.WriteMore() + v.WriteObjectField(LogSelector) + encodeLogSelector(v.Stream, logRange.Left) + v.WriteObjectEnd() + v.WriteMore() + + v.WriteObjectField(Variants) + v.WriteArrayStart() + for i, variant := range e.Variants() { + if i > 0 { + v.WriteMore() + } + variant.Accept(v) + } + v.WriteArrayEnd() + v.WriteObjectEnd() + v.WriteObjectEnd() + v.Flush() +} + // Below are StageExpr visitors that we are skipping since a pipeline is // serialized as a string. func (*JSONSerializer) VisitDecolorize(*DecolorizeExpr) {} @@ -724,6 +767,33 @@ func decodeSample(iter *jsoniter.Iterator) (SampleExpr, error) { return expr, err } +func decodeVariants(iter *jsoniter.Iterator) (VariantsExpr, error) { + var e MultiVariantExpr + + for f := iter.ReadObject(); f != ""; f = iter.ReadObject() { + switch f { + case Variants: + for iter.ReadArray() { + expr, err := decodeSample(iter) + if err != nil { + return nil, err + } + + e.AddVariant(expr) + } + case LogSelector: + logRange, err := decodeLogRange(iter) + if err != nil { + return nil, err + } + + e.SetLogSelector(logRange) + } + } + + return &e, nil +} + func decodeBinOp(iter *jsoniter.Iterator) (*BinOpExpr, error) { expr := &BinOpExpr{} var err error diff --git a/pkg/logql/syntax/serialize_test.go b/pkg/logql/syntax/serialize_test.go index 51469b74da1dd..19ca479d2c130 100644 --- a/pkg/logql/syntax/serialize_test.go +++ b/pkg/logql/syntax/serialize_test.go @@ -4,7 +4,9 @@ import ( "bytes" "strings" "testing" + "time" + "github.com/prometheus/prometheus/model/labels" "github.com/stretchr/testify/require" ) @@ -59,6 +61,12 @@ func TestJSONSerializationRoundTrip(t *testing.T) { "empty label filter string": { query: `rate({app="foo"} |= "bar" | json | unwrap latency | path!="" [5m])`, }, + "single variant": { + query: `variants(count_over_time({app="loki"} [1m])) of ({app="loki"}[1m])`, + }, + "multiple variants": { + query: `variants(count_over_time({app="loki"} [1m]), bytes_over_time({app="loki"} [1m])) of ({app="loki"}[1m])`, + }, } for name, test := range tests { @@ -104,3 +112,80 @@ func TestJSONSerializationParseTestCases(t *testing.T) { } } } + +func TestJSONSerializationRoundTrip_Variants(t *testing.T) { + tests := map[string]struct { + query string + expected MultiVariantExpr + }{ + "single variant": { + query: `variants(count_over_time({app="loki"} [5m])) of ({app="loki"} [5m])`, + expected: MultiVariantExpr{ + logRange: newLogRange( + newMatcherExpr( + []*labels.Matcher{mustNewMatcher(labels.MatchEqual, "app", "loki")}, + ), 5*time.Minute, nil, nil), + variants: []SampleExpr{ + newRangeAggregationExpr(&LogRange{ + Left: &MatchersExpr{ + Mts: []*labels.Matcher{ + mustNewMatcher(labels.MatchEqual, "app", "loki"), + }, + }, + Interval: 5 * time.Minute, + }, "count_over_time", nil, nil), + }, + }, + }, + "multiple variants": { + query: `variants(count_over_time({app="loki"} [5m]), bytes_over_time({app="loki"} [5m])) of ({app="loki"}[5m])`, + expected: MultiVariantExpr{ + logRange: newLogRange( + newMatcherExpr( + []*labels.Matcher{mustNewMatcher(labels.MatchEqual, "app", "loki")}, + ), 5*time.Minute, nil, nil), + variants: []SampleExpr{ + newRangeAggregationExpr(&LogRange{ + Left: &MatchersExpr{ + Mts: []*labels.Matcher{ + mustNewMatcher(labels.MatchEqual, "app", "loki"), + }, + }, + Interval: 5 * time.Minute, + }, "count_over_time", nil, nil), + newRangeAggregationExpr(&LogRange{ + Left: &MatchersExpr{ + Mts: []*labels.Matcher{ + mustNewMatcher(labels.MatchEqual, "app", "loki"), + }, + }, + Interval: 5 * time.Minute, + }, "bytes_over_time", nil, nil), + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + expr, err := ParseExpr(test.query) + require.NoError(t, err) + + var buf bytes.Buffer + err = EncodeJSON(expr, &buf) + require.NoError(t, err) + + actual, err := DecodeJSON(buf.String()) + require.NoError(t, err) + + require.Equal(t, expr.Pretty(0), actual.Pretty(0)) + + require.ElementsMatch( + t, + test.expected.Variants(), + actual.(*MultiVariantExpr).Variants(), + ) + require.Equal(t, test.expected.LogRange(), actual.(*MultiVariantExpr).LogRange()) + }) + } +} diff --git a/pkg/logql/syntax/test_utils.go b/pkg/logql/syntax/test_utils.go index 4aff08dbbd343..4b6fd07fbe905 100644 --- a/pkg/logql/syntax/test_utils.go +++ b/pkg/logql/syntax/test_utils.go @@ -54,7 +54,7 @@ func removeFastRegexMatcherFromExpr(expr Expr) Expr { } typed.Unwrap.PostFilters = cleaned case *MultiVariantExpr: - typed.logSelector = removeFastRegexMatcherFromExpr(typed.logSelector).(LogSelectorExpr) + typed.logRange.Left = removeFastRegexMatcherFromExpr(typed.logRange.Left).(LogSelectorExpr) for i, variant := range typed.variants { typed.variants[i] = removeFastRegexMatcherFromExpr(variant).(SampleExpr) } diff --git a/pkg/logql/syntax/visit.go b/pkg/logql/syntax/visit.go index 968c5b53b01b5..3e4321fb876d6 100644 --- a/pkg/logql/syntax/visit.go +++ b/pkg/logql/syntax/visit.go @@ -7,6 +7,7 @@ type AcceptVisitor interface { type RootVisitor interface { SampleExprVisitor LogSelectorExprVisitor + VariantExprVisitor StageExprVisitor VisitLogRange(*LogRange) @@ -28,6 +29,10 @@ type LogSelectorExprVisitor interface { VisitVector(*VectorExpr) } +type VariantExprVisitor interface { + VisitVariants(*MultiVariantExpr) +} + type StageExprVisitor interface { VisitDecolorize(*DecolorizeExpr) VisitDropLabels(*DropLabelsExpr) @@ -67,6 +72,10 @@ type DepthFirstTraversal struct { VisitVectorAggregationFn func(v RootVisitor, e *VectorAggregationExpr) } +func (d *DepthFirstTraversal) VisitVariants(_ *MultiVariantExpr) { + panic("not implemented") // TODO: Implement +} + // VisitBinOp implements RootVisitor. func (v *DepthFirstTraversal) VisitBinOp(e *BinOpExpr) { if e == nil { diff --git a/pkg/logql/test_utils.go b/pkg/logql/test_utils.go index e7f003327ea01..010acb2565a09 100644 --- a/pkg/logql/test_utils.go +++ b/pkg/logql/test_utils.go @@ -38,6 +38,10 @@ type MockQuerier struct { streams []logproto.Stream } +func (q MockQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on MockQuerier") // TODO: Implement +} + func (q MockQuerier) extractOldShard(xs []string) (*index.ShardAnnotation, error) { parsed, version, err := ParseShards(xs) if err != nil { diff --git a/pkg/querier-rf1/querier.go b/pkg/querier-rf1/querier.go new file mode 100644 index 0000000000000..61796a2f75085 --- /dev/null +++ b/pkg/querier-rf1/querier.go @@ -0,0 +1,935 @@ +package querierrf1 + +import ( + "context" + "flag" + "fmt" + "net/http" + "sort" + "strconv" + "time" + + "github.com/axiomhq/hyperloglog" + "github.com/dustin/go-humanize" + "github.com/go-kit/log" + "github.com/go-kit/log/level" + "github.com/google/uuid" + "github.com/grafana/dskit/httpgrpc" + "github.com/grafana/dskit/tenant" + "github.com/opentracing/opentracing-go" + "github.com/pkg/errors" + "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/model/labels" + "golang.org/x/exp/slices" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc/health/grpc_health_v1" + + "github.com/grafana/loki/v3/pkg/compactor/deletion" + "github.com/grafana/loki/v3/pkg/indexgateway" + "github.com/grafana/loki/v3/pkg/iter" + "github.com/grafana/loki/v3/pkg/loghttp" + "github.com/grafana/loki/v3/pkg/logproto" + "github.com/grafana/loki/v3/pkg/logql" + logql_log "github.com/grafana/loki/v3/pkg/logql/log" + "github.com/grafana/loki/v3/pkg/logql/syntax" + "github.com/grafana/loki/v3/pkg/logqlmodel" + "github.com/grafana/loki/v3/pkg/querier" + "github.com/grafana/loki/v3/pkg/querier-rf1/wal" + querier_limits "github.com/grafana/loki/v3/pkg/querier/limits" + "github.com/grafana/loki/v3/pkg/querier/plan" + "github.com/grafana/loki/v3/pkg/storage" + "github.com/grafana/loki/v3/pkg/storage/stores/index" + "github.com/grafana/loki/v3/pkg/storage/stores/index/seriesvolume" + "github.com/grafana/loki/v3/pkg/storage/stores/index/stats" + "github.com/grafana/loki/v3/pkg/util/spanlogger" + util_validation "github.com/grafana/loki/v3/pkg/util/validation" +) + +var nowFunc = func() time.Time { return time.Now() } + +type Config struct { + Enabled bool + ExtraQueryDelay time.Duration `yaml:"extra_query_delay,omitempty"` + Engine logql.EngineOpts `yaml:"engine,omitempty"` + MaxConcurrent int `yaml:"max_concurrent"` + PerRequestLimitsEnabled bool `yaml:"per_request_limits_enabled"` +} + +// RegisterFlags register flags. +func (cfg *Config) RegisterFlags(f *flag.FlagSet) { + cfg.Engine.RegisterFlagsWithPrefix("querier-rf1", f) + f.BoolVar(&cfg.Enabled, "querier-rf1.enabled", false, "Enable the RF1 querier. If set, replaces the usual querier with an RF-1 querier.") + f.DurationVar(&cfg.ExtraQueryDelay, "querier-rf1.extra-query-delay", 0, "Time to wait before sending more than the minimum successful query requests.") + f.IntVar(&cfg.MaxConcurrent, "querier-rf1.max-concurrent", 4, "The maximum number of queries that can be simultaneously processed by the querier.") + f.BoolVar(&cfg.PerRequestLimitsEnabled, "querier-rf1.per-request-limits-enabled", false, "When true, querier limits sent via a header are enforced.") +} + +var _ Querier = &Rf1Querier{} + +// Querier can select logs and samples and handle query requests. +type Querier interface { + logql.Querier + Label(ctx context.Context, req *logproto.LabelRequest) (*logproto.LabelResponse, error) + Series(ctx context.Context, req *logproto.SeriesRequest) (*logproto.SeriesResponse, error) + Tail(ctx context.Context, req *logproto.TailRequest, categorizedLabels bool) (*querier.Tailer, error) + IndexStats(ctx context.Context, req *loghttp.RangeQuery) (*stats.Stats, error) + IndexShards(ctx context.Context, req *loghttp.RangeQuery, targetBytesPerShard uint64) (*logproto.ShardsResponse, error) + Volume(ctx context.Context, req *logproto.VolumeRequest) (*logproto.VolumeResponse, error) + DetectedFields(ctx context.Context, req *logproto.DetectedFieldsRequest) (*logproto.DetectedFieldsResponse, error) + Patterns(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error) + DetectedLabels(ctx context.Context, req *logproto.DetectedLabelsRequest) (*logproto.DetectedLabelsResponse, error) +} + +type Limits querier_limits.Limits + +// Store is the store interface we need on the querier. +type Store interface { + storage.SelectStore + index.BaseReader + index.StatsReader +} + +// Rf1Querier handles rf1 queries. +type Rf1Querier struct { + cfg Config + store Store + limits Limits + deleteGetter deleteGetter + logger log.Logger + patternQuerier PatterQuerier + walQuerier logql.Querier +} + +func (r *Rf1Querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on Rf1Querier") // TODO: Implement +} + +type deleteGetter interface { + GetAllDeleteRequestsForUser(ctx context.Context, userID string) ([]deletion.DeleteRequest, error) +} + +// New makes a new Querier for RF1 work. +func New(cfg Config, store Store, limits Limits, d deleteGetter, metastore wal.Metastore, b wal.BlockStorage, logger log.Logger) (*Rf1Querier, error) { + querier, err := wal.New(metastore, b) + if err != nil { + return nil, err + } + return &Rf1Querier{ + cfg: cfg, + store: store, + limits: limits, + deleteGetter: d, + walQuerier: querier, + logger: logger, + }, nil +} + +// Select Implements logql.Querier which select logs via matchers and regex filters. +func (q *Rf1Querier) SelectLogs(ctx context.Context, params logql.SelectLogParams) (iter.EntryIterator, error) { + var err error + params.Start, params.End, err = q.validateQueryRequest(ctx, params) + if err != nil { + return nil, err + } + + params.QueryRequest.Deletes, err = q.deletesForUser(ctx, params.Start, params.End) + if err != nil { + level.Error(spanlogger.FromContext(ctx)).Log("msg", "failed loading deletes for user", "err", err) + } + + sp := opentracing.SpanFromContext(ctx) + iters := []iter.EntryIterator{} + if sp != nil { + sp.LogKV( + "msg", "querying rf1 store", + "params", params) + } + storeIter, err := q.walQuerier.SelectLogs(ctx, params) + if err != nil { + return nil, err + } + + iters = append(iters, storeIter) + if len(iters) == 1 { + return iters[0], nil + } + return iter.NewMergeEntryIterator(ctx, iters, params.Direction), nil +} + +func (q *Rf1Querier) SelectSamples(ctx context.Context, params logql.SelectSampleParams) (iter.SampleIterator, error) { + var err error + params.Start, params.End, err = q.validateQueryRequest(ctx, params) + if err != nil { + return nil, err + } + + params.SampleQueryRequest.Deletes, err = q.deletesForUser(ctx, params.Start, params.End) + if err != nil { + level.Error(spanlogger.FromContext(ctx)).Log("msg", "failed loading deletes for user", "err", err) + } + + sp := opentracing.SpanFromContext(ctx) + if sp != nil { + sp.LogKV( + "msg", "querying rf1 store for samples", + "params", params) + } + storeIter, err := q.walQuerier.SelectSamples(ctx, params) + if err != nil { + return nil, err + } + + iters := []iter.SampleIterator{} + iters = append(iters, storeIter) + return iter.NewMergeSampleIterator(ctx, iters), nil +} + +func (q *Rf1Querier) deletesForUser(ctx context.Context, startT, endT time.Time) ([]*logproto.Delete, error) { + userID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + + d, err := q.deleteGetter.GetAllDeleteRequestsForUser(ctx, userID) + if err != nil { + return nil, err + } + + start := startT.UnixNano() + end := endT.UnixNano() + + var deletes []*logproto.Delete + for _, del := range d { + if del.StartTime.UnixNano() <= end && del.EndTime.UnixNano() >= start { + deletes = append(deletes, &logproto.Delete{ + Selector: del.Query, + Start: del.StartTime.UnixNano(), + End: del.EndTime.UnixNano(), + }) + } + } + + return deletes, nil +} + +// Label does the heavy lifting for a Label query. +func (q *Rf1Querier) Label(ctx context.Context, req *logproto.LabelRequest) (*logproto.LabelResponse, error) { + userID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + + if *req.Start, *req.End, err = validateQueryTimeRangeLimits(ctx, userID, q.limits, *req.Start, *req.End); err != nil { + return nil, err + } + + var matchers []*labels.Matcher + if req.Query != "" { + matchers, err = syntax.ParseMatchers(req.Query, true) + if err != nil { + return nil, err + } + } + + // Enforce the query timeout while querying backends + queryTimeout := q.limits.QueryTimeout(ctx, userID) + ctx, cancel := context.WithDeadline(ctx, time.Now().Add(queryTimeout)) + defer cancel() + + g, ctx := errgroup.WithContext(ctx) + + var storeValues []string + g.Go(func() error { + var ( + err error + from = model.TimeFromUnixNano(req.Start.UnixNano()) + through = model.TimeFromUnixNano(req.End.UnixNano()) + ) + + if req.Values { + storeValues, err = q.store.LabelValuesForMetricName(ctx, userID, from, through, "logs", req.Name, matchers...) + } else { + storeValues, err = q.store.LabelNamesForMetricName(ctx, userID, from, through, "logs", matchers...) + } + return err + }) + + if err := g.Wait(); err != nil { + return nil, err + } + + return &logproto.LabelResponse{ + Values: storeValues, + }, nil +} + +// Check implements the grpc healthcheck +func (*Rf1Querier) Check(_ context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) { + return &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_SERVING}, nil +} + +// Tail keeps getting matching logs from all ingesters for given query +func (q *Rf1Querier) Tail(_ context.Context, _ *logproto.TailRequest, _ bool) (*querier.Tailer, error) { + return nil, errors.New("not implemented") +} + +// Series fetches any matching series for a list of matcher sets +func (q *Rf1Querier) Series(ctx context.Context, req *logproto.SeriesRequest) (*logproto.SeriesResponse, error) { + userID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + + if req.Start, req.End, err = validateQueryTimeRangeLimits(ctx, userID, q.limits, req.Start, req.End); err != nil { + return nil, err + } + + // Enforce the query timeout while querying backends + queryTimeout := q.limits.QueryTimeout(ctx, userID) + ctx, cancel := context.WithDeadlineCause(ctx, time.Now().Add(queryTimeout), errors.New("query timeout reached")) + defer cancel() + + return q.awaitSeries(ctx, req) +} + +func (q *Rf1Querier) awaitSeries(ctx context.Context, req *logproto.SeriesRequest) (*logproto.SeriesResponse, error) { + // buffer the channels to the # of calls they're expecting su + series := make(chan [][]logproto.SeriesIdentifier, 1) + errs := make(chan error, 1) + + go func() { + storeValues, err := q.seriesForMatchers(ctx, req.Start, req.End, req.GetGroups(), req.Shards) + if err != nil { + errs <- err + return + } + series <- [][]logproto.SeriesIdentifier{storeValues} + }() + + var sets [][]logproto.SeriesIdentifier + for i := 0; i < 2; i++ { + select { + case err := <-errs: + return nil, err + case s := <-series: + sets = append(sets, s...) + } + } + + response := &logproto.SeriesResponse{ + Series: make([]logproto.SeriesIdentifier, 0), + } + seen := make(map[uint64]struct{}) + b := make([]byte, 0, 1024) + for _, set := range sets { + for _, s := range set { + key := s.Hash(b) + if _, exists := seen[key]; !exists { + seen[key] = struct{}{} + response.Series = append(response.Series, s) + } + } + } + + return response, nil +} + +// seriesForMatchers fetches series from the store for each matcher set +// TODO: make efficient if/when the index supports labels so we don't have to read chunks +func (q *Rf1Querier) seriesForMatchers( + ctx context.Context, + from, through time.Time, + groups []string, + shards []string, +) ([]logproto.SeriesIdentifier, error) { + var results []logproto.SeriesIdentifier + // If no matchers were specified for the series query, + // we send a query with an empty matcher which will match every series. + if len(groups) == 0 { + var err error + results, err = q.seriesForMatcher(ctx, from, through, "", shards) + if err != nil { + return nil, err + } + } else { + for _, group := range groups { + ids, err := q.seriesForMatcher(ctx, from, through, group, shards) + if err != nil { + return nil, err + } + results = append(results, ids...) + } + } + return results, nil +} + +// seriesForMatcher fetches series from the store for a given matcher +func (q *Rf1Querier) seriesForMatcher(ctx context.Context, from, through time.Time, matcher string, shards []string) ([]logproto.SeriesIdentifier, error) { + var parsed syntax.Expr + var err error + if matcher != "" { + parsed, err = syntax.ParseExpr(matcher) + if err != nil { + return nil, err + } + } + + ids, err := q.store.SelectSeries(ctx, logql.SelectLogParams{ + QueryRequest: &logproto.QueryRequest{ + Selector: matcher, + Limit: 1, + Start: from, + End: through, + Direction: logproto.FORWARD, + Shards: shards, + Plan: &plan.QueryPlan{ + AST: parsed, + }, + }, + }) + if err != nil { + return nil, err + } + return ids, nil +} + +func (q *Rf1Querier) validateQueryRequest(ctx context.Context, req logql.QueryParams) (time.Time, time.Time, error) { + userID, err := tenant.TenantID(ctx) + if err != nil { + return time.Time{}, time.Time{}, err + } + + selector, err := req.LogSelector() + if err != nil { + return time.Time{}, time.Time{}, err + } + matchers := selector.Matchers() + + maxStreamMatchersPerQuery := q.limits.MaxStreamsMatchersPerQuery(ctx, userID) + if len(matchers) > maxStreamMatchersPerQuery { + return time.Time{}, time.Time{}, httpgrpc.Errorf(http.StatusBadRequest, + "max streams matchers per query exceeded, matchers-count > limit (%d > %d)", len(matchers), maxStreamMatchersPerQuery) + } + + return validateQueryTimeRangeLimits(ctx, userID, q.limits, req.GetStart(), req.GetEnd()) +} + +type TimeRangeLimits querier_limits.TimeRangeLimits + +func validateQueryTimeRangeLimits(ctx context.Context, userID string, limits TimeRangeLimits, from, through time.Time) (time.Time, time.Time, error) { + now := nowFunc() + // Clamp the time range based on the max query lookback. + maxQueryLookback := limits.MaxQueryLookback(ctx, userID) + if maxQueryLookback > 0 && from.Before(now.Add(-maxQueryLookback)) { + origStartTime := from + from = now.Add(-maxQueryLookback) + + level.Debug(spanlogger.FromContext(ctx)).Log( + "msg", "the start time of the query has been manipulated because of the 'max query lookback' setting", + "original", origStartTime, + "updated", from) + + } + maxQueryLength := limits.MaxQueryLength(ctx, userID) + if maxQueryLength > 0 && (through).Sub(from) > maxQueryLength { + return time.Time{}, time.Time{}, httpgrpc.Errorf(http.StatusBadRequest, util_validation.ErrQueryTooLong, (through).Sub(from), model.Duration(maxQueryLength)) + } + if through.Before(from) { + return time.Time{}, time.Time{}, httpgrpc.Errorf(http.StatusBadRequest, util_validation.ErrQueryTooOld, model.Duration(maxQueryLookback)) + } + return from, through, nil +} + +func (q *Rf1Querier) IndexStats(ctx context.Context, req *loghttp.RangeQuery) (*stats.Stats, error) { + userID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + + start, end, err := validateQueryTimeRangeLimits(ctx, userID, q.limits, req.Start, req.End) + if err != nil { + return nil, err + } + + matchers, err := syntax.ParseMatchers(req.Query, true) + if err != nil { + return nil, err + } + + // Enforce the query timeout while querying backends + queryTimeout := q.limits.QueryTimeout(ctx, userID) + ctx, cancel := context.WithDeadline(ctx, time.Now().Add(queryTimeout)) + defer cancel() + + return q.store.Stats( + ctx, + userID, + model.TimeFromUnixNano(start.UnixNano()), + model.TimeFromUnixNano(end.UnixNano()), + matchers..., + ) +} + +func (q *Rf1Querier) IndexShards( + ctx context.Context, + req *loghttp.RangeQuery, + targetBytesPerShard uint64, +) (*logproto.ShardsResponse, error) { + userID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + + start, end, err := validateQueryTimeRangeLimits(ctx, userID, q.limits, req.Start, req.End) + if err != nil { + return nil, err + } + + // Enforce the query timeout while querying backends + queryTimeout := q.limits.QueryTimeout(ctx, userID) + ctx, cancel := context.WithDeadline(ctx, time.Now().Add(queryTimeout)) + defer cancel() + + p, err := indexgateway.ExtractShardRequestMatchersAndAST(req.Query) + if err != nil { + return nil, err + } + + shards, err := q.store.GetShards( + ctx, + userID, + model.TimeFromUnixNano(start.UnixNano()), + model.TimeFromUnixNano(end.UnixNano()), + targetBytesPerShard, + p, + ) + if err != nil { + return nil, err + } + return shards, nil +} + +func (q *Rf1Querier) Volume(ctx context.Context, req *logproto.VolumeRequest) (*logproto.VolumeResponse, error) { + sp, ctx := opentracing.StartSpanFromContext(ctx, "Querier.Volume") + defer sp.Finish() + + userID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + + matchers, err := syntax.ParseMatchers(req.Matchers, true) + if err != nil && req.Matchers != seriesvolume.MatchAny { + return nil, err + } + + // Enforce the query timeout while querying backends + queryTimeout := q.limits.QueryTimeout(ctx, userID) + ctx, cancel := context.WithDeadline(ctx, time.Now().Add(queryTimeout)) + defer cancel() + + sp.LogKV( + "user", userID, + "from", req.From.Time(), + "through", req.Through.Time(), + "matchers", syntax.MatchersString(matchers), + "limit", req.Limit, + "targetLabels", req.TargetLabels, + "aggregateBy", req.AggregateBy, + ) + + numResponses := 1 + responses := make([]*logproto.VolumeResponse, 0, numResponses) + + resp, err := q.store.Volume( + ctx, + userID, + model.TimeFromUnix(req.From.Unix()), + model.TimeFromUnix(req.Through.Unix()), + req.Limit, + req.TargetLabels, + req.AggregateBy, + matchers..., + ) + if err != nil { + return nil, err + } + + responses = append(responses, resp) + + return seriesvolume.Merge(responses, req.Limit), nil +} + +// DetectedLabels fetches labels and values from store and ingesters and filters them by relevance criteria as per logs app. +func (q *Rf1Querier) DetectedLabels(ctx context.Context, req *logproto.DetectedLabelsRequest) (*logproto.DetectedLabelsResponse, error) { + userID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + staticLabels := map[string]struct{}{"cluster": {}, "namespace": {}, "instance": {}, "pod": {}} + + // Enforce the query timeout while querying backends + queryTimeout := q.limits.QueryTimeout(ctx, userID) + ctx, cancel := context.WithDeadline(ctx, time.Now().Add(queryTimeout)) + defer cancel() + g, ctx := errgroup.WithContext(ctx) + + if req.Start, req.End, err = validateQueryTimeRangeLimits(ctx, userID, q.limits, req.Start, req.End); err != nil { + return nil, err + } + + // Fetch labels from the store + storeLabelsMap := make(map[string][]string) + var matchers []*labels.Matcher + if req.Query != "" { + matchers, err = syntax.ParseMatchers(req.Query, true) + if err != nil { + return nil, err + } + } + g.Go(func() error { + var err error + start := model.TimeFromUnixNano(req.Start.UnixNano()) + end := model.TimeFromUnixNano(req.End.UnixNano()) + storeLabels, err := q.store.LabelNamesForMetricName(ctx, userID, start, end, "logs") + for _, label := range storeLabels { + values, err := q.store.LabelValuesForMetricName(ctx, userID, start, end, "logs", label, matchers...) + if err != nil { + return err + } + storeLabelsMap[label] = values + } + return err + }) + + if err := g.Wait(); err != nil { + return nil, err + } + + if len(storeLabelsMap) == 0 { + return &logproto.DetectedLabelsResponse{ + DetectedLabels: []*logproto.DetectedLabel{}, + }, nil + } + + return &logproto.DetectedLabelsResponse{ + DetectedLabels: countLabelsAndCardinality(storeLabelsMap, staticLabels), + }, nil +} + +func countLabelsAndCardinality(storeLabelsMap map[string][]string, staticLabels map[string]struct{}) []*logproto.DetectedLabel { + dlMap := make(map[string]*parsedFields) + + for label, values := range storeLabelsMap { + if _, isStatic := staticLabels[label]; isStatic || !containsAllIDTypes(values) { + _, ok := dlMap[label] + if !ok { + dlMap[label] = newParsedLabels() + } + + parsedFields := dlMap[label] + for _, v := range values { + parsedFields.Insert(v) + } + } + } + + var detectedLabels []*logproto.DetectedLabel + for k, v := range dlMap { + sketch, err := v.sketch.MarshalBinary() + if err != nil { + // TODO: add log here + continue + } + detectedLabels = append(detectedLabels, &logproto.DetectedLabel{ + Label: k, + Cardinality: v.Estimate(), + Sketch: sketch, + }) + } + return detectedLabels +} + +// containsAllIDTypes filters out all UUID, GUID and numeric types. Returns false if even one value is not of the type +func containsAllIDTypes(values []string) bool { + for _, v := range values { + _, err := strconv.ParseFloat(v, 64) + if err != nil { + _, err = uuid.Parse(v) + if err != nil { + return false + } + } + } + + return true +} + +func (q *Rf1Querier) DetectedFields(ctx context.Context, req *logproto.DetectedFieldsRequest) (*logproto.DetectedFieldsResponse, error) { + expr, err := syntax.ParseLogSelector(req.Query, true) + if err != nil { + return nil, err + } + params := logql.SelectLogParams{ + QueryRequest: &logproto.QueryRequest{ + Start: req.Start, + End: req.End, + Limit: req.LineLimit, + Direction: logproto.BACKWARD, + Selector: expr.String(), + Plan: &plan.QueryPlan{ + AST: expr, + }, + }, + } + + iters, err := q.SelectLogs(ctx, params) + if err != nil { + return nil, err + } + + // TODO(twhitney): converting from a step to a duration should be abstracted and reused, + // doing this in a few places now. + streams, err := streamsForFieldDetection(iters, req.LineLimit) + if err != nil { + return nil, err + } + + detectedFields := parseDetectedFields(ctx, req.Limit, streams) + + fields := make([]*logproto.DetectedField, len(detectedFields)) + fieldCount := 0 + for k, v := range detectedFields { + sketch, err := v.sketch.MarshalBinary() + if err != nil { + level.Warn(q.logger).Log("msg", "failed to marshal hyperloglog sketch", "err", err) + continue + } + + fields[fieldCount] = &logproto.DetectedField{ + Label: k, + Type: v.fieldType, + Cardinality: v.Estimate(), + Sketch: sketch, + Parsers: v.parsers, + } + + fieldCount++ + } + + return &logproto.DetectedFieldsResponse{ + Fields: fields, + Limit: req.GetLimit(), + }, nil +} + +type parsedFields struct { + sketch *hyperloglog.Sketch + fieldType logproto.DetectedFieldType + parsers []string +} + +func newParsedFields(parser *string) *parsedFields { + p := "" + if parser != nil { + p = *parser + } + return &parsedFields{ + sketch: hyperloglog.New(), + fieldType: logproto.DetectedFieldString, + parsers: []string{p}, + } +} + +func newParsedLabels() *parsedFields { + return &parsedFields{ + sketch: hyperloglog.New(), + fieldType: logproto.DetectedFieldString, + } +} + +func (p *parsedFields) Insert(value string) { + p.sketch.Insert([]byte(value)) +} + +func (p *parsedFields) Estimate() uint64 { + return p.sketch.Estimate() +} + +func (p *parsedFields) Marshal() ([]byte, error) { + return p.sketch.MarshalBinary() +} + +func (p *parsedFields) DetermineType(value string) { + p.fieldType = determineType(value) +} + +func determineType(value string) logproto.DetectedFieldType { + if _, err := strconv.ParseInt(value, 10, 64); err == nil { + return logproto.DetectedFieldInt + } + + if _, err := strconv.ParseFloat(value, 64); err == nil { + return logproto.DetectedFieldFloat + } + + if _, err := strconv.ParseBool(value); err == nil { + return logproto.DetectedFieldBoolean + } + + if _, err := time.ParseDuration(value); err == nil { + return logproto.DetectedFieldDuration + } + + if _, err := humanize.ParseBytes(value); err == nil { + return logproto.DetectedFieldBytes + } + + return logproto.DetectedFieldString +} + +func parseDetectedFields(ctx context.Context, limit uint32, streams logqlmodel.Streams) map[string]*parsedFields { + detectedFields := make(map[string]*parsedFields, limit) + fieldCount := uint32(0) + + for _, stream := range streams { + level.Debug(spanlogger.FromContext(ctx)).Log( + "detected_fields", "true", + "msg", fmt.Sprintf("looking for detected fields in stream %d with %d lines", stream.Hash, len(stream.Entries))) + + for _, entry := range stream.Entries { + detected, parser := parseLine(entry.Line) + for k, vals := range detected { + df, ok := detectedFields[k] + if !ok && fieldCount < limit { + df = newParsedFields(parser) + detectedFields[k] = df + fieldCount++ + } + + if df == nil { + continue + } + + if !slices.Contains(df.parsers, *parser) { + df.parsers = append(df.parsers, *parser) + } + + detectType := true + for _, v := range vals { + parsedFields := detectedFields[k] + if detectType { + // we don't want to determine the type for every line, so we assume the type in each stream will be the same, and re-detect the type for the next stream + parsedFields.DetermineType(v) + detectType = false + } + + parsedFields.Insert(v) + } + + level.Debug(spanlogger.FromContext(ctx)).Log( + "detected_fields", "true", + "msg", fmt.Sprintf("detected field %s with %d values", k, len(vals))) + } + } + } + + return detectedFields +} + +func parseLine(line string) (map[string][]string, *string) { + parser := "logfmt" + logFmtParser := logql_log.NewLogfmtParser(true, false) + + lbls := logql_log.NewBaseLabelsBuilder().ForLabels(labels.EmptyLabels(), 0) + _, logfmtSuccess := logFmtParser.Process(0, []byte(line), lbls) + if !logfmtSuccess || lbls.HasErr() { + parser = "json" + jsonParser := logql_log.NewJSONParser() + lbls.Reset() + _, jsonSuccess := jsonParser.Process(0, []byte(line), lbls) + if !jsonSuccess || lbls.HasErr() { + return map[string][]string{}, nil + } + } + + parsedLabels := map[string]map[string]struct{}{} + for _, lbl := range lbls.LabelsResult().Labels() { + if values, ok := parsedLabels[lbl.Name]; ok { + values[lbl.Value] = struct{}{} + } else { + parsedLabels[lbl.Name] = map[string]struct{}{lbl.Value: {}} + } + } + + result := make(map[string][]string, len(parsedLabels)) + for lbl, values := range parsedLabels { + vals := make([]string, 0, len(values)) + for v := range values { + vals = append(vals, v) + } + result[lbl] = vals + } + + return result, &parser +} + +// streamsForFieldDetection reads the streams from the iterator and returns them sorted. +// If categorizeLabels is true, the stream labels contains just the stream labels and entries inside each stream have their +// structuredMetadata and parsed fields populated with structured metadata labels plus the parsed labels respectively. +// Otherwise, the stream labels are the whole series labels including the stream labels, structured metadata labels and parsed labels. +func streamsForFieldDetection(i iter.EntryIterator, size uint32) (logqlmodel.Streams, error) { + streams := map[string]*logproto.Stream{} + respSize := uint32(0) + // lastEntry should be a really old time so that the first comparison is always true, we use a negative + // value here because many unit tests start at time.Unix(0,0) + lastEntry := time.Unix(-100, 0) + for respSize < size && i.Next() { + streamLabels, entry := i.Labels(), i.At() + + // Always going backward as the direction for field detection is hard-coded to BACKWARD + shouldOutput := entry.Timestamp.Equal(lastEntry) || entry.Timestamp.Before(lastEntry) + + // If lastEntry.Unix < 0 this is the first pass through the loop and we should output the line. + // Then check to see if the entry is equal to, or past a forward step + if lastEntry.Unix() < 0 || shouldOutput { + stream, ok := streams[streamLabels] + if !ok { + stream = &logproto.Stream{ + Labels: streamLabels, + } + streams[streamLabels] = stream + } + stream.Entries = append(stream.Entries, entry) + lastEntry = i.At().Timestamp + respSize++ + } + } + + result := make(logqlmodel.Streams, 0, len(streams)) + for _, stream := range streams { + result = append(result, *stream) + } + sort.Sort(result) + return result, i.Err() +} + +type PatterQuerier interface { + Patterns(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error) +} + +func (q *Rf1Querier) WithPatternQuerier(pq querier.PatterQuerier) { + q.patternQuerier = pq +} + +func (q *Rf1Querier) Patterns(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error) { + if q.patternQuerier == nil { + return nil, httpgrpc.Errorf(http.StatusNotFound, "") + } + res, err := q.patternQuerier.Patterns(ctx, req) + if err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) + } + + return res, err +} diff --git a/pkg/querier-rf1/wal/querier.go b/pkg/querier-rf1/wal/querier.go new file mode 100644 index 0000000000000..b8f6507ac582f --- /dev/null +++ b/pkg/querier-rf1/wal/querier.go @@ -0,0 +1,205 @@ +package wal + +import ( + "bytes" + "context" + "io" + "sync" + + "github.com/opentracing/opentracing-go" + "github.com/prometheus/prometheus/model/labels" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc" + + "github.com/grafana/dskit/tenant" + + "github.com/grafana/loki/v3/pkg/ingester-rf1/metastore/metastorepb" + "github.com/grafana/loki/v3/pkg/iter" + "github.com/grafana/loki/v3/pkg/logql" + "github.com/grafana/loki/v3/pkg/storage/wal" + "github.com/grafana/loki/v3/pkg/storage/wal/chunks" + "github.com/grafana/loki/v3/pkg/storage/wal/index" +) + +var _ logql.Querier = (*Querier)(nil) + +type BlockStorage interface { + GetObjectRange(ctx context.Context, objectKey string, off, length int64) (io.ReadCloser, error) +} + +type Metastore interface { + ListBlocksForQuery(ctx context.Context, in *metastorepb.ListBlocksForQueryRequest, opts ...grpc.CallOption) (*metastorepb.ListBlocksForQueryResponse, error) +} + +type Querier struct { + blockStorage BlockStorage + metaStore Metastore +} + +func (q *Querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on Querier") // TODO: Implement +} + +func New( + metaStore Metastore, + blockStorage BlockStorage, +) (*Querier, error) { + return &Querier{ + blockStorage: blockStorage, + metaStore: metaStore, + }, nil +} + +func (q *Querier) SelectLogs(ctx context.Context, req logql.SelectLogParams) (iter.EntryIterator, error) { + // todo request validation and delete markers. + tenantID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + expr, err := req.LogSelector() + if err != nil { + return nil, err + } + matchers := expr.Matchers() + // todo: not sure if Pipeline is thread safe + pipeline, err := expr.Pipeline() + if err != nil { + return nil, err + } + + chks, err := q.matchingChunks(ctx, tenantID, req.Start.UnixNano(), req.End.UnixNano(), matchers...) + if err != nil { + return nil, err + } + + return NewChunksEntryIterator(ctx, + q.blockStorage, + chks, + pipeline, + req.Direction, + req.Start.UnixNano(), + req.End.UnixNano()), nil +} + +func (q *Querier) SelectSamples(ctx context.Context, req logql.SelectSampleParams) (iter.SampleIterator, error) { + // todo request validation and delete markers. + tenantID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + expr, err := req.Expr() + if err != nil { + return nil, err + } + selector, err := expr.Selector() + if err != nil { + return nil, err + } + matchers := selector.Matchers() + // todo: not sure if Extractor is thread safe + + extractor, err := expr.Extractor() + if err != nil { + return nil, err + } + + chks, err := q.matchingChunks(ctx, tenantID, req.Start.UnixNano(), req.End.UnixNano(), matchers...) + if err != nil { + return nil, err + } + + return NewChunksSampleIterator(ctx, + q.blockStorage, + chks, + extractor, + req.Start.UnixNano(), + req.End.UnixNano()), nil +} + +func (q *Querier) matchingChunks(ctx context.Context, tenantID string, from, through int64, matchers ...*labels.Matcher) ([]ChunkData, error) { + sp, ctx := opentracing.StartSpanFromContext(ctx, "matchingChunks") + defer sp.Finish() + // todo support sharding + var ( + lazyChunks []ChunkData + mtx sync.Mutex + ) + + err := q.forSeries(ctx, &metastorepb.ListBlocksForQueryRequest{ + TenantId: tenantID, + StartTime: from, + EndTime: through, + }, func(id string, lbs *labels.ScratchBuilder, chk *chunks.Meta) error { + mtx.Lock() + lazyChunks = append(lazyChunks, newChunkData(id, lbs, chk)) + mtx.Unlock() + return nil + }, matchers...) + if err != nil { + return nil, err + } + if sp != nil { + sp.LogKV("matchedChunks", len(lazyChunks)) + } + return lazyChunks, nil +} + +func (q *Querier) forSeries(ctx context.Context, req *metastorepb.ListBlocksForQueryRequest, fn func(string, *labels.ScratchBuilder, *chunks.Meta) error, matchers ...*labels.Matcher) error { + // copy matchers to avoid modifying the original slice. + ms := make([]*labels.Matcher, 0, len(matchers)+1) + ms = append(ms, matchers...) + ms = append(ms, labels.MustNewMatcher(labels.MatchEqual, index.TenantLabel, req.TenantId)) + + return q.forIndices(ctx, req, func(ir *index.Reader, id string) error { + bufLbls := labels.ScratchBuilder{} + chunks := make([]chunks.Meta, 0, 1) + p, err := ir.PostingsForMatchers(ctx, ms...) + if err != nil { + return err + } + for p.Next() { + err := ir.Series(p.At(), &bufLbls, &chunks) + if err != nil { + return err + } + if err := fn(id, &bufLbls, &chunks[0]); err != nil { + return err + } + } + return p.Err() + }) +} + +func (q *Querier) forIndices(ctx context.Context, req *metastorepb.ListBlocksForQueryRequest, fn func(ir *index.Reader, id string) error) error { + resp, err := q.metaStore.ListBlocksForQuery(ctx, req) + if err != nil { + return err + } + metas := resp.Blocks + if len(metas) == 0 { + return nil + } + g, ctx := errgroup.WithContext(ctx) + g.SetLimit(32) + for _, meta := range metas { + g.Go(func() error { + reader, err := q.blockStorage.GetObjectRange(ctx, wal.Dir+meta.Id, meta.IndexRef.Offset, meta.IndexRef.Length) + if err != nil { + return err + } + defer reader.Close() + // todo: use a buffer pool + buf := bytes.NewBuffer(make([]byte, 0, meta.IndexRef.Length)) + _, err = buf.ReadFrom(reader) + if err != nil { + return err + } + index, err := index.NewReader(index.RealByteSlice(buf.Bytes())) + if err != nil { + return err + } + return fn(index, meta.Id) + }) + } + return g.Wait() +} diff --git a/pkg/querier/plan/plan_test.go b/pkg/querier/plan/plan_test.go index 5998448cfa56a..f348723e1bab3 100644 --- a/pkg/querier/plan/plan_test.go +++ b/pkg/querier/plan/plan_test.go @@ -24,3 +24,22 @@ func TestMarshalTo(t *testing.T) { require.JSONEq(t, buf.String(), string(data)) } + +func TestMarshalTo_Variant(t *testing.T) { + plan := QueryPlan{ + AST: syntax.MustParseExpr(`variants( + count_over_time({app="loki"} [1m]), + bytes_over_time({app="loki"} [1m]) + ) of ({app="loki"})`), + } + + data := make([]byte, plan.Size()) + _, err := plan.MarshalTo(data) + require.NoError(t, err) + + var buf bytes.Buffer + err = syntax.EncodeJSON(plan.AST, &buf) + require.NoError(t, err) + + require.JSONEq(t, buf.String(), string(data)) +} diff --git a/pkg/querier/querier.go b/pkg/querier/querier.go index cdc4175f9fb0a..2a897eba75e37 100644 --- a/pkg/querier/querier.go +++ b/pkg/querier/querier.go @@ -133,6 +133,10 @@ type SingleTenantQuerier struct { logger log.Logger } +func (s *SingleTenantQuerier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on SingleTenantQuerier") // TODO: Implement +} + type deleteGetter interface { GetAllDeleteRequestsForUser(ctx context.Context, userID string) ([]deletion.DeleteRequest, error) } diff --git a/pkg/querier/querier_mock_test.go b/pkg/querier/querier_mock_test.go index ab70de4baacea..0bf2bd4f770c6 100644 --- a/pkg/querier/querier_mock_test.go +++ b/pkg/querier/querier_mock_test.go @@ -728,6 +728,10 @@ type querierMock struct { util.ExtendedMock } +func (q *querierMock) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on querierMock") // TODO: Implement +} + func newQuerierMock() *querierMock { return &querierMock{} } diff --git a/pkg/querier/queryrange/roundtrip.go b/pkg/querier/queryrange/roundtrip.go index 61a9d519b3bac..253c0655d5fb4 100644 --- a/pkg/querier/queryrange/roundtrip.go +++ b/pkg/querier/queryrange/roundtrip.go @@ -258,6 +258,27 @@ func NewMiddleware( if err != nil { return nil, nil, err } + + variantsTripperware, err := NewVariantsTripperware( + cfg, + engineOpts, + log, + limits, + schema, + codec, + iqo, + resultsCache, + cacheGenNumLoader, + retentionEnabled, + PrometheusExtractor{}, + metrics, + indexStatsTripperware, + metricsNamespace, + ) + if err != nil { + return nil, nil, err + } + return base.MiddlewareFunc(func(next base.Handler) base.Handler { var ( metricRT = metricsTripperware.Wrap(next) @@ -270,9 +291,25 @@ func NewMiddleware( seriesVolumeRT = seriesVolumeTripperware.Wrap(next) detectedFieldsRT = detectedFieldsTripperware.Wrap(next) detectedLabelsRT = detectedLabelsTripperware.Wrap(next) + variantsRT = variantsTripperware.Wrap(next) ) - return newRoundTripper(log, next, limitedRT, logFilterRT, metricRT, seriesRT, labelsRT, instantRT, statsRT, seriesVolumeRT, detectedFieldsRT, detectedLabelsRT, limits) + return newRoundTripper( + log, + next, + limitedRT, + logFilterRT, + metricRT, + seriesRT, + labelsRT, + instantRT, + statsRT, + seriesVolumeRT, + detectedFieldsRT, + detectedLabelsRT, + variantsRT, + limits, + ) }), StopperWrapper{resultsCache, statsCache, volumeCache}, nil } @@ -326,13 +363,17 @@ func NewDetectedLabelsCardinalityFilter(rt queryrangebase.Handler) queryrangebas type roundTripper struct { logger log.Logger - next, limited, log, metric, series, labels, instantMetric, indexStats, seriesVolume, detectedFields, detectedLabels base.Handler + next, limited, log, metric, series, labels, instantMetric, indexStats, seriesVolume, detectedFields, detectedLabels, variants base.Handler limits Limits } // newRoundTripper creates a new queryrange roundtripper -func newRoundTripper(logger log.Logger, next, limited, log, metric, series, labels, instantMetric, indexStats, seriesVolume, detectedFields, detectedLabels base.Handler, limits Limits) roundTripper { +func newRoundTripper( + logger log.Logger, + next, limited, log, metric, series, labels, instantMetric, indexStats, seriesVolume, detectedFields, detectedLabels, variants base.Handler, + limits Limits, +) roundTripper { return roundTripper{ logger: logger, limited: limited, @@ -346,6 +387,7 @@ func newRoundTripper(logger log.Logger, next, limited, log, metric, series, labe seriesVolume: seriesVolume, detectedFields: detectedFields, detectedLabels: detectedLabels, + variants: variants, next: next, } } @@ -402,7 +444,31 @@ func (r roundTripper) Do(ctx context.Context, req base.Request) (base.Response, return r.limited.Do(ctx, req) } return r.log.Do(ctx, req) + case syntax.VariantsExpr: + if err := validateMaxEntriesLimits(ctx, op.Limit, r.limits); err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) + } + + matchers := e.LogRange().Left.Matchers() + + if err := validateMatchers(ctx, r.limits, matchers); err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) + } + for _, v := range e.Variants() { + groups, err := v.MatcherGroups() + if err != nil { + level.Warn(logger).Log("msg", "unexpected matcher groups error in roundtripper", "err", err) + } + + for _, g := range groups { + if err := validateMatchers(ctx, r.limits, g.Matchers); err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) + } + } + } + + return r.variants.Do(ctx, req) default: return r.next.Do(ctx, req) } @@ -1231,3 +1297,61 @@ func NewDetectedFieldsTripperware( return NewDetectedFieldsHandler(limitedHandler, logHandler, limits) }), nil } + +// NewMetricTripperware creates a new frontend tripperware responsible for handling metric queries +func NewVariantsTripperware( + cfg Config, + engineOpts logql.EngineOpts, + log log.Logger, + limits Limits, + schema config.SchemaConfig, + merger base.Merger, + iqo util.IngesterQueryOptions, + c cache.Cache, + cacheGenNumLoader base.CacheGenNumberLoader, + retentionEnabled bool, + extractor base.Extractor, + metrics *Metrics, + indexStatsTripperware base.Middleware, + metricsNamespace string, +) (base.Middleware, error) { + return base.MiddlewareFunc(func(next base.Handler) base.Handler { + queryRangeMiddleware := []base.Middleware{ + queryrangebase.MiddlewareFunc(func(next queryrangebase.Handler) queryrangebase.Handler { + return queryrangebase.HandlerFunc( + func(ctx context.Context, req queryrangebase.Request) (queryrangebase.Response, error) { + return next.Do(ctx, req) + }, + ) + }), + } + + // TODO(twhitney): turn off retries for faster failure while spking + // if cfg.MaxRetries > 0 { + // queryRangeMiddleware = append( + // queryRangeMiddleware, + // base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics), + // base.NewRetryMiddleware( + // log, + // cfg.MaxRetries, + // metrics.RetryMiddlewareMetrics, + // metricsNamespace, + // ), + // ) + // } + + // Finally, if the user selected any query range middleware, stitch it in. + if len(queryRangeMiddleware) > 0 { + rt := NewLimitedRoundTripper(next, limits, schema.Configs, queryRangeMiddleware...) + return base.HandlerFunc( + func(ctx context.Context, r base.Request) (base.Response, error) { + if _, ok := r.(*LokiRequest); !ok { + return next.Do(ctx, r) + } + return rt.Do(ctx, r) + }, + ) + } + return next + }), nil +} diff --git a/pkg/querier/queryrange/roundtrip_test.go b/pkg/querier/queryrange/roundtrip_test.go index ba46bce9c32f3..fb8bc5f1f3cf0 100644 --- a/pkg/querier/queryrange/roundtrip_test.go +++ b/pkg/querier/queryrange/roundtrip_test.go @@ -1005,6 +1005,7 @@ func TestPostQueries(t *testing.T) { handler, handler, handler, + handler, fakeLimits{}, ).Do(ctx, lreq) require.NoError(t, err) diff --git a/pkg/ruler/compat_test.go b/pkg/ruler/compat_test.go index 2097be3dec21e..c11b925e1da78 100644 --- a/pkg/ruler/compat_test.go +++ b/pkg/ruler/compat_test.go @@ -117,6 +117,10 @@ func TestNonMetricQuery(t *testing.T) { type FakeQuerier struct{} +func (f *FakeQuerier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on FakeQuerier") // TODO: Implement +} + func (q *FakeQuerier) SelectLogs(context.Context, logql.SelectLogParams) (iter.EntryIterator, error) { return iter.NoopEntryIterator, nil } diff --git a/pkg/storage/store.go b/pkg/storage/store.go index a8e6a1add3239..0ece9d935bf9e 100644 --- a/pkg/storage/store.go +++ b/pkg/storage/store.go @@ -102,6 +102,10 @@ type LokiStore struct { metricsNamespace string } +func (l *LokiStore) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on LokiStore") // TODO: Implement +} + // NewStore creates a new Loki Store using configuration supplied. func NewStore(cfg Config, storeCfg config.ChunkStoreConfig, schemaCfg config.SchemaConfig, limits StoreLimits, clientMetrics ClientMetrics, registerer prometheus.Registerer, logger log.Logger, From cedced16644259f6e3cbf8160bae93fb6f813313 Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Thu, 24 Oct 2024 10:27:17 -0600 Subject: [PATCH 3/7] feat: add without logs syntax to variant queries --- pkg/logql/syntax/ast.go | 27 +- pkg/logql/syntax/ast_test.go | 15 +- pkg/logql/syntax/expr.y | 3 +- pkg/logql/syntax/expr.y.go | 480 +++++++++++++++-------------- pkg/logql/syntax/lex.go | 1 + pkg/logql/syntax/lex_test.go | 35 ++- pkg/logql/syntax/serialize.go | 10 + pkg/logql/syntax/serialize_test.go | 56 ++++ 8 files changed, 377 insertions(+), 250 deletions(-) diff --git a/pkg/logql/syntax/ast.go b/pkg/logql/syntax/ast.go index 447cb33efa790..0103ec02cae6b 100644 --- a/pkg/logql/syntax/ast.go +++ b/pkg/logql/syntax/ast.go @@ -2447,12 +2447,15 @@ type VariantsExpr interface { SetVariant(i int, e SampleExpr) error Interval() time.Duration Offset() time.Duration + IncludeLogs(bool) + ShouldIncludeLogs() bool Expr } type MultiVariantExpr struct { - logRange *LogRange + logRange *LogRange variants []SampleExpr + includeLogs bool implicit } @@ -2484,6 +2487,14 @@ func (m *MultiVariantExpr) AddVariant(v SampleExpr) { m.variants = append(m.variants, v) } +func (m *MultiVariantExpr) IncludeLogs(include bool) { + m.includeLogs = include +} + +func (m *MultiVariantExpr) ShouldIncludeLogs() bool { + return m.includeLogs +} + func (m *MultiVariantExpr) SetVariant(i int, v SampleExpr) error { if i >= len(m.variants) { return fmt.Errorf("variant index out of range") @@ -2528,6 +2539,12 @@ func (m *MultiVariantExpr) String() string { sb.WriteString(m.logRange.String()) sb.WriteString(")") + if !m.ShouldIncludeLogs() { + sb.WriteString(Without) + sb.WriteString(" ") + sb.WriteString(Logs) + } + return sb.String() } @@ -2567,6 +2584,12 @@ func (m *MultiVariantExpr) Pretty(level int) string { func newVariantsExpr(variants []SampleExpr, logRange *LogRange) VariantsExpr { return &MultiVariantExpr{ variants: variants, - logRange: logRange, + logRange: logRange, + includeLogs: true, } } + +func newLoglessVariantsExpr(v VariantsExpr) VariantsExpr { + v.IncludeLogs(false) + return v +} diff --git a/pkg/logql/syntax/ast_test.go b/pkg/logql/syntax/ast_test.go index 9435997e3dff6..6bc0ff2ffd80f 100644 --- a/pkg/logql/syntax/ast_test.go +++ b/pkg/logql/syntax/ast_test.go @@ -1157,6 +1157,13 @@ func Test_VariantsExpr_String(t *testing.T) { { `variants(count_over_time({baz="qux", foo!="bar"}[5m]),rate({baz="qux", foo!="bar"}[5m])) of ({baz="qux", foo!="bar"} |= "that" [5m])`, }, + {`variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"}[5m]) without logs`}, + { + `variants(count_over_time({baz="qux", foo=~"bar"}[5m]), bytes_over_time({baz="qux", foo=~"bar"}[5m])) of ({baz="qux", foo=~"bar"} | logfmt | this = "that"[5m]) without logs`, + }, + { + `variants(count_over_time({baz="qux", foo!="bar"}[5m]),rate({baz="qux", foo!="bar"}[5m])) of ({baz="qux", foo!="bar"} |= "that" [5m]) without logs`, + }, } for _, tt := range tests { @@ -1179,19 +1186,19 @@ func Test_VariantsExpr_Pretty(t *testing.T) { expr string pretty string }{ - {`variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"})`, ` + {`variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"}[5m])`, ` variants( count_over_time({foo="bar"}[5m]) ) of ( - {foo="bar"} + {foo="bar"} [5m] )`}, { - `variants(count_over_time({baz="qux", foo=~"bar"}[5m]), bytes_over_time({baz="qux", foo=~"bar"}[5m])) of ({baz="qux", foo=~"bar"} | logfmt | this = "that")`, + `variants(count_over_time({baz="qux", foo=~"bar"}[5m]), bytes_over_time({baz="qux", foo=~"bar"}[5m])) of ({baz="qux", foo=~"bar"} | logfmt | this = "that"[5m])`, `variants( count_over_time({baz="qux", foo=~"bar"}[5m]), bytes_over_time({baz="qux", foo=~"bar"}[5m]) ) of ( - {baz="qux", foo=~"bar"} | logfmt | this="that" + {baz="qux", foo=~"bar"} | logfmt | this="that" [5m] )`, }, } diff --git a/pkg/logql/syntax/expr.y b/pkg/logql/syntax/expr.y index 2323701dd8133..bbbfffdeab50b 100644 --- a/pkg/logql/syntax/expr.y +++ b/pkg/logql/syntax/expr.y @@ -152,7 +152,7 @@ import ( BYTES_OVER_TIME BYTES_RATE BOOL JSON REGEXP LOGFMT PIPE LINE_FMT LABEL_FMT UNWRAP AVG_OVER_TIME SUM_OVER_TIME MIN_OVER_TIME MAX_OVER_TIME STDVAR_OVER_TIME STDDEV_OVER_TIME QUANTILE_OVER_TIME BYTES_CONV DURATION_CONV DURATION_SECONDS_CONV FIRST_OVER_TIME LAST_OVER_TIME ABSENT_OVER_TIME VECTOR LABEL_REPLACE UNPACK OFFSET PATTERN IP ON IGNORING GROUP_LEFT GROUP_RIGHT - DECOLORIZE DROP KEEP VARIANTS OF + DECOLORIZE DROP KEEP VARIANTS OF LOGS // Operators are listed with increasing precedence. %left OR @@ -597,6 +597,7 @@ grouping: variantsExpr: variantsOp OPEN_PARENTHESIS variantsList CLOSE_PARENTHESIS variantsOf OPEN_PARENTHESIS variantsRangeExpr CLOSE_PARENTHESIS { $$ = newVariantsExpr($3, $7) } + | variantsExpr WITHOUT LOGS { $$ = newLoglessVariantsExpr($1) } ; variantsOp: diff --git a/pkg/logql/syntax/expr.y.go b/pkg/logql/syntax/expr.y.go index daa848d382a5a..d487b73049080 100644 --- a/pkg/logql/syntax/expr.y.go +++ b/pkg/logql/syntax/expr.y.go @@ -161,21 +161,22 @@ const DROP = 57421 const KEEP = 57422 const VARIANTS = 57423 const OF = 57424 -const OR = 57425 -const AND = 57426 -const UNLESS = 57427 -const CMP_EQ = 57428 -const NEQ = 57429 -const LT = 57430 -const LTE = 57431 -const GT = 57432 -const GTE = 57433 -const ADD = 57434 -const SUB = 57435 -const MUL = 57436 -const DIV = 57437 -const MOD = 57438 -const POW = 57439 +const LOGS = 57425 +const OR = 57426 +const AND = 57427 +const UNLESS = 57428 +const CMP_EQ = 57429 +const NEQ = 57430 +const LT = 57431 +const LTE = 57432 +const GT = 57433 +const GTE = 57434 +const ADD = 57435 +const SUB = 57436 +const MUL = 57437 +const DIV = 57438 +const MOD = 57439 +const POW = 57440 var exprToknames = [...]string{ "$end", @@ -260,6 +261,7 @@ var exprToknames = [...]string{ "KEEP", "VARIANTS", "OF", + "LOGS", "OR", "AND", "UNLESS", @@ -287,153 +289,152 @@ var exprExca = [...]int{ -1, 1, 1, -1, -2, 0, - -1, 151, - 21, 234, - 27, 234, - -2, 3, - -1, 298, + -1, 153, 21, 235, 27, 235, -2, 3, + -1, 300, + 21, 236, + 27, 236, + -2, 3, } const exprPrivate = 57344 -const exprLast = 747 +const exprLast = 731 var exprAct = [...]int{ - 301, 6, 373, 68, 4, 221, 189, 131, 237, 89, - 211, 204, 79, 67, 207, 196, 246, 159, 194, 81, - 2, 60, 292, 85, 52, 53, 54, 61, 62, 65, - 66, 63, 64, 55, 56, 57, 58, 59, 60, 224, + 303, 6, 375, 69, 4, 223, 191, 133, 239, 90, + 213, 206, 80, 68, 209, 198, 248, 161, 196, 82, + 2, 60, 294, 86, 52, 53, 54, 61, 62, 65, + 66, 63, 64, 55, 56, 57, 58, 59, 60, 226, 11, 53, 54, 61, 62, 65, 66, 63, 64, 55, 56, 57, 58, 59, 60, 61, 62, 65, 66, 63, 64, 55, 56, 57, 58, 59, 60, 57, 58, 59, - 60, 114, 144, 297, 222, 141, 223, 120, 55, 56, - 57, 58, 59, 60, 145, 290, 304, 151, 18, 161, - 289, 191, 309, 163, 173, 174, 135, 306, 275, 168, - 230, 18, 271, 274, 229, 18, 287, 270, 382, 18, - 99, 286, 284, 171, 172, 18, 170, 283, 71, 352, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 421, 281, 382, 409, 18, 248, - 280, 147, 201, 214, 157, 158, 198, 209, 213, 146, - 278, 147, 305, 18, 190, 277, 304, 155, 157, 158, - 306, 328, 228, 405, 240, 90, 91, 273, 76, 78, - 244, 269, 15, 19, 20, 238, 73, 74, 75, 318, - 241, 375, 379, 392, 249, 369, 19, 20, 115, 141, - 19, 20, 248, 306, 19, 20, 318, 257, 258, 259, - 19, 20, 368, 318, 70, 191, 141, 353, 408, 367, - 135, 264, 261, 390, 326, 389, 220, 215, 218, 219, - 216, 217, 191, 19, 20, 76, 78, 135, 416, 248, - 294, 156, 298, 73, 74, 75, 387, 161, 19, 20, - 77, 372, 114, 362, 299, 302, 120, 308, 315, 311, - 303, 325, 314, 300, 312, 272, 276, 279, 282, 285, - 288, 291, 342, 352, 355, 356, 357, 192, 190, 316, - 322, 324, 327, 329, 252, 209, 213, 332, 330, 337, - 385, 242, 336, 248, 192, 190, 405, 88, 141, 90, - 91, 76, 78, 392, 305, 233, 318, 77, 340, 73, - 74, 75, 366, 415, 306, 323, 349, 114, 351, 135, - 345, 359, 347, 350, 149, 346, 114, 318, 391, 393, - 344, 361, 363, 320, 76, 78, 141, 70, 148, 76, - 78, 233, 73, 74, 75, 306, 406, 73, 74, 75, - 318, 343, 191, 233, 248, 374, 319, 135, 248, 15, - 114, 227, 160, 378, 376, 377, 313, 226, 162, 380, - 70, 339, 15, 77, 338, 70, 250, 381, 234, 418, - 247, 162, 386, 293, 256, 255, 254, 395, 396, 253, - 225, 167, 166, 165, 399, 400, 95, 94, 394, 398, - 87, 82, 402, 365, 403, 262, 77, 317, 114, 268, - 267, 77, 410, 18, 153, 265, 413, 404, 114, 407, - 251, 114, 243, 15, 235, 417, 114, 412, 266, 420, - 152, 263, 7, 154, 414, 401, 24, 25, 26, 39, - 48, 49, 40, 42, 43, 41, 44, 45, 46, 47, - 50, 27, 28, 384, 383, 86, 358, 348, 334, 335, - 419, 29, 30, 31, 32, 33, 34, 35, 84, 169, - 93, 36, 37, 38, 51, 21, 92, 307, 245, 411, - 388, 197, 76, 78, 260, 3, 197, 23, 15, 195, - 73, 74, 75, 80, 360, 371, 370, 7, 19, 20, - 341, 24, 25, 26, 39, 48, 49, 40, 42, 43, - 41, 44, 45, 46, 47, 50, 27, 28, 239, 333, - 331, 321, 205, 296, 295, 232, 29, 30, 31, 32, - 33, 34, 35, 231, 230, 229, 36, 37, 38, 51, - 21, 202, 236, 164, 200, 199, 397, 76, 78, 364, - 212, 208, 23, 15, 77, 73, 74, 75, 197, 310, - 86, 205, 7, 19, 20, 14, 24, 25, 26, 39, - 48, 49, 40, 42, 43, 41, 44, 45, 46, 47, - 50, 27, 28, 239, 150, 5, 132, 133, 118, 119, - 203, 29, 30, 31, 32, 33, 34, 35, 76, 78, - 123, 36, 37, 38, 51, 21, 73, 74, 75, 393, - 210, 125, 206, 124, 76, 78, 122, 23, 121, 77, - 193, 69, 73, 74, 75, 307, 142, 134, 19, 20, - 76, 78, 143, 116, 70, 76, 78, 117, 73, 74, - 75, 98, 236, 73, 74, 75, 97, 76, 78, 12, - 70, 76, 78, 141, 304, 73, 74, 75, 10, 73, - 74, 75, 22, 13, 17, 9, 239, 141, 354, 16, - 77, 239, 8, 83, 135, 72, 1, 0, 0, 0, - 0, 0, 0, 239, 0, 0, 77, 239, 135, 96, - 0, 304, 0, 0, 0, 0, 127, 128, 126, 0, - 136, 138, 77, 0, 0, 0, 0, 77, 0, 0, - 127, 128, 126, 0, 136, 138, 309, 0, 129, 77, - 130, 0, 0, 77, 0, 0, 137, 139, 140, 0, - 0, 0, 129, 0, 130, 0, 0, 0, 0, 0, - 137, 139, 140, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, + 60, 277, 116, 232, 18, 146, 276, 115, 122, 55, + 56, 57, 58, 59, 60, 299, 292, 72, 153, 18, + 163, 291, 175, 176, 165, 306, 157, 159, 160, 273, + 170, 231, 18, 224, 272, 311, 77, 79, 173, 174, + 225, 354, 308, 147, 74, 75, 76, 172, 216, 159, + 160, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 384, 289, 384, 67, 18, + 275, 288, 71, 100, 203, 423, 354, 411, 200, 211, + 215, 286, 308, 143, 18, 306, 285, 392, 117, 381, + 19, 20, 306, 387, 230, 355, 242, 307, 271, 193, + 149, 158, 246, 394, 137, 19, 20, 240, 283, 78, + 149, 18, 243, 282, 148, 320, 251, 308, 19, 20, + 143, 371, 222, 217, 220, 221, 218, 219, 410, 259, + 260, 261, 280, 391, 407, 18, 193, 279, 308, 77, + 79, 137, 266, 89, 263, 91, 92, 74, 75, 76, + 250, 417, 357, 358, 359, 19, 20, 91, 92, 320, + 320, 320, 296, 192, 300, 370, 369, 368, 389, 163, + 19, 20, 330, 374, 116, 71, 301, 304, 122, 310, + 317, 313, 305, 364, 316, 302, 314, 274, 278, 281, + 284, 287, 290, 293, 394, 235, 307, 19, 20, 194, + 192, 235, 324, 326, 329, 331, 250, 211, 215, 334, + 332, 339, 78, 361, 338, 344, 318, 254, 395, 393, + 346, 19, 20, 77, 79, 143, 315, 250, 328, 244, + 342, 74, 75, 76, 15, 408, 250, 308, 351, 116, + 353, 193, 347, 377, 349, 352, 137, 348, 116, 327, + 235, 309, 250, 363, 365, 320, 77, 79, 325, 71, + 151, 322, 250, 320, 74, 75, 76, 150, 362, 321, + 229, 77, 79, 143, 252, 236, 228, 376, 162, 74, + 75, 76, 116, 418, 249, 380, 378, 379, 15, 193, + 143, 382, 241, 15, 137, 345, 78, 164, 341, 383, + 340, 295, 164, 258, 388, 77, 79, 241, 257, 397, + 398, 137, 256, 74, 75, 76, 401, 402, 255, 227, + 396, 400, 169, 168, 167, 96, 405, 306, 95, 78, + 116, 88, 83, 404, 412, 18, 367, 264, 415, 406, + 116, 409, 319, 116, 78, 15, 270, 419, 116, 414, + 269, 422, 194, 192, 7, 267, 253, 245, 24, 25, + 26, 39, 48, 49, 40, 42, 43, 41, 44, 45, + 46, 47, 50, 27, 28, 237, 268, 87, 78, 265, + 420, 416, 155, 29, 30, 31, 32, 33, 34, 35, + 85, 403, 386, 36, 37, 38, 51, 21, 154, 238, + 247, 156, 385, 350, 77, 79, 360, 171, 199, 23, + 15, 262, 74, 75, 76, 199, 312, 421, 197, 7, + 94, 19, 20, 24, 25, 26, 39, 48, 49, 40, + 42, 43, 41, 44, 45, 46, 47, 50, 27, 28, + 241, 336, 337, 399, 93, 413, 390, 3, 29, 30, + 31, 32, 33, 34, 35, 81, 373, 372, 36, 37, + 38, 51, 21, 343, 335, 166, 407, 207, 298, 333, + 323, 77, 79, 297, 23, 15, 234, 78, 233, 74, + 75, 76, 232, 231, 7, 204, 19, 20, 24, 25, + 26, 39, 48, 49, 40, 42, 43, 41, 44, 45, + 46, 47, 50, 27, 28, 202, 201, 71, 366, 214, + 210, 14, 199, 29, 30, 31, 32, 33, 34, 35, + 87, 77, 79, 36, 37, 38, 51, 21, 395, 74, + 75, 76, 309, 77, 79, 207, 152, 77, 79, 23, + 5, 74, 75, 76, 78, 74, 75, 76, 238, 134, + 135, 19, 20, 77, 79, 120, 121, 71, 205, 125, + 143, 74, 75, 76, 212, 127, 77, 79, 208, 71, + 126, 143, 124, 241, 74, 75, 76, 123, 195, 70, + 144, 137, 136, 145, 118, 119, 99, 98, 12, 241, + 10, 22, 137, 97, 78, 13, 17, 9, 356, 16, + 8, 84, 241, 129, 130, 128, 78, 138, 140, 311, + 78, 73, 1, 0, 129, 130, 128, 0, 138, 140, + 0, 0, 0, 0, 0, 131, 78, 132, 0, 0, + 0, 0, 0, 139, 141, 142, 131, 0, 132, 78, + 0, 0, 0, 0, 139, 141, 142, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, } var exprPact = [...]int{ - 396, -1000, -59, -1000, -1000, -1000, 314, 396, -1000, -1000, - -1000, -1000, -1000, -1000, 365, 440, 364, 261, -1000, 459, - 453, 361, 360, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + 398, -1000, -60, -1000, -1000, 109, 576, 398, -1000, -1000, + -1000, -1000, -1000, -1000, 376, 442, 375, 187, -1000, 507, + 483, 372, 369, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 314, -1000, 210, - 638, -11, 78, -1000, -1000, -1000, -1000, -1000, -1000, 301, - 287, -59, 396, 402, -1000, -1000, 144, 345, 526, 357, - 356, 355, -1000, -1000, 396, 452, 396, 39, 18, -1000, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, -1000, -1000, -1000, -1000, -1000, -1000, - 201, -1000, -1000, -1000, -1000, -1000, 471, 543, 529, -1000, - 528, -1000, -1000, -1000, -1000, 283, 525, -1000, 546, 536, - 535, 130, -1000, -1000, 68, -44, 354, -1000, -1000, -1000, - 330, -1000, -1000, -1000, 545, 519, 518, 517, 509, 341, - 393, 622, 332, 254, 391, 461, 343, 339, 389, 247, - -43, 353, 350, 349, 348, -31, -31, -27, -27, -76, - -76, -76, -76, -14, -14, -14, -14, -14, -14, 201, - 283, 283, 283, 466, 374, -1000, -1000, 408, 374, -1000, - -1000, 184, -1000, 384, -1000, 405, 379, -1000, 144, -1000, - 378, -1000, 144, -1000, 98, 94, 146, 131, 108, 102, - 81, -1000, -61, 347, 68, 508, -9, 396, -1000, -1000, - -1000, -1000, -1000, -1000, 137, 332, 610, 142, 605, 652, - 522, 329, 137, 396, 242, 376, 319, -1000, -1000, 296, - -1000, 505, -1000, 278, 224, 187, 134, 321, 201, 70, - -1000, 374, 543, 504, -1000, 507, 443, 536, 535, 338, - -1000, -1000, -1000, 335, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, -6, 576, -1000, + 360, 636, -9, 107, -1000, -1000, -1000, -1000, -1000, -1000, + 310, 303, -60, 398, 450, -1000, -1000, 83, 341, 528, + 368, 367, 366, -1000, -1000, 398, 470, 398, 34, 16, + -1000, 398, 398, 398, 398, 398, 398, 398, 398, 398, + 398, 398, 398, 398, 398, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, 338, -1000, -1000, -1000, -1000, -1000, 480, 577, + 570, -1000, 569, -1000, -1000, -1000, -1000, 355, 549, -1000, + 600, 575, 574, 105, -1000, -1000, 97, -45, 363, -1000, + -1000, -1000, 319, -1000, -1000, -1000, 585, 547, 546, 542, + 540, 318, 424, 608, 346, 272, 406, 463, 327, 317, + 405, 260, -44, 362, 356, 352, 347, -32, -32, -28, + -28, -77, -77, -77, -77, -14, -14, -14, -14, -14, + -14, 338, 355, 355, 355, 473, 386, -1000, -1000, 436, + 386, -1000, -1000, 185, -1000, 404, -1000, 433, 399, -1000, + 83, -1000, 395, -1000, 83, -1000, 95, 67, 198, 174, + 147, 132, 82, -1000, -62, 345, 97, 537, 3, 398, + -1000, -1000, -1000, -1000, -1000, -1000, 199, 346, 326, 157, + 592, 625, 459, 269, 199, 398, 259, 391, 312, -1000, + -1000, 304, -1000, 534, -1000, 301, 292, 271, 215, 290, + 338, 148, -1000, 386, 577, 533, -1000, 532, 506, 575, + 574, 344, -1000, -1000, -1000, 342, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, 68, 484, -1000, 235, 315, -1000, -1000, -1000, - 293, 626, 46, 626, 438, 15, 283, 15, 109, 202, - 436, 284, 457, -1000, -1000, 216, -1000, 396, 534, -1000, - -1000, 372, 275, -1000, 182, -1000, -1000, 175, -1000, 158, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 480, 479, - -1000, 214, -1000, 155, 137, 46, 626, 46, -1000, -1000, - 201, -1000, 15, -1000, 156, -1000, -1000, -1000, 85, 434, - 433, 253, 137, 209, -1000, 464, -1000, -1000, -1000, -1000, - 188, 186, -1000, 291, 589, 155, -1000, 46, -1000, 531, - 57, 46, 38, 15, 15, 415, -1000, -1000, 371, -1000, - -1000, -1000, -1000, 573, 153, 309, 181, 110, 46, -1000, - -1000, 15, 463, 314, 314, 15, 414, 276, -1000, -1000, - -1000, 207, 314, -1000, 15, 359, 444, -1000, 15, 107, - -1000, -1000, + -1000, -1000, -1000, -1000, 97, 527, -1000, 258, 339, -1000, + -1000, -1000, 263, 621, 61, 621, 464, 24, 355, 24, + 101, 160, 466, 256, 311, -1000, -1000, 226, -1000, 398, + 573, -1000, -1000, 385, 210, -1000, 209, -1000, -1000, 208, + -1000, 164, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + 521, 520, -1000, 216, -1000, 287, 199, 61, 621, 61, + -1000, -1000, 338, -1000, 24, -1000, 133, -1000, -1000, -1000, + 84, 462, 452, 136, 199, 211, -1000, 510, -1000, -1000, + -1000, -1000, 176, 130, -1000, 262, 588, 287, -1000, 61, + -1000, 508, 86, 61, 51, 24, 24, 451, -1000, -1000, + 382, -1000, -1000, -1000, -1000, 91, 526, 278, 171, 120, + 61, -1000, -1000, 24, 509, 576, 576, 24, 441, 194, + -1000, -1000, -1000, 332, 576, -1000, 24, 440, 481, -1000, + 24, 118, -1000, -1000, } var exprPgo = [...]int{ - 0, 666, 19, 665, 9, 16, 475, 4, 17, 7, - 663, 662, 659, 658, 1, 655, 654, 653, 652, 76, - 648, 40, 639, 679, 636, 631, 627, 623, 13, 3, - 622, 617, 616, 6, 611, 118, 5, 610, 608, 606, - 603, 602, 14, 601, 600, 10, 590, 11, 580, 15, - 18, 579, 578, 8, 577, 576, 0, 575, 574, 555, - 513, 2, + 0, 682, 19, 681, 9, 16, 517, 4, 17, 7, + 671, 670, 669, 668, 1, 667, 666, 665, 661, 110, + 660, 40, 658, 663, 657, 656, 655, 654, 13, 3, + 653, 652, 650, 6, 649, 87, 5, 648, 647, 642, + 640, 638, 14, 635, 634, 10, 629, 11, 628, 15, + 18, 626, 625, 8, 620, 619, 0, 610, 606, 581, + 538, 2, } var exprR1 = [...]int{ @@ -460,8 +461,8 @@ var exprR1 = [...]int{ 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 56, 5, 5, 4, 4, 4, - 4, 57, 59, 60, 58, 58, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, + 4, 57, 57, 59, 60, 58, 58, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, } var exprR2 = [...]int{ @@ -488,100 +489,100 @@ var exprR2 = [...]int{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 4, 4, 3, - 3, 8, 1, 1, 1, 3, 2, 3, 4, 5, - 3, 4, 5, 6, 3, 4, 3, 2, + 3, 8, 3, 1, 1, 1, 3, 2, 3, 4, + 5, 3, 4, 5, 6, 3, 4, 3, 2, } var exprChk = [...]int{ -1000, -1, -2, -6, -7, -57, -14, 26, -11, -15, - -20, -21, -22, -17, -59, 17, -12, -16, 7, 92, - 93, 69, -18, 81, 30, 31, 32, 45, 46, 55, + -20, -21, -22, -17, -59, 17, -12, -16, 7, 93, + 94, 69, -18, 81, 30, 31, 32, 45, 46, 55, 56, 57, 58, 59, 60, 61, 65, 66, 67, 33, 36, 39, 37, 38, 40, 41, 42, 43, 34, 35, - 44, 68, 83, 84, 85, 92, 93, 94, 95, 96, - 97, 86, 87, 90, 91, 88, 89, -28, -29, -34, - 51, -35, -3, 23, 24, 25, 15, 87, 16, -7, - -6, -2, 26, -10, 18, -9, 5, 26, 26, -4, - 28, 29, 7, 7, 26, 26, -23, -24, -25, 47, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -29, -35, -27, -26, -52, -51, - -33, -38, -39, -46, -40, -43, 50, 48, 49, 70, - 72, -9, -55, -54, -31, 26, 52, 78, 53, 79, - 80, 5, -32, -30, 83, 6, -19, 73, 27, 27, - -58, -7, 18, 2, 21, 13, 87, 14, 15, -8, - 7, -14, 26, -7, 7, 26, 26, 26, -7, 7, - -2, 74, 75, 76, 77, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -33, - 84, 21, 83, -37, -50, 8, -49, 5, -50, 6, - 6, -33, 6, -48, -47, 5, -41, -42, 5, -9, - -44, -45, 5, -9, 13, 87, 90, 91, 88, 89, - 86, -36, 6, -19, 83, 26, 27, 21, -9, 6, - 6, 6, 6, 2, 27, 21, 10, -53, -28, 51, - -14, -8, 27, 21, -7, 7, -5, 27, 5, -5, - 27, 21, 27, 26, 26, 26, 26, -33, -33, -33, - 8, -50, 21, 13, 27, 21, 13, 21, 21, 73, - 9, 4, -21, 73, 9, 4, -21, 9, 4, -21, - 9, 4, -21, 9, 4, -21, 9, 4, -21, 9, - 4, -21, 83, 26, -36, 6, -60, 82, -7, -4, - -8, -56, -53, -28, 71, 10, 51, 10, -53, 54, - 27, -53, -28, 27, -4, -7, 27, 21, 21, 27, - 27, 6, -5, 27, -5, 27, 27, -5, 27, -5, - -49, 6, -47, 2, 5, 6, -42, -45, 26, 26, - -36, 6, 27, 26, 27, -53, -28, -53, 9, -56, - -33, -56, 10, 5, -13, 62, 63, 64, 10, 27, - 27, -53, 27, -7, 5, 21, 27, 27, 27, 27, - 6, 6, 27, -61, -14, 26, -4, -53, -56, 26, - -56, -53, 51, 10, 10, 27, -4, 27, 6, 27, - 27, 27, 2, 10, -28, -14, -61, 5, -53, -56, - -56, 10, 21, -56, -28, 10, 27, -28, 27, 27, - -56, 6, -28, -56, 10, 27, 21, -56, 10, 6, - -56, 27, + 44, 68, 84, 85, 86, 93, 94, 95, 96, 97, + 98, 87, 88, 91, 92, 89, 90, 29, -28, -29, + -34, 51, -35, -3, 23, 24, 25, 15, 88, 16, + -7, -6, -2, 26, -10, 18, -9, 5, 26, 26, + -4, 28, 29, 7, 7, 26, 26, -23, -24, -25, + 47, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, 83, -29, -35, -27, -26, + -52, -51, -33, -38, -39, -46, -40, -43, 50, 48, + 49, 70, 72, -9, -55, -54, -31, 26, 52, 78, + 53, 79, 80, 5, -32, -30, 84, 6, -19, 73, + 27, 27, -58, -7, 18, 2, 21, 13, 88, 14, + 15, -8, 7, -14, 26, -7, 7, 26, 26, 26, + -7, 7, -2, 74, 75, 76, 77, -2, -2, -2, + -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, + -2, -33, 85, 21, 84, -37, -50, 8, -49, 5, + -50, 6, 6, -33, 6, -48, -47, 5, -41, -42, + 5, -9, -44, -45, 5, -9, 13, 88, 91, 92, + 89, 90, 87, -36, 6, -19, 84, 26, 27, 21, + -9, 6, 6, 6, 6, 2, 27, 21, 10, -53, + -28, 51, -14, -8, 27, 21, -7, 7, -5, 27, + 5, -5, 27, 21, 27, 26, 26, 26, 26, -33, + -33, -33, 8, -50, 21, 13, 27, 21, 13, 21, + 21, 73, 9, 4, -21, 73, 9, 4, -21, 9, + 4, -21, 9, 4, -21, 9, 4, -21, 9, 4, + -21, 9, 4, -21, 84, 26, -36, 6, -60, 82, + -7, -4, -8, -56, -53, -28, 71, 10, 51, 10, + -53, 54, 27, -53, -28, 27, -4, -7, 27, 21, + 21, 27, 27, 6, -5, 27, -5, 27, 27, -5, + 27, -5, -49, 6, -47, 2, 5, 6, -42, -45, + 26, 26, -36, 6, 27, 26, 27, -53, -28, -53, + 9, -56, -33, -56, 10, 5, -13, 62, 63, 64, + 10, 27, 27, -53, 27, -7, 5, 21, 27, 27, + 27, 27, 6, 6, 27, -61, -14, 26, -4, -53, + -56, 26, -56, -53, 51, 10, 10, 27, -4, 27, + 6, 27, 27, 27, 2, 10, -28, -14, -61, 5, + -53, -56, -56, 10, 21, -56, -28, 10, 27, -28, + 27, 27, -56, 6, -28, -56, 10, 27, 21, -56, + 10, 6, -56, 27, } var exprDef = [...]int{ 0, -2, 1, 2, 3, 4, 12, 0, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 192, 0, - 0, 0, 0, 232, 209, 210, 211, 212, 213, 214, + 0, 0, 0, 233, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 196, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 13, 73, 75, - 0, 93, 0, 58, 59, 60, 61, 62, 63, 3, - 2, 0, 0, 0, 66, 67, 0, 0, 0, 0, - 0, 0, 193, 194, 0, 0, 0, 184, 185, 179, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 74, 95, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 98, 100, 0, 102, - 0, 115, 116, 117, 118, 0, 0, 108, 0, 0, - 0, 0, 130, 131, 0, 90, 0, 86, 11, 14, - 0, -2, 64, 65, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 192, 0, 0, 0, 3, 0, - 163, 0, 0, 186, 189, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 120, - 0, 0, 0, 99, 106, 96, 126, 125, 104, 101, - 103, 0, 107, 114, 111, 0, 157, 155, 153, 154, - 162, 160, 158, 159, 0, 0, 0, 0, 0, 0, - 0, 94, 87, 0, 0, 0, 0, 0, 68, 69, - 70, 71, 72, 40, 47, 0, 15, 0, 0, 0, - 0, 0, 51, 0, 3, 192, 0, 229, 225, 0, - 230, 0, 195, 0, 0, 0, 0, 121, 122, 123, - 97, 105, 0, 0, 119, 0, 0, 0, 0, 0, - 137, 144, 151, 0, 136, 143, 150, 132, 139, 146, - 133, 140, 147, 134, 141, 148, 135, 142, 149, 138, - 145, 152, 0, 0, 92, 0, 0, 233, -2, 49, - 0, 16, 19, 35, 0, 23, 0, 27, 0, 0, - 0, 0, 0, 39, 53, 3, 52, 0, 0, 227, - 228, 0, 0, 181, 0, 183, 187, 0, 190, 0, - 127, 124, 112, 113, 109, 110, 156, 161, 0, 0, - 89, 0, 91, 0, 48, 20, 36, 37, 224, 24, - 43, 28, 31, 41, 0, 44, 45, 46, 17, 0, - 0, 0, 54, 3, 226, 0, 180, 182, 188, 191, - 0, 0, 88, 0, 0, 0, 50, 38, 32, 0, - 18, 21, 0, 25, 29, 0, 55, 56, 0, 128, - 129, 231, 247, 236, 0, 0, 0, 0, 22, 26, - 30, 33, 0, 237, 244, 240, 0, 0, 246, 42, - 34, 0, 245, 241, 238, 0, 0, 239, 242, 0, - 243, 57, + 178, 178, 178, 178, 178, 178, 178, 0, 13, 73, + 75, 0, 93, 0, 58, 59, 60, 61, 62, 63, + 3, 2, 0, 0, 0, 66, 67, 0, 0, 0, + 0, 0, 0, 193, 194, 0, 0, 0, 184, 185, + 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 232, 74, 95, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 98, 100, + 0, 102, 0, 115, 116, 117, 118, 0, 0, 108, + 0, 0, 0, 0, 130, 131, 0, 90, 0, 86, + 11, 14, 0, -2, 64, 65, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 192, 0, 0, 0, + 3, 0, 163, 0, 0, 186, 189, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 120, 0, 0, 0, 99, 106, 96, 126, 125, + 104, 101, 103, 0, 107, 114, 111, 0, 157, 155, + 153, 154, 162, 160, 158, 159, 0, 0, 0, 0, + 0, 0, 0, 94, 87, 0, 0, 0, 0, 0, + 68, 69, 70, 71, 72, 40, 47, 0, 15, 0, + 0, 0, 0, 0, 51, 0, 3, 192, 0, 229, + 225, 0, 230, 0, 195, 0, 0, 0, 0, 121, + 122, 123, 97, 105, 0, 0, 119, 0, 0, 0, + 0, 0, 137, 144, 151, 0, 136, 143, 150, 132, + 139, 146, 133, 140, 147, 134, 141, 148, 135, 142, + 149, 138, 145, 152, 0, 0, 92, 0, 0, 234, + -2, 49, 0, 16, 19, 35, 0, 23, 0, 27, + 0, 0, 0, 0, 0, 39, 53, 3, 52, 0, + 0, 227, 228, 0, 0, 181, 0, 183, 187, 0, + 190, 0, 127, 124, 112, 113, 109, 110, 156, 161, + 0, 0, 89, 0, 91, 0, 48, 20, 36, 37, + 224, 24, 43, 28, 31, 41, 0, 44, 45, 46, + 17, 0, 0, 0, 54, 3, 226, 0, 180, 182, + 188, 191, 0, 0, 88, 0, 0, 0, 50, 38, + 32, 0, 18, 21, 0, 25, 29, 0, 55, 56, + 0, 128, 129, 231, 248, 237, 0, 0, 0, 0, + 22, 26, 30, 33, 0, 238, 245, 241, 0, 0, + 247, 42, 34, 0, 246, 242, 239, 0, 0, 240, + 243, 0, 244, 57, } var exprTok1 = [...]int{ @@ -598,7 +599,7 @@ var exprTok2 = [...]int{ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, + 92, 93, 94, 95, 96, 97, 98, } var exprTok3 = [...]int{ 0, @@ -2097,76 +2098,81 @@ exprdefault: exprVAL.VariantsExpr = newVariantsExpr(exprDollar[3].VariantsList, exprDollar[7].VariantsRangeExpr) } case 232: + exprDollar = exprS[exprpt-3 : exprpt+1] + { + exprVAL.VariantsExpr = newLoglessVariantsExpr(exprDollar[1].VariantsExpr) + } + case 233: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VariantsOp = OpVariants } - case 233: + case 234: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VariantsOf = VariantsOf } - case 234: + case 235: exprDollar = exprS[exprpt-1 : exprpt+1] { exprVAL.VariantsList = []SampleExpr{exprDollar[1].MetricExpr} } - case 235: + case 236: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.VariantsList = append(exprDollar[1].VariantsList, exprDollar[3].MetricExpr) } - case 236: + case 237: exprDollar = exprS[exprpt-2 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, nil, nil) } - case 237: + case 238: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].duration, nil, exprDollar[3].OffsetExpr) } - case 238: + case 239: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, nil, nil) } - case 239: + case 240: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newMatcherExpr(exprDollar[2].Selector), exprDollar[4].duration, nil, exprDollar[5].OffsetExpr) } - case 240: + case 241: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[3].duration, nil, nil) } - case 241: + case 242: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[2].PipelineExpr), exprDollar[3].duration, nil, exprDollar[4].OffsetExpr) } - case 242: + case 243: exprDollar = exprS[exprpt-5 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[5].duration, nil, nil) } - case 243: + case 244: exprDollar = exprS[exprpt-6 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[2].Selector), exprDollar[3].PipelineExpr), exprDollar[5].duration, nil, exprDollar[6].OffsetExpr) } - case 244: + case 245: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[3].PipelineExpr), exprDollar[2].duration, nil, nil) } - case 245: + case 246: exprDollar = exprS[exprpt-4 : exprpt+1] { exprVAL.VariantsRangeExpr = newLogRange(newPipelineExpr(newMatcherExpr(exprDollar[1].Selector), exprDollar[4].PipelineExpr), exprDollar[2].duration, nil, exprDollar[3].OffsetExpr) } - case 246: + case 247: exprDollar = exprS[exprpt-3 : exprpt+1] { exprVAL.VariantsRangeExpr = exprDollar[2].VariantsRangeExpr diff --git a/pkg/logql/syntax/lex.go b/pkg/logql/syntax/lex.go index 5d6a5737dc748..401852a761178 100644 --- a/pkg/logql/syntax/lex.go +++ b/pkg/logql/syntax/lex.go @@ -36,6 +36,7 @@ var tokens = map[string]int{ "bool": BOOL, "[": OPEN_BRACKET, "]": CLOSE_BRACKET, + "logs": LOGS, OpLabelReplace: LABEL_REPLACE, OpOffset: OFFSET, OpOn: ON, diff --git a/pkg/logql/syntax/lex_test.go b/pkg/logql/syntax/lex_test.go index e0c3bfaddae71..f403f132be0ff 100644 --- a/pkg/logql/syntax/lex_test.go +++ b/pkg/logql/syntax/lex_test.go @@ -137,19 +137,42 @@ func TestLex_Variatns(t *testing.T) { }{ // {`count_over_time({foo="bar"}[5m])`, []int{COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS}}, { - `variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"})`, - []int{VARIANTS, OPEN_PARENTHESIS, COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, OF, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, CLOSE_PARENTHESIS}, + `variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"}[5m])`, + []int{VARIANTS, OPEN_PARENTHESIS, COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, OF, + OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS}, }, { - `variants(bytes_over_time({foo="bar"}[5m]), count_over_time({foo="bar"}[5m])) of ({foo="bar"})`, + `variants(bytes_over_time({foo="bar"}[5m]), count_over_time({foo="bar"}[5m])) of ({foo="bar"}[5m])`, []int{VARIANTS, OPEN_PARENTHESIS, BYTES_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, COMMA, - COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, OF, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, CLOSE_PARENTHESIS}, + COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, + OF, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS}, }, { - `variants(count_over_time({foo="bar"}[5m]), rate({foo="bar"}[5m])) of ({foo="bar"} | logfmt | number="42")`, + `variants(count_over_time({foo="bar"}[5m]), rate({foo="bar"}[5m])) of ({foo="bar"} | logfmt | number="42"[5m])`, []int{VARIANTS, OPEN_PARENTHESIS, COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, COMMA, RATE, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, OF, - OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, PIPE, LOGFMT, PIPE, IDENTIFIER, EQ, STRING, CLOSE_PARENTHESIS}, + OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, PIPE, LOGFMT, PIPE, IDENTIFIER, EQ, STRING, RANGE, CLOSE_PARENTHESIS}, + }, + { + `variants(count_over_time({foo="bar"}[5m])) of ({foo="bar"}[1m]) without logs`, + []int{VARIANTS, OPEN_PARENTHESIS, COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, + OF, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, WITHOUT, LOGS}, + }, + { + `variants(bytes_over_time({foo="bar"}[5m]), count_over_time({foo="bar"}[5m])) of ({foo="bar"}[1m]) without logs`, + []int{VARIANTS, OPEN_PARENTHESIS, BYTES_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, COMMA, + COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, + OF, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, + WITHOUT, LOGS, + }, + }, + { + `variants(count_over_time({foo="bar"}[5m]), rate({foo="bar"}[5m])) of ({foo="bar"} | logfmt | number="42" [1m]) without logs`, + []int{VARIANTS, OPEN_PARENTHESIS, COUNT_OVER_TIME, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, COMMA, + RATE, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, RANGE, CLOSE_PARENTHESIS, CLOSE_PARENTHESIS, + OF, OPEN_PARENTHESIS, OPEN_BRACE, IDENTIFIER, EQ, STRING, CLOSE_BRACE, PIPE, LOGFMT, PIPE, IDENTIFIER, EQ, STRING, RANGE, CLOSE_PARENTHESIS, + WITHOUT, LOGS, + }, }, } { t.Run(tc.input, func(t *testing.T) { diff --git a/pkg/logql/syntax/serialize.go b/pkg/logql/syntax/serialize.go index 82276d3312784..ed81520ef4b30 100644 --- a/pkg/logql/syntax/serialize.go +++ b/pkg/logql/syntax/serialize.go @@ -79,6 +79,7 @@ const ( Without = "without" Variants = "variants" Of = "of" + Logs = "logs" ) func DecodeJSON(raw string) (Expr, error) { @@ -342,6 +343,13 @@ func (v *JSONSerializer) VisitVariants(e *MultiVariantExpr) { variant.Accept(v) } v.WriteArrayEnd() + + if !e.ShouldIncludeLogs() { + v.WriteMore() + v.WriteObjectField(Without) + v.WriteBool(true) + } + v.WriteObjectEnd() v.WriteObjectEnd() v.Flush() @@ -788,6 +796,8 @@ func decodeVariants(iter *jsoniter.Iterator) (VariantsExpr, error) { } e.SetLogSelector(logRange) + case Without: + e.IncludeLogs(iter.ReadBool()) } } diff --git a/pkg/logql/syntax/serialize_test.go b/pkg/logql/syntax/serialize_test.go index 19ca479d2c130..208267c23a699 100644 --- a/pkg/logql/syntax/serialize_test.go +++ b/pkg/logql/syntax/serialize_test.go @@ -67,6 +67,12 @@ func TestJSONSerializationRoundTrip(t *testing.T) { "multiple variants": { query: `variants(count_over_time({app="loki"} [1m]), bytes_over_time({app="loki"} [1m])) of ({app="loki"}[1m])`, }, + "single variant without logs": { + query: `variants(count_over_time({app="loki"} [1m])) of ({app="loki"}[1m]) without logs`, + }, + "multiple variants without logs": { + query: `variants(count_over_time({app="loki"} [1m]), bytes_over_time({app="loki"} [1m])) of ({app="loki"}[1m]) without logs`, + }, } for name, test := range tests { @@ -135,6 +141,27 @@ func TestJSONSerializationRoundTrip_Variants(t *testing.T) { Interval: 5 * time.Minute, }, "count_over_time", nil, nil), }, + includeLogs: true, + }, + }, + "single variant without logs": { + query: `variants(count_over_time({app="loki"} [5m])) of ({app="loki"} [5m]) without logs`, + expected: MultiVariantExpr{ + logRange: newLogRange( + newMatcherExpr( + []*labels.Matcher{mustNewMatcher(labels.MatchEqual, "app", "loki")}, + ), 5*time.Minute, nil, nil), + variants: []SampleExpr{ + newRangeAggregationExpr(&LogRange{ + Left: &MatchersExpr{ + Mts: []*labels.Matcher{ + mustNewMatcher(labels.MatchEqual, "app", "loki"), + }, + }, + Interval: 5 * time.Minute, + }, "count_over_time", nil, nil), + }, + includeLogs: false, }, }, "multiple variants": { @@ -162,6 +189,35 @@ func TestJSONSerializationRoundTrip_Variants(t *testing.T) { Interval: 5 * time.Minute, }, "bytes_over_time", nil, nil), }, + includeLogs: true, + }, + }, + "multiple variants without logs": { + query: `variants(count_over_time({app="loki"} [5m]), bytes_over_time({app="loki"} [5m])) of ({app="loki"}[5m]) without logs`, + expected: MultiVariantExpr{ + logRange: newLogRange( + newMatcherExpr( + []*labels.Matcher{mustNewMatcher(labels.MatchEqual, "app", "loki")}, + ), 5*time.Minute, nil, nil), + variants: []SampleExpr{ + newRangeAggregationExpr(&LogRange{ + Left: &MatchersExpr{ + Mts: []*labels.Matcher{ + mustNewMatcher(labels.MatchEqual, "app", "loki"), + }, + }, + Interval: 5 * time.Minute, + }, "count_over_time", nil, nil), + newRangeAggregationExpr(&LogRange{ + Left: &MatchersExpr{ + Mts: []*labels.Matcher{ + mustNewMatcher(labels.MatchEqual, "app", "loki"), + }, + }, + Interval: 5 * time.Minute, + }, "bytes_over_time", nil, nil), + }, + includeLogs: false, }, }, } From 7e2af6cb25daf5651b1d2bffbcf32c937865ee0e Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Mon, 28 Oct 2024 13:54:01 -0600 Subject: [PATCH 4/7] wip: initial implementaiton of multi extractors and variant step eval --- pkg/chunkenc/interface.go | 2 + pkg/chunkenc/memchunk.go | 7 + pkg/chunkenc/variants.go | 78 ++++ pkg/ingester/flush_test.go | 4 + pkg/ingester/ingester_test.go | 4 + pkg/iter/iterator.go | 23 +- pkg/logcli/client/file.go | 2 +- pkg/logproto/logproto.pb.go | 700 +++++++++---------------------- pkg/logproto/logproto.proto | 16 +- pkg/logql/downstream.go | 2 +- pkg/logql/engine.go | 23 +- pkg/logql/engine_test.go | 8 +- pkg/logql/evaluator.go | 277 ++++++++++-- pkg/logql/syntax/ast.go | 16 + pkg/logql/test_utils.go | 2 +- pkg/querier-rf1/querier.go | 2 +- pkg/querier-rf1/wal/querier.go | 2 +- pkg/querier/querier.go | 88 +++- pkg/querier/querier_mock_test.go | 8 +- pkg/ruler/compat_test.go | 2 +- pkg/storage/batch.go | 152 ++++++- pkg/storage/lazy_chunk.go | 16 +- pkg/storage/store.go | 78 +++- pkg/util/deletion/deletion.go | 6 +- 24 files changed, 939 insertions(+), 579 deletions(-) create mode 100644 pkg/chunkenc/variants.go diff --git a/pkg/chunkenc/interface.go b/pkg/chunkenc/interface.go index e894b687236c0..0df9f8a5913b3 100644 --- a/pkg/chunkenc/interface.go +++ b/pkg/chunkenc/interface.go @@ -86,4 +86,6 @@ type Block interface { Iterator(ctx context.Context, pipeline log.StreamPipeline) iter.EntryIterator // SampleIterator returns a sample iterator for the block. SampleIterator(ctx context.Context, extractor log.StreamSampleExtractor) iter.SampleIterator + // MultiExtractorSampleIterator returns a sample iterator for the block that can do multiple extractions per line. + MultiExtractorSampleIterator(ctx context.Context, extractors []log.StreamSampleExtractor) iter.SampleIterator } diff --git a/pkg/chunkenc/memchunk.go b/pkg/chunkenc/memchunk.go index 790210d3af8b2..498073e116459 100644 --- a/pkg/chunkenc/memchunk.go +++ b/pkg/chunkenc/memchunk.go @@ -1193,6 +1193,13 @@ func (b encBlock) SampleIterator(ctx context.Context, extractor log.StreamSample return newSampleIterator(ctx, compression.GetReaderPool(b.enc), b.b, b.format, extractor, b.symbolizer) } +func (b encBlock) MultiExtractorSampleIterator(ctx context.Context, extractors []log.StreamSampleExtractor) iter.SampleIterator { + if len(b.b) == 0 { + return iter.NoopSampleIterator + } + return newMultiExtractorSampleIterator(ctx, compression.GetReaderPool(b.enc), b.b, b.format, extractors, b.symbolizer) +} + func (b block) Offset() int { return b.offset } diff --git a/pkg/chunkenc/variants.go b/pkg/chunkenc/variants.go new file mode 100644 index 0000000000000..da74dc3561972 --- /dev/null +++ b/pkg/chunkenc/variants.go @@ -0,0 +1,78 @@ +package chunkenc + +import ( + "context" + + "github.com/cespare/xxhash/v2" + "github.com/grafana/loki/v3/pkg/compression" + "github.com/grafana/loki/v3/pkg/iter" + "github.com/grafana/loki/v3/pkg/logproto" + "github.com/grafana/loki/v3/pkg/logql/log" + "github.com/grafana/loki/v3/pkg/logqlmodel/stats" +) + +func newMultiExtractorSampleIterator(ctx context.Context, pool compression.ReaderPool, b []byte, format byte, extractors []log.StreamSampleExtractor, symbolizer *symbolizer) iter.SampleIterator { + return &multiExtractorSampleBufferedIterator{ + bufferedIterator: newBufferedIterator(ctx, pool, b, format, symbolizer), + extractors: extractors, + stats: stats.FromContext(ctx), + } +} + +type multiExtractorSampleBufferedIterator struct { + *bufferedIterator + + extractors []log.StreamSampleExtractor + stats *stats.Context + + cur []logproto.Sample + currLabels []log.LabelsResult + currBaseLabels []log.LabelsResult +} + +func (e *multiExtractorSampleBufferedIterator) Next() bool { + if len(e.cur) > 0 { + e.cur = e.cur[1:] + e.currLabels = e.currLabels[1:] + e.currBaseLabels = e.currBaseLabels[1:] + + return true + } + + for e.bufferedIterator.Next() { + for _, extractor := range e.extractors { + val, labels, ok := extractor.Process(e.currTs, e.currLine, e.currStructuredMetadata...) + if !ok { + continue + } + e.stats.AddPostFilterLines(1) + e.currLabels = append(e.currLabels, labels) + e.currBaseLabels = append(e.currBaseLabels, extractor.BaseLabels()) + + e.cur = append(e.cur, logproto.Sample{ + Value: val, + Hash: xxhash.Sum64(e.currLine), + Timestamp: e.currTs, + }) + + return true + } + } + return false +} + +func (e *multiExtractorSampleBufferedIterator) Close() error { + for _, extractor := range e.extractors { + if extractor.ReferencedStructuredMetadata() { + e.stats.SetQueryReferencedStructuredMetadata() + } + } + + return e.bufferedIterator.Close() +} + +func (e *multiExtractorSampleBufferedIterator) Labels() string { return e.currLabels[0].String() } + +func (e *multiExtractorSampleBufferedIterator) StreamHash() uint64 { return e.currBaseLabels[0].Hash() } + +func (e *multiExtractorSampleBufferedIterator) At() logproto.Sample { return e.cur[0] } diff --git a/pkg/ingester/flush_test.go b/pkg/ingester/flush_test.go index f4251747115a2..69cb04ce0d5bd 100644 --- a/pkg/ingester/flush_test.go +++ b/pkg/ingester/flush_test.go @@ -380,6 +380,10 @@ type testStore struct { onPut func(ctx context.Context, chunks []chunk.Chunk) error } +func (t *testStore) SelectVariants(ctx context.Context, req logql.SelectVariantsParams) (iter.SampleIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on testStore") // TODO: Implement +} + // Note: the ingester New() function creates it's own WAL first which we then override if specified. // Because of this, ensure any WAL directories exist/are cleaned up even when overriding the wal. // This is an ugly hook for testing :( diff --git a/pkg/ingester/ingester_test.go b/pkg/ingester/ingester_test.go index 9074580b4eb40..93bee8df37241 100644 --- a/pkg/ingester/ingester_test.go +++ b/pkg/ingester/ingester_test.go @@ -435,6 +435,10 @@ type mockStore struct { chunks map[string][]chunk.Chunk } +func (m *mockStore) SelectVariants(ctx context.Context, req logql.SelectVariantsParams) (iter.SampleIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on mockStore") // TODO: Implement +} + func (s *mockStore) Put(ctx context.Context, chunks []chunk.Chunk) error { s.mtx.Lock() defer s.mtx.Unlock() diff --git a/pkg/iter/iterator.go b/pkg/iter/iterator.go index 9ff3a91bc4647..a621c612a045b 100644 --- a/pkg/iter/iterator.go +++ b/pkg/iter/iterator.go @@ -8,7 +8,7 @@ import ( ) type logprotoType interface { - logproto.Entry | logproto.Sample | logproto.Variants + logproto.Entry | logproto.Sample } type StreamIterator[T logprotoType] interface { @@ -20,9 +20,10 @@ type StreamIterator[T logprotoType] interface { StreamHash() uint64 } -type EntryIterator StreamIterator[logproto.Entry] -type SampleIterator StreamIterator[logproto.Sample] -type VariantsIterator StreamIterator[logproto.Variants] +type ( + EntryIterator StreamIterator[logproto.Entry] + SampleIterator StreamIterator[logproto.Sample] +) // noOpIterator implements StreamIterator type noOpIterator[T logprotoType] struct{} @@ -34,9 +35,10 @@ func (noOpIterator[T]) Labels() string { return "" } func (noOpIterator[T]) StreamHash() uint64 { return 0 } func (noOpIterator[T]) Close() error { return nil } -var NoopEntryIterator = noOpIterator[logproto.Entry]{} -var NoopSampleIterator = noOpIterator[logproto.Sample]{} -var NoopVariantsIterator = noOpIterator[logproto.Variants]{} +var ( + NoopEntryIterator = noOpIterator[logproto.Entry]{} + NoopSampleIterator = noOpIterator[logproto.Sample]{} +) // errorIterator implements StreamIterator type errorIterator[T logprotoType] struct{} @@ -48,6 +50,7 @@ func (errorIterator[T]) Labels() string { return "" } func (errorIterator[T]) StreamHash() uint64 { return 0 } func (errorIterator[T]) Close() error { return errors.New("close") } -var ErrorEntryIterator = errorIterator[logproto.Entry]{} -var ErrorSampleIterator = errorIterator[logproto.Sample]{} -var ErrorVariantsIterator = errorIterator[logproto.Variants]{} +var ( + ErrorEntryIterator = errorIterator[logproto.Entry]{} + ErrorSampleIterator = errorIterator[logproto.Sample]{} +) diff --git a/pkg/logcli/client/file.go b/pkg/logcli/client/file.go index 7e3f6db0c764e..5945766d28363 100644 --- a/pkg/logcli/client/file.go +++ b/pkg/logcli/client/file.go @@ -246,7 +246,7 @@ type querier struct { labels labels.Labels } -func (q *querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { +func (q *querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectVariants not implemented on logcli client.Querier") // TODO: Implement } diff --git a/pkg/logproto/logproto.pb.go b/pkg/logproto/logproto.pb.go index 7fe00455e2535..f8ca745eeee0b 100644 --- a/pkg/logproto/logproto.pb.go +++ b/pkg/logproto/logproto.pb.go @@ -3210,9 +3210,9 @@ func (m *VariantsQueryRequest) GetStoreChunks() *ChunkRefGroup { } type VariantsQueryResponse struct { - Variants []*Variants `protobuf:"bytes,1,rep,name=variants,proto3" json:"variants,omitempty"` - Stats stats.Ingester `protobuf:"bytes,3,opt,name=stats,proto3" json:"stats"` - Warnings []string `protobuf:"bytes,4,rep,name=warnings,proto3" json:"warnings,omitempty"` + Series []Series `protobuf:"bytes,1,rep,name=series,proto3,customtype=Series" json:"series,omitempty"` + Stats stats.Ingester `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats"` + Warnings []string `protobuf:"bytes,3,rep,name=warnings,proto3" json:"warnings,omitempty"` } func (m *VariantsQueryResponse) Reset() { *m = VariantsQueryResponse{} } @@ -3247,13 +3247,6 @@ func (m *VariantsQueryResponse) XXX_DiscardUnknown() { var xxx_messageInfo_VariantsQueryResponse proto.InternalMessageInfo -func (m *VariantsQueryResponse) GetVariants() []*Variants { - if m != nil { - return m.Variants - } - return nil -} - func (m *VariantsQueryResponse) GetStats() stats.Ingester { if m != nil { return m.Stats @@ -3268,43 +3261,6 @@ func (m *VariantsQueryResponse) GetWarnings() []string { return nil } -type Variants struct { - Streams []github_com_grafana_loki_pkg_push.Stream `protobuf:"bytes,1,rep,name=streams,proto3,customtype=github.com/grafana/loki/pkg/push.Stream" json:"streams,omitempty"` - Series []Series `protobuf:"bytes,2,rep,name=series,proto3,customtype=Series" json:"series,omitempty"` -} - -func (m *Variants) Reset() { *m = Variants{} } -func (*Variants) ProtoMessage() {} -func (*Variants) Descriptor() ([]byte, []int) { - return fileDescriptor_c28a5f14f1f4c79a, []int{56} -} -func (m *Variants) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Variants) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Variants.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Variants) XXX_Merge(src proto.Message) { - xxx_messageInfo_Variants.Merge(m, src) -} -func (m *Variants) XXX_Size() int { - return m.Size() -} -func (m *Variants) XXX_DiscardUnknown() { - xxx_messageInfo_Variants.DiscardUnknown(m) -} - -var xxx_messageInfo_Variants proto.InternalMessageInfo - func init() { proto.RegisterEnum("logproto.Direction", Direction_name, Direction_value) proto.RegisterType((*LabelToValuesResponse)(nil), "logproto.LabelToValuesResponse") @@ -3365,194 +3321,191 @@ func init() { proto.RegisterType((*DetectedLabel)(nil), "logproto.DetectedLabel") proto.RegisterType((*VariantsQueryRequest)(nil), "logproto.VariantsQueryRequest") proto.RegisterType((*VariantsQueryResponse)(nil), "logproto.VariantsQueryResponse") - proto.RegisterType((*Variants)(nil), "logproto.Variants") } func init() { proto.RegisterFile("pkg/logproto/logproto.proto", fileDescriptor_c28a5f14f1f4c79a) } var fileDescriptor_c28a5f14f1f4c79a = []byte{ - // 2891 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x1a, 0x4b, 0x6f, 0x1b, 0xc7, - 0x99, 0x4b, 0x2e, 0x5f, 0x1f, 0x29, 0x59, 0x1e, 0xd1, 0x36, 0x21, 0x3b, 0x5c, 0x65, 0xd1, 0x26, - 0x4e, 0xec, 0x88, 0xb6, 0xf3, 0x68, 0xe2, 0x34, 0x4d, 0x4d, 0x29, 0x76, 0xec, 0x28, 0xb6, 0x33, - 0x52, 0x9c, 0xb4, 0x68, 0x10, 0xac, 0xc9, 0x11, 0xb5, 0x30, 0xb9, 0x4b, 0xef, 0x0e, 0xed, 0xf0, - 0x96, 0x3f, 0x50, 0x34, 0x40, 0xd1, 0xd7, 0xa5, 0x40, 0x81, 0x02, 0xcd, 0x25, 0x97, 0xa2, 0x87, - 0x1e, 0x8a, 0xf6, 0x52, 0xa0, 0xe9, 0x2d, 0xc7, 0x20, 0x07, 0xb6, 0x51, 0x2e, 0x85, 0x80, 0x02, - 0x39, 0xb5, 0x40, 0x4e, 0xc5, 0xbc, 0x76, 0x67, 0x97, 0x64, 0x6c, 0x3a, 0x6e, 0x93, 0x00, 0xbd, - 0x48, 0x3b, 0xdf, 0x7c, 0xf3, 0xcd, 0x7c, 0x8f, 0xf9, 0x5e, 0x43, 0x38, 0x3a, 0xb8, 0xd1, 0x6d, - 0xf6, 0xfc, 0xee, 0x20, 0xf0, 0xa9, 0x1f, 0x7d, 0xac, 0xf1, 0xbf, 0xa8, 0xa4, 0xc6, 0x2b, 0xb5, - 0xae, 0xdf, 0xf5, 0x05, 0x0e, 0xfb, 0x12, 0xf3, 0x2b, 0x56, 0xd7, 0xf7, 0xbb, 0x3d, 0xd2, 0xe4, - 0xa3, 0xeb, 0xc3, 0x9d, 0x26, 0x75, 0xfb, 0x24, 0xa4, 0x4e, 0x7f, 0x20, 0x11, 0x56, 0x25, 0xf5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, - 0x37, 0x32, 0xa1, 0xba, 0x52, 0x51, 0xec, 0xab, 0x05, 0x80, 0x59, 0x62, 0x87, 0xf4, 0x9c, 0xd1, - 0x79, 0x3f, 0xe0, 0x74, 0x17, 0x70, 0x34, 0x8e, 0x63, 0xb8, 0x39, 0x35, 0x86, 0xe7, 0xe7, 0x77, - 0xed, 0xff, 0x5d, 0x47, 0x7a, 0xc9, 0x2c, 0x65, 0x97, 0x72, 0xf6, 0x7b, 0x06, 0x54, 0x05, 0xf3, - 0xd2, 0xf2, 0x7e, 0x00, 0x05, 0x21, 0x1b, 0xce, 0xfe, 0xe7, 0x38, 0xa6, 0x13, 0xf3, 0x38, 0x25, - 0x49, 0x13, 0x3d, 0x0f, 0x8b, 0x9d, 0xc0, 0x1f, 0x0c, 0x48, 0x67, 0x4b, 0xba, 0xbf, 0x6c, 0xda, - 0xfd, 0x6d, 0xe8, 0xf3, 0x38, 0x85, 0x6e, 0xff, 0xd5, 0x80, 0x05, 0xe9, 0x4c, 0xa4, 0xba, 0x22, - 0x11, 0x1b, 0xf7, 0x1c, 0x3d, 0xb3, 0xf3, 0x46, 0xcf, 0xc3, 0x50, 0xe8, 0xb2, 0xf8, 0xa2, 0x1c, - 0x92, 0x1c, 0xcd, 0x17, 0x55, 0xed, 0x4b, 0xb0, 0xa8, 0x58, 0x99, 0xe1, 0x51, 0x57, 0xd2, 0x1e, - 0xf5, 0x62, 0x87, 0x78, 0xd4, 0xdd, 0x71, 0x23, 0x1f, 0x29, 0xf1, 0xed, 0x1f, 0x19, 0xb0, 0x94, - 0x46, 0x41, 0x1b, 0xa9, 0xc2, 0xe2, 0xa1, 0xd9, 0xe4, 0xf4, 0x9a, 0x42, 0x91, 0x96, 0x95, 0xc5, - 0x93, 0x77, 0xaa, 0x2c, 0x6a, 0xba, 0x93, 0x29, 0x4b, 0xaf, 0x60, 0xff, 0xcc, 0x80, 0x85, 0x84, - 0x2e, 0xd1, 0xd3, 0x60, 0xee, 0x04, 0x7e, 0x7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 0xcd, 0xc8, - 0x6e, 0xa2, 0x73, 0xad, 0xce, 0x46, 0x88, 0x28, 0xbf, 0x96, 0xa0, 0x2c, 0xd3, 0x71, 0x6b, 0x46, - 0x1c, 0x8c, 0x28, 0x5b, 0x77, 0xf8, 0x0d, 0x97, 0x9d, 0x41, 0xdb, 0xf2, 0x47, 0x01, 0x91, 0x0f, - 0x68, 0x4c, 0x7a, 0x9f, 0x84, 0x99, 0x5b, 0x33, 0xe7, 0x63, 0x8b, 0x3b, 0xf3, 0x86, 0xfa, 0x71, - 0xd4, 0x86, 0x43, 0x1d, 0x74, 0x05, 0x16, 0xb9, 0x86, 0xa2, 0x5f, 0x4f, 0x25, 0x6e, 0xd2, 0xc4, - 0x4f, 0xb5, 0x12, 0x37, 0x69, 0xf2, 0x27, 0x5b, 0x76, 0xa6, 0xf5, 0xc6, 0x07, 0x1f, 0x37, 0x32, - 0x1f, 0x7e, 0xdc, 0xc8, 0x7c, 0xfa, 0x71, 0xc3, 0x78, 0x7b, 0xaf, 0x61, 0xbc, 0xbb, 0xd7, 0x30, - 0xde, 0xdf, 0x6b, 0x18, 0x1f, 0xec, 0x35, 0x8c, 0xbf, 0xef, 0x35, 0x8c, 0x7f, 0xec, 0x35, 0x32, - 0x9f, 0xee, 0x35, 0x8c, 0x77, 0x3e, 0x69, 0x64, 0x3e, 0xf8, 0xa4, 0x91, 0xf9, 0xf0, 0x93, 0x46, - 0xe6, 0xfb, 0x0f, 0xdf, 0xb9, 0x6f, 0x26, 0x02, 0x60, 0x81, 0xff, 0x7b, 0xfc, 0x3f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x7f, 0x5f, 0x5f, 0x35, 0xf4, 0x27, 0x00, 0x00, + // 2855 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3a, 0xcd, 0x6f, 0x1b, 0xc7, + 0xf5, 0x5c, 0x72, 0xf9, 0xf5, 0x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0x34, 0x1d, 0x04, 0x80, 0xc8, 0x7f, 0x7c, + 0x2f, 0xea, 0x31, 0x61, 0x35, 0x76, 0xbc, 0x97, 0x02, 0x11, 0xfd, 0x81, 0xff, 0x9d, 0x85, 0xb9, + 0xeb, 0x7e, 0x7f, 0x14, 0x87, 0xd7, 0xaf, 0x53, 0x68, 0x49, 0x34, 0x04, 0xf2, 0xba, 0x21, 0x80, + 0xc0, 0x0e, 0x19, 0x1d, 0x0a, 0xcb, 0xca, 0x11, 0xf1, 0x8d, 0x30, 0x54, 0x99, 0x13, 0xf4, 0x28, + 0x93, 0x65, 0x56, 0xbd, 0x20, 0xf2, 0xdf, 0x04, 0x0c, 0x2d, 0x43, 0xc5, 0xe9, 0xf5, 0x02, 0xda, + 0x73, 0x18, 0x6d, 0x8f, 0xeb, 0x45, 0xb1, 0x99, 0x09, 0x42, 0x97, 0x61, 0xbe, 0xe3, 0x74, 0x76, + 0x5c, 0xaf, 0x77, 0x75, 0xc8, 0x5c, 0xdf, 0x0b, 0xeb, 0x25, 0xe1, 0xc1, 0x4f, 0xac, 0x9a, 0x4f, + 0x52, 0xab, 0x6b, 0x09, 0x1c, 0xe5, 0xc7, 0x52, 0x2b, 0xf1, 0x1b, 0x30, 0xaf, 0x05, 0xaf, 0xcc, + 0xe3, 0x34, 0x14, 0x6f, 0x0b, 0xc8, 0x94, 0x66, 0x9f, 0x44, 0x55, 0xa4, 0x34, 0x5a, 0xf2, 0x51, + 0x43, 0xf3, 0x8f, 0x2f, 0x43, 0x41, 0xa2, 0xa3, 0x13, 0x66, 0xe1, 0x25, 0x73, 0x4f, 0x3e, 0x56, + 0x55, 0x14, 0x86, 0x82, 0x24, 0xa4, 0x8c, 0x48, 0xd8, 0x99, 0x84, 0x10, 0xf5, 0x1f, 0xff, 0x38, + 0x0b, 0x47, 0xd6, 0x29, 0xa3, 0x1d, 0x46, 0xbb, 0x17, 0x5c, 0xda, 0xef, 0x7e, 0xa9, 0x3d, 0x81, + 0xa8, 0x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85, 0x86, 0xa2, 0x9f, 0x25, 0x25, 0x6e, 0xd2, 0xbe, 0xdf, 0x40, 0x25, 0x6e, + 0xd2, 0xfe, 0xdf, 0x42, 0xe1, 0x4c, 0xfb, 0xcd, 0x0f, 0x3e, 0x6e, 0x64, 0x3e, 0xfc, 0xb8, 0x91, + 0xf9, 0xf4, 0xe3, 0x86, 0xf5, 0xce, 0x6e, 0xc3, 0xfa, 0xcd, 0x6e, 0xc3, 0x7a, 0x7f, 0xb7, 0x61, + 0x7d, 0xb0, 0xdb, 0xb0, 0xfe, 0xbe, 0xdb, 0xb0, 0xfe, 0xb1, 0xdb, 0xc8, 0x7c, 0xba, 0xdb, 0xb0, + 0xde, 0xfd, 0xa4, 0x91, 0xf9, 0xe0, 0x93, 0x46, 0xe6, 0xc3, 0x4f, 0x1a, 0x99, 0xef, 0x3d, 0x7a, + 0xf7, 0x86, 0x94, 0x8c, 0x2c, 0x05, 0xf1, 0xef, 0xc9, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x67, + 0x3c, 0xbb, 0xef, 0x4d, 0x27, 0x00, 0x00, } func (x Direction) String() string { @@ -5458,11 +5411,11 @@ func (this *VariantsQueryResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Variants) != len(that1.Variants) { + if len(this.Series) != len(that1.Series) { return false } - for i := range this.Variants { - if !this.Variants[i].Equal(that1.Variants[i]) { + for i := range this.Series { + if !this.Series[i].Equal(that1.Series[i]) { return false } } @@ -5479,43 +5432,6 @@ func (this *VariantsQueryResponse) Equal(that interface{}) bool { } return true } -func (this *Variants) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Variants) - if !ok { - that2, ok := that.(Variants) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Streams) != len(that1.Streams) { - return false - } - for i := range this.Streams { - if !this.Streams[i].Equal(that1.Streams[i]) { - return false - } - } - if len(this.Series) != len(that1.Series) { - return false - } - for i := range this.Series { - if !this.Series[i].Equal(that1.Series[i]) { - return false - } - } - return true -} func (this *LabelToValuesResponse) GoString() string { if this == nil { return "nil" @@ -6262,25 +6178,12 @@ func (this *VariantsQueryResponse) GoString() string { } s := make([]string, 0, 7) s = append(s, "&logproto.VariantsQueryResponse{") - if this.Variants != nil { - s = append(s, "Variants: "+fmt.Sprintf("%#v", this.Variants)+",\n") - } + s = append(s, "Series: "+fmt.Sprintf("%#v", this.Series)+",\n") s = append(s, "Stats: "+strings.Replace(this.Stats.GoString(), `&`, ``, 1)+",\n") s = append(s, "Warnings: "+fmt.Sprintf("%#v", this.Warnings)+",\n") s = append(s, "}") return strings.Join(s, "") } -func (this *Variants) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&logproto.Variants{") - s = append(s, "Streams: "+fmt.Sprintf("%#v", this.Streams)+",\n") - s = append(s, "Series: "+fmt.Sprintf("%#v", this.Series)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} func valueToGoStringLogproto(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -9606,7 +9509,7 @@ func (m *VariantsQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Warnings[iNdEx]) i = encodeVarintLogproto(dAtA, i, uint64(len(m.Warnings[iNdEx]))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } } { @@ -9618,44 +9521,7 @@ func (m *VariantsQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintLogproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - if len(m.Variants) > 0 { - for iNdEx := len(m.Variants) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Variants[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogproto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Variants) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Variants) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Variants) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l + dAtA[i] = 0x12 if len(m.Series) > 0 { for iNdEx := len(m.Series) - 1; iNdEx >= 0; iNdEx-- { { @@ -9667,20 +9533,6 @@ func (m *Variants) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintLogproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - } - if len(m.Streams) > 0 { - for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Streams[iNdEx].Size() - i -= size - if _, err := m.Streams[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintLogproto(dAtA, i, uint64(size)) - } - i-- dAtA[i] = 0xa } } @@ -10854,8 +10706,8 @@ func (m *VariantsQueryResponse) Size() (n int) { } var l int _ = l - if len(m.Variants) > 0 { - for _, e := range m.Variants { + if len(m.Series) > 0 { + for _, e := range m.Series { l = e.Size() n += 1 + l + sovLogproto(uint64(l)) } @@ -10871,27 +10723,6 @@ func (m *VariantsQueryResponse) Size() (n int) { return n } -func (m *Variants) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Streams) > 0 { - for _, e := range m.Streams { - l = e.Size() - n += 1 + l + sovLogproto(uint64(l)) - } - } - if len(m.Series) > 0 { - for _, e := range m.Series { - l = e.Size() - n += 1 + l + sovLogproto(uint64(l)) - } - } - return n -} - func sovLogproto(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -11662,30 +11493,14 @@ func (this *VariantsQueryResponse) String() string { if this == nil { return "nil" } - repeatedStringForVariants := "[]*Variants{" - for _, f := range this.Variants { - repeatedStringForVariants += strings.Replace(f.String(), "Variants", "Variants", 1) + "," - } - repeatedStringForVariants += "}" s := strings.Join([]string{`&VariantsQueryResponse{`, - `Variants:` + repeatedStringForVariants + `,`, + `Series:` + fmt.Sprintf("%v", this.Series) + `,`, `Stats:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Stats), "Ingester", "stats.Ingester", 1), `&`, ``, 1) + `,`, `Warnings:` + fmt.Sprintf("%v", this.Warnings) + `,`, `}`, }, "") return s } -func (this *Variants) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Variants{`, - `Streams:` + fmt.Sprintf("%v", this.Streams) + `,`, - `Series:` + fmt.Sprintf("%v", this.Series) + `,`, - `}`, - }, "") - return s -} func valueToStringLogproto(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -19551,7 +19366,7 @@ func (m *VariantsQueryResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Variants", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -19578,12 +19393,12 @@ func (m *VariantsQueryResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Variants = append(m.Variants, &Variants{}) - if err := m.Variants[len(m.Variants)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Series = append(m.Series, Series{}) + if err := m.Series[len(m.Series)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) } @@ -19616,7 +19431,7 @@ func (m *VariantsQueryResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) } @@ -19672,127 +19487,6 @@ func (m *VariantsQueryResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Variants) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogproto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Variants: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Variants: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogproto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogproto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogproto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Streams = append(m.Streams, github_com_grafana_loki_pkg_push.Stream{}) - if err := m.Streams[len(m.Streams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogproto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogproto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogproto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Series = append(m.Series, Series{}) - if err := m.Series[len(m.Series)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogproto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLogproto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthLogproto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipLogproto(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/pkg/logproto/logproto.proto b/pkg/logproto/logproto.proto index 94baf635d3f66..c017005321293 100644 --- a/pkg/logproto/logproto.proto +++ b/pkg/logproto/logproto.proto @@ -529,20 +529,10 @@ message VariantsQueryRequest { } message VariantsQueryResponse { - repeated Variants variants = 1 [(gogoproto.nullable) = true]; - stats.Ingester stats = 3 [(gogoproto.nullable) = false]; - repeated string warnings = 4; -} - -message Variants { - repeated StreamAdapter streams = 1 [ - (gogoproto.customtype) = "github.com/grafana/loki/pkg/push.Stream", - (gogoproto.nullable) = true - ]; - - repeated Series series = 2 [ + repeated Series series = 1 [ (gogoproto.customtype) = "Series", (gogoproto.nullable) = true ]; - + stats.Ingester stats = 2 [(gogoproto.nullable) = false]; + repeated string warnings = 3; } diff --git a/pkg/logql/downstream.go b/pkg/logql/downstream.go index d57f53c59187c..ebdb71122e8e5 100644 --- a/pkg/logql/downstream.go +++ b/pkg/logql/downstream.go @@ -456,7 +456,7 @@ func (ev DownstreamEvaluator) Downstream(ctx context.Context, queries []Downstre type errorQuerier struct{} -func (e *errorQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { +func (e *errorQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectorVariants not implemented on errorQuerier") // TODO: Implement } diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index f118c599c8e28..c9dec0b3446be 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -64,6 +64,7 @@ type QueryParams interface { GetStart() time.Time GetEnd() time.Time GetShards() []string + GetDeletes() []*logproto.Delete } // SelectParams specifies parameters passed to data selections. @@ -136,7 +137,7 @@ func (s SelectSampleParams) LogSelector() (syntax.LogSelectorExpr, error) { type Querier interface { SelectLogs(context.Context, SelectLogParams) (iter.EntryIterator, error) SelectSamples(context.Context, SelectSampleParams) (iter.SampleIterator, error) - SelectVariants(context.Context, SelectVariantsParams) (iter.VariantsIterator, error) + SelectVariants(context.Context, SelectVariantsParams) (iter.SampleIterator, error) } // EngineOpts is the list of options to use with the LogQL query engine. @@ -674,6 +675,26 @@ func (q *query) evalVariant( } return nil, errors.New("unexpected empty result") } + type SelectVariantsParams struct { *logproto.VariantsQueryRequest } + +func (s SelectVariantsParams) Expr() (syntax.VariantsExpr, error) { + if s.VariantsQueryRequest.Plan == nil { + return nil, errors.New("query plan is empty") + } + expr, ok := s.VariantsQueryRequest.Plan.AST.(syntax.VariantsExpr) + if !ok { + return nil, errors.New("only sample expression supported") + } + return expr, nil +} + +func (s SelectVariantsParams) LogSelector() (syntax.LogSelectorExpr, error) { + expr, err := s.Expr() + if err != nil { + return nil, err + } + return expr.LogRange().Left, nil +} diff --git a/pkg/logql/engine_test.go b/pkg/logql/engine_test.go index 249cd7d66729f..4e073a833f8a5 100644 --- a/pkg/logql/engine_test.go +++ b/pkg/logql/engine_test.go @@ -2273,7 +2273,7 @@ func TestEngine_RangeQuery(t *testing.T) { type statsQuerier struct{} -func (s *statsQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { +func (s *statsQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectVariants not implemented on statsQuerier") // TODO: Implement } @@ -2307,7 +2307,7 @@ func TestEngine_Stats(t *testing.T) { type metaQuerier struct{} -func (m *metaQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { +func (m *metaQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelecttVariants not implemented on metaQuerier") // TODO: Implement } @@ -2373,7 +2373,7 @@ type errorIteratorQuerier struct { entries func() []iter.EntryIterator } -func (e *errorIteratorQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { +func (e *errorIteratorQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectVariants not implemented on errorIteratorQuerier") // TODO: Implement } @@ -2702,7 +2702,7 @@ type querierRecorder struct { match bool } -func (q *querierRecorder) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { +func (q *querierRecorder) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectVariants not implemented on querierRecorder") // TODO: Implement } diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index 02f526d3088b9..4e03a51585bd0 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -6,11 +6,13 @@ import ( "fmt" "math" "sort" + "strconv" "time" "github.com/pkg/errors" "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql" + "github.com/prometheus/prometheus/promql/parser" "golang.org/x/sync/errgroup" "github.com/grafana/loki/v3/pkg/iter" @@ -413,9 +415,6 @@ func (ev *DefaultEvaluator) NewVariantsStepEvaluator( q Params, ) (StepEvaluator, error) { switch e := expr.(type) { - //TODO(twhitney): how do we handle range aggregations?? - //TODO(twhitney): do we need to enforce that the variants have the same range? - //TODO(twhitney): going to need to handle merging aggregations (ie sum() by) case *syntax.MultiVariantExpr: logRange := e.LogRange() variants := make([]string, 0, len(e.Variants())) @@ -423,6 +422,8 @@ func (ev *DefaultEvaluator) NewVariantsStepEvaluator( variants = append(variants, variant.String()) } + // We don't have the benefit of sending the vector expression to the source for reducing labels + // Since multiple samples are allowed, and they may not share the same labels to reduce by it, err := ev.querier.SelectVariants(ctx, SelectVariantsParams{ &logproto.VariantsQueryRequest{ // extend startTs backwards by step @@ -442,8 +443,7 @@ func (ev *DefaultEvaluator) NewVariantsStepEvaluator( if err != nil { return nil, err } - //TODO(twhitney): do we need a peeking iterator here? - return newVariantsEvaluator(it, e, q, e.LogRange().Offset) + return ev.newVariantsEvaluator(ctx, iter.NewPeekingSampleIterator(it), e, q) default: return nil, EvaluatorUnsupportedType(e, ev) } @@ -1399,39 +1399,264 @@ func absentLabels(expr syntax.SampleExpr) (labels.Labels, error) { return m, nil } -type VariantsEvaluator struct { - iter iter.VariantsIterator +func (ev *DefaultEvaluator) newVariantsEvaluator( + ctx context.Context, + it iter.PeekingSampleIterator, + expr *syntax.MultiVariantExpr, + q Params, +) (StepEvaluator, error) { + // an iterator that can buffer samples across all variants for each step + bufferedIterator := &bufferedVariantsIterator{ + iter: it, + } - err error + variantEvaluators := make([]StepEvaluator, len(expr.Variants())) + for i, variant := range expr.Variants() { + // wraps the buffered iterator to only return samples for the current variant (determined by the index) + variantIterator := &bufferedVariantsIteratorWrapper{ + bufferedVariantsIterator: bufferedIterator, + index: i, + } + + var variantEvaluator StepEvaluator + var err error + switch e := variant.(type) { + case *syntax.VectorAggregationExpr: + if rangExpr, ok := e.Left.(*syntax.RangeAggregationExpr); ok { + rangeEvaluator, err := newRangeAggEvaluator(iter.NewPeekingSampleIterator(variantIterator), rangExpr, q, rangExpr.Left.Offset) + if err != nil { + return nil, err + } + + sort.Strings(e.Grouping.Groups) + variantEvaluator = &VectorAggEvaluator{ + nextEvaluator: rangeEvaluator, + expr: e, + buf: make([]byte, 0, 1024), + lb: labels.NewBuilder(nil), + } + } else { + return nil, fmt.Errorf("expected range aggregation expression but got %T", e.Left) + } + case *syntax.RangeAggregationExpr: + variantEvaluator, err = newRangeAggEvaluator(iter.NewPeekingSampleIterator(variantIterator), e, q, e.Left.Offset) + } + + if err != nil { + return nil, err + } + + variantEvaluators[i] = variantEvaluator + } + + logRange := expr.LogRange() + return &VariantsEvaluator{ + selRange: logRange.Interval.Nanoseconds(), + step: q.Step().Nanoseconds(), + end: q.End().UnixNano(), + current: q.Start().UnixNano() - q.Step().Nanoseconds(), + offset: logRange.Offset.Nanoseconds(), + + variantEvaluators: variantEvaluators, + }, nil } -// while Next returns a promql.Value, the only acceptable types are Scalar and Vector. -func (v *VariantsEvaluator) Next() (ok bool, ts int64, r StepResult) { - panic("not implemented") // TODO: Implement +type bufferedVariantsIterator struct { + iter iter.PeekingSampleIterator + buffer map[int][]sampleWithLabelsAndStreamHash + current sampleWithLabelsAndStreamHash + currentLabels string + err error } -// Close all resources used. -func (v *VariantsEvaluator) Close() error { - panic("not implemented") // TODO: Implement +type sampleWithLabelsAndStreamHash struct { + sample logproto.Sample + labels string + streamHash uint64 +} + +func (it *bufferedVariantsIterator) Next(index int) bool { + // Check if there are samples in the buffer for the requested index + if samples, ok := it.buffer[index]; ok && len(samples) > 0 { + it.current = samples[0] + it.buffer[index] = samples[1:] + return true + } + + // If not, keep popping samples from the underlying iterator + for it.iter.Next() { + sample := it.iter.At() + variantIndex := it.getVariantIndex(it.iter.Labels()) + if variantIndex == -1 { + it.err = fmt.Errorf("variant label not found in %s", it.iter.Labels()) + return false + } + + currentSample := sampleWithLabelsAndStreamHash{ + sample: sample, + labels: it.iter.Labels(), + streamHash: it.iter.StreamHash(), + } + + if variantIndex == index { + it.current = currentSample + return true + } + + // Store the sample in the buffer for its variant + it.storeSample(variantIndex, currentSample) + } + + return false +} + +// getVariantIndex determines the variant index for a given sample based on the "__variant__" label +func (it *bufferedVariantsIterator) getVariantIndex(lbls string) int { + metric, err := parser.ParseMetric(lbls) + if err != nil { + it.err = err + return -1 + } + + for _, lbl := range metric { + // TODO: make constant + if lbl.Name == "__variant__" { + val, err := strconv.Atoi(lbl.Value) + if err != nil { + it.err = err + return -1 + } + + return val + } + } + + it.err = fmt.Errorf("variant label not found in %s", lbls) + return -1 +} + +func (it *bufferedVariantsIterator) storeSample(index int, sample sampleWithLabelsAndStreamHash) { + if it.buffer == nil { + it.buffer = make(map[int][]sampleWithLabelsAndStreamHash) + } + it.buffer[index] = append(it.buffer[index], sample) +} + +func (it *bufferedVariantsIterator) At() logproto.Sample { + return it.current.sample +} + +func (it *bufferedVariantsIterator) Labels() string { + return it.current.labels +} + +func (it *bufferedVariantsIterator) StreamHash() uint64 { + return it.current.streamHash +} + +func (it *bufferedVariantsIterator) Err() error { + return it.err +} + +func (it *bufferedVariantsIterator) Close() error { + return it.iter.Close() +} + +type bufferedVariantsIteratorWrapper struct { + *bufferedVariantsIterator + index int +} + +func (it *bufferedVariantsIteratorWrapper) Next() bool { + return it.bufferedVariantsIterator.Next(it.index) +} + +// VariantsEvaluator is responsible for making sure the window is loaded from all +// evaluators for all variants +type VariantsEvaluator struct { + selRange, step, end, current, offset int64 + + variantEvaluators []StepEvaluator + currentSamples SampleVector + nextSample int + err error } // Reports any error -func (v *VariantsEvaluator) Error() error { - panic("not implemented") // TODO: Implement +func (it *VariantsEvaluator) Error() error { + return it.err } // Explain returns a print of the step evaluation tree -func (v *VariantsEvaluator) Explain(_ Node) { +func (it *VariantsEvaluator) Explain(_ Node) { panic("not implemented") // TODO: Implement } -func newVariantsEvaluator( - it iter.VariantsIterator, - expr *syntax.MultiVariantExpr, - q Params, - o time.Duration, -) (StepEvaluator, error) { - return &VariantsEvaluator{ - iter: it, - }, nil +func (it *VariantsEvaluator) Next() (bool, int64, StepResult) { + // return calculated samples for current window while available + for it.nextSample >= len(it.currentSamples) { + // once exhausted, load the next window + if !it.loadNextWindow() { + return false, it.current, SampleVector{} + } + } + + return true, it.current, it.currentSamples +} + +func (it *VariantsEvaluator) loadNextWindow() bool { + it.current += it.step + if it.current > it.end { + return false + } + + rangeStart := it.current - it.selRange + rangeEnd := it.current + + // store samples for each variant + samples := it.currentSamples[:0] + for _, variantEval := range it.variantEvaluators { + samples = append(samples, it.loadSamplesForRange(variantEval, rangeStart, rangeEnd)...) + } + + it.currentSamples = samples + it.nextSample = 0 + return true +} + +func (it *VariantsEvaluator) loadSamplesForRange( + variantIter StepEvaluator, + start, end int64, +) []promql.Sample { + var samples []promql.Sample + + // Next() (ok bool, ts int64, r StepResult) + for ok, ts, result := variantIter.Next(); ok; { + // upper bound is inclusive for step evaluation + if ts > end { + break + } + + // the lower bound of the range is not inclusive + if ts > start { + for _, sample := range result.SampleVector() { + samples = append(samples, sample) + } + } + } + + return samples +} + +func (it *VariantsEvaluator) Close() error { + var errs []error + for _, variantIter := range it.variantEvaluators { + if err := variantIter.Close(); err != nil { + errs = append(errs, err) + } + } + if len(errs) > 0 { + return fmt.Errorf("multiple errors on close: %v", errs) + } + return nil } diff --git a/pkg/logql/syntax/ast.go b/pkg/logql/syntax/ast.go index 0103ec02cae6b..fb1e3000fb481 100644 --- a/pkg/logql/syntax/ast.go +++ b/pkg/logql/syntax/ast.go @@ -2449,6 +2449,7 @@ type VariantsExpr interface { Offset() time.Duration IncludeLogs(bool) ShouldIncludeLogs() bool + Extractors() ([]SampleExtractor, error) Expr } @@ -2456,6 +2457,7 @@ type MultiVariantExpr struct { logRange *LogRange variants []SampleExpr includeLogs bool + err error implicit } @@ -2581,6 +2583,20 @@ func (m *MultiVariantExpr) Pretty(level int) string { return s } +func (m *MultiVariantExpr) Extractors() ([]log.SampleExtractor, error) { + extractors := make([]log.SampleExtractor, 0, len(m.variants)) + for _, v := range m.variants { + e, err := v.Extractor() + if err != nil { + return nil, err + } + + extractors = append(extractors, e) + } + + return extractors, nil +} + func newVariantsExpr(variants []SampleExpr, logRange *LogRange) VariantsExpr { return &MultiVariantExpr{ variants: variants, diff --git a/pkg/logql/test_utils.go b/pkg/logql/test_utils.go index 010acb2565a09..2ddb85c5af4c2 100644 --- a/pkg/logql/test_utils.go +++ b/pkg/logql/test_utils.go @@ -38,7 +38,7 @@ type MockQuerier struct { streams []logproto.Stream } -func (q MockQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.VariantsIterator, error) { +func (q MockQuerier) SelectVariants(_ context.Context, _ SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectVariants not implemented on MockQuerier") // TODO: Implement } diff --git a/pkg/querier-rf1/querier.go b/pkg/querier-rf1/querier.go index 61796a2f75085..44df79005d8d7 100644 --- a/pkg/querier-rf1/querier.go +++ b/pkg/querier-rf1/querier.go @@ -100,7 +100,7 @@ type Rf1Querier struct { walQuerier logql.Querier } -func (r *Rf1Querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { +func (r *Rf1Querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectVariants not implemented on Rf1Querier") // TODO: Implement } diff --git a/pkg/querier-rf1/wal/querier.go b/pkg/querier-rf1/wal/querier.go index b8f6507ac582f..2ea37508c39e7 100644 --- a/pkg/querier-rf1/wal/querier.go +++ b/pkg/querier-rf1/wal/querier.go @@ -36,7 +36,7 @@ type Querier struct { metaStore Metastore } -func (q *Querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { +func (q *Querier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectVariants not implemented on Querier") // TODO: Implement } diff --git a/pkg/querier/querier.go b/pkg/querier/querier.go index 2a897eba75e37..039b50b161150 100644 --- a/pkg/querier/querier.go +++ b/pkg/querier/querier.go @@ -133,10 +133,6 @@ type SingleTenantQuerier struct { logger log.Logger } -func (s *SingleTenantQuerier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { - panic("TODO(twhitney): SelectVariants not implemented on SingleTenantQuerier") // TODO: Implement -} - type deleteGetter interface { GetAllDeleteRequestsForUser(ctx context.Context, userID string) ([]deletion.DeleteRequest, error) } @@ -1441,3 +1437,87 @@ func streamsForFieldDetection(i iter.EntryIterator, size uint32) (logqlmodel.Str sort.Sort(result) return result, i.Err() } + +func (q *SingleTenantQuerier) SelectVariants( + ctx context.Context, + params logql.SelectVariantsParams, +) (iter.SampleIterator, error) { + var err error + params.Start, params.End, err = q.validateVariantsRequest(ctx, params) + if err != nil { + return nil, err + } + + params.VariantsQueryRequest.Deletes, err = q.deletesForUser(ctx, params.Start, params.End) + if err != nil { + level.Error(spanlogger.FromContext(ctx)).Log("msg", "failed loading deletes for user", "err", err) + } + + _, storeQueryInterval := q.buildQueryIntervals(params.Start, params.End) + + iters := []iter.SampleIterator{} + // TODO(twhitney): deal with ingesters later + // if !q.cfg.QueryStoreOnly && ingesterQueryInterval != nil { + // // Make a copy of the request before modifying + // // because the initial request is used below to query stores + // queryRequestCopy := *params.VariantsQueryRequest + // newParams := logql.SelectVariantsParams{ + // VariantsQueryRequest: &queryRequestCopy, + // } + // newParams.Start = ingesterQueryInterval.start + // newParams.End = ingesterQueryInterval.end + + // ingesterIters, err := q.ingesterQuerier.SelectVariants(ctx, newParams) + // if err != nil { + // return nil, err + // } + + // for _, iter := range ingesterIters { + // for iter.Next() { + // iters = append(iters, iter.At()) + // } + // } + // } + + if !q.cfg.QueryIngesterOnly && storeQueryInterval != nil { + params.Start = storeQueryInterval.start + params.End = storeQueryInterval.end + + storeIter, err := q.store.SelectVariants(ctx, params) + if err != nil { + return nil, err + } + + iters = append(iters, storeIter) + } + + return iter.NewMergeSampleIterator(ctx, iters), nil +} + +func (q *SingleTenantQuerier) validateVariantsRequest( + ctx context.Context, + req logql.QueryParams, +) (time.Time, time.Time, error) { + userID, err := tenant.TenantID(ctx) + if err != nil { + return time.Time{}, time.Time{}, err + } + + selector, err := req.LogSelector() + if err != nil { + return time.Time{}, time.Time{}, err + } + matchers := selector.Matchers() + + maxStreamMatchersPerQuery := q.limits.MaxStreamsMatchersPerQuery(ctx, userID) + if len(matchers) > maxStreamMatchersPerQuery { + return time.Time{}, time.Time{}, httpgrpc.Errorf( + http.StatusBadRequest, + "max streams matchers per query exceeded, matchers-count > limit (%d > %d)", + len(matchers), + maxStreamMatchersPerQuery, + ) + } + + return validateQueryTimeRangeLimits(ctx, userID, q.limits, req.GetStart(), req.GetEnd()) +} diff --git a/pkg/querier/querier_mock_test.go b/pkg/querier/querier_mock_test.go index 0bf2bd4f770c6..d7a88bf8d8ad8 100644 --- a/pkg/querier/querier_mock_test.go +++ b/pkg/querier/querier_mock_test.go @@ -313,6 +313,10 @@ type storeMock struct { util.ExtendedMock } +func (s *storeMock) SelectVariants(ctx context.Context, req logql.SelectVariantsParams) (iter.SampleIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on querier.storeMock") // TODO: Implement +} + func newStoreMock() *storeMock { return &storeMock{} } @@ -728,8 +732,8 @@ type querierMock struct { util.ExtendedMock } -func (q *querierMock) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { - panic("TODO(twhitney): SelectVariants not implemented on querierMock") // TODO: Implement +func (q *querierMock) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.SampleIterator, error) { + panic("TODO(twhitney): SelectVariants not implemented on querierMock") // TODO: Implement } func newQuerierMock() *querierMock { diff --git a/pkg/ruler/compat_test.go b/pkg/ruler/compat_test.go index c11b925e1da78..711ab2eab6112 100644 --- a/pkg/ruler/compat_test.go +++ b/pkg/ruler/compat_test.go @@ -117,7 +117,7 @@ func TestNonMetricQuery(t *testing.T) { type FakeQuerier struct{} -func (f *FakeQuerier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { +func (f *FakeQuerier) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.SampleIterator, error) { panic("TODO(twhitney): SelectVariants not implemented on FakeQuerier") // TODO: Implement } diff --git a/pkg/storage/batch.go b/pkg/storage/batch.go index 739a27f9b2334..2bdcfe02d3bea 100644 --- a/pkg/storage/batch.go +++ b/pkg/storage/batch.go @@ -585,7 +585,157 @@ func (it *sampleBatchIterator) buildHeapIterator(chks [][]*LazyChunk, from, thro if !chks[i][j].IsValid { continue } - iterator, err := chks[i][j].SampleIterator(it.ctx, from, through, streamExtractor, nextChunk) + iterator, err := chks[i][j].SampleIterator( + it.ctx, + from, + through, + []log.StreamSampleExtractor{streamExtractor}, + nextChunk, + ) + if err != nil { + return nil, err + } + iterators = append(iterators, iterator) + } + result = append(result, iter.NewNonOverlappingSampleIterator(iterators)) + } + + return iter.NewMergeSampleIterator(it.ctx, result), nil +} + +type multiExtractorSampleIterator struct { + *sampleBatchIterator + + extractors []log.SampleExtractor +} + +func newMultiExtractorSampleBatchIterator( + ctx context.Context, + schemas config.SchemaConfig, + metrics *ChunkMetrics, + chunks []*LazyChunk, + batchSize int, + matchers []*labels.Matcher, + extractors []syntax.SampleExtractor, + start, end time.Time, + chunkFilterer chunk.Filterer, +) (iter.SampleIterator, error) { + ctx, cancel := context.WithCancel(ctx) + return &multiExtractorSampleIterator{ + sampleBatchIterator: &sampleBatchIterator{ + extractor: nil, + ctx: ctx, + cancel: cancel, + batchChunkIterator: newBatchChunkIterator( + ctx, + schemas, + chunks, + batchSize, + logproto.FORWARD, + start, + end, + metrics, + matchers, + chunkFilterer, + ), + }, + extractors: extractors, + }, nil +} + +func (it *multiExtractorSampleIterator) Next() bool { + // for loop to avoid recursion + for it.ctx.Err() == nil { + if it.curr != nil && it.curr.Next() { + return true + } + // close previous iterator + if it.curr != nil { + it.err = it.curr.Close() + } + next := it.batchChunkIterator.Next() + if next == nil { + return false + } + if next.err != nil { + it.err = next.err + return false + } + var err error + it.curr, err = it.newChunksIterator(next) + if err != nil { + it.err = err + return false + } + } + return false +} + +// newChunksIterator creates an iterator over a set of lazychunks. +func (it *multiExtractorSampleIterator) newChunksIterator( + b *chunkBatch, +) (iter.SampleIterator, error) { + iters, err := it.buildIterators(b.chunksBySeries, b.from, b.through, b.nextChunk) + if err != nil { + return nil, err + } + + return iter.NewSortSampleIterator(iters), nil +} + +func (it *multiExtractorSampleIterator) buildIterators( + chks map[model.Fingerprint][][]*LazyChunk, + from, through time.Time, + nextChunk *LazyChunk, +) ([]iter.SampleIterator, error) { + // 1 iterator per chunk + result := make([]iter.SampleIterator, 0, len(chks)) + for _, chunks := range chks { + if len(chunks) != 0 && len(chunks[0]) != 0 { + extractors := make([]log.StreamSampleExtractor, 0, len(it.extractors)) + for _, extractor := range it.extractors { + extractors = append( + extractors, + extractor.ForStream( + labels.NewBuilder(chunks[0][0].Chunk.Metric). + Del(labels.MetricName). + Labels(), + ), + ) + + iterator, err := it.buildHeapIterator(chunks, from, through, extractors, nextChunk) + if err != nil { + return nil, err + } + result = append(result, iterator) + } + } + } + + return result, nil +} + +func (it *multiExtractorSampleIterator) buildHeapIterator( + chks [][]*LazyChunk, + from, through time.Time, + streamExtractors []log.StreamSampleExtractor, + nextChunk *LazyChunk, +) (iter.SampleIterator, error) { + result := make([]iter.SampleIterator, 0, len(chks)) + + for i := range chks { + iterators := make([]iter.SampleIterator, 0, len(chks[i])) + for j := range chks[i] { + if !chks[i][j].IsValid { + continue + } + iterator, err := chks[i][j].SampleIterator( + it.ctx, + from, + through, + streamExtractors, + nextChunk, + ) if err != nil { return nil, err } diff --git a/pkg/storage/lazy_chunk.go b/pkg/storage/lazy_chunk.go index 3ff1a3c891029..c65ee22328df3 100644 --- a/pkg/storage/lazy_chunk.go +++ b/pkg/storage/lazy_chunk.go @@ -115,7 +115,7 @@ func (c *LazyChunk) Iterator( func (c *LazyChunk) SampleIterator( ctx context.Context, from, through time.Time, - extractor log.StreamSampleExtractor, + extractors []log.StreamSampleExtractor, nextChunk *LazyChunk, ) (iter.SampleIterator, error) { // If the chunk is not already loaded, then error out. @@ -137,10 +137,20 @@ func (c *LazyChunk) SampleIterator( its = append(its, cache) continue } + + var blockSampleIterator iter.SampleIterator + if len(extractors) == 0 { + return nil, errors.New("no extractors provided") + } else if len(extractors) > 0 { + blockSampleIterator = b.MultiExtractorSampleIterator(ctx, extractors) + } else { + blockSampleIterator = b.SampleIterator(ctx, extractors[0]) + } + // if the block is overlapping cache it with the next chunk boundaries. if nextChunk != nil && IsBlockOverlapping(b, nextChunk, logproto.FORWARD) { // todo(cyriltovena) we can avoid to drop the metric name for each chunks since many chunks have the same metric/labelset. - it := iter.NewCachedSampleIterator(b.SampleIterator(ctx, extractor), b.Entries()) + it := iter.NewCachedSampleIterator(blockSampleIterator, b.Entries()) its = append(its, it) if c.overlappingSampleBlocks == nil { c.overlappingSampleBlocks = make(map[int]iter.CacheSampleIterator) @@ -160,7 +170,7 @@ func (c *LazyChunk) SampleIterator( } } // non-overlapping block with the next chunk are not cached. - its = append(its, b.SampleIterator(ctx, extractor)) + its = append(its, blockSampleIterator) } // build the final iterator bound to the requested time range. diff --git a/pkg/storage/store.go b/pkg/storage/store.go index 0ece9d935bf9e..ed633044e56ea 100644 --- a/pkg/storage/store.go +++ b/pkg/storage/store.go @@ -54,7 +54,11 @@ var ( type SelectStore interface { SelectSamples(ctx context.Context, req logql.SelectSampleParams) (iter.SampleIterator, error) SelectLogs(ctx context.Context, req logql.SelectLogParams) (iter.EntryIterator, error) - SelectSeries(ctx context.Context, req logql.SelectLogParams) ([]logproto.SeriesIdentifier, error) + SelectSeries( + ctx context.Context, + req logql.SelectLogParams, + ) ([]logproto.SeriesIdentifier, error) + SelectVariants(ctx context.Context, req logql.SelectVariantsParams) (iter.SampleIterator, error) } type SchemaConfigProvider interface { @@ -102,8 +106,76 @@ type LokiStore struct { metricsNamespace string } -func (l *LokiStore) SelectVariants(_ context.Context, _ logql.SelectVariantsParams) (iter.VariantsIterator, error) { - panic("TODO(twhitney): SelectVariants not implemented on LokiStore") // TODO: Implement +func (s *LokiStore) SelectVariants( + ctx context.Context, + req logql.SelectVariantsParams, +) (iter.SampleIterator, error) { + matchers, from, through, err := decodeReq(req) + if err != nil { + return nil, err + } + + lazyChunks, err := s.lazyChunks( + ctx, + from, + through, + chunk.NewPredicate(matchers, req.Plan), + req.GetStoreChunks(), + ) + if err != nil { + return nil, err + } + + if len(lazyChunks) == 0 { + return iter.NoopSampleIterator, nil + } + + expr, err := req.Expr() + if err != nil { + return nil, err + } + + extractors, err := expr.Extractors() + if err != nil { + return nil, err + } + + for i, extractor := range extractors { + extractor, err = deletion.SetupExtractor(req, extractor) + if err != nil { + return nil, err + } + + if s.extractorWrapper != nil && + httpreq.ExtractHeader(ctx, httpreq.LokiDisablePipelineWrappersHeader) != "true" { + userID, err := tenant.TenantID(ctx) + if err != nil { + return nil, err + } + + extractor = s.extractorWrapper.Wrap(ctx, extractor, req.Plan.String(), userID) + } + + extractors[i] = extractor + } + + var chunkFilterer chunk.Filterer + if s.chunkFilterer != nil { + chunkFilterer = s.chunkFilterer.ForRequest(ctx) + } + + return newMultiExtractorSampleBatchIterator( + ctx, + s.schemaCfg, + s.chunkMetrics, + lazyChunks, + s.cfg.MaxChunkBatchSize, + matchers, + extractors, + req.Start, + req.End, + chunkFilterer, + ) } // NewStore creates a new Loki Store using configuration supplied. diff --git a/pkg/util/deletion/deletion.go b/pkg/util/deletion/deletion.go index fd97205a6bf45..73726d517280b 100644 --- a/pkg/util/deletion/deletion.go +++ b/pkg/util/deletion/deletion.go @@ -20,12 +20,12 @@ func SetupPipeline(req logql.SelectLogParams, p log.Pipeline) (log.Pipeline, err return log.NewFilteringPipeline(filters, p), nil } -func SetupExtractor(req logql.SelectSampleParams, se log.SampleExtractor) (log.SampleExtractor, error) { - if len(req.Deletes) == 0 { +func SetupExtractor(req logql.QueryParams, se log.SampleExtractor) (log.SampleExtractor, error) { + if len(req.GetDeletes()) == 0 { return se, nil } - filters, err := deleteFilters(req.Deletes) + filters, err := deleteFilters(req.GetDeletes()) if err != nil { return nil, err } From 4f99f1171ce791242627685654969bef9276d1af Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Wed, 30 Oct 2024 10:53:24 -0600 Subject: [PATCH 5/7] wip --- pkg/chunkenc/variants.go | 42 ++++++++++++++++++++++++++++++++++++---- pkg/logql/evaluator.go | 18 ++++++++--------- 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/pkg/chunkenc/variants.go b/pkg/chunkenc/variants.go index da74dc3561972..f0d46239a8dea 100644 --- a/pkg/chunkenc/variants.go +++ b/pkg/chunkenc/variants.go @@ -2,6 +2,8 @@ package chunkenc import ( "context" + "sort" + "strconv" "github.com/cespare/xxhash/v2" "github.com/grafana/loki/v3/pkg/compression" @@ -9,6 +11,7 @@ import ( "github.com/grafana/loki/v3/pkg/logproto" "github.com/grafana/loki/v3/pkg/logql/log" "github.com/grafana/loki/v3/pkg/logqlmodel/stats" + "github.com/prometheus/prometheus/model/labels" ) func newMultiExtractorSampleIterator(ctx context.Context, pool compression.ReaderPool, b []byte, format byte, extractors []log.StreamSampleExtractor, symbolizer *symbolizer) iter.SampleIterator { @@ -40,15 +43,27 @@ func (e *multiExtractorSampleBufferedIterator) Next() bool { } for e.bufferedIterator.Next() { - for _, extractor := range e.extractors { - val, labels, ok := extractor.Process(e.currTs, e.currLine, e.currStructuredMetadata...) + for i, extractor := range e.extractors { + val, lbls, ok := extractor.Process(e.currTs, e.currLine, e.currStructuredMetadata...) if !ok { continue } + e.stats.AddPostFilterLines(1) - e.currLabels = append(e.currLabels, labels) - e.currBaseLabels = append(e.currBaseLabels, extractor.BaseLabels()) + streamLbls := lbls.Stream() + streamLbls = append(streamLbls, labels.Label{ + Name: "__variant__", + Value: strconv.FormatInt(int64(i), 10), + }) + + builder := log.NewBaseLabelsBuilder().ForLabels(streamLbls, streamLbls.Hash()) + builder.Add(log.StructuredMetadataLabel, lbls.StructuredMetadata()...) + builder.Add(log.ParsedLabel, lbls.Parsed()...) + e.currLabels = append(e.currLabels, builder.LabelsResult()) + + //TODO: is it enough to add __variant__ to result labels? Do the base labels need it to? + e.currBaseLabels = append(e.currBaseLabels, extractor.BaseLabels()) e.cur = append(e.cur, logproto.Sample{ Value: val, Hash: xxhash.Sum64(e.currLine), @@ -61,6 +76,25 @@ func (e *multiExtractorSampleBufferedIterator) Next() bool { return false } +func flattenLabels(buf labels.Labels, many ...labels.Labels) labels.Labels { + var size int + for _, lbls := range many { + size += len(lbls) + } + + if buf == nil || cap(buf) < size { + buf = make(labels.Labels, 0, size) + } else { + buf = buf[:0] + } + + for _, lbls := range many { + buf = append(buf, lbls...) + } + sort.Sort(buf) + return buf +} + func (e *multiExtractorSampleBufferedIterator) Close() error { for _, extractor := range e.extractors { if extractor.ReferencedStructuredMetadata() { diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index 4e03a51585bd0..cce07edd7edaf 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -1578,7 +1578,6 @@ type VariantsEvaluator struct { variantEvaluators []StepEvaluator currentSamples SampleVector - nextSample int err error } @@ -1593,12 +1592,8 @@ func (it *VariantsEvaluator) Explain(_ Node) { } func (it *VariantsEvaluator) Next() (bool, int64, StepResult) { - // return calculated samples for current window while available - for it.nextSample >= len(it.currentSamples) { - // once exhausted, load the next window - if !it.loadNextWindow() { - return false, it.current, SampleVector{} - } + if !it.loadNextWindow() { + return false, it.current, SampleVector{} } return true, it.current, it.currentSamples @@ -1620,18 +1615,21 @@ func (it *VariantsEvaluator) loadNextWindow() bool { } it.currentSamples = samples - it.nextSample = 0 return true } func (it *VariantsEvaluator) loadSamplesForRange( - variantIter StepEvaluator, + variantEval StepEvaluator, start, end int64, ) []promql.Sample { var samples []promql.Sample + // convert to milliseconds, as thats what the evalutors Next() will return + start = start / 1e+6 + end = end / 1e+6 + // Next() (ok bool, ts int64, r StepResult) - for ok, ts, result := variantIter.Next(); ok; { + for ok, ts, result := variantEval.Next(); ok; { // upper bound is inclusive for step evaluation if ts > end { break From 3e74b802d24719a31f718433d9d25b5f04f94b0f Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Wed, 6 Nov 2024 14:39:18 -0700 Subject: [PATCH 6/7] wip --- cmd/loki/loki-local-config.yaml | 7 +++ pkg/chunkenc/memchunk.go | 1 + pkg/chunkenc/variants.go | 23 +++++++-- pkg/ingester/flush_test.go | 2 +- pkg/ingester/ingester.go | 2 +- pkg/ingester/ingester_test.go | 2 +- pkg/logql/engine.go | 10 +++- pkg/logql/evaluator.go | 85 ++++++++++++--------------------- pkg/logql/syntax/visit.go | 15 +++++- pkg/querier/ingester_querier.go | 16 +++++++ pkg/querier/querier.go | 43 ++++++++--------- pkg/storage/batch.go | 62 ++++++++++++++++-------- pkg/storage/batch_test.go | 3 +- pkg/storage/lazy_chunk.go | 2 +- pkg/storage/store.go | 16 ++++++- 15 files changed, 179 insertions(+), 110 deletions(-) diff --git a/cmd/loki/loki-local-config.yaml b/cmd/loki/loki-local-config.yaml index c593b14a252c0..9c35f7bd4157c 100644 --- a/cmd/loki/loki-local-config.yaml +++ b/cmd/loki/loki-local-config.yaml @@ -25,6 +25,13 @@ query_range: enabled: true max_size_mb: 100 +# querier: +# query_ingesters_within: 10m + +ingester: + max_chunk_age: 5m + # query_store_max_look_back_period: 10m + schema_config: configs: - from: 2020-10-24 diff --git a/pkg/chunkenc/memchunk.go b/pkg/chunkenc/memchunk.go index 498073e116459..294a4abfae00c 100644 --- a/pkg/chunkenc/memchunk.go +++ b/pkg/chunkenc/memchunk.go @@ -1064,6 +1064,7 @@ func (c *MemChunk) Iterator(ctx context.Context, mintT, maxtT time.Time, directi return iter.NewSortEntryIterator(blockItrs, direction), nil } +// TODO(twhitney): do I need a multi extractor iterator here as well? // Iterator implements Chunk. func (c *MemChunk) SampleIterator(ctx context.Context, from, through time.Time, extractor log.StreamSampleExtractor) iter.SampleIterator { mint, maxt := from.UnixNano(), through.UnixNano() diff --git a/pkg/chunkenc/variants.go b/pkg/chunkenc/variants.go index f0d46239a8dea..f27c2ba6bf855 100644 --- a/pkg/chunkenc/variants.go +++ b/pkg/chunkenc/variants.go @@ -34,7 +34,7 @@ type multiExtractorSampleBufferedIterator struct { } func (e *multiExtractorSampleBufferedIterator) Next() bool { - if len(e.cur) > 0 { + if len(e.cur) > 1 { e.cur = e.cur[1:] e.currLabels = e.currLabels[1:] e.currBaseLabels = e.currBaseLabels[1:] @@ -42,6 +42,13 @@ func (e *multiExtractorSampleBufferedIterator) Next() bool { return true } + if len(e.cur) == 1 { + e.cur = e.cur[:0] + e.currLabels = e.currLabels[:0] + e.currBaseLabels = e.currBaseLabels[:0] + } + + // TDOO(twhitney): this loops never stops for e.bufferedIterator.Next() { for i, extractor := range e.extractors { val, lbls, ok := extractor.Process(e.currTs, e.currLine, e.currStructuredMetadata...) @@ -62,17 +69,23 @@ func (e *multiExtractorSampleBufferedIterator) Next() bool { builder.Add(log.ParsedLabel, lbls.Parsed()...) e.currLabels = append(e.currLabels, builder.LabelsResult()) - //TODO: is it enough to add __variant__ to result labels? Do the base labels need it to? + // TODO: is it enough to add __variant__ to result labels? Do the base labels need it too? e.currBaseLabels = append(e.currBaseLabels, extractor.BaseLabels()) e.cur = append(e.cur, logproto.Sample{ Value: val, Hash: xxhash.Sum64(e.currLine), Timestamp: e.currTs, }) + } - return true + // catch the case where no extractors were ok + if len(e.cur) <= 1 { + continue } + + return true } + return false } @@ -109,4 +122,6 @@ func (e *multiExtractorSampleBufferedIterator) Labels() string { return e.currLa func (e *multiExtractorSampleBufferedIterator) StreamHash() uint64 { return e.currBaseLabels[0].Hash() } -func (e *multiExtractorSampleBufferedIterator) At() logproto.Sample { return e.cur[0] } +func (e *multiExtractorSampleBufferedIterator) At() logproto.Sample { + return e.cur[0] +} diff --git a/pkg/ingester/flush_test.go b/pkg/ingester/flush_test.go index 69cb04ce0d5bd..90407ec1a90b2 100644 --- a/pkg/ingester/flush_test.go +++ b/pkg/ingester/flush_test.go @@ -381,7 +381,7 @@ type testStore struct { } func (t *testStore) SelectVariants(ctx context.Context, req logql.SelectVariantsParams) (iter.SampleIterator, error) { - panic("TODO(twhitney): SelectVariants not implemented on testStore") // TODO: Implement + panic("TODO(twhitney): SelectVariants not implemented on testStore") // TODO: Implement } // Note: the ingester New() function creates it's own WAL first which we then override if specified. diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index dfdb3ac043b26..e58aa9e5570ef 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -1654,5 +1654,5 @@ func (i *Ingester) getDetectedLabels(ctx context.Context, req *logproto.Detected // QuerySample the ingesters for series from logs matching a set of matchers. func (i *Ingester) QueryVariants(req *logproto.VariantsQueryRequest, queryServer logproto.Querier_QueryVariantsServer) error { - panic("TODO(twhitney): QueryVariants not implemented on Ingester") + panic("TODO(twhitney): QueryVariants not implemented on Ingester") } diff --git a/pkg/ingester/ingester_test.go b/pkg/ingester/ingester_test.go index 93bee8df37241..7208df2255e39 100644 --- a/pkg/ingester/ingester_test.go +++ b/pkg/ingester/ingester_test.go @@ -436,7 +436,7 @@ type mockStore struct { } func (m *mockStore) SelectVariants(ctx context.Context, req logql.SelectVariantsParams) (iter.SampleIterator, error) { - panic("TODO(twhitney): SelectVariants not implemented on mockStore") // TODO: Implement + panic("TODO(twhitney): SelectVariants not implemented on mockStore") // TODO: Implement } func (s *mockStore) Put(ctx context.Context, chunks []chunk.Chunk) error { diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index c9dec0b3446be..675d5fc7a9060 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -659,6 +659,7 @@ func (q *query) evalVariant( } defer util.LogErrorWithContext(ctx, "closing VariantsExpr", stepEvaluator.Close) + //TODO: this never returns next, _, r := stepEvaluator.Next() if stepEvaluator.Error() != nil { return nil, stepEvaluator.Error() @@ -668,7 +669,14 @@ func (q *query) evalVariant( switch vec := r.(type) { //TODO(twhitney): need case for a log query case SampleVector: - return nil, fmt.Errorf("unsupported result type: %T", vec) + maxSeriesCapture := func(id string) int { return q.limits.MaxQuerySeries(ctx, id) } + maxSeries := validation.SmallestPositiveIntPerTenant(tenantIDs, maxSeriesCapture) + //TDOO: what is merge first last for? + mfl := false + // if rae, ok := expr.(*syntax.RangeAggregationExpr); ok && (rae.Operation == syntax.OpRangeTypeFirstWithTimestamp || rae.Operation == syntax.OpRangeTypeLastWithTimestamp) { + // mfl = true + // } + return q.JoinSampleVector(next, vec, stepEvaluator, maxSeries, mfl) default: return nil, fmt.Errorf("unsupported result type: %T", r) } diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index cce07edd7edaf..284a480f6e32b 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -440,10 +440,25 @@ func (ev *DefaultEvaluator) NewVariantsStepEvaluator( StoreChunks: q.GetStoreChunks(), }, }) + // variant := e.Variants()[0] + // it, err := ev.querier.SelectSamples(ctx, SelectSampleParams{ + // &logproto.SampleQueryRequest{ + // Start: q.Start().Add(-logRange.Interval).Add(-logRange.Offset), + // End: q.End().Add(-logRange.Offset).Add(time.Nanosecond), + // // intentionally send the vector for reducing labels. + // Selector: variant.String(), + // Shards: q.Shards(), + // Plan: &plan.QueryPlan{ + // AST: variant, + // }, + // StoreChunks: q.GetStoreChunks(), + // }, + // }) if err != nil { return nil, err } return ev.newVariantsEvaluator(ctx, iter.NewPeekingSampleIterator(it), e, q) + // return newRangeAggEvaluator(iter.NewPeekingSampleIterator(it), variant.(*syntax.RangeAggregationExpr), q, 0) default: return nil, EvaluatorUnsupportedType(e, ev) } @@ -748,6 +763,7 @@ func newRangeAggEvaluator( iter: iter, }, nil default: + // TODO(twhitney): this is the case we match iter, err := newRangeVectorIterator( it, expr, expr.Left.Interval.Nanoseconds(), @@ -1449,14 +1465,8 @@ func (ev *DefaultEvaluator) newVariantsEvaluator( variantEvaluators[i] = variantEvaluator } - logRange := expr.LogRange() return &VariantsEvaluator{ - selRange: logRange.Interval.Nanoseconds(), - step: q.Step().Nanoseconds(), - end: q.End().UnixNano(), - current: q.Start().UnixNano() - q.Step().Nanoseconds(), - offset: logRange.Offset.Nanoseconds(), - + current: q.Start().UnixNano() - q.Step().Nanoseconds(), variantEvaluators: variantEvaluators, }, nil } @@ -1574,7 +1584,7 @@ func (it *bufferedVariantsIteratorWrapper) Next() bool { // VariantsEvaluator is responsible for making sure the window is loaded from all // evaluators for all variants type VariantsEvaluator struct { - selRange, step, end, current, offset int64 + current int64 variantEvaluators []StepEvaluator currentSamples SampleVector @@ -1592,58 +1602,25 @@ func (it *VariantsEvaluator) Explain(_ Node) { } func (it *VariantsEvaluator) Next() (bool, int64, StepResult) { - if !it.loadNextWindow() { - return false, it.current, SampleVector{} - } - - return true, it.current, it.currentSamples -} - -func (it *VariantsEvaluator) loadNextWindow() bool { - it.current += it.step - if it.current > it.end { - return false - } - - rangeStart := it.current - it.selRange - rangeEnd := it.current - - // store samples for each variant samples := it.currentSamples[:0] - for _, variantEval := range it.variantEvaluators { - samples = append(samples, it.loadSamplesForRange(variantEval, rangeStart, rangeEnd)...) - } - - it.currentSamples = samples - return true -} - -func (it *VariantsEvaluator) loadSamplesForRange( - variantEval StepEvaluator, - start, end int64, -) []promql.Sample { - var samples []promql.Sample - - // convert to milliseconds, as thats what the evalutors Next() will return - start = start / 1e+6 - end = end / 1e+6 - - // Next() (ok bool, ts int64, r StepResult) - for ok, ts, result := variantEval.Next(); ok; { - // upper bound is inclusive for step evaluation - if ts > end { - break - } + hasNext := false - // the lower bound of the range is not inclusive - if ts > start { - for _, sample := range result.SampleVector() { - samples = append(samples, sample) + for _, variantEval := range it.variantEvaluators { + if ok, ts, result := variantEval.Next(); ok { + hasNext = true + samples = append(samples, result.SampleVector()...) + if ts > it.current { + it.current = ts } } } - return samples + if !hasNext { + return false, 0, SampleVector{} + } + + it.currentSamples = samples + return true, it.current, it.currentSamples } func (it *VariantsEvaluator) Close() error { diff --git a/pkg/logql/syntax/visit.go b/pkg/logql/syntax/visit.go index 3e4321fb876d6..060e336f0e400 100644 --- a/pkg/logql/syntax/visit.go +++ b/pkg/logql/syntax/visit.go @@ -70,10 +70,21 @@ type DepthFirstTraversal struct { VisitRangeAggregationFn func(v RootVisitor, e *RangeAggregationExpr) VisitVectorFn func(v RootVisitor, e *VectorExpr) VisitVectorAggregationFn func(v RootVisitor, e *VectorAggregationExpr) + VisiVectorAggregationFn func(v RootVisitor, e *VectorAggregationExpr) + VisitVariantsFn func(v RootVisitor, e *MultiVariantExpr) } -func (d *DepthFirstTraversal) VisitVariants(_ *MultiVariantExpr) { - panic("not implemented") // TODO: Implement +// TODO: this is what's getting triggered +func (v *DepthFirstTraversal) VisitVariants(e *MultiVariantExpr) { + if e == nil { + return + } + + if v.VisitVariantsFn != nil { + v.VisitVariantsFn(v, e) + } else { + e.LogRange().Left.Accept(v) + } } // VisitBinOp implements RootVisitor. diff --git a/pkg/querier/ingester_querier.go b/pkg/querier/ingester_querier.go index cc076be1faefd..deaf7b0d2233a 100644 --- a/pkg/querier/ingester_querier.go +++ b/pkg/querier/ingester_querier.go @@ -447,6 +447,22 @@ func (q *IngesterQuerier) DetectedLabel(ctx context.Context, req *logproto.Detec return &logproto.LabelToValuesResponse{Labels: mergedResult}, nil } +func (q *IngesterQuerier) SelectVariants(ctx context.Context, req logql.SelectVariantsParams) ([]iter.SampleIterator, error) { + resps, err := q.forAllIngesters(ctx, func(ctx context.Context, client logproto.QuerierClient) (interface{}, error) { + return client.QueryVariants(ctx, req.VariantsQueryRequest) + }) + + if err != nil { + return nil, err + } + + iterators := make([]iter.SampleIterator, len(resps)) + // for i := range resps { + // iterators[i] = iter.NewSampleQueryClientIterator(resps[i].response.(logproto.Querier_QuerySampleClient)) + // } + return iterators, nil +} + func convertMatchersToString(matchers []*labels.Matcher) string { out := strings.Builder{} out.WriteRune('{') diff --git a/pkg/querier/querier.go b/pkg/querier/querier.go index 039b50b161150..961537f4c27d3 100644 --- a/pkg/querier/querier.go +++ b/pkg/querier/querier.go @@ -311,6 +311,8 @@ func (q *SingleTenantQuerier) calculateIngesterMaxLookbackPeriod() time.Duration } func (q *SingleTenantQuerier) buildQueryIntervals(queryStart, queryEnd time.Time) (*interval, *interval) { + queryStart, queryEnd = queryStart.In(time.UTC), queryEnd.In(time.UTC) + // limitQueryInterval is a flag for whether store queries should be limited to start time of ingester queries. limitQueryInterval := false // ingesterMLB having -1 means query ingester for whole duration. @@ -1453,31 +1455,28 @@ func (q *SingleTenantQuerier) SelectVariants( level.Error(spanlogger.FromContext(ctx)).Log("msg", "failed loading deletes for user", "err", err) } - _, storeQueryInterval := q.buildQueryIntervals(params.Start, params.End) + ingesterQueryInterval, storeQueryInterval := q.buildQueryIntervals(params.Start, params.End) iters := []iter.SampleIterator{} // TODO(twhitney): deal with ingesters later - // if !q.cfg.QueryStoreOnly && ingesterQueryInterval != nil { - // // Make a copy of the request before modifying - // // because the initial request is used below to query stores - // queryRequestCopy := *params.VariantsQueryRequest - // newParams := logql.SelectVariantsParams{ - // VariantsQueryRequest: &queryRequestCopy, - // } - // newParams.Start = ingesterQueryInterval.start - // newParams.End = ingesterQueryInterval.end - - // ingesterIters, err := q.ingesterQuerier.SelectVariants(ctx, newParams) - // if err != nil { - // return nil, err - // } - - // for _, iter := range ingesterIters { - // for iter.Next() { - // iters = append(iters, iter.At()) - // } - // } - // } + if !q.cfg.QueryStoreOnly && ingesterQueryInterval != nil { + // Make a copy of the request before modifying + // because the initial request is used below to query stores + // TOTO(twhitney): implement iterators + // queryRequestCopy := *params.VariantsQueryRequest + // newParams := logql.SelectVariantsParams{ + // VariantsQueryRequest: &queryRequestCopy, + // } + // newParams.Start = ingesterQueryInterval.start + // newParams.End = ingesterQueryInterval.end + + // ingesterIters, err := q.ingesterQuerier.SelectVariants(ctx, newParams) + // if err != nil { + // return nil, err + // } + + // iters = append(iters, ingesterIters...) + } if !q.cfg.QueryIngesterOnly && storeQueryInterval != nil { params.Start = storeQueryInterval.start diff --git a/pkg/storage/batch.go b/pkg/storage/batch.go index 2bdcfe02d3bea..f04ccf91289c4 100644 --- a/pkg/storage/batch.go +++ b/pkg/storage/batch.go @@ -464,9 +464,9 @@ type sampleBatchIterator struct { curr iter.SampleIterator err error - ctx context.Context - cancel context.CancelFunc - extractor syntax.SampleExtractor + ctx context.Context + cancel context.CancelFunc + extractors []syntax.SampleExtractor } func newSampleBatchIterator( @@ -476,16 +476,27 @@ func newSampleBatchIterator( chunks []*LazyChunk, batchSize int, matchers []*labels.Matcher, - extractor syntax.SampleExtractor, + extractors []syntax.SampleExtractor, start, end time.Time, chunkFilterer chunk.Filterer, ) (iter.SampleIterator, error) { ctx, cancel := context.WithCancel(ctx) return &sampleBatchIterator{ - extractor: extractor, - ctx: ctx, - cancel: cancel, - batchChunkIterator: newBatchChunkIterator(ctx, schemas, chunks, batchSize, logproto.FORWARD, start, end, metrics, matchers, chunkFilterer), + extractors: extractors, + ctx: ctx, + cancel: cancel, + batchChunkIterator: newBatchChunkIterator( + ctx, + schemas, + chunks, + batchSize, + logproto.FORWARD, + start, + end, + metrics, + matchers, + chunkFilterer, + ), }, nil } @@ -564,8 +575,18 @@ func (it *sampleBatchIterator) buildIterators(chks map[model.Fingerprint][][]*La result := make([]iter.SampleIterator, 0, len(chks)) for _, chunks := range chks { if len(chunks) != 0 && len(chunks[0]) != 0 { - streamExtractor := it.extractor.ForStream(labels.NewBuilder(chunks[0][0].Chunk.Metric).Del(labels.MetricName).Labels()) - iterator, err := it.buildHeapIterator(chunks, from, through, streamExtractor, nextChunk) + extractors := make([]log.StreamSampleExtractor, 0, len(it.extractors)) + for _, extractor := range it.extractors { + extractors = append( + extractors, + extractor.ForStream( + labels.NewBuilder(chunks[0][0].Chunk.Metric). + Del(labels.MetricName). + Labels(), + ), + ) + } + iterator, err := it.buildHeapIterator(chunks, from, through, extractors, nextChunk) if err != nil { return nil, err } @@ -576,7 +597,7 @@ func (it *sampleBatchIterator) buildIterators(chks map[model.Fingerprint][][]*La return result, nil } -func (it *sampleBatchIterator) buildHeapIterator(chks [][]*LazyChunk, from, through time.Time, streamExtractor log.StreamSampleExtractor, nextChunk *LazyChunk) (iter.SampleIterator, error) { +func (it *sampleBatchIterator) buildHeapIterator(chks [][]*LazyChunk, from, through time.Time, streamExtractors []log.StreamSampleExtractor, nextChunk *LazyChunk) (iter.SampleIterator, error) { result := make([]iter.SampleIterator, 0, len(chks)) for i := range chks { @@ -589,7 +610,7 @@ func (it *sampleBatchIterator) buildHeapIterator(chks [][]*LazyChunk, from, thro it.ctx, from, through, - []log.StreamSampleExtractor{streamExtractor}, + streamExtractors, nextChunk, ) if err != nil { @@ -623,9 +644,10 @@ func newMultiExtractorSampleBatchIterator( ctx, cancel := context.WithCancel(ctx) return &multiExtractorSampleIterator{ sampleBatchIterator: &sampleBatchIterator{ - extractor: nil, - ctx: ctx, - cancel: cancel, + extractors: nil, + ctx: ctx, + cancel: cancel, + batchChunkIterator: newBatchChunkIterator( ctx, schemas, @@ -702,13 +724,13 @@ func (it *multiExtractorSampleIterator) buildIterators( Labels(), ), ) + } - iterator, err := it.buildHeapIterator(chunks, from, through, extractors, nextChunk) - if err != nil { - return nil, err - } - result = append(result, iterator) + iterator, err := it.buildHeapIterator(chunks, from, through, extractors, nextChunk) + if err != nil { + return nil, err } + result = append(result, iterator) } } diff --git a/pkg/storage/batch_test.go b/pkg/storage/batch_test.go index 115e625a28af7..e03cfcd4f3a8c 100644 --- a/pkg/storage/batch_test.go +++ b/pkg/storage/batch_test.go @@ -18,6 +18,7 @@ import ( "github.com/grafana/loki/v3/pkg/logproto" "github.com/grafana/loki/v3/pkg/logql" "github.com/grafana/loki/v3/pkg/logql/log" + "github.com/grafana/loki/v3/pkg/logql/syntax" "github.com/grafana/loki/v3/pkg/logqlmodel/stats" "github.com/grafana/loki/v3/pkg/storage/config" ) @@ -1418,7 +1419,7 @@ func Test_newSampleBatchChunkIterator(t *testing.T) { ex, err := log.NewLineSampleExtractor(log.CountExtractor, nil, nil, false, false) require.NoError(t, err) - it, err := newSampleBatchIterator(context.Background(), s, NilMetrics, tt.chunks, tt.batchSize, newMatchers(tt.matchers), ex, tt.start, tt.end, nil) + it, err := newSampleBatchIterator(context.Background(), s, NilMetrics, tt.chunks, tt.batchSize, newMatchers(tt.matchers), []syntax.SampleExtractor{ex}, tt.start, tt.end, nil) require.NoError(t, err) series, _, err := iter.ReadSampleBatch(it, 1000) _ = it.Close() diff --git a/pkg/storage/lazy_chunk.go b/pkg/storage/lazy_chunk.go index c65ee22328df3..aa6ab2012003e 100644 --- a/pkg/storage/lazy_chunk.go +++ b/pkg/storage/lazy_chunk.go @@ -141,7 +141,7 @@ func (c *LazyChunk) SampleIterator( var blockSampleIterator iter.SampleIterator if len(extractors) == 0 { return nil, errors.New("no extractors provided") - } else if len(extractors) > 0 { + } else if len(extractors) > 1 { blockSampleIterator = b.MultiExtractorSampleIterator(ctx, extractors) } else { blockSampleIterator = b.SampleIterator(ctx, extractors[0]) diff --git a/pkg/storage/store.go b/pkg/storage/store.go index ed633044e56ea..abd32dc21f8fe 100644 --- a/pkg/storage/store.go +++ b/pkg/storage/store.go @@ -25,6 +25,7 @@ import ( "github.com/grafana/loki/v3/pkg/iter" "github.com/grafana/loki/v3/pkg/logproto" "github.com/grafana/loki/v3/pkg/logql" + "github.com/grafana/loki/v3/pkg/logql/syntax" "github.com/grafana/loki/v3/pkg/logqlmodel/stats" "github.com/grafana/loki/v3/pkg/querier/astmapper" "github.com/grafana/loki/v3/pkg/storage/chunk" @@ -164,7 +165,7 @@ func (s *LokiStore) SelectVariants( chunkFilterer = s.chunkFilterer.ForRequest(ctx) } - return newMultiExtractorSampleBatchIterator( + return newSampleBatchIterator( ctx, s.schemaCfg, s.chunkMetrics, @@ -651,7 +652,18 @@ func (s *LokiStore) SelectSamples(ctx context.Context, req logql.SelectSamplePar chunkFilterer = s.chunkFilterer.ForRequest(ctx) } - return newSampleBatchIterator(ctx, s.schemaCfg, s.chunkMetrics, lazyChunks, s.cfg.MaxChunkBatchSize, matchers, extractor, req.Start, req.End, chunkFilterer) + return newSampleBatchIterator( + ctx, + s.schemaCfg, + s.chunkMetrics, + lazyChunks, + s.cfg.MaxChunkBatchSize, + matchers, + []syntax.SampleExtractor{extractor}, + req.Start, + req.End, + chunkFilterer, + ) } func (s *LokiStore) GetSchemaConfigs() []config.PeriodConfig { From a36f94b23ca5be53f7492aac8d22ffe4e04afeaa Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Thu, 21 Nov 2024 14:57:02 -0700 Subject: [PATCH 7/7] fix local config and rebase on main --- cmd/loki/loki-local-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/loki/loki-local-config.yaml b/cmd/loki/loki-local-config.yaml index 9c35f7bd4157c..9a7573751d750 100644 --- a/cmd/loki/loki-local-config.yaml +++ b/cmd/loki/loki-local-config.yaml @@ -45,7 +45,6 @@ schema_config: pattern_ingester: enabled: true metric_aggregation: - enabled: true loki_address: localhost:3100 ruler: