cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
internal/parser/source/source_test.snap
11910lines · modecode
| 1 | [TestLabelsSource/1 - 1] |
| 2 | expr: "1" |
| 3 | output: |
| 4 | - labels: |
| 5 | "": |
| 6 | reason: This query returns a number value with no labels. |
| 7 | kind: excluded |
| 8 | fragment: |
| 9 | start: 0 |
| 10 | end: 1 |
| 11 | returns: scalar |
| 12 | returnInfo: |
| 13 | logicalexpr: "" |
| 14 | valueposition: |
| 15 | start: 0 |
| 16 | end: 1 |
| 17 | returnednumber: 1 |
| 18 | alwaysreturns: true |
| 19 | knownreturn: true |
| 20 | isreturnbool: false |
| 21 | position: |
| 22 | start: 0 |
| 23 | end: 1 |
| 24 | type: number |
| 25 | fixedLabels: true |
| 26 | |
| 27 | --- |
| 28 | |
| 29 | [TestLabelsSource/2 - 1] |
| 30 | expr: 1 / 5 |
| 31 | output: |
| 32 | - labels: |
| 33 | "": |
| 34 | reason: This query returns a number value with no labels. |
| 35 | kind: excluded |
| 36 | fragment: |
| 37 | start: 0 |
| 38 | end: 1 |
| 39 | returns: scalar |
| 40 | returnInfo: |
| 41 | logicalexpr: 1 / 5 |
| 42 | valueposition: |
| 43 | start: 0 |
| 44 | end: 1 |
| 45 | returnednumber: 0.2 |
| 46 | alwaysreturns: true |
| 47 | knownreturn: true |
| 48 | isreturnbool: false |
| 49 | position: |
| 50 | start: 0 |
| 51 | end: 1 |
| 52 | type: number |
| 53 | fixedLabels: true |
| 54 | |
| 55 | --- |
| 56 | |
| 57 | [TestLabelsSource/3 - 1] |
| 58 | expr: (2 ^ 5) == bool 5 |
| 59 | output: |
| 60 | - labels: |
| 61 | "": |
| 62 | reason: This query returns a number value with no labels. |
| 63 | kind: excluded |
| 64 | fragment: |
| 65 | start: 1 |
| 66 | end: 2 |
| 67 | deadInfo: |
| 68 | reason: '`2 ^ 5 == 5` always evaluates to `32 == 5` and uses the `bool` modifier which means it will always return 0' |
| 69 | fragment: |
| 70 | start: 1 |
| 71 | end: 2 |
| 72 | returns: scalar |
| 73 | returnInfo: |
| 74 | logicalexpr: 2 ^ 5 |
| 75 | valueposition: |
| 76 | start: 1 |
| 77 | end: 2 |
| 78 | returnednumber: 32 |
| 79 | alwaysreturns: true |
| 80 | knownreturn: true |
| 81 | isreturnbool: true |
| 82 | position: |
| 83 | start: 1 |
| 84 | end: 2 |
| 85 | type: number |
| 86 | fixedLabels: true |
| 87 | isConditional: true |
| 88 | |
| 89 | --- |
| 90 | |
| 91 | [TestLabelsSource/4 - 1] |
| 92 | expr: (2 ^ 5 + 11) % 5 <= bool 2 |
| 93 | output: |
| 94 | - labels: |
| 95 | "": |
| 96 | reason: This query returns a number value with no labels. |
| 97 | kind: excluded |
| 98 | fragment: |
| 99 | start: 1 |
| 100 | end: 2 |
| 101 | deadInfo: |
| 102 | reason: '`2 ^ 5 + 11 % 5 <= 2` always evaluates to `3 <= 2` and uses the `bool` modifier which means it will always return 0' |
| 103 | fragment: |
| 104 | start: 1 |
| 105 | end: 2 |
| 106 | returns: scalar |
| 107 | returnInfo: |
| 108 | logicalexpr: 2 ^ 5 + 11 % 5 |
| 109 | valueposition: |
| 110 | start: 1 |
| 111 | end: 2 |
| 112 | returnednumber: 3 |
| 113 | alwaysreturns: true |
| 114 | knownreturn: true |
| 115 | isreturnbool: true |
| 116 | position: |
| 117 | start: 1 |
| 118 | end: 2 |
| 119 | type: number |
| 120 | fixedLabels: true |
| 121 | isConditional: true |
| 122 | |
| 123 | --- |
| 124 | |
| 125 | [TestLabelsSource/5 - 1] |
| 126 | expr: (2 ^ 5 + 11) % 5 >= bool 20 |
| 127 | output: |
| 128 | - labels: |
| 129 | "": |
| 130 | reason: This query returns a number value with no labels. |
| 131 | kind: excluded |
| 132 | fragment: |
| 133 | start: 1 |
| 134 | end: 2 |
| 135 | deadInfo: |
| 136 | reason: '`2 ^ 5 + 11 % 5 >= 20` always evaluates to `3 >= 20` and uses the `bool` modifier which means it will always return 0' |
| 137 | fragment: |
| 138 | start: 1 |
| 139 | end: 2 |
| 140 | returns: scalar |
| 141 | returnInfo: |
| 142 | logicalexpr: 2 ^ 5 + 11 % 5 |
| 143 | valueposition: |
| 144 | start: 1 |
| 145 | end: 2 |
| 146 | returnednumber: 3 |
| 147 | alwaysreturns: true |
| 148 | knownreturn: true |
| 149 | isreturnbool: true |
| 150 | position: |
| 151 | start: 1 |
| 152 | end: 2 |
| 153 | type: number |
| 154 | fixedLabels: true |
| 155 | isConditional: true |
| 156 | |
| 157 | --- |
| 158 | |
| 159 | [TestLabelsSource/6 - 1] |
| 160 | expr: (2 ^ 5 + 11) % 5 <= bool 3 |
| 161 | output: |
| 162 | - labels: |
| 163 | "": |
| 164 | reason: This query returns a number value with no labels. |
| 165 | kind: excluded |
| 166 | fragment: |
| 167 | start: 1 |
| 168 | end: 2 |
| 169 | returns: scalar |
| 170 | returnInfo: |
| 171 | logicalexpr: 2 ^ 5 + 11 % 5 |
| 172 | valueposition: |
| 173 | start: 1 |
| 174 | end: 2 |
| 175 | returnednumber: 3 |
| 176 | alwaysreturns: true |
| 177 | knownreturn: true |
| 178 | isreturnbool: true |
| 179 | position: |
| 180 | start: 1 |
| 181 | end: 2 |
| 182 | type: number |
| 183 | fixedLabels: true |
| 184 | isConditional: true |
| 185 | |
| 186 | --- |
| 187 | |
| 188 | [TestLabelsSource/7 - 1] |
| 189 | expr: (2 ^ 5 + 11) % 5 < bool 1 |
| 190 | output: |
| 191 | - labels: |
| 192 | "": |
| 193 | reason: This query returns a number value with no labels. |
| 194 | kind: excluded |
| 195 | fragment: |
| 196 | start: 1 |
| 197 | end: 2 |
| 198 | deadInfo: |
| 199 | reason: '`2 ^ 5 + 11 % 5 < 1` always evaluates to `3 < 1` and uses the `bool` modifier which means it will always return 0' |
| 200 | fragment: |
| 201 | start: 1 |
| 202 | end: 2 |
| 203 | returns: scalar |
| 204 | returnInfo: |
| 205 | logicalexpr: 2 ^ 5 + 11 % 5 |
| 206 | valueposition: |
| 207 | start: 1 |
| 208 | end: 2 |
| 209 | returnednumber: 3 |
| 210 | alwaysreturns: true |
| 211 | knownreturn: true |
| 212 | isreturnbool: true |
| 213 | position: |
| 214 | start: 1 |
| 215 | end: 2 |
| 216 | type: number |
| 217 | fixedLabels: true |
| 218 | isConditional: true |
| 219 | |
| 220 | --- |
| 221 | |
| 222 | [TestLabelsSource/8 - 1] |
| 223 | expr: 20 - 15 < bool 1 |
| 224 | output: |
| 225 | - labels: |
| 226 | "": |
| 227 | reason: This query returns a number value with no labels. |
| 228 | kind: excluded |
| 229 | fragment: |
| 230 | start: 0 |
| 231 | end: 2 |
| 232 | deadInfo: |
| 233 | reason: '`20 - 15 < 1` always evaluates to `5 < 1` and uses the `bool` modifier which means it will always return 0' |
| 234 | fragment: |
| 235 | start: 0 |
| 236 | end: 2 |
| 237 | returns: scalar |
| 238 | returnInfo: |
| 239 | logicalexpr: 20 - 15 |
| 240 | valueposition: |
| 241 | start: 0 |
| 242 | end: 2 |
| 243 | returnednumber: 5 |
| 244 | alwaysreturns: true |
| 245 | knownreturn: true |
| 246 | isreturnbool: true |
| 247 | position: |
| 248 | start: 0 |
| 249 | end: 2 |
| 250 | type: number |
| 251 | fixedLabels: true |
| 252 | isConditional: true |
| 253 | |
| 254 | --- |
| 255 | |
| 256 | [TestLabelsSource/9 - 1] |
| 257 | expr: 2 * 5 |
| 258 | output: |
| 259 | - labels: |
| 260 | "": |
| 261 | reason: This query returns a number value with no labels. |
| 262 | kind: excluded |
| 263 | fragment: |
| 264 | start: 0 |
| 265 | end: 1 |
| 266 | returns: scalar |
| 267 | returnInfo: |
| 268 | logicalexpr: 2 * 5 |
| 269 | valueposition: |
| 270 | start: 0 |
| 271 | end: 1 |
| 272 | returnednumber: 10 |
| 273 | alwaysreturns: true |
| 274 | knownreturn: true |
| 275 | isreturnbool: false |
| 276 | position: |
| 277 | start: 0 |
| 278 | end: 1 |
| 279 | type: number |
| 280 | fixedLabels: true |
| 281 | |
| 282 | --- |
| 283 | |
| 284 | [TestLabelsSource/10 - 1] |
| 285 | expr: (foo or bar) * 5 |
| 286 | output: |
| 287 | - returns: vector |
| 288 | operations: |
| 289 | - node: '[*parser.VectorSelector] foo' |
| 290 | op: "" |
| 291 | position: |
| 292 | start: 1 |
| 293 | end: 4 |
| 294 | type: selector |
| 295 | - returns: vector |
| 296 | operations: |
| 297 | - node: '[*parser.VectorSelector] bar' |
| 298 | op: "" |
| 299 | position: |
| 300 | start: 8 |
| 301 | end: 11 |
| 302 | type: selector |
| 303 | |
| 304 | --- |
| 305 | |
| 306 | [TestLabelsSource/11 - 1] |
| 307 | expr: (foo or vector(2)) * 5 |
| 308 | output: |
| 309 | - returns: vector |
| 310 | operations: |
| 311 | - node: '[*parser.VectorSelector] foo' |
| 312 | op: "" |
| 313 | position: |
| 314 | start: 1 |
| 315 | end: 4 |
| 316 | type: selector |
| 317 | - labels: |
| 318 | "": |
| 319 | reason: Calling `vector()` will return a vector value with no labels. |
| 320 | kind: excluded |
| 321 | fragment: |
| 322 | start: 8 |
| 323 | end: 14 |
| 324 | returns: vector |
| 325 | operations: |
| 326 | - args: |
| 327 | - "2" |
| 328 | node: '[*parser.Call] vector(2)' |
| 329 | op: vector |
| 330 | returnInfo: |
| 331 | logicalexpr: vector(2) * 5 |
| 332 | valueposition: |
| 333 | start: 8 |
| 334 | end: 17 |
| 335 | returnednumber: 10 |
| 336 | alwaysreturns: true |
| 337 | knownreturn: true |
| 338 | isreturnbool: false |
| 339 | position: |
| 340 | start: 8 |
| 341 | end: 17 |
| 342 | type: function |
| 343 | fixedLabels: true |
| 344 | |
| 345 | --- |
| 346 | |
| 347 | [TestLabelsSource/12 - 1] |
| 348 | expr: (foo or vector(5)) * (vector(2) or bar) |
| 349 | output: |
| 350 | - labels: |
| 351 | __name__: |
| 352 | reason: Binary operation between two vectors removes metric names. |
| 353 | kind: excluded |
| 354 | fragment: |
| 355 | start: 0 |
| 356 | end: 39 |
| 357 | returns: vector |
| 358 | operations: |
| 359 | - node: '[*parser.VectorSelector] foo' |
| 360 | op: "" |
| 361 | joins: |
| 362 | - matchinglabels: [] |
| 363 | addedlabels: [] |
| 364 | src: |
| 365 | labels: |
| 366 | "": |
| 367 | reason: Calling `vector()` will return a vector value with no labels. |
| 368 | kind: excluded |
| 369 | fragment: |
| 370 | start: 22 |
| 371 | end: 28 |
| 372 | returns: vector |
| 373 | operations: |
| 374 | - args: |
| 375 | - "2" |
| 376 | node: '[*parser.Call] vector(2)' |
| 377 | op: vector |
| 378 | returnInfo: |
| 379 | logicalexpr: "" |
| 380 | valueposition: |
| 381 | start: 22 |
| 382 | end: 31 |
| 383 | returnednumber: 2 |
| 384 | alwaysreturns: true |
| 385 | knownreturn: true |
| 386 | isreturnbool: false |
| 387 | position: |
| 388 | start: 22 |
| 389 | end: 31 |
| 390 | type: function |
| 391 | fixedLabels: true |
| 392 | op: 57395 |
| 393 | depth: 0 |
| 394 | ison: false |
| 395 | - matchinglabels: [] |
| 396 | addedlabels: [] |
| 397 | src: |
| 398 | deadInfo: |
| 399 | reason: The left hand side always returns something and so the right hand side is never used. |
| 400 | fragment: |
| 401 | start: 35 |
| 402 | end: 38 |
| 403 | returns: vector |
| 404 | operations: |
| 405 | - node: '[*parser.VectorSelector] bar' |
| 406 | op: "" |
| 407 | position: |
| 408 | start: 35 |
| 409 | end: 38 |
| 410 | type: selector |
| 411 | op: 57395 |
| 412 | depth: 0 |
| 413 | ison: false |
| 414 | position: |
| 415 | start: 1 |
| 416 | end: 4 |
| 417 | type: selector |
| 418 | - labels: |
| 419 | "": |
| 420 | reason: Calling `vector()` will return a vector value with no labels. |
| 421 | kind: excluded |
| 422 | fragment: |
| 423 | start: 8 |
| 424 | end: 14 |
| 425 | __name__: |
| 426 | reason: Binary operation between two vectors removes metric names. |
| 427 | kind: excluded |
| 428 | fragment: |
| 429 | start: 0 |
| 430 | end: 39 |
| 431 | returns: vector |
| 432 | operations: |
| 433 | - args: |
| 434 | - "5" |
| 435 | node: '[*parser.Call] vector(5)' |
| 436 | op: vector |
| 437 | joins: |
| 438 | - matchinglabels: [] |
| 439 | addedlabels: [] |
| 440 | src: |
| 441 | labels: |
| 442 | "": |
| 443 | reason: Calling `vector()` will return a vector value with no labels. |
| 444 | kind: excluded |
| 445 | fragment: |
| 446 | start: 22 |
| 447 | end: 28 |
| 448 | returns: vector |
| 449 | operations: |
| 450 | - args: |
| 451 | - "2" |
| 452 | node: '[*parser.Call] vector(2)' |
| 453 | op: vector |
| 454 | returnInfo: |
| 455 | logicalexpr: "" |
| 456 | valueposition: |
| 457 | start: 22 |
| 458 | end: 31 |
| 459 | returnednumber: 2 |
| 460 | alwaysreturns: true |
| 461 | knownreturn: true |
| 462 | isreturnbool: false |
| 463 | position: |
| 464 | start: 22 |
| 465 | end: 31 |
| 466 | type: function |
| 467 | fixedLabels: true |
| 468 | op: 57395 |
| 469 | depth: 0 |
| 470 | ison: false |
| 471 | - matchinglabels: [] |
| 472 | addedlabels: [] |
| 473 | src: |
| 474 | deadInfo: |
| 475 | reason: The left hand side always returns something and so the right hand side is never used. |
| 476 | fragment: |
| 477 | start: 35 |
| 478 | end: 38 |
| 479 | returns: vector |
| 480 | operations: |
| 481 | - node: '[*parser.VectorSelector] bar' |
| 482 | op: "" |
| 483 | position: |
| 484 | start: 35 |
| 485 | end: 38 |
| 486 | type: selector |
| 487 | op: 57395 |
| 488 | depth: 0 |
| 489 | ison: false |
| 490 | returnInfo: |
| 491 | logicalexpr: vector(5) * vector(2) |
| 492 | valueposition: |
| 493 | start: 8 |
| 494 | end: 17 |
| 495 | returnednumber: 10 |
| 496 | alwaysreturns: true |
| 497 | knownreturn: true |
| 498 | isreturnbool: false |
| 499 | position: |
| 500 | start: 8 |
| 501 | end: 17 |
| 502 | type: function |
| 503 | fixedLabels: true |
| 504 | |
| 505 | --- |
| 506 | |
| 507 | [TestLabelsSource/13 - 1] |
| 508 | expr: 1 > bool 0 |
| 509 | output: |
| 510 | - labels: |
| 511 | "": |
| 512 | reason: This query returns a number value with no labels. |
| 513 | kind: excluded |
| 514 | fragment: |
| 515 | start: 0 |
| 516 | end: 1 |
| 517 | returns: scalar |
| 518 | returnInfo: |
| 519 | logicalexpr: "" |
| 520 | valueposition: |
| 521 | start: 0 |
| 522 | end: 1 |
| 523 | returnednumber: 1 |
| 524 | alwaysreturns: true |
| 525 | knownreturn: true |
| 526 | isreturnbool: true |
| 527 | position: |
| 528 | start: 0 |
| 529 | end: 1 |
| 530 | type: number |
| 531 | fixedLabels: true |
| 532 | isConditional: true |
| 533 | |
| 534 | --- |
| 535 | |
| 536 | [TestLabelsSource/14 - 1] |
| 537 | expr: 20 > bool 10 |
| 538 | output: |
| 539 | - labels: |
| 540 | "": |
| 541 | reason: This query returns a number value with no labels. |
| 542 | kind: excluded |
| 543 | fragment: |
| 544 | start: 0 |
| 545 | end: 2 |
| 546 | returns: scalar |
| 547 | returnInfo: |
| 548 | logicalexpr: "" |
| 549 | valueposition: |
| 550 | start: 0 |
| 551 | end: 2 |
| 552 | returnednumber: 20 |
| 553 | alwaysreturns: true |
| 554 | knownreturn: true |
| 555 | isreturnbool: true |
| 556 | position: |
| 557 | start: 0 |
| 558 | end: 2 |
| 559 | type: number |
| 560 | fixedLabels: true |
| 561 | isConditional: true |
| 562 | |
| 563 | --- |
| 564 | |
| 565 | [TestLabelsSource/15 - 1] |
| 566 | expr: '"test"' |
| 567 | output: |
| 568 | - labels: |
| 569 | "": |
| 570 | reason: This query returns a string value with no labels. |
| 571 | kind: excluded |
| 572 | fragment: |
| 573 | start: 0 |
| 574 | end: 6 |
| 575 | returns: string |
| 576 | returnInfo: |
| 577 | logicalexpr: "" |
| 578 | valueposition: |
| 579 | start: 0 |
| 580 | end: 0 |
| 581 | returnednumber: 0 |
| 582 | alwaysreturns: true |
| 583 | knownreturn: false |
| 584 | isreturnbool: false |
| 585 | position: |
| 586 | start: 0 |
| 587 | end: 6 |
| 588 | type: string |
| 589 | fixedLabels: true |
| 590 | |
| 591 | --- |
| 592 | |
| 593 | [TestLabelsSource/16 - 1] |
| 594 | expr: foo |
| 595 | output: |
| 596 | - returns: vector |
| 597 | operations: |
| 598 | - node: '[*parser.VectorSelector] foo' |
| 599 | op: "" |
| 600 | position: |
| 601 | start: 0 |
| 602 | end: 3 |
| 603 | type: selector |
| 604 | |
| 605 | --- |
| 606 | |
| 607 | [TestLabelsSource/17 - 1] |
| 608 | expr: (foo > 1) > bool 1 |
| 609 | output: |
| 610 | - returns: vector |
| 611 | operations: |
| 612 | - node: '[*parser.VectorSelector] foo' |
| 613 | op: "" |
| 614 | position: |
| 615 | start: 1 |
| 616 | end: 4 |
| 617 | type: selector |
| 618 | isConditional: true |
| 619 | |
| 620 | --- |
| 621 | |
| 622 | [TestLabelsSource/18 - 1] |
| 623 | expr: foo > bool 5 |
| 624 | output: |
| 625 | - returns: vector |
| 626 | operations: |
| 627 | - node: '[*parser.VectorSelector] foo' |
| 628 | op: "" |
| 629 | returnInfo: |
| 630 | logicalexpr: "" |
| 631 | valueposition: |
| 632 | start: 0 |
| 633 | end: 0 |
| 634 | returnednumber: 0 |
| 635 | alwaysreturns: false |
| 636 | knownreturn: false |
| 637 | isreturnbool: true |
| 638 | position: |
| 639 | start: 0 |
| 640 | end: 3 |
| 641 | type: selector |
| 642 | isConditional: true |
| 643 | |
| 644 | --- |
| 645 | |
| 646 | [TestLabelsSource/19 - 1] |
| 647 | expr: foo > bool 5 == 1 |
| 648 | output: |
| 649 | - returns: vector |
| 650 | operations: |
| 651 | - node: '[*parser.VectorSelector] foo' |
| 652 | op: "" |
| 653 | position: |
| 654 | start: 0 |
| 655 | end: 3 |
| 656 | type: selector |
| 657 | isConditional: true |
| 658 | |
| 659 | --- |
| 660 | |
| 661 | [TestLabelsSource/20 - 1] |
| 662 | expr: foo > bool bar |
| 663 | output: |
| 664 | - labels: |
| 665 | __name__: |
| 666 | reason: Binary operation between two vectors removes metric names. |
| 667 | kind: excluded |
| 668 | fragment: |
| 669 | start: 0 |
| 670 | end: 14 |
| 671 | returns: vector |
| 672 | operations: |
| 673 | - node: '[*parser.VectorSelector] foo' |
| 674 | op: "" |
| 675 | joins: |
| 676 | - matchinglabels: [] |
| 677 | addedlabels: [] |
| 678 | src: |
| 679 | returns: vector |
| 680 | operations: |
| 681 | - node: '[*parser.VectorSelector] bar' |
| 682 | op: "" |
| 683 | position: |
| 684 | start: 11 |
| 685 | end: 14 |
| 686 | type: selector |
| 687 | op: 57388 |
| 688 | depth: 0 |
| 689 | ison: false |
| 690 | returnInfo: |
| 691 | logicalexpr: "" |
| 692 | valueposition: |
| 693 | start: 0 |
| 694 | end: 0 |
| 695 | returnednumber: 0 |
| 696 | alwaysreturns: false |
| 697 | knownreturn: false |
| 698 | isreturnbool: true |
| 699 | position: |
| 700 | start: 0 |
| 701 | end: 3 |
| 702 | type: selector |
| 703 | isConditional: true |
| 704 | |
| 705 | --- |
| 706 | |
| 707 | [TestLabelsSource/21 - 1] |
| 708 | expr: (foo > bool bar) == 0 |
| 709 | output: |
| 710 | - labels: |
| 711 | __name__: |
| 712 | reason: Binary operation between two vectors removes metric names. |
| 713 | kind: excluded |
| 714 | fragment: |
| 715 | start: 1 |
| 716 | end: 15 |
| 717 | returns: vector |
| 718 | operations: |
| 719 | - node: '[*parser.VectorSelector] foo' |
| 720 | op: "" |
| 721 | joins: |
| 722 | - matchinglabels: [] |
| 723 | addedlabels: [] |
| 724 | src: |
| 725 | returns: vector |
| 726 | operations: |
| 727 | - node: '[*parser.VectorSelector] bar' |
| 728 | op: "" |
| 729 | position: |
| 730 | start: 12 |
| 731 | end: 15 |
| 732 | type: selector |
| 733 | op: 57388 |
| 734 | depth: 0 |
| 735 | ison: false |
| 736 | position: |
| 737 | start: 1 |
| 738 | end: 4 |
| 739 | type: selector |
| 740 | isConditional: true |
| 741 | |
| 742 | --- |
| 743 | |
| 744 | [TestLabelsSource/22 - 1] |
| 745 | expr: foo > bool on(instance) bar |
| 746 | output: |
| 747 | - labels: |
| 748 | "": |
| 749 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 750 | kind: excluded |
| 751 | fragment: |
| 752 | start: 11 |
| 753 | end: 23 |
| 754 | __name__: |
| 755 | reason: Binary operation between two vectors removes metric names. |
| 756 | kind: excluded |
| 757 | fragment: |
| 758 | start: 0 |
| 759 | end: 27 |
| 760 | instance: |
| 761 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 762 | kind: included |
| 763 | fragment: |
| 764 | start: 14 |
| 765 | end: 22 |
| 766 | returns: vector |
| 767 | operations: |
| 768 | - node: '[*parser.VectorSelector] foo' |
| 769 | op: "" |
| 770 | joins: |
| 771 | - matchinglabels: |
| 772 | - instance |
| 773 | addedlabels: [] |
| 774 | src: |
| 775 | returns: vector |
| 776 | operations: |
| 777 | - node: '[*parser.VectorSelector] bar' |
| 778 | op: "" |
| 779 | position: |
| 780 | start: 24 |
| 781 | end: 27 |
| 782 | type: selector |
| 783 | op: 57388 |
| 784 | depth: 0 |
| 785 | ison: true |
| 786 | usedLabels: |
| 787 | - instance |
| 788 | returnInfo: |
| 789 | logicalexpr: "" |
| 790 | valueposition: |
| 791 | start: 0 |
| 792 | end: 0 |
| 793 | returnednumber: 0 |
| 794 | alwaysreturns: false |
| 795 | knownreturn: false |
| 796 | isreturnbool: true |
| 797 | position: |
| 798 | start: 0 |
| 799 | end: 3 |
| 800 | type: selector |
| 801 | fixedLabels: true |
| 802 | isConditional: true |
| 803 | |
| 804 | --- |
| 805 | |
| 806 | [TestLabelsSource/23 - 1] |
| 807 | expr: (foo > bool on(instance) bar) == 1 |
| 808 | output: |
| 809 | - labels: |
| 810 | "": |
| 811 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 812 | kind: excluded |
| 813 | fragment: |
| 814 | start: 12 |
| 815 | end: 24 |
| 816 | __name__: |
| 817 | reason: Binary operation between two vectors removes metric names. |
| 818 | kind: excluded |
| 819 | fragment: |
| 820 | start: 1 |
| 821 | end: 28 |
| 822 | instance: |
| 823 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 824 | kind: included |
| 825 | fragment: |
| 826 | start: 15 |
| 827 | end: 23 |
| 828 | returns: vector |
| 829 | operations: |
| 830 | - node: '[*parser.VectorSelector] foo' |
| 831 | op: "" |
| 832 | joins: |
| 833 | - matchinglabels: |
| 834 | - instance |
| 835 | addedlabels: [] |
| 836 | src: |
| 837 | returns: vector |
| 838 | operations: |
| 839 | - node: '[*parser.VectorSelector] bar' |
| 840 | op: "" |
| 841 | position: |
| 842 | start: 25 |
| 843 | end: 28 |
| 844 | type: selector |
| 845 | op: 57388 |
| 846 | depth: 0 |
| 847 | ison: true |
| 848 | usedLabels: |
| 849 | - instance |
| 850 | position: |
| 851 | start: 1 |
| 852 | end: 4 |
| 853 | type: selector |
| 854 | fixedLabels: true |
| 855 | isConditional: true |
| 856 | |
| 857 | --- |
| 858 | |
| 859 | [TestLabelsSource/24 - 1] |
| 860 | expr: foo > bool on(instance) group_left(version) bar |
| 861 | output: |
| 862 | - labels: |
| 863 | __name__: |
| 864 | reason: Binary operation between two vectors removes metric names. |
| 865 | kind: excluded |
| 866 | fragment: |
| 867 | start: 0 |
| 868 | end: 47 |
| 869 | instance: |
| 870 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 871 | kind: included |
| 872 | fragment: |
| 873 | start: 14 |
| 874 | end: 22 |
| 875 | version: |
| 876 | reason: Query is using `group_left(version)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 877 | kind: included |
| 878 | fragment: |
| 879 | start: 35 |
| 880 | end: 42 |
| 881 | returns: vector |
| 882 | operations: |
| 883 | - node: '[*parser.VectorSelector] foo' |
| 884 | op: "" |
| 885 | joins: |
| 886 | - matchinglabels: |
| 887 | - instance |
| 888 | addedlabels: |
| 889 | - version |
| 890 | src: |
| 891 | returns: vector |
| 892 | operations: |
| 893 | - node: '[*parser.VectorSelector] bar' |
| 894 | op: "" |
| 895 | position: |
| 896 | start: 44 |
| 897 | end: 47 |
| 898 | type: selector |
| 899 | op: 57388 |
| 900 | depth: 0 |
| 901 | ison: true |
| 902 | usedLabels: |
| 903 | - instance |
| 904 | returnInfo: |
| 905 | logicalexpr: "" |
| 906 | valueposition: |
| 907 | start: 0 |
| 908 | end: 0 |
| 909 | returnednumber: 0 |
| 910 | alwaysreturns: false |
| 911 | knownreturn: false |
| 912 | isreturnbool: true |
| 913 | position: |
| 914 | start: 0 |
| 915 | end: 3 |
| 916 | type: selector |
| 917 | isConditional: true |
| 918 | |
| 919 | --- |
| 920 | |
| 921 | [TestLabelsSource/25 - 1] |
| 922 | expr: bar > bool on(instance) group_right(version) foo |
| 923 | output: |
| 924 | - labels: |
| 925 | __name__: |
| 926 | reason: Binary operation between two vectors removes metric names. |
| 927 | kind: excluded |
| 928 | fragment: |
| 929 | start: 0 |
| 930 | end: 48 |
| 931 | instance: |
| 932 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 933 | kind: included |
| 934 | fragment: |
| 935 | start: 14 |
| 936 | end: 22 |
| 937 | version: |
| 938 | reason: Query is using `group_right(version)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 939 | kind: included |
| 940 | fragment: |
| 941 | start: 36 |
| 942 | end: 43 |
| 943 | returns: vector |
| 944 | operations: |
| 945 | - node: '[*parser.VectorSelector] foo' |
| 946 | op: "" |
| 947 | joins: |
| 948 | - matchinglabels: |
| 949 | - instance |
| 950 | addedlabels: |
| 951 | - version |
| 952 | src: |
| 953 | returns: vector |
| 954 | operations: |
| 955 | - node: '[*parser.VectorSelector] bar' |
| 956 | op: "" |
| 957 | position: |
| 958 | start: 0 |
| 959 | end: 3 |
| 960 | type: selector |
| 961 | op: 57388 |
| 962 | depth: 0 |
| 963 | ison: true |
| 964 | usedLabels: |
| 965 | - instance |
| 966 | returnInfo: |
| 967 | logicalexpr: "" |
| 968 | valueposition: |
| 969 | start: 0 |
| 970 | end: 0 |
| 971 | returnednumber: 0 |
| 972 | alwaysreturns: false |
| 973 | knownreturn: false |
| 974 | isreturnbool: true |
| 975 | position: |
| 976 | start: 45 |
| 977 | end: 48 |
| 978 | type: selector |
| 979 | isConditional: true |
| 980 | |
| 981 | --- |
| 982 | |
| 983 | [TestLabelsSource/26 - 1] |
| 984 | expr: foo and bar > bool 0 |
| 985 | output: |
| 986 | - returns: vector |
| 987 | operations: |
| 988 | - node: '[*parser.VectorSelector] foo' |
| 989 | op: "" |
| 990 | joins: |
| 991 | - matchinglabels: [] |
| 992 | addedlabels: [] |
| 993 | src: |
| 994 | returns: vector |
| 995 | operations: |
| 996 | - node: '[*parser.VectorSelector] bar' |
| 997 | op: "" |
| 998 | returnInfo: |
| 999 | logicalexpr: "" |
| 1000 | valueposition: |
| 1001 | start: 0 |
| 1002 | end: 0 |
| 1003 | returnednumber: 0 |
| 1004 | alwaysreturns: false |
| 1005 | knownreturn: false |
| 1006 | isreturnbool: true |
| 1007 | position: |
| 1008 | start: 8 |
| 1009 | end: 11 |
| 1010 | type: selector |
| 1011 | isConditional: true |
| 1012 | op: 57389 |
| 1013 | depth: 0 |
| 1014 | ison: false |
| 1015 | position: |
| 1016 | start: 0 |
| 1017 | end: 3 |
| 1018 | type: selector |
| 1019 | isConditional: true |
| 1020 | |
| 1021 | --- |
| 1022 | |
| 1023 | [TestLabelsSource/27 - 1] |
| 1024 | expr: foo offset 5m |
| 1025 | output: |
| 1026 | - returns: vector |
| 1027 | operations: |
| 1028 | - node: '[*parser.VectorSelector] foo offset 5m' |
| 1029 | op: "" |
| 1030 | position: |
| 1031 | start: 0 |
| 1032 | end: 13 |
| 1033 | type: selector |
| 1034 | |
| 1035 | --- |
| 1036 | |
| 1037 | [TestLabelsSource/28 - 1] |
| 1038 | expr: foo{job="bar"} |
| 1039 | output: |
| 1040 | - labels: |
| 1041 | job: |
| 1042 | reason: Query will only return series where these labels are present. |
| 1043 | kind: guaranteed |
| 1044 | fragment: |
| 1045 | start: 0 |
| 1046 | end: 14 |
| 1047 | returns: vector |
| 1048 | operations: |
| 1049 | - node: '[*parser.VectorSelector] foo{job="bar"}' |
| 1050 | op: "" |
| 1051 | position: |
| 1052 | start: 0 |
| 1053 | end: 14 |
| 1054 | type: selector |
| 1055 | |
| 1056 | --- |
| 1057 | |
| 1058 | [TestLabelsSource/29 - 1] |
| 1059 | expr: foo{job=""} |
| 1060 | output: |
| 1061 | - labels: |
| 1062 | job: |
| 1063 | reason: Query uses `{job=""}` selector which will filter out any time series with the `job` label set. |
| 1064 | kind: excluded |
| 1065 | fragment: |
| 1066 | start: 0 |
| 1067 | end: 11 |
| 1068 | returns: vector |
| 1069 | operations: |
| 1070 | - node: '[*parser.VectorSelector] foo{job=""}' |
| 1071 | op: "" |
| 1072 | position: |
| 1073 | start: 0 |
| 1074 | end: 11 |
| 1075 | type: selector |
| 1076 | |
| 1077 | --- |
| 1078 | |
| 1079 | [TestLabelsSource/30 - 1] |
| 1080 | expr: foo{job="bar"} or bar{job="foo"} |
| 1081 | output: |
| 1082 | - labels: |
| 1083 | job: |
| 1084 | reason: Query will only return series where these labels are present. |
| 1085 | kind: guaranteed |
| 1086 | fragment: |
| 1087 | start: 0 |
| 1088 | end: 14 |
| 1089 | returns: vector |
| 1090 | operations: |
| 1091 | - node: '[*parser.VectorSelector] foo{job="bar"}' |
| 1092 | op: "" |
| 1093 | usedLabels: |
| 1094 | - job |
| 1095 | position: |
| 1096 | start: 0 |
| 1097 | end: 14 |
| 1098 | type: selector |
| 1099 | - labels: |
| 1100 | job: |
| 1101 | reason: Query will only return series where these labels are present. |
| 1102 | kind: guaranteed |
| 1103 | fragment: |
| 1104 | start: 18 |
| 1105 | end: 32 |
| 1106 | returns: vector |
| 1107 | operations: |
| 1108 | - node: '[*parser.VectorSelector] bar{job="foo"}' |
| 1109 | op: "" |
| 1110 | position: |
| 1111 | start: 18 |
| 1112 | end: 32 |
| 1113 | type: selector |
| 1114 | |
| 1115 | --- |
| 1116 | |
| 1117 | [TestLabelsSource/31 - 1] |
| 1118 | expr: foo{a="bar"} or bar{b="foo"} |
| 1119 | output: |
| 1120 | - labels: |
| 1121 | a: |
| 1122 | reason: Query will only return series where these labels are present. |
| 1123 | kind: guaranteed |
| 1124 | fragment: |
| 1125 | start: 0 |
| 1126 | end: 12 |
| 1127 | returns: vector |
| 1128 | operations: |
| 1129 | - node: '[*parser.VectorSelector] foo{a="bar"}' |
| 1130 | op: "" |
| 1131 | usedLabels: |
| 1132 | - a |
| 1133 | position: |
| 1134 | start: 0 |
| 1135 | end: 12 |
| 1136 | type: selector |
| 1137 | - labels: |
| 1138 | b: |
| 1139 | reason: Query will only return series where these labels are present. |
| 1140 | kind: guaranteed |
| 1141 | fragment: |
| 1142 | start: 16 |
| 1143 | end: 28 |
| 1144 | returns: vector |
| 1145 | operations: |
| 1146 | - node: '[*parser.VectorSelector] bar{b="foo"}' |
| 1147 | op: "" |
| 1148 | position: |
| 1149 | start: 16 |
| 1150 | end: 28 |
| 1151 | type: selector |
| 1152 | |
| 1153 | --- |
| 1154 | |
| 1155 | [TestLabelsSource/32 - 1] |
| 1156 | expr: foo[5m] |
| 1157 | output: |
| 1158 | - returns: matrix |
| 1159 | operations: |
| 1160 | - node: '[*parser.VectorSelector] foo' |
| 1161 | op: "" |
| 1162 | position: |
| 1163 | start: 0 |
| 1164 | end: 3 |
| 1165 | type: selector |
| 1166 | |
| 1167 | --- |
| 1168 | |
| 1169 | [TestLabelsSource/33 - 1] |
| 1170 | expr: prometheus_build_info[2m:1m] |
| 1171 | output: |
| 1172 | - returns: vector |
| 1173 | operations: |
| 1174 | - node: '[*parser.VectorSelector] prometheus_build_info' |
| 1175 | op: "" |
| 1176 | position: |
| 1177 | start: 0 |
| 1178 | end: 21 |
| 1179 | type: selector |
| 1180 | |
| 1181 | --- |
| 1182 | |
| 1183 | [TestLabelsSource/34 - 1] |
| 1184 | expr: deriv(rate(distance_covered_meters_total[1m])[5m:1m]) |
| 1185 | output: |
| 1186 | - returns: vector |
| 1187 | operations: |
| 1188 | - node: '[*parser.VectorSelector] distance_covered_meters_total' |
| 1189 | op: "" |
| 1190 | - node: '[*parser.Call] rate(distance_covered_meters_total[1m])' |
| 1191 | op: rate |
| 1192 | - node: '[*parser.Call] deriv(rate(distance_covered_meters_total[1m])[5m:1m])' |
| 1193 | op: deriv |
| 1194 | position: |
| 1195 | start: 6 |
| 1196 | end: 52 |
| 1197 | type: function |
| 1198 | |
| 1199 | --- |
| 1200 | |
| 1201 | [TestLabelsSource/35 - 1] |
| 1202 | expr: foo - 1 |
| 1203 | output: |
| 1204 | - returns: vector |
| 1205 | operations: |
| 1206 | - node: '[*parser.VectorSelector] foo' |
| 1207 | op: "" |
| 1208 | position: |
| 1209 | start: 0 |
| 1210 | end: 3 |
| 1211 | type: selector |
| 1212 | |
| 1213 | --- |
| 1214 | |
| 1215 | [TestLabelsSource/36 - 1] |
| 1216 | expr: foo / 5 |
| 1217 | output: |
| 1218 | - returns: vector |
| 1219 | operations: |
| 1220 | - node: '[*parser.VectorSelector] foo' |
| 1221 | op: "" |
| 1222 | position: |
| 1223 | start: 0 |
| 1224 | end: 3 |
| 1225 | type: selector |
| 1226 | |
| 1227 | --- |
| 1228 | |
| 1229 | [TestLabelsSource/37 - 1] |
| 1230 | expr: -foo |
| 1231 | output: |
| 1232 | - returns: vector |
| 1233 | operations: |
| 1234 | - node: '[*parser.VectorSelector] foo' |
| 1235 | op: "" |
| 1236 | position: |
| 1237 | start: 1 |
| 1238 | end: 4 |
| 1239 | type: selector |
| 1240 | |
| 1241 | --- |
| 1242 | |
| 1243 | [TestLabelsSource/38 - 1] |
| 1244 | expr: sum(foo{job="myjob"}) |
| 1245 | output: |
| 1246 | - labels: |
| 1247 | "": |
| 1248 | reason: Query is using aggregation that removes all labels. |
| 1249 | kind: excluded |
| 1250 | fragment: |
| 1251 | start: 0 |
| 1252 | end: 3 |
| 1253 | __name__: |
| 1254 | reason: Aggregation removes metric name. |
| 1255 | kind: excluded |
| 1256 | fragment: |
| 1257 | start: 0 |
| 1258 | end: 21 |
| 1259 | job: |
| 1260 | reason: Query is using aggregation that removes all labels. |
| 1261 | kind: excluded |
| 1262 | fragment: |
| 1263 | start: 0 |
| 1264 | end: 3 |
| 1265 | returns: vector |
| 1266 | operations: |
| 1267 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1268 | op: "" |
| 1269 | - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})' |
| 1270 | op: sum |
| 1271 | position: |
| 1272 | start: 4 |
| 1273 | end: 20 |
| 1274 | type: aggregation |
| 1275 | fixedLabels: true |
| 1276 | |
| 1277 | --- |
| 1278 | |
| 1279 | [TestLabelsSource/39 - 1] |
| 1280 | expr: sum(count(foo{job="myjob"}) by(instance)) |
| 1281 | output: |
| 1282 | - labels: |
| 1283 | "": |
| 1284 | reason: Query is using aggregation that removes all labels. |
| 1285 | kind: excluded |
| 1286 | fragment: |
| 1287 | start: 0 |
| 1288 | end: 3 |
| 1289 | __name__: |
| 1290 | reason: Aggregation removes metric name. |
| 1291 | kind: excluded |
| 1292 | fragment: |
| 1293 | start: 0 |
| 1294 | end: 41 |
| 1295 | instance: |
| 1296 | reason: Query is using aggregation that removes all labels. |
| 1297 | kind: excluded |
| 1298 | fragment: |
| 1299 | start: 0 |
| 1300 | end: 3 |
| 1301 | job: |
| 1302 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 1303 | kind: excluded |
| 1304 | fragment: |
| 1305 | start: 28 |
| 1306 | end: 40 |
| 1307 | returns: vector |
| 1308 | operations: |
| 1309 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1310 | op: "" |
| 1311 | - node: '[*parser.AggregateExpr] count by (instance) (foo{job="myjob"})' |
| 1312 | op: count |
| 1313 | - node: '[*parser.AggregateExpr] sum(count by (instance) (foo{job="myjob"}))' |
| 1314 | op: sum |
| 1315 | position: |
| 1316 | start: 10 |
| 1317 | end: 26 |
| 1318 | type: aggregation |
| 1319 | fixedLabels: true |
| 1320 | |
| 1321 | --- |
| 1322 | |
| 1323 | [TestLabelsSource/40 - 1] |
| 1324 | expr: sum(foo{job="myjob"}) > 20 |
| 1325 | output: |
| 1326 | - labels: |
| 1327 | "": |
| 1328 | reason: Query is using aggregation that removes all labels. |
| 1329 | kind: excluded |
| 1330 | fragment: |
| 1331 | start: 0 |
| 1332 | end: 3 |
| 1333 | __name__: |
| 1334 | reason: Aggregation removes metric name. |
| 1335 | kind: excluded |
| 1336 | fragment: |
| 1337 | start: 0 |
| 1338 | end: 21 |
| 1339 | job: |
| 1340 | reason: Query is using aggregation that removes all labels. |
| 1341 | kind: excluded |
| 1342 | fragment: |
| 1343 | start: 0 |
| 1344 | end: 3 |
| 1345 | returns: vector |
| 1346 | operations: |
| 1347 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1348 | op: "" |
| 1349 | - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})' |
| 1350 | op: sum |
| 1351 | position: |
| 1352 | start: 4 |
| 1353 | end: 20 |
| 1354 | type: aggregation |
| 1355 | fixedLabels: true |
| 1356 | isConditional: true |
| 1357 | |
| 1358 | --- |
| 1359 | |
| 1360 | [TestLabelsSource/41 - 1] |
| 1361 | expr: sum(foo{job="myjob"}) without(job) |
| 1362 | output: |
| 1363 | - labels: |
| 1364 | __name__: |
| 1365 | reason: Aggregation removes metric name. |
| 1366 | kind: excluded |
| 1367 | fragment: |
| 1368 | start: 0 |
| 1369 | end: 34 |
| 1370 | job: |
| 1371 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 1372 | kind: excluded |
| 1373 | fragment: |
| 1374 | start: 30 |
| 1375 | end: 33 |
| 1376 | returns: vector |
| 1377 | operations: |
| 1378 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1379 | op: "" |
| 1380 | - node: '[*parser.AggregateExpr] sum without (job) (foo{job="myjob"})' |
| 1381 | op: sum |
| 1382 | position: |
| 1383 | start: 4 |
| 1384 | end: 20 |
| 1385 | type: aggregation |
| 1386 | |
| 1387 | --- |
| 1388 | |
| 1389 | [TestLabelsSource/42 - 1] |
| 1390 | expr: sum(foo) by(job) |
| 1391 | output: |
| 1392 | - labels: |
| 1393 | "": |
| 1394 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 1395 | kind: excluded |
| 1396 | fragment: |
| 1397 | start: 9 |
| 1398 | end: 11 |
| 1399 | __name__: |
| 1400 | reason: Aggregation removes metric name. |
| 1401 | kind: excluded |
| 1402 | fragment: |
| 1403 | start: 0 |
| 1404 | end: 16 |
| 1405 | job: |
| 1406 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 1407 | kind: included |
| 1408 | fragment: |
| 1409 | start: 12 |
| 1410 | end: 15 |
| 1411 | returns: vector |
| 1412 | operations: |
| 1413 | - node: '[*parser.VectorSelector] foo' |
| 1414 | op: "" |
| 1415 | - node: '[*parser.AggregateExpr] sum by (job) (foo)' |
| 1416 | op: sum |
| 1417 | usedLabels: |
| 1418 | - job |
| 1419 | position: |
| 1420 | start: 4 |
| 1421 | end: 7 |
| 1422 | type: aggregation |
| 1423 | fixedLabels: true |
| 1424 | |
| 1425 | --- |
| 1426 | |
| 1427 | [TestLabelsSource/43 - 1] |
| 1428 | expr: sum(foo{job="myjob"}) by(job) |
| 1429 | output: |
| 1430 | - labels: |
| 1431 | "": |
| 1432 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 1433 | kind: excluded |
| 1434 | fragment: |
| 1435 | start: 22 |
| 1436 | end: 24 |
| 1437 | __name__: |
| 1438 | reason: Aggregation removes metric name. |
| 1439 | kind: excluded |
| 1440 | fragment: |
| 1441 | start: 0 |
| 1442 | end: 29 |
| 1443 | job: |
| 1444 | reason: Query will only return series where these labels are present. |
| 1445 | kind: guaranteed |
| 1446 | fragment: |
| 1447 | start: 4 |
| 1448 | end: 20 |
| 1449 | returns: vector |
| 1450 | operations: |
| 1451 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1452 | op: "" |
| 1453 | - node: '[*parser.AggregateExpr] sum by (job) (foo{job="myjob"})' |
| 1454 | op: sum |
| 1455 | usedLabels: |
| 1456 | - job |
| 1457 | position: |
| 1458 | start: 4 |
| 1459 | end: 20 |
| 1460 | type: aggregation |
| 1461 | fixedLabels: true |
| 1462 | |
| 1463 | --- |
| 1464 | |
| 1465 | [TestLabelsSource/44 - 1] |
| 1466 | expr: abs(foo{job="myjob"} offset 5m) |
| 1467 | output: |
| 1468 | - labels: |
| 1469 | job: |
| 1470 | reason: Query will only return series where these labels are present. |
| 1471 | kind: guaranteed |
| 1472 | fragment: |
| 1473 | start: 0 |
| 1474 | end: 31 |
| 1475 | returns: vector |
| 1476 | operations: |
| 1477 | - node: '[*parser.VectorSelector] foo{job="myjob"} offset 5m' |
| 1478 | op: "" |
| 1479 | - node: '[*parser.Call] abs(foo{job="myjob"} offset 5m)' |
| 1480 | op: abs |
| 1481 | position: |
| 1482 | start: 4 |
| 1483 | end: 30 |
| 1484 | type: function |
| 1485 | |
| 1486 | --- |
| 1487 | |
| 1488 | [TestLabelsSource/45 - 1] |
| 1489 | expr: abs(foo{job="myjob"} or bar{cluster="dev"}) |
| 1490 | output: |
| 1491 | - labels: |
| 1492 | job: |
| 1493 | reason: Query will only return series where these labels are present. |
| 1494 | kind: guaranteed |
| 1495 | fragment: |
| 1496 | start: 0 |
| 1497 | end: 43 |
| 1498 | returns: vector |
| 1499 | operations: |
| 1500 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1501 | op: "" |
| 1502 | - node: '[*parser.Call] abs(foo{job="myjob"} or bar{cluster="dev"})' |
| 1503 | op: abs |
| 1504 | usedLabels: |
| 1505 | - job |
| 1506 | position: |
| 1507 | start: 4 |
| 1508 | end: 42 |
| 1509 | type: function |
| 1510 | - labels: |
| 1511 | cluster: |
| 1512 | reason: Query will only return series where these labels are present. |
| 1513 | kind: guaranteed |
| 1514 | fragment: |
| 1515 | start: 0 |
| 1516 | end: 43 |
| 1517 | returns: vector |
| 1518 | operations: |
| 1519 | - node: '[*parser.VectorSelector] bar{cluster="dev"}' |
| 1520 | op: "" |
| 1521 | - node: '[*parser.Call] abs(foo{job="myjob"} or bar{cluster="dev"})' |
| 1522 | op: abs |
| 1523 | position: |
| 1524 | start: 4 |
| 1525 | end: 42 |
| 1526 | type: function |
| 1527 | |
| 1528 | --- |
| 1529 | |
| 1530 | [TestLabelsSource/46 - 1] |
| 1531 | expr: sum(foo{job="myjob"} or bar{cluster="dev"}) without(instance) |
| 1532 | output: |
| 1533 | - labels: |
| 1534 | __name__: |
| 1535 | reason: Aggregation removes metric name. |
| 1536 | kind: excluded |
| 1537 | fragment: |
| 1538 | start: 0 |
| 1539 | end: 61 |
| 1540 | instance: |
| 1541 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 1542 | kind: excluded |
| 1543 | fragment: |
| 1544 | start: 52 |
| 1545 | end: 60 |
| 1546 | job: |
| 1547 | reason: Query will only return series where these labels are present. |
| 1548 | kind: guaranteed |
| 1549 | fragment: |
| 1550 | start: 4 |
| 1551 | end: 20 |
| 1552 | returns: vector |
| 1553 | operations: |
| 1554 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1555 | op: "" |
| 1556 | - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"} or bar{cluster="dev"})' |
| 1557 | op: sum |
| 1558 | usedLabels: |
| 1559 | - job |
| 1560 | position: |
| 1561 | start: 4 |
| 1562 | end: 20 |
| 1563 | type: aggregation |
| 1564 | - labels: |
| 1565 | __name__: |
| 1566 | reason: Aggregation removes metric name. |
| 1567 | kind: excluded |
| 1568 | fragment: |
| 1569 | start: 0 |
| 1570 | end: 61 |
| 1571 | cluster: |
| 1572 | reason: Query will only return series where these labels are present. |
| 1573 | kind: guaranteed |
| 1574 | fragment: |
| 1575 | start: 24 |
| 1576 | end: 42 |
| 1577 | instance: |
| 1578 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 1579 | kind: excluded |
| 1580 | fragment: |
| 1581 | start: 52 |
| 1582 | end: 60 |
| 1583 | returns: vector |
| 1584 | operations: |
| 1585 | - node: '[*parser.VectorSelector] bar{cluster="dev"}' |
| 1586 | op: "" |
| 1587 | - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"} or bar{cluster="dev"})' |
| 1588 | op: sum |
| 1589 | position: |
| 1590 | start: 24 |
| 1591 | end: 42 |
| 1592 | type: aggregation |
| 1593 | |
| 1594 | --- |
| 1595 | |
| 1596 | [TestLabelsSource/47 - 1] |
| 1597 | expr: sum(foo{job="myjob"}) without(instance) |
| 1598 | output: |
| 1599 | - labels: |
| 1600 | __name__: |
| 1601 | reason: Aggregation removes metric name. |
| 1602 | kind: excluded |
| 1603 | fragment: |
| 1604 | start: 0 |
| 1605 | end: 39 |
| 1606 | instance: |
| 1607 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 1608 | kind: excluded |
| 1609 | fragment: |
| 1610 | start: 30 |
| 1611 | end: 38 |
| 1612 | job: |
| 1613 | reason: Query will only return series where these labels are present. |
| 1614 | kind: guaranteed |
| 1615 | fragment: |
| 1616 | start: 4 |
| 1617 | end: 20 |
| 1618 | returns: vector |
| 1619 | operations: |
| 1620 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1621 | op: "" |
| 1622 | - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"})' |
| 1623 | op: sum |
| 1624 | position: |
| 1625 | start: 4 |
| 1626 | end: 20 |
| 1627 | type: aggregation |
| 1628 | |
| 1629 | --- |
| 1630 | |
| 1631 | [TestLabelsSource/48 - 1] |
| 1632 | expr: min(foo{job="myjob"}) / max(foo{job="myjob"}) |
| 1633 | output: |
| 1634 | - labels: |
| 1635 | "": |
| 1636 | reason: Query is using aggregation that removes all labels. |
| 1637 | kind: excluded |
| 1638 | fragment: |
| 1639 | start: 0 |
| 1640 | end: 3 |
| 1641 | __name__: |
| 1642 | reason: Binary operation between two vectors removes metric names. |
| 1643 | kind: excluded |
| 1644 | fragment: |
| 1645 | start: 0 |
| 1646 | end: 45 |
| 1647 | job: |
| 1648 | reason: Query is using aggregation that removes all labels. |
| 1649 | kind: excluded |
| 1650 | fragment: |
| 1651 | start: 0 |
| 1652 | end: 3 |
| 1653 | returns: vector |
| 1654 | operations: |
| 1655 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1656 | op: "" |
| 1657 | - node: '[*parser.AggregateExpr] min(foo{job="myjob"})' |
| 1658 | op: min |
| 1659 | joins: |
| 1660 | - matchinglabels: [] |
| 1661 | addedlabels: [] |
| 1662 | src: |
| 1663 | labels: |
| 1664 | "": |
| 1665 | reason: Query is using aggregation that removes all labels. |
| 1666 | kind: excluded |
| 1667 | fragment: |
| 1668 | start: 24 |
| 1669 | end: 27 |
| 1670 | __name__: |
| 1671 | reason: Aggregation removes metric name. |
| 1672 | kind: excluded |
| 1673 | fragment: |
| 1674 | start: 24 |
| 1675 | end: 45 |
| 1676 | job: |
| 1677 | reason: Query is using aggregation that removes all labels. |
| 1678 | kind: excluded |
| 1679 | fragment: |
| 1680 | start: 24 |
| 1681 | end: 27 |
| 1682 | returns: vector |
| 1683 | operations: |
| 1684 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1685 | op: "" |
| 1686 | - node: '[*parser.AggregateExpr] max(foo{job="myjob"})' |
| 1687 | op: max |
| 1688 | position: |
| 1689 | start: 28 |
| 1690 | end: 44 |
| 1691 | type: aggregation |
| 1692 | fixedLabels: true |
| 1693 | op: 57384 |
| 1694 | depth: 0 |
| 1695 | ison: false |
| 1696 | position: |
| 1697 | start: 4 |
| 1698 | end: 20 |
| 1699 | type: aggregation |
| 1700 | fixedLabels: true |
| 1701 | |
| 1702 | --- |
| 1703 | |
| 1704 | [TestLabelsSource/49 - 1] |
| 1705 | expr: max(foo{job="myjob"}) / min(foo{job="myjob"}) |
| 1706 | output: |
| 1707 | - labels: |
| 1708 | "": |
| 1709 | reason: Query is using aggregation that removes all labels. |
| 1710 | kind: excluded |
| 1711 | fragment: |
| 1712 | start: 0 |
| 1713 | end: 3 |
| 1714 | __name__: |
| 1715 | reason: Binary operation between two vectors removes metric names. |
| 1716 | kind: excluded |
| 1717 | fragment: |
| 1718 | start: 0 |
| 1719 | end: 45 |
| 1720 | job: |
| 1721 | reason: Query is using aggregation that removes all labels. |
| 1722 | kind: excluded |
| 1723 | fragment: |
| 1724 | start: 0 |
| 1725 | end: 3 |
| 1726 | returns: vector |
| 1727 | operations: |
| 1728 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1729 | op: "" |
| 1730 | - node: '[*parser.AggregateExpr] max(foo{job="myjob"})' |
| 1731 | op: max |
| 1732 | joins: |
| 1733 | - matchinglabels: [] |
| 1734 | addedlabels: [] |
| 1735 | src: |
| 1736 | labels: |
| 1737 | "": |
| 1738 | reason: Query is using aggregation that removes all labels. |
| 1739 | kind: excluded |
| 1740 | fragment: |
| 1741 | start: 24 |
| 1742 | end: 27 |
| 1743 | __name__: |
| 1744 | reason: Aggregation removes metric name. |
| 1745 | kind: excluded |
| 1746 | fragment: |
| 1747 | start: 24 |
| 1748 | end: 45 |
| 1749 | job: |
| 1750 | reason: Query is using aggregation that removes all labels. |
| 1751 | kind: excluded |
| 1752 | fragment: |
| 1753 | start: 24 |
| 1754 | end: 27 |
| 1755 | returns: vector |
| 1756 | operations: |
| 1757 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1758 | op: "" |
| 1759 | - node: '[*parser.AggregateExpr] min(foo{job="myjob"})' |
| 1760 | op: min |
| 1761 | position: |
| 1762 | start: 28 |
| 1763 | end: 44 |
| 1764 | type: aggregation |
| 1765 | fixedLabels: true |
| 1766 | op: 57384 |
| 1767 | depth: 0 |
| 1768 | ison: false |
| 1769 | position: |
| 1770 | start: 4 |
| 1771 | end: 20 |
| 1772 | type: aggregation |
| 1773 | fixedLabels: true |
| 1774 | |
| 1775 | --- |
| 1776 | |
| 1777 | [TestLabelsSource/50 - 1] |
| 1778 | expr: avg(foo{job="myjob"}) by(job) |
| 1779 | output: |
| 1780 | - labels: |
| 1781 | "": |
| 1782 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 1783 | kind: excluded |
| 1784 | fragment: |
| 1785 | start: 22 |
| 1786 | end: 24 |
| 1787 | __name__: |
| 1788 | reason: Aggregation removes metric name. |
| 1789 | kind: excluded |
| 1790 | fragment: |
| 1791 | start: 0 |
| 1792 | end: 29 |
| 1793 | job: |
| 1794 | reason: Query will only return series where these labels are present. |
| 1795 | kind: guaranteed |
| 1796 | fragment: |
| 1797 | start: 4 |
| 1798 | end: 20 |
| 1799 | returns: vector |
| 1800 | operations: |
| 1801 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 1802 | op: "" |
| 1803 | - node: '[*parser.AggregateExpr] avg by (job) (foo{job="myjob"})' |
| 1804 | op: avg |
| 1805 | usedLabels: |
| 1806 | - job |
| 1807 | position: |
| 1808 | start: 4 |
| 1809 | end: 20 |
| 1810 | type: aggregation |
| 1811 | fixedLabels: true |
| 1812 | |
| 1813 | --- |
| 1814 | |
| 1815 | [TestLabelsSource/51 - 1] |
| 1816 | expr: group(foo) by(job) |
| 1817 | output: |
| 1818 | - labels: |
| 1819 | "": |
| 1820 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 1821 | kind: excluded |
| 1822 | fragment: |
| 1823 | start: 11 |
| 1824 | end: 13 |
| 1825 | __name__: |
| 1826 | reason: Aggregation removes metric name. |
| 1827 | kind: excluded |
| 1828 | fragment: |
| 1829 | start: 0 |
| 1830 | end: 18 |
| 1831 | job: |
| 1832 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 1833 | kind: included |
| 1834 | fragment: |
| 1835 | start: 14 |
| 1836 | end: 17 |
| 1837 | returns: vector |
| 1838 | operations: |
| 1839 | - node: '[*parser.VectorSelector] foo' |
| 1840 | op: "" |
| 1841 | - node: '[*parser.AggregateExpr] group by (job) (foo)' |
| 1842 | op: group |
| 1843 | usedLabels: |
| 1844 | - job |
| 1845 | position: |
| 1846 | start: 6 |
| 1847 | end: 9 |
| 1848 | type: aggregation |
| 1849 | fixedLabels: true |
| 1850 | |
| 1851 | --- |
| 1852 | |
| 1853 | [TestLabelsSource/52 - 1] |
| 1854 | expr: stddev(rate(foo[5m])) |
| 1855 | output: |
| 1856 | - labels: |
| 1857 | "": |
| 1858 | reason: Query is using aggregation that removes all labels. |
| 1859 | kind: excluded |
| 1860 | fragment: |
| 1861 | start: 0 |
| 1862 | end: 6 |
| 1863 | __name__: |
| 1864 | reason: Aggregation removes metric name. |
| 1865 | kind: excluded |
| 1866 | fragment: |
| 1867 | start: 0 |
| 1868 | end: 21 |
| 1869 | returns: vector |
| 1870 | operations: |
| 1871 | - node: '[*parser.VectorSelector] foo' |
| 1872 | op: "" |
| 1873 | - node: '[*parser.Call] rate(foo[5m])' |
| 1874 | op: rate |
| 1875 | - node: '[*parser.AggregateExpr] stddev(rate(foo[5m]))' |
| 1876 | op: stddev |
| 1877 | position: |
| 1878 | start: 12 |
| 1879 | end: 19 |
| 1880 | type: aggregation |
| 1881 | fixedLabels: true |
| 1882 | |
| 1883 | --- |
| 1884 | |
| 1885 | [TestLabelsSource/53 - 1] |
| 1886 | expr: stdvar(rate(foo[5m])) |
| 1887 | output: |
| 1888 | - labels: |
| 1889 | "": |
| 1890 | reason: Query is using aggregation that removes all labels. |
| 1891 | kind: excluded |
| 1892 | fragment: |
| 1893 | start: 0 |
| 1894 | end: 6 |
| 1895 | __name__: |
| 1896 | reason: Aggregation removes metric name. |
| 1897 | kind: excluded |
| 1898 | fragment: |
| 1899 | start: 0 |
| 1900 | end: 21 |
| 1901 | returns: vector |
| 1902 | operations: |
| 1903 | - node: '[*parser.VectorSelector] foo' |
| 1904 | op: "" |
| 1905 | - node: '[*parser.Call] rate(foo[5m])' |
| 1906 | op: rate |
| 1907 | - node: '[*parser.AggregateExpr] stdvar(rate(foo[5m]))' |
| 1908 | op: stdvar |
| 1909 | position: |
| 1910 | start: 12 |
| 1911 | end: 19 |
| 1912 | type: aggregation |
| 1913 | fixedLabels: true |
| 1914 | |
| 1915 | --- |
| 1916 | |
| 1917 | [TestLabelsSource/54 - 1] |
| 1918 | expr: stddev_over_time(foo[5m]) |
| 1919 | output: |
| 1920 | - returns: vector |
| 1921 | operations: |
| 1922 | - node: '[*parser.VectorSelector] foo' |
| 1923 | op: "" |
| 1924 | - node: '[*parser.Call] stddev_over_time(foo[5m])' |
| 1925 | op: stddev_over_time |
| 1926 | position: |
| 1927 | start: 17 |
| 1928 | end: 24 |
| 1929 | type: function |
| 1930 | |
| 1931 | --- |
| 1932 | |
| 1933 | [TestLabelsSource/55 - 1] |
| 1934 | expr: stdvar_over_time(foo[5m]) |
| 1935 | output: |
| 1936 | - returns: vector |
| 1937 | operations: |
| 1938 | - node: '[*parser.VectorSelector] foo' |
| 1939 | op: "" |
| 1940 | - node: '[*parser.Call] stdvar_over_time(foo[5m])' |
| 1941 | op: stdvar_over_time |
| 1942 | position: |
| 1943 | start: 17 |
| 1944 | end: 24 |
| 1945 | type: function |
| 1946 | |
| 1947 | --- |
| 1948 | |
| 1949 | [TestLabelsSource/56 - 1] |
| 1950 | expr: quantile(0.9, rate(foo[5m])) |
| 1951 | output: |
| 1952 | - labels: |
| 1953 | "": |
| 1954 | reason: Query is using aggregation that removes all labels. |
| 1955 | kind: excluded |
| 1956 | fragment: |
| 1957 | start: 0 |
| 1958 | end: 8 |
| 1959 | __name__: |
| 1960 | reason: Aggregation removes metric name. |
| 1961 | kind: excluded |
| 1962 | fragment: |
| 1963 | start: 0 |
| 1964 | end: 28 |
| 1965 | returns: vector |
| 1966 | operations: |
| 1967 | - node: '[*parser.VectorSelector] foo' |
| 1968 | op: "" |
| 1969 | - node: '[*parser.Call] rate(foo[5m])' |
| 1970 | op: rate |
| 1971 | - args: |
| 1972 | - "0.9" |
| 1973 | node: '[*parser.AggregateExpr] quantile(0.9, rate(foo[5m]))' |
| 1974 | op: quantile |
| 1975 | position: |
| 1976 | start: 19 |
| 1977 | end: 26 |
| 1978 | type: aggregation |
| 1979 | fixedLabels: true |
| 1980 | |
| 1981 | --- |
| 1982 | |
| 1983 | [TestLabelsSource/57 - 1] |
| 1984 | expr: count_values("version", build_version) |
| 1985 | output: |
| 1986 | - labels: |
| 1987 | "": |
| 1988 | reason: Query is using aggregation that removes all labels. |
| 1989 | kind: excluded |
| 1990 | fragment: |
| 1991 | start: 0 |
| 1992 | end: 12 |
| 1993 | __name__: |
| 1994 | reason: Aggregation removes metric name. |
| 1995 | kind: excluded |
| 1996 | fragment: |
| 1997 | start: 0 |
| 1998 | end: 38 |
| 1999 | version: |
| 2000 | reason: This label will be added to the results by the count_values() call. |
| 2001 | kind: guaranteed |
| 2002 | fragment: |
| 2003 | start: 0 |
| 2004 | end: 38 |
| 2005 | returns: vector |
| 2006 | operations: |
| 2007 | - node: '[*parser.VectorSelector] build_version' |
| 2008 | op: "" |
| 2009 | - args: |
| 2010 | - '"version"' |
| 2011 | node: '[*parser.AggregateExpr] count_values("version", build_version)' |
| 2012 | op: count_values |
| 2013 | position: |
| 2014 | start: 24 |
| 2015 | end: 37 |
| 2016 | type: aggregation |
| 2017 | fixedLabels: true |
| 2018 | |
| 2019 | --- |
| 2020 | |
| 2021 | [TestLabelsSource/58 - 1] |
| 2022 | expr: count_values("version", build_version) without(job) |
| 2023 | output: |
| 2024 | - labels: |
| 2025 | __name__: |
| 2026 | reason: Aggregation removes metric name. |
| 2027 | kind: excluded |
| 2028 | fragment: |
| 2029 | start: 0 |
| 2030 | end: 51 |
| 2031 | job: |
| 2032 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 2033 | kind: excluded |
| 2034 | fragment: |
| 2035 | start: 47 |
| 2036 | end: 50 |
| 2037 | version: |
| 2038 | reason: This label will be added to the results by the count_values() call. |
| 2039 | kind: guaranteed |
| 2040 | fragment: |
| 2041 | start: 0 |
| 2042 | end: 51 |
| 2043 | returns: vector |
| 2044 | operations: |
| 2045 | - node: '[*parser.VectorSelector] build_version' |
| 2046 | op: "" |
| 2047 | - args: |
| 2048 | - '"version"' |
| 2049 | node: '[*parser.AggregateExpr] count_values without (job) ("version", build_version)' |
| 2050 | op: count_values |
| 2051 | position: |
| 2052 | start: 24 |
| 2053 | end: 37 |
| 2054 | type: aggregation |
| 2055 | |
| 2056 | --- |
| 2057 | |
| 2058 | [TestLabelsSource/59 - 1] |
| 2059 | expr: count_values("version", build_version{job="foo"}) without(job) |
| 2060 | output: |
| 2061 | - labels: |
| 2062 | __name__: |
| 2063 | reason: Aggregation removes metric name. |
| 2064 | kind: excluded |
| 2065 | fragment: |
| 2066 | start: 0 |
| 2067 | end: 62 |
| 2068 | job: |
| 2069 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 2070 | kind: excluded |
| 2071 | fragment: |
| 2072 | start: 58 |
| 2073 | end: 61 |
| 2074 | version: |
| 2075 | reason: This label will be added to the results by the count_values() call. |
| 2076 | kind: guaranteed |
| 2077 | fragment: |
| 2078 | start: 0 |
| 2079 | end: 62 |
| 2080 | returns: vector |
| 2081 | operations: |
| 2082 | - node: '[*parser.VectorSelector] build_version{job="foo"}' |
| 2083 | op: "" |
| 2084 | - args: |
| 2085 | - '"version"' |
| 2086 | node: '[*parser.AggregateExpr] count_values without (job) ("version", build_version{job="foo"})' |
| 2087 | op: count_values |
| 2088 | position: |
| 2089 | start: 24 |
| 2090 | end: 48 |
| 2091 | type: aggregation |
| 2092 | |
| 2093 | --- |
| 2094 | |
| 2095 | [TestLabelsSource/60 - 1] |
| 2096 | expr: count_values("version", build_version) by(job) |
| 2097 | output: |
| 2098 | - labels: |
| 2099 | "": |
| 2100 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 2101 | kind: excluded |
| 2102 | fragment: |
| 2103 | start: 39 |
| 2104 | end: 41 |
| 2105 | __name__: |
| 2106 | reason: Aggregation removes metric name. |
| 2107 | kind: excluded |
| 2108 | fragment: |
| 2109 | start: 0 |
| 2110 | end: 46 |
| 2111 | job: |
| 2112 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 2113 | kind: included |
| 2114 | fragment: |
| 2115 | start: 42 |
| 2116 | end: 45 |
| 2117 | version: |
| 2118 | reason: This label will be added to the results by the count_values() call. |
| 2119 | kind: guaranteed |
| 2120 | fragment: |
| 2121 | start: 0 |
| 2122 | end: 46 |
| 2123 | returns: vector |
| 2124 | operations: |
| 2125 | - node: '[*parser.VectorSelector] build_version' |
| 2126 | op: "" |
| 2127 | - args: |
| 2128 | - '"version"' |
| 2129 | node: '[*parser.AggregateExpr] count_values by (job) ("version", build_version)' |
| 2130 | op: count_values |
| 2131 | usedLabels: |
| 2132 | - job |
| 2133 | position: |
| 2134 | start: 24 |
| 2135 | end: 37 |
| 2136 | type: aggregation |
| 2137 | fixedLabels: true |
| 2138 | |
| 2139 | --- |
| 2140 | |
| 2141 | [TestLabelsSource/61 - 1] |
| 2142 | expr: topk(10, foo{job="myjob"}) > 10 |
| 2143 | output: |
| 2144 | - labels: |
| 2145 | job: |
| 2146 | reason: Query will only return series where these labels are present. |
| 2147 | kind: guaranteed |
| 2148 | fragment: |
| 2149 | start: 9 |
| 2150 | end: 25 |
| 2151 | returns: vector |
| 2152 | operations: |
| 2153 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2154 | op: "" |
| 2155 | - args: |
| 2156 | - "10" |
| 2157 | node: '[*parser.AggregateExpr] topk(10, foo{job="myjob"})' |
| 2158 | op: topk |
| 2159 | position: |
| 2160 | start: 9 |
| 2161 | end: 25 |
| 2162 | type: aggregation |
| 2163 | isConditional: true |
| 2164 | |
| 2165 | --- |
| 2166 | |
| 2167 | [TestLabelsSource/62 - 1] |
| 2168 | expr: topk(10, foo or bar) |
| 2169 | output: |
| 2170 | - returns: vector |
| 2171 | operations: |
| 2172 | - node: '[*parser.VectorSelector] foo' |
| 2173 | op: "" |
| 2174 | - args: |
| 2175 | - "10" |
| 2176 | node: '[*parser.AggregateExpr] topk(10, foo or bar)' |
| 2177 | op: topk |
| 2178 | position: |
| 2179 | start: 9 |
| 2180 | end: 12 |
| 2181 | type: aggregation |
| 2182 | - returns: vector |
| 2183 | operations: |
| 2184 | - node: '[*parser.VectorSelector] bar' |
| 2185 | op: "" |
| 2186 | - args: |
| 2187 | - "10" |
| 2188 | node: '[*parser.AggregateExpr] topk(10, foo or bar)' |
| 2189 | op: topk |
| 2190 | position: |
| 2191 | start: 16 |
| 2192 | end: 19 |
| 2193 | type: aggregation |
| 2194 | |
| 2195 | --- |
| 2196 | |
| 2197 | [TestLabelsSource/63 - 1] |
| 2198 | expr: rate(foo[10m]) |
| 2199 | output: |
| 2200 | - returns: vector |
| 2201 | operations: |
| 2202 | - node: '[*parser.VectorSelector] foo' |
| 2203 | op: "" |
| 2204 | - node: '[*parser.Call] rate(foo[10m])' |
| 2205 | op: rate |
| 2206 | position: |
| 2207 | start: 5 |
| 2208 | end: 13 |
| 2209 | type: function |
| 2210 | |
| 2211 | --- |
| 2212 | |
| 2213 | [TestLabelsSource/64 - 1] |
| 2214 | expr: sum(rate(foo[10m])) without(instance) |
| 2215 | output: |
| 2216 | - labels: |
| 2217 | __name__: |
| 2218 | reason: Aggregation removes metric name. |
| 2219 | kind: excluded |
| 2220 | fragment: |
| 2221 | start: 0 |
| 2222 | end: 37 |
| 2223 | instance: |
| 2224 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 2225 | kind: excluded |
| 2226 | fragment: |
| 2227 | start: 28 |
| 2228 | end: 36 |
| 2229 | returns: vector |
| 2230 | operations: |
| 2231 | - node: '[*parser.VectorSelector] foo' |
| 2232 | op: "" |
| 2233 | - node: '[*parser.Call] rate(foo[10m])' |
| 2234 | op: rate |
| 2235 | - node: '[*parser.AggregateExpr] sum without (instance) (rate(foo[10m]))' |
| 2236 | op: sum |
| 2237 | position: |
| 2238 | start: 9 |
| 2239 | end: 17 |
| 2240 | type: aggregation |
| 2241 | |
| 2242 | --- |
| 2243 | |
| 2244 | [TestLabelsSource/65 - 1] |
| 2245 | expr: foo{job="foo"} / bar |
| 2246 | output: |
| 2247 | - labels: |
| 2248 | __name__: |
| 2249 | reason: Binary operation between two vectors removes metric names. |
| 2250 | kind: excluded |
| 2251 | fragment: |
| 2252 | start: 0 |
| 2253 | end: 20 |
| 2254 | job: |
| 2255 | reason: Query will only return series where these labels are present. |
| 2256 | kind: guaranteed |
| 2257 | fragment: |
| 2258 | start: 0 |
| 2259 | end: 14 |
| 2260 | returns: vector |
| 2261 | operations: |
| 2262 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 2263 | op: "" |
| 2264 | joins: |
| 2265 | - matchinglabels: [] |
| 2266 | addedlabels: [] |
| 2267 | src: |
| 2268 | returns: vector |
| 2269 | operations: |
| 2270 | - node: '[*parser.VectorSelector] bar' |
| 2271 | op: "" |
| 2272 | position: |
| 2273 | start: 17 |
| 2274 | end: 20 |
| 2275 | type: selector |
| 2276 | op: 57384 |
| 2277 | depth: 0 |
| 2278 | ison: false |
| 2279 | usedLabels: |
| 2280 | - job |
| 2281 | position: |
| 2282 | start: 0 |
| 2283 | end: 14 |
| 2284 | type: selector |
| 2285 | |
| 2286 | --- |
| 2287 | |
| 2288 | [TestLabelsSource/66 - 1] |
| 2289 | expr: foo{job="foo"} * on(instance) bar |
| 2290 | output: |
| 2291 | - labels: |
| 2292 | "": |
| 2293 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 2294 | kind: excluded |
| 2295 | fragment: |
| 2296 | start: 17 |
| 2297 | end: 29 |
| 2298 | __name__: |
| 2299 | reason: Binary operation between two vectors removes metric names. |
| 2300 | kind: excluded |
| 2301 | fragment: |
| 2302 | start: 0 |
| 2303 | end: 33 |
| 2304 | instance: |
| 2305 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 2306 | kind: included |
| 2307 | fragment: |
| 2308 | start: 20 |
| 2309 | end: 28 |
| 2310 | job: |
| 2311 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 2312 | kind: excluded |
| 2313 | fragment: |
| 2314 | start: 17 |
| 2315 | end: 29 |
| 2316 | returns: vector |
| 2317 | operations: |
| 2318 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 2319 | op: "" |
| 2320 | joins: |
| 2321 | - matchinglabels: |
| 2322 | - instance |
| 2323 | addedlabels: [] |
| 2324 | src: |
| 2325 | returns: vector |
| 2326 | operations: |
| 2327 | - node: '[*parser.VectorSelector] bar' |
| 2328 | op: "" |
| 2329 | position: |
| 2330 | start: 30 |
| 2331 | end: 33 |
| 2332 | type: selector |
| 2333 | op: 57395 |
| 2334 | depth: 0 |
| 2335 | ison: true |
| 2336 | usedLabels: |
| 2337 | - instance |
| 2338 | position: |
| 2339 | start: 0 |
| 2340 | end: 14 |
| 2341 | type: selector |
| 2342 | fixedLabels: true |
| 2343 | |
| 2344 | --- |
| 2345 | |
| 2346 | [TestLabelsSource/67 - 1] |
| 2347 | expr: foo{job="foo"} * on(instance) group_left(bar) bar |
| 2348 | output: |
| 2349 | - labels: |
| 2350 | __name__: |
| 2351 | reason: Binary operation between two vectors removes metric names. |
| 2352 | kind: excluded |
| 2353 | fragment: |
| 2354 | start: 0 |
| 2355 | end: 49 |
| 2356 | bar: |
| 2357 | reason: Query is using `group_left(bar)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 2358 | kind: included |
| 2359 | fragment: |
| 2360 | start: 41 |
| 2361 | end: 44 |
| 2362 | instance: |
| 2363 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 2364 | kind: included |
| 2365 | fragment: |
| 2366 | start: 20 |
| 2367 | end: 28 |
| 2368 | job: |
| 2369 | reason: Query will only return series where these labels are present. |
| 2370 | kind: guaranteed |
| 2371 | fragment: |
| 2372 | start: 0 |
| 2373 | end: 14 |
| 2374 | returns: vector |
| 2375 | operations: |
| 2376 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 2377 | op: "" |
| 2378 | joins: |
| 2379 | - matchinglabels: |
| 2380 | - instance |
| 2381 | addedlabels: |
| 2382 | - bar |
| 2383 | src: |
| 2384 | returns: vector |
| 2385 | operations: |
| 2386 | - node: '[*parser.VectorSelector] bar' |
| 2387 | op: "" |
| 2388 | position: |
| 2389 | start: 46 |
| 2390 | end: 49 |
| 2391 | type: selector |
| 2392 | op: 57395 |
| 2393 | depth: 0 |
| 2394 | ison: true |
| 2395 | usedLabels: |
| 2396 | - instance |
| 2397 | position: |
| 2398 | start: 0 |
| 2399 | end: 14 |
| 2400 | type: selector |
| 2401 | |
| 2402 | --- |
| 2403 | |
| 2404 | [TestLabelsSource/68 - 1] |
| 2405 | expr: foo{job="foo"} * on(instance) group_left(cluster) bar{cluster="bar", ignored="true"} |
| 2406 | output: |
| 2407 | - labels: |
| 2408 | __name__: |
| 2409 | reason: Binary operation between two vectors removes metric names. |
| 2410 | kind: excluded |
| 2411 | fragment: |
| 2412 | start: 0 |
| 2413 | end: 84 |
| 2414 | cluster: |
| 2415 | reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 2416 | kind: included |
| 2417 | fragment: |
| 2418 | start: 41 |
| 2419 | end: 48 |
| 2420 | instance: |
| 2421 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 2422 | kind: included |
| 2423 | fragment: |
| 2424 | start: 20 |
| 2425 | end: 28 |
| 2426 | job: |
| 2427 | reason: Query will only return series where these labels are present. |
| 2428 | kind: guaranteed |
| 2429 | fragment: |
| 2430 | start: 0 |
| 2431 | end: 14 |
| 2432 | returns: vector |
| 2433 | operations: |
| 2434 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 2435 | op: "" |
| 2436 | joins: |
| 2437 | - matchinglabels: |
| 2438 | - instance |
| 2439 | addedlabels: |
| 2440 | - cluster |
| 2441 | src: |
| 2442 | labels: |
| 2443 | cluster: |
| 2444 | reason: Query will only return series where these labels are present. |
| 2445 | kind: guaranteed |
| 2446 | fragment: |
| 2447 | start: 50 |
| 2448 | end: 84 |
| 2449 | ignored: |
| 2450 | reason: Query will only return series where these labels are present. |
| 2451 | kind: guaranteed |
| 2452 | fragment: |
| 2453 | start: 50 |
| 2454 | end: 84 |
| 2455 | returns: vector |
| 2456 | operations: |
| 2457 | - node: '[*parser.VectorSelector] bar{cluster="bar",ignored="true"}' |
| 2458 | op: "" |
| 2459 | position: |
| 2460 | start: 50 |
| 2461 | end: 84 |
| 2462 | type: selector |
| 2463 | op: 57395 |
| 2464 | depth: 0 |
| 2465 | ison: true |
| 2466 | usedLabels: |
| 2467 | - instance |
| 2468 | position: |
| 2469 | start: 0 |
| 2470 | end: 14 |
| 2471 | type: selector |
| 2472 | |
| 2473 | --- |
| 2474 | |
| 2475 | [TestLabelsSource/69 - 1] |
| 2476 | expr: foo{job="foo", ignored="true"} * on(instance) group_right(job) bar{cluster="bar"} |
| 2477 | output: |
| 2478 | - labels: |
| 2479 | __name__: |
| 2480 | reason: Binary operation between two vectors removes metric names. |
| 2481 | kind: excluded |
| 2482 | fragment: |
| 2483 | start: 0 |
| 2484 | end: 81 |
| 2485 | cluster: |
| 2486 | reason: Query will only return series where these labels are present. |
| 2487 | kind: guaranteed |
| 2488 | fragment: |
| 2489 | start: 63 |
| 2490 | end: 81 |
| 2491 | instance: |
| 2492 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 2493 | kind: included |
| 2494 | fragment: |
| 2495 | start: 36 |
| 2496 | end: 44 |
| 2497 | job: |
| 2498 | reason: Query is using `group_right(job)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 2499 | kind: included |
| 2500 | fragment: |
| 2501 | start: 58 |
| 2502 | end: 61 |
| 2503 | returns: vector |
| 2504 | operations: |
| 2505 | - node: '[*parser.VectorSelector] bar{cluster="bar"}' |
| 2506 | op: "" |
| 2507 | joins: |
| 2508 | - matchinglabels: |
| 2509 | - instance |
| 2510 | addedlabels: |
| 2511 | - job |
| 2512 | src: |
| 2513 | labels: |
| 2514 | ignored: |
| 2515 | reason: Query will only return series where these labels are present. |
| 2516 | kind: guaranteed |
| 2517 | fragment: |
| 2518 | start: 0 |
| 2519 | end: 30 |
| 2520 | job: |
| 2521 | reason: Query will only return series where these labels are present. |
| 2522 | kind: guaranteed |
| 2523 | fragment: |
| 2524 | start: 0 |
| 2525 | end: 30 |
| 2526 | returns: vector |
| 2527 | operations: |
| 2528 | - node: '[*parser.VectorSelector] foo{ignored="true",job="foo"}' |
| 2529 | op: "" |
| 2530 | position: |
| 2531 | start: 0 |
| 2532 | end: 30 |
| 2533 | type: selector |
| 2534 | op: 57395 |
| 2535 | depth: 0 |
| 2536 | ison: true |
| 2537 | usedLabels: |
| 2538 | - instance |
| 2539 | position: |
| 2540 | start: 63 |
| 2541 | end: 81 |
| 2542 | type: selector |
| 2543 | |
| 2544 | --- |
| 2545 | |
| 2546 | [TestLabelsSource/70 - 1] |
| 2547 | expr: count(foo / bar) |
| 2548 | output: |
| 2549 | - labels: |
| 2550 | "": |
| 2551 | reason: Query is using aggregation that removes all labels. |
| 2552 | kind: excluded |
| 2553 | fragment: |
| 2554 | start: 0 |
| 2555 | end: 5 |
| 2556 | __name__: |
| 2557 | reason: Aggregation removes metric name. |
| 2558 | kind: excluded |
| 2559 | fragment: |
| 2560 | start: 0 |
| 2561 | end: 16 |
| 2562 | returns: vector |
| 2563 | operations: |
| 2564 | - node: '[*parser.VectorSelector] foo' |
| 2565 | op: "" |
| 2566 | - node: '[*parser.AggregateExpr] count(foo / bar)' |
| 2567 | op: count |
| 2568 | joins: |
| 2569 | - matchinglabels: [] |
| 2570 | addedlabels: [] |
| 2571 | src: |
| 2572 | returns: vector |
| 2573 | operations: |
| 2574 | - node: '[*parser.VectorSelector] bar' |
| 2575 | op: "" |
| 2576 | position: |
| 2577 | start: 12 |
| 2578 | end: 15 |
| 2579 | type: selector |
| 2580 | op: 57384 |
| 2581 | depth: 1 |
| 2582 | ison: false |
| 2583 | position: |
| 2584 | start: 6 |
| 2585 | end: 9 |
| 2586 | type: aggregation |
| 2587 | fixedLabels: true |
| 2588 | |
| 2589 | --- |
| 2590 | |
| 2591 | [TestLabelsSource/71 - 1] |
| 2592 | expr: count(up{job="a"} / on () up{job="b"}) |
| 2593 | output: |
| 2594 | - labels: |
| 2595 | "": |
| 2596 | reason: Query is using aggregation that removes all labels. |
| 2597 | kind: excluded |
| 2598 | fragment: |
| 2599 | start: 0 |
| 2600 | end: 5 |
| 2601 | __name__: |
| 2602 | reason: Aggregation removes metric name. |
| 2603 | kind: excluded |
| 2604 | fragment: |
| 2605 | start: 0 |
| 2606 | end: 38 |
| 2607 | job: |
| 2608 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 2609 | kind: excluded |
| 2610 | fragment: |
| 2611 | start: 20 |
| 2612 | end: 25 |
| 2613 | returns: vector |
| 2614 | operations: |
| 2615 | - node: '[*parser.VectorSelector] up{job="a"}' |
| 2616 | op: "" |
| 2617 | - node: '[*parser.AggregateExpr] count(up{job="a"} / on () up{job="b"})' |
| 2618 | op: count |
| 2619 | joins: |
| 2620 | - matchinglabels: [] |
| 2621 | addedlabels: [] |
| 2622 | src: |
| 2623 | labels: |
| 2624 | job: |
| 2625 | reason: Query will only return series where these labels are present. |
| 2626 | kind: guaranteed |
| 2627 | fragment: |
| 2628 | start: 26 |
| 2629 | end: 37 |
| 2630 | returns: vector |
| 2631 | operations: |
| 2632 | - node: '[*parser.VectorSelector] up{job="b"}' |
| 2633 | op: "" |
| 2634 | position: |
| 2635 | start: 26 |
| 2636 | end: 37 |
| 2637 | type: selector |
| 2638 | op: 57384 |
| 2639 | depth: 1 |
| 2640 | ison: true |
| 2641 | position: |
| 2642 | start: 6 |
| 2643 | end: 17 |
| 2644 | type: aggregation |
| 2645 | fixedLabels: true |
| 2646 | |
| 2647 | --- |
| 2648 | |
| 2649 | [TestLabelsSource/72 - 1] |
| 2650 | expr: count(up{job="a"} / on (env) up{job="b"}) |
| 2651 | output: |
| 2652 | - labels: |
| 2653 | "": |
| 2654 | reason: Query is using aggregation that removes all labels. |
| 2655 | kind: excluded |
| 2656 | fragment: |
| 2657 | start: 0 |
| 2658 | end: 5 |
| 2659 | __name__: |
| 2660 | reason: Aggregation removes metric name. |
| 2661 | kind: excluded |
| 2662 | fragment: |
| 2663 | start: 0 |
| 2664 | end: 41 |
| 2665 | env: |
| 2666 | reason: Query is using aggregation that removes all labels. |
| 2667 | kind: excluded |
| 2668 | fragment: |
| 2669 | start: 0 |
| 2670 | end: 5 |
| 2671 | job: |
| 2672 | reason: Query is using one-to-one vector matching with `on(env)`, only labels included inside `on(...)` will be present on the results. |
| 2673 | kind: excluded |
| 2674 | fragment: |
| 2675 | start: 20 |
| 2676 | end: 28 |
| 2677 | returns: vector |
| 2678 | operations: |
| 2679 | - node: '[*parser.VectorSelector] up{job="a"}' |
| 2680 | op: "" |
| 2681 | - node: '[*parser.AggregateExpr] count(up{job="a"} / on (env) up{job="b"})' |
| 2682 | op: count |
| 2683 | joins: |
| 2684 | - matchinglabels: |
| 2685 | - env |
| 2686 | addedlabels: [] |
| 2687 | src: |
| 2688 | labels: |
| 2689 | job: |
| 2690 | reason: Query will only return series where these labels are present. |
| 2691 | kind: guaranteed |
| 2692 | fragment: |
| 2693 | start: 29 |
| 2694 | end: 40 |
| 2695 | returns: vector |
| 2696 | operations: |
| 2697 | - node: '[*parser.VectorSelector] up{job="b"}' |
| 2698 | op: "" |
| 2699 | position: |
| 2700 | start: 29 |
| 2701 | end: 40 |
| 2702 | type: selector |
| 2703 | op: 57384 |
| 2704 | depth: 1 |
| 2705 | ison: true |
| 2706 | position: |
| 2707 | start: 6 |
| 2708 | end: 17 |
| 2709 | type: aggregation |
| 2710 | fixedLabels: true |
| 2711 | |
| 2712 | --- |
| 2713 | |
| 2714 | [TestLabelsSource/73 - 1] |
| 2715 | expr: foo{job="foo", instance="1"} and bar |
| 2716 | output: |
| 2717 | - labels: |
| 2718 | instance: |
| 2719 | reason: Query will only return series where these labels are present. |
| 2720 | kind: guaranteed |
| 2721 | fragment: |
| 2722 | start: 0 |
| 2723 | end: 28 |
| 2724 | job: |
| 2725 | reason: Query will only return series where these labels are present. |
| 2726 | kind: guaranteed |
| 2727 | fragment: |
| 2728 | start: 0 |
| 2729 | end: 28 |
| 2730 | returns: vector |
| 2731 | operations: |
| 2732 | - node: '[*parser.VectorSelector] foo{instance="1",job="foo"}' |
| 2733 | op: "" |
| 2734 | joins: |
| 2735 | - matchinglabels: [] |
| 2736 | addedlabels: [] |
| 2737 | src: |
| 2738 | returns: vector |
| 2739 | operations: |
| 2740 | - node: '[*parser.VectorSelector] bar' |
| 2741 | op: "" |
| 2742 | position: |
| 2743 | start: 33 |
| 2744 | end: 36 |
| 2745 | type: selector |
| 2746 | op: 57389 |
| 2747 | depth: 0 |
| 2748 | ison: false |
| 2749 | usedLabels: |
| 2750 | - instance |
| 2751 | - job |
| 2752 | position: |
| 2753 | start: 0 |
| 2754 | end: 28 |
| 2755 | type: selector |
| 2756 | |
| 2757 | --- |
| 2758 | |
| 2759 | [TestLabelsSource/74 - 1] |
| 2760 | expr: foo{job="foo", instance="1"} and on(cluster) bar |
| 2761 | output: |
| 2762 | - labels: |
| 2763 | cluster: |
| 2764 | reason: Query is using many-to-many vector matching with `on(cluster)`, labels included inside `on(...)` will be present on the results if matched time series have them. |
| 2765 | kind: included |
| 2766 | fragment: |
| 2767 | start: 36 |
| 2768 | end: 43 |
| 2769 | instance: |
| 2770 | reason: Query will only return series where these labels are present. |
| 2771 | kind: guaranteed |
| 2772 | fragment: |
| 2773 | start: 0 |
| 2774 | end: 28 |
| 2775 | job: |
| 2776 | reason: Query will only return series where these labels are present. |
| 2777 | kind: guaranteed |
| 2778 | fragment: |
| 2779 | start: 0 |
| 2780 | end: 28 |
| 2781 | returns: vector |
| 2782 | operations: |
| 2783 | - node: '[*parser.VectorSelector] foo{instance="1",job="foo"}' |
| 2784 | op: "" |
| 2785 | joins: |
| 2786 | - matchinglabels: |
| 2787 | - cluster |
| 2788 | addedlabels: [] |
| 2789 | src: |
| 2790 | returns: vector |
| 2791 | operations: |
| 2792 | - node: '[*parser.VectorSelector] bar' |
| 2793 | op: "" |
| 2794 | position: |
| 2795 | start: 45 |
| 2796 | end: 48 |
| 2797 | type: selector |
| 2798 | op: 57389 |
| 2799 | depth: 0 |
| 2800 | ison: true |
| 2801 | usedLabels: |
| 2802 | - cluster |
| 2803 | position: |
| 2804 | start: 0 |
| 2805 | end: 28 |
| 2806 | type: selector |
| 2807 | |
| 2808 | --- |
| 2809 | |
| 2810 | [TestLabelsSource/75 - 1] |
| 2811 | expr: topk(10, foo) |
| 2812 | output: |
| 2813 | - returns: vector |
| 2814 | operations: |
| 2815 | - node: '[*parser.VectorSelector] foo' |
| 2816 | op: "" |
| 2817 | - args: |
| 2818 | - "10" |
| 2819 | node: '[*parser.AggregateExpr] topk(10, foo)' |
| 2820 | op: topk |
| 2821 | position: |
| 2822 | start: 9 |
| 2823 | end: 12 |
| 2824 | type: aggregation |
| 2825 | |
| 2826 | --- |
| 2827 | |
| 2828 | [TestLabelsSource/76 - 1] |
| 2829 | expr: topk(10, foo) without(cluster) |
| 2830 | output: |
| 2831 | - returns: vector |
| 2832 | operations: |
| 2833 | - node: '[*parser.VectorSelector] foo' |
| 2834 | op: "" |
| 2835 | - args: |
| 2836 | - "10" |
| 2837 | node: '[*parser.AggregateExpr] topk without (cluster) (10, foo)' |
| 2838 | op: topk |
| 2839 | position: |
| 2840 | start: 9 |
| 2841 | end: 12 |
| 2842 | type: aggregation |
| 2843 | |
| 2844 | --- |
| 2845 | |
| 2846 | [TestLabelsSource/77 - 1] |
| 2847 | expr: topk(10, foo) by(cluster) |
| 2848 | output: |
| 2849 | - returns: vector |
| 2850 | operations: |
| 2851 | - node: '[*parser.VectorSelector] foo' |
| 2852 | op: "" |
| 2853 | - args: |
| 2854 | - "10" |
| 2855 | node: '[*parser.AggregateExpr] topk by (cluster) (10, foo)' |
| 2856 | op: topk |
| 2857 | position: |
| 2858 | start: 9 |
| 2859 | end: 12 |
| 2860 | type: aggregation |
| 2861 | |
| 2862 | --- |
| 2863 | |
| 2864 | [TestLabelsSource/78 - 1] |
| 2865 | expr: bottomk(10, sum(rate(foo[5m])) without(job)) |
| 2866 | output: |
| 2867 | - labels: |
| 2868 | __name__: |
| 2869 | reason: Aggregation removes metric name. |
| 2870 | kind: excluded |
| 2871 | fragment: |
| 2872 | start: 12 |
| 2873 | end: 43 |
| 2874 | job: |
| 2875 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 2876 | kind: excluded |
| 2877 | fragment: |
| 2878 | start: 39 |
| 2879 | end: 42 |
| 2880 | returns: vector |
| 2881 | operations: |
| 2882 | - node: '[*parser.VectorSelector] foo' |
| 2883 | op: "" |
| 2884 | - node: '[*parser.Call] rate(foo[5m])' |
| 2885 | op: rate |
| 2886 | - node: '[*parser.AggregateExpr] sum without (job) (rate(foo[5m]))' |
| 2887 | op: sum |
| 2888 | - args: |
| 2889 | - "10" |
| 2890 | node: '[*parser.AggregateExpr] bottomk(10, sum without (job) (rate(foo[5m])))' |
| 2891 | op: bottomk |
| 2892 | position: |
| 2893 | start: 21 |
| 2894 | end: 28 |
| 2895 | type: aggregation |
| 2896 | |
| 2897 | --- |
| 2898 | |
| 2899 | [TestLabelsSource/79 - 1] |
| 2900 | expr: foo or bar |
| 2901 | output: |
| 2902 | - returns: vector |
| 2903 | operations: |
| 2904 | - node: '[*parser.VectorSelector] foo' |
| 2905 | op: "" |
| 2906 | position: |
| 2907 | start: 0 |
| 2908 | end: 3 |
| 2909 | type: selector |
| 2910 | - returns: vector |
| 2911 | operations: |
| 2912 | - node: '[*parser.VectorSelector] bar' |
| 2913 | op: "" |
| 2914 | position: |
| 2915 | start: 7 |
| 2916 | end: 10 |
| 2917 | type: selector |
| 2918 | |
| 2919 | --- |
| 2920 | |
| 2921 | [TestLabelsSource/80 - 1] |
| 2922 | expr: foo or bar or baz |
| 2923 | output: |
| 2924 | - returns: vector |
| 2925 | operations: |
| 2926 | - node: '[*parser.VectorSelector] foo' |
| 2927 | op: "" |
| 2928 | position: |
| 2929 | start: 0 |
| 2930 | end: 3 |
| 2931 | type: selector |
| 2932 | - returns: vector |
| 2933 | operations: |
| 2934 | - node: '[*parser.VectorSelector] bar' |
| 2935 | op: "" |
| 2936 | position: |
| 2937 | start: 7 |
| 2938 | end: 10 |
| 2939 | type: selector |
| 2940 | - returns: vector |
| 2941 | operations: |
| 2942 | - node: '[*parser.VectorSelector] baz' |
| 2943 | op: "" |
| 2944 | position: |
| 2945 | start: 14 |
| 2946 | end: 17 |
| 2947 | type: selector |
| 2948 | |
| 2949 | --- |
| 2950 | |
| 2951 | [TestLabelsSource/81 - 1] |
| 2952 | expr: (foo or bar) or baz |
| 2953 | output: |
| 2954 | - returns: vector |
| 2955 | operations: |
| 2956 | - node: '[*parser.VectorSelector] foo' |
| 2957 | op: "" |
| 2958 | position: |
| 2959 | start: 1 |
| 2960 | end: 4 |
| 2961 | type: selector |
| 2962 | - returns: vector |
| 2963 | operations: |
| 2964 | - node: '[*parser.VectorSelector] bar' |
| 2965 | op: "" |
| 2966 | position: |
| 2967 | start: 8 |
| 2968 | end: 11 |
| 2969 | type: selector |
| 2970 | - returns: vector |
| 2971 | operations: |
| 2972 | - node: '[*parser.VectorSelector] baz' |
| 2973 | op: "" |
| 2974 | position: |
| 2975 | start: 16 |
| 2976 | end: 19 |
| 2977 | type: selector |
| 2978 | |
| 2979 | --- |
| 2980 | |
| 2981 | [TestLabelsSource/82 - 1] |
| 2982 | expr: foo unless bar |
| 2983 | output: |
| 2984 | - returns: vector |
| 2985 | operations: |
| 2986 | - node: '[*parser.VectorSelector] foo' |
| 2987 | op: "" |
| 2988 | unless: |
| 2989 | - matchinglabels: [] |
| 2990 | src: |
| 2991 | returns: vector |
| 2992 | operations: |
| 2993 | - node: '[*parser.VectorSelector] bar' |
| 2994 | op: "" |
| 2995 | position: |
| 2996 | start: 11 |
| 2997 | end: 14 |
| 2998 | type: selector |
| 2999 | ison: false |
| 3000 | position: |
| 3001 | start: 0 |
| 3002 | end: 3 |
| 3003 | type: selector |
| 3004 | |
| 3005 | --- |
| 3006 | |
| 3007 | [TestLabelsSource/83 - 1] |
| 3008 | expr: foo unless bar > 5 |
| 3009 | output: |
| 3010 | - returns: vector |
| 3011 | operations: |
| 3012 | - node: '[*parser.VectorSelector] foo' |
| 3013 | op: "" |
| 3014 | unless: |
| 3015 | - matchinglabels: [] |
| 3016 | src: |
| 3017 | returns: vector |
| 3018 | operations: |
| 3019 | - node: '[*parser.VectorSelector] bar' |
| 3020 | op: "" |
| 3021 | position: |
| 3022 | start: 11 |
| 3023 | end: 14 |
| 3024 | type: selector |
| 3025 | isConditional: true |
| 3026 | ison: false |
| 3027 | position: |
| 3028 | start: 0 |
| 3029 | end: 3 |
| 3030 | type: selector |
| 3031 | |
| 3032 | --- |
| 3033 | |
| 3034 | [TestLabelsSource/84 - 1] |
| 3035 | expr: foo unless bar unless baz |
| 3036 | output: |
| 3037 | - returns: vector |
| 3038 | operations: |
| 3039 | - node: '[*parser.VectorSelector] foo' |
| 3040 | op: "" |
| 3041 | unless: |
| 3042 | - matchinglabels: [] |
| 3043 | src: |
| 3044 | returns: vector |
| 3045 | operations: |
| 3046 | - node: '[*parser.VectorSelector] bar' |
| 3047 | op: "" |
| 3048 | position: |
| 3049 | start: 11 |
| 3050 | end: 14 |
| 3051 | type: selector |
| 3052 | ison: false |
| 3053 | - matchinglabels: [] |
| 3054 | src: |
| 3055 | returns: vector |
| 3056 | operations: |
| 3057 | - node: '[*parser.VectorSelector] baz' |
| 3058 | op: "" |
| 3059 | position: |
| 3060 | start: 22 |
| 3061 | end: 25 |
| 3062 | type: selector |
| 3063 | ison: false |
| 3064 | position: |
| 3065 | start: 0 |
| 3066 | end: 3 |
| 3067 | type: selector |
| 3068 | |
| 3069 | --- |
| 3070 | |
| 3071 | [TestLabelsSource/85 - 1] |
| 3072 | expr: count(sum(up{job="foo", cluster="dev"}) by(job, cluster) == 0) without(job, cluster) |
| 3073 | output: |
| 3074 | - labels: |
| 3075 | "": |
| 3076 | reason: Query is using aggregation with `by(job, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 3077 | kind: excluded |
| 3078 | fragment: |
| 3079 | start: 40 |
| 3080 | end: 42 |
| 3081 | __name__: |
| 3082 | reason: Aggregation removes metric name. |
| 3083 | kind: excluded |
| 3084 | fragment: |
| 3085 | start: 0 |
| 3086 | end: 84 |
| 3087 | cluster: |
| 3088 | reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results. |
| 3089 | kind: excluded |
| 3090 | fragment: |
| 3091 | start: 76 |
| 3092 | end: 83 |
| 3093 | job: |
| 3094 | reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results. |
| 3095 | kind: excluded |
| 3096 | fragment: |
| 3097 | start: 71 |
| 3098 | end: 74 |
| 3099 | returns: vector |
| 3100 | operations: |
| 3101 | - node: '[*parser.VectorSelector] up{cluster="dev",job="foo"}' |
| 3102 | op: "" |
| 3103 | - node: '[*parser.AggregateExpr] sum by (job, cluster) (up{cluster="dev",job="foo"})' |
| 3104 | op: sum |
| 3105 | - node: '[*parser.AggregateExpr] count without (job, cluster) (sum by (job, cluster) (up{cluster="dev",job="foo"}) == 0)' |
| 3106 | op: count |
| 3107 | position: |
| 3108 | start: 10 |
| 3109 | end: 38 |
| 3110 | type: aggregation |
| 3111 | fixedLabels: true |
| 3112 | isConditional: true |
| 3113 | |
| 3114 | --- |
| 3115 | |
| 3116 | [TestLabelsSource/86 - 1] |
| 3117 | expr: year() |
| 3118 | output: |
| 3119 | - labels: |
| 3120 | "": |
| 3121 | reason: Calling `year()` with no arguments will return an empty time series with no labels. |
| 3122 | kind: excluded |
| 3123 | fragment: |
| 3124 | start: 0 |
| 3125 | end: 6 |
| 3126 | returns: vector |
| 3127 | operations: |
| 3128 | - node: '[*parser.Call] year()' |
| 3129 | op: year |
| 3130 | returnInfo: |
| 3131 | logicalexpr: "" |
| 3132 | valueposition: |
| 3133 | start: 0 |
| 3134 | end: 0 |
| 3135 | returnednumber: 0 |
| 3136 | alwaysreturns: true |
| 3137 | knownreturn: false |
| 3138 | isreturnbool: false |
| 3139 | position: |
| 3140 | start: 0 |
| 3141 | end: 6 |
| 3142 | type: function |
| 3143 | fixedLabels: true |
| 3144 | |
| 3145 | --- |
| 3146 | |
| 3147 | [TestLabelsSource/87 - 1] |
| 3148 | expr: year(foo) |
| 3149 | output: |
| 3150 | - returns: vector |
| 3151 | operations: |
| 3152 | - node: '[*parser.VectorSelector] foo' |
| 3153 | op: "" |
| 3154 | - node: '[*parser.Call] year(foo)' |
| 3155 | op: year |
| 3156 | position: |
| 3157 | start: 5 |
| 3158 | end: 8 |
| 3159 | type: function |
| 3160 | |
| 3161 | --- |
| 3162 | |
| 3163 | [TestLabelsSource/88 - 1] |
| 3164 | expr: label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3") |
| 3165 | output: |
| 3166 | - labels: |
| 3167 | foo: |
| 3168 | reason: This label will be added to the result by label_join() call. |
| 3169 | kind: guaranteed |
| 3170 | fragment: |
| 3171 | start: 0 |
| 3172 | end: 95 |
| 3173 | job: |
| 3174 | reason: Query will only return series where these labels are present. |
| 3175 | kind: guaranteed |
| 3176 | fragment: |
| 3177 | start: 11 |
| 3178 | end: 58 |
| 3179 | src1: |
| 3180 | reason: Query will only return series where these labels are present. |
| 3181 | kind: guaranteed |
| 3182 | fragment: |
| 3183 | start: 11 |
| 3184 | end: 58 |
| 3185 | src2: |
| 3186 | reason: Query will only return series where these labels are present. |
| 3187 | kind: guaranteed |
| 3188 | fragment: |
| 3189 | start: 11 |
| 3190 | end: 58 |
| 3191 | src3: |
| 3192 | reason: Query will only return series where these labels are present. |
| 3193 | kind: guaranteed |
| 3194 | fragment: |
| 3195 | start: 11 |
| 3196 | end: 58 |
| 3197 | returns: vector |
| 3198 | operations: |
| 3199 | - node: '[*parser.VectorSelector] up{job="api-server",src1="a",src2="b",src3="c"}' |
| 3200 | op: "" |
| 3201 | - args: |
| 3202 | - '"foo"' |
| 3203 | - '","' |
| 3204 | - '"src1"' |
| 3205 | - '"src2"' |
| 3206 | - '"src3"' |
| 3207 | node: '[*parser.Call] label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")' |
| 3208 | op: label_join |
| 3209 | usedLabels: |
| 3210 | - src1 |
| 3211 | - src2 |
| 3212 | - src3 |
| 3213 | position: |
| 3214 | start: 11 |
| 3215 | end: 58 |
| 3216 | type: function |
| 3217 | |
| 3218 | --- |
| 3219 | |
| 3220 | [TestLabelsSource/89 - 1] |
| 3221 | expr: |4- |
| 3222 | |
| 3223 | ( |
| 3224 | sum(foo:sum > 0) without(notify) |
| 3225 | * on(job) group_left(notify) |
| 3226 | job:notify |
| 3227 | ) |
| 3228 | and on(job) |
| 3229 | sum(foo:count) by(job) > 20 |
| 3230 | output: |
| 3231 | - labels: |
| 3232 | __name__: |
| 3233 | reason: Binary operation between two vectors removes metric names. |
| 3234 | kind: excluded |
| 3235 | fragment: |
| 3236 | start: 4 |
| 3237 | end: 78 |
| 3238 | job: |
| 3239 | reason: Query is using many-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results if matched time series have them. |
| 3240 | kind: included |
| 3241 | fragment: |
| 3242 | start: 111 |
| 3243 | end: 114 |
| 3244 | notify: |
| 3245 | reason: Query is using `group_left(notify)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 3246 | kind: included |
| 3247 | fragment: |
| 3248 | start: 59 |
| 3249 | end: 65 |
| 3250 | returns: vector |
| 3251 | operations: |
| 3252 | - node: '[*parser.VectorSelector] foo:sum' |
| 3253 | op: "" |
| 3254 | - node: '[*parser.AggregateExpr] sum without (notify) (foo:sum > 0)' |
| 3255 | op: sum |
| 3256 | joins: |
| 3257 | - matchinglabels: |
| 3258 | - job |
| 3259 | addedlabels: |
| 3260 | - notify |
| 3261 | src: |
| 3262 | returns: vector |
| 3263 | operations: |
| 3264 | - node: '[*parser.VectorSelector] job:notify' |
| 3265 | op: "" |
| 3266 | position: |
| 3267 | start: 68 |
| 3268 | end: 78 |
| 3269 | type: selector |
| 3270 | op: 57395 |
| 3271 | depth: 0 |
| 3272 | ison: true |
| 3273 | - matchinglabels: |
| 3274 | - job |
| 3275 | addedlabels: [] |
| 3276 | src: |
| 3277 | labels: |
| 3278 | "": |
| 3279 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 3280 | kind: excluded |
| 3281 | fragment: |
| 3282 | start: 108 |
| 3283 | end: 110 |
| 3284 | __name__: |
| 3285 | reason: Aggregation removes metric name. |
| 3286 | kind: excluded |
| 3287 | fragment: |
| 3288 | start: 93 |
| 3289 | end: 115 |
| 3290 | job: |
| 3291 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 3292 | kind: included |
| 3293 | fragment: |
| 3294 | start: 111 |
| 3295 | end: 114 |
| 3296 | returns: vector |
| 3297 | operations: |
| 3298 | - node: '[*parser.VectorSelector] foo:count' |
| 3299 | op: "" |
| 3300 | - node: '[*parser.AggregateExpr] sum by (job) (foo:count)' |
| 3301 | op: sum |
| 3302 | usedLabels: |
| 3303 | - job |
| 3304 | position: |
| 3305 | start: 97 |
| 3306 | end: 106 |
| 3307 | type: aggregation |
| 3308 | fixedLabels: true |
| 3309 | isConditional: true |
| 3310 | op: 57389 |
| 3311 | depth: 0 |
| 3312 | ison: true |
| 3313 | usedLabels: |
| 3314 | - job |
| 3315 | position: |
| 3316 | start: 8 |
| 3317 | end: 15 |
| 3318 | type: aggregation |
| 3319 | isConditional: true |
| 3320 | |
| 3321 | --- |
| 3322 | |
| 3323 | [TestLabelsSource/90 - 1] |
| 3324 | expr: container_file_descriptors / on (instance, app_name) container_ulimits_soft{ulimit="max_open_files"} |
| 3325 | output: |
| 3326 | - labels: |
| 3327 | "": |
| 3328 | reason: Query is using one-to-one vector matching with `on(instance, app_name)`, only labels included inside `on(...)` will be present on the results. |
| 3329 | kind: excluded |
| 3330 | fragment: |
| 3331 | start: 29 |
| 3332 | end: 52 |
| 3333 | __name__: |
| 3334 | reason: Binary operation between two vectors removes metric names. |
| 3335 | kind: excluded |
| 3336 | fragment: |
| 3337 | start: 0 |
| 3338 | end: 100 |
| 3339 | app_name: |
| 3340 | reason: Query is using one-to-one vector matching with `on(instance, app_name)`, only labels included inside `on(...)` will be present on the results. |
| 3341 | kind: included |
| 3342 | fragment: |
| 3343 | start: 43 |
| 3344 | end: 51 |
| 3345 | instance: |
| 3346 | reason: Query is using one-to-one vector matching with `on(instance, app_name)`, only labels included inside `on(...)` will be present on the results. |
| 3347 | kind: included |
| 3348 | fragment: |
| 3349 | start: 33 |
| 3350 | end: 41 |
| 3351 | returns: vector |
| 3352 | operations: |
| 3353 | - node: '[*parser.VectorSelector] container_file_descriptors' |
| 3354 | op: "" |
| 3355 | joins: |
| 3356 | - matchinglabels: |
| 3357 | - instance |
| 3358 | - app_name |
| 3359 | addedlabels: [] |
| 3360 | src: |
| 3361 | labels: |
| 3362 | ulimit: |
| 3363 | reason: Query will only return series where these labels are present. |
| 3364 | kind: guaranteed |
| 3365 | fragment: |
| 3366 | start: 53 |
| 3367 | end: 100 |
| 3368 | returns: vector |
| 3369 | operations: |
| 3370 | - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}' |
| 3371 | op: "" |
| 3372 | position: |
| 3373 | start: 53 |
| 3374 | end: 100 |
| 3375 | type: selector |
| 3376 | op: 57384 |
| 3377 | depth: 0 |
| 3378 | ison: true |
| 3379 | usedLabels: |
| 3380 | - instance |
| 3381 | - app_name |
| 3382 | position: |
| 3383 | start: 0 |
| 3384 | end: 26 |
| 3385 | type: selector |
| 3386 | fixedLabels: true |
| 3387 | |
| 3388 | --- |
| 3389 | |
| 3390 | [TestLabelsSource/91 - 1] |
| 3391 | expr: container_file_descriptors / on (instance, app_name) group_left() container_ulimits_soft{ulimit="max_open_files"} |
| 3392 | output: |
| 3393 | - labels: |
| 3394 | __name__: |
| 3395 | reason: Binary operation between two vectors removes metric names. |
| 3396 | kind: excluded |
| 3397 | fragment: |
| 3398 | start: 0 |
| 3399 | end: 113 |
| 3400 | app_name: |
| 3401 | reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results. |
| 3402 | kind: included |
| 3403 | fragment: |
| 3404 | start: 43 |
| 3405 | end: 51 |
| 3406 | instance: |
| 3407 | reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results. |
| 3408 | kind: included |
| 3409 | fragment: |
| 3410 | start: 33 |
| 3411 | end: 41 |
| 3412 | returns: vector |
| 3413 | operations: |
| 3414 | - node: '[*parser.VectorSelector] container_file_descriptors' |
| 3415 | op: "" |
| 3416 | joins: |
| 3417 | - matchinglabels: |
| 3418 | - instance |
| 3419 | - app_name |
| 3420 | addedlabels: [] |
| 3421 | src: |
| 3422 | labels: |
| 3423 | ulimit: |
| 3424 | reason: Query will only return series where these labels are present. |
| 3425 | kind: guaranteed |
| 3426 | fragment: |
| 3427 | start: 66 |
| 3428 | end: 113 |
| 3429 | returns: vector |
| 3430 | operations: |
| 3431 | - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}' |
| 3432 | op: "" |
| 3433 | position: |
| 3434 | start: 66 |
| 3435 | end: 113 |
| 3436 | type: selector |
| 3437 | op: 57384 |
| 3438 | depth: 0 |
| 3439 | ison: true |
| 3440 | usedLabels: |
| 3441 | - instance |
| 3442 | - app_name |
| 3443 | position: |
| 3444 | start: 0 |
| 3445 | end: 26 |
| 3446 | type: selector |
| 3447 | |
| 3448 | --- |
| 3449 | |
| 3450 | [TestLabelsSource/92 - 1] |
| 3451 | expr: absent(foo{job="bar"}) |
| 3452 | output: |
| 3453 | - labels: |
| 3454 | "": |
| 3455 | reason: |- |
| 3456 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3457 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3458 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3459 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3460 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3461 | kind: excluded |
| 3462 | fragment: |
| 3463 | start: 0 |
| 3464 | end: 6 |
| 3465 | job: |
| 3466 | reason: All labels passed to absent() call will be present on the results if the query doesn't match anything. |
| 3467 | kind: guaranteed |
| 3468 | fragment: |
| 3469 | start: 0 |
| 3470 | end: 22 |
| 3471 | returns: vector |
| 3472 | operations: |
| 3473 | - node: '[*parser.VectorSelector] foo{job="bar"}' |
| 3474 | op: "" |
| 3475 | - node: '[*parser.Call] absent(foo{job="bar"})' |
| 3476 | op: absent |
| 3477 | usedLabels: |
| 3478 | - job |
| 3479 | position: |
| 3480 | start: 7 |
| 3481 | end: 21 |
| 3482 | type: function |
| 3483 | fixedLabels: true |
| 3484 | |
| 3485 | --- |
| 3486 | |
| 3487 | [TestLabelsSource/93 - 1] |
| 3488 | expr: absent(foo{job="bar", cluster!="dev", instance=~".+", env="prod"}) |
| 3489 | output: |
| 3490 | - labels: |
| 3491 | "": |
| 3492 | reason: |- |
| 3493 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3494 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3495 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3496 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3497 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3498 | kind: excluded |
| 3499 | fragment: |
| 3500 | start: 0 |
| 3501 | end: 6 |
| 3502 | env: |
| 3503 | reason: All labels passed to absent() call will be present on the results if the query doesn't match anything. |
| 3504 | kind: guaranteed |
| 3505 | fragment: |
| 3506 | start: 0 |
| 3507 | end: 66 |
| 3508 | instance: |
| 3509 | reason: |- |
| 3510 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3511 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3512 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3513 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3514 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3515 | kind: excluded |
| 3516 | fragment: |
| 3517 | start: 0 |
| 3518 | end: 6 |
| 3519 | job: |
| 3520 | reason: All labels passed to absent() call will be present on the results if the query doesn't match anything. |
| 3521 | kind: guaranteed |
| 3522 | fragment: |
| 3523 | start: 0 |
| 3524 | end: 66 |
| 3525 | returns: vector |
| 3526 | operations: |
| 3527 | - node: '[*parser.VectorSelector] foo{cluster!="dev",env="prod",instance=~".+",job="bar"}' |
| 3528 | op: "" |
| 3529 | - node: '[*parser.Call] absent(foo{cluster!="dev",env="prod",instance=~".+",job="bar"})' |
| 3530 | op: absent |
| 3531 | usedLabels: |
| 3532 | - job |
| 3533 | - env |
| 3534 | position: |
| 3535 | start: 7 |
| 3536 | end: 65 |
| 3537 | type: function |
| 3538 | fixedLabels: true |
| 3539 | |
| 3540 | --- |
| 3541 | |
| 3542 | [TestLabelsSource/94 - 1] |
| 3543 | expr: absent(sum(foo) by(job, instance)) |
| 3544 | output: |
| 3545 | - labels: |
| 3546 | "": |
| 3547 | reason: |- |
| 3548 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3549 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3550 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3551 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3552 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3553 | kind: excluded |
| 3554 | fragment: |
| 3555 | start: 0 |
| 3556 | end: 6 |
| 3557 | __name__: |
| 3558 | reason: Aggregation removes metric name. |
| 3559 | kind: excluded |
| 3560 | fragment: |
| 3561 | start: 7 |
| 3562 | end: 33 |
| 3563 | instance: |
| 3564 | reason: |- |
| 3565 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3566 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3567 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3568 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3569 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3570 | kind: excluded |
| 3571 | fragment: |
| 3572 | start: 0 |
| 3573 | end: 6 |
| 3574 | job: |
| 3575 | reason: |- |
| 3576 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3577 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3578 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3579 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3580 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3581 | kind: excluded |
| 3582 | fragment: |
| 3583 | start: 0 |
| 3584 | end: 6 |
| 3585 | returns: vector |
| 3586 | operations: |
| 3587 | - node: '[*parser.VectorSelector] foo' |
| 3588 | op: "" |
| 3589 | - node: '[*parser.AggregateExpr] sum by (job, instance) (foo)' |
| 3590 | op: sum |
| 3591 | - node: '[*parser.Call] absent(sum by (job, instance) (foo))' |
| 3592 | op: absent |
| 3593 | position: |
| 3594 | start: 7 |
| 3595 | end: 33 |
| 3596 | type: function |
| 3597 | fixedLabels: true |
| 3598 | |
| 3599 | --- |
| 3600 | |
| 3601 | [TestLabelsSource/95 - 1] |
| 3602 | expr: absent(foo{job="prometheus", xxx="1"}) AND on(job) prometheus_build_info |
| 3603 | output: |
| 3604 | - labels: |
| 3605 | "": |
| 3606 | reason: |- |
| 3607 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3608 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3609 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3610 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3611 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3612 | kind: excluded |
| 3613 | fragment: |
| 3614 | start: 0 |
| 3615 | end: 6 |
| 3616 | job: |
| 3617 | reason: All labels passed to absent() call will be present on the results if the query doesn't match anything. |
| 3618 | kind: guaranteed |
| 3619 | fragment: |
| 3620 | start: 0 |
| 3621 | end: 38 |
| 3622 | xxx: |
| 3623 | reason: All labels passed to absent() call will be present on the results if the query doesn't match anything. |
| 3624 | kind: guaranteed |
| 3625 | fragment: |
| 3626 | start: 0 |
| 3627 | end: 38 |
| 3628 | returns: vector |
| 3629 | operations: |
| 3630 | - node: '[*parser.VectorSelector] foo{job="prometheus",xxx="1"}' |
| 3631 | op: "" |
| 3632 | - node: '[*parser.Call] absent(foo{job="prometheus",xxx="1"})' |
| 3633 | op: absent |
| 3634 | joins: |
| 3635 | - matchinglabels: |
| 3636 | - job |
| 3637 | addedlabels: [] |
| 3638 | src: |
| 3639 | returns: vector |
| 3640 | operations: |
| 3641 | - node: '[*parser.VectorSelector] prometheus_build_info' |
| 3642 | op: "" |
| 3643 | position: |
| 3644 | start: 51 |
| 3645 | end: 72 |
| 3646 | type: selector |
| 3647 | op: 57389 |
| 3648 | depth: 0 |
| 3649 | ison: true |
| 3650 | usedLabels: |
| 3651 | - job |
| 3652 | - xxx |
| 3653 | position: |
| 3654 | start: 7 |
| 3655 | end: 37 |
| 3656 | type: function |
| 3657 | fixedLabels: true |
| 3658 | |
| 3659 | --- |
| 3660 | |
| 3661 | [TestLabelsSource/96 - 1] |
| 3662 | expr: 1 + sum(foo) by(notjob) |
| 3663 | output: |
| 3664 | - labels: |
| 3665 | "": |
| 3666 | reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results. |
| 3667 | kind: excluded |
| 3668 | fragment: |
| 3669 | start: 13 |
| 3670 | end: 15 |
| 3671 | __name__: |
| 3672 | reason: Aggregation removes metric name. |
| 3673 | kind: excluded |
| 3674 | fragment: |
| 3675 | start: 4 |
| 3676 | end: 23 |
| 3677 | notjob: |
| 3678 | reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results. |
| 3679 | kind: included |
| 3680 | fragment: |
| 3681 | start: 16 |
| 3682 | end: 22 |
| 3683 | returns: vector |
| 3684 | operations: |
| 3685 | - node: '[*parser.VectorSelector] foo' |
| 3686 | op: "" |
| 3687 | - node: '[*parser.AggregateExpr] sum by (notjob) (foo)' |
| 3688 | op: sum |
| 3689 | usedLabels: |
| 3690 | - notjob |
| 3691 | position: |
| 3692 | start: 8 |
| 3693 | end: 11 |
| 3694 | type: aggregation |
| 3695 | fixedLabels: true |
| 3696 | |
| 3697 | --- |
| 3698 | |
| 3699 | [TestLabelsSource/97 - 1] |
| 3700 | expr: count(node_exporter_build_info) by (instance, version) != ignoring(package,version) group_left(foo) count(deb_package_version) by (instance, version, package) |
| 3701 | output: |
| 3702 | - labels: |
| 3703 | "": |
| 3704 | reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results. |
| 3705 | kind: excluded |
| 3706 | fragment: |
| 3707 | start: 32 |
| 3708 | end: 35 |
| 3709 | __name__: |
| 3710 | reason: Binary operation between two vectors removes metric names. |
| 3711 | kind: excluded |
| 3712 | fragment: |
| 3713 | start: 0 |
| 3714 | end: 158 |
| 3715 | foo: |
| 3716 | reason: Query is using `group_left(foo)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 3717 | kind: included |
| 3718 | fragment: |
| 3719 | start: 95 |
| 3720 | end: 98 |
| 3721 | instance: |
| 3722 | reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results. |
| 3723 | kind: included |
| 3724 | fragment: |
| 3725 | start: 36 |
| 3726 | end: 44 |
| 3727 | version: |
| 3728 | reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results. |
| 3729 | kind: included |
| 3730 | fragment: |
| 3731 | start: 46 |
| 3732 | end: 53 |
| 3733 | returns: vector |
| 3734 | operations: |
| 3735 | - node: '[*parser.VectorSelector] node_exporter_build_info' |
| 3736 | op: "" |
| 3737 | - node: '[*parser.AggregateExpr] count by (instance, version) (node_exporter_build_info)' |
| 3738 | op: count |
| 3739 | joins: |
| 3740 | - matchinglabels: |
| 3741 | - package |
| 3742 | - version |
| 3743 | addedlabels: |
| 3744 | - foo |
| 3745 | src: |
| 3746 | labels: |
| 3747 | "": |
| 3748 | reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 3749 | kind: excluded |
| 3750 | fragment: |
| 3751 | start: 127 |
| 3752 | end: 130 |
| 3753 | __name__: |
| 3754 | reason: Aggregation removes metric name. |
| 3755 | kind: excluded |
| 3756 | fragment: |
| 3757 | start: 100 |
| 3758 | end: 158 |
| 3759 | instance: |
| 3760 | reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 3761 | kind: included |
| 3762 | fragment: |
| 3763 | start: 131 |
| 3764 | end: 139 |
| 3765 | package: |
| 3766 | reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 3767 | kind: included |
| 3768 | fragment: |
| 3769 | start: 150 |
| 3770 | end: 157 |
| 3771 | version: |
| 3772 | reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 3773 | kind: included |
| 3774 | fragment: |
| 3775 | start: 141 |
| 3776 | end: 148 |
| 3777 | deadLabels: |
| 3778 | - name: foo |
| 3779 | reason: You can't use `foo` because this label is not possible here. |
| 3780 | labelreason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 3781 | usagefragment: |
| 3782 | start: 95 |
| 3783 | end: 98 |
| 3784 | labelfragment: |
| 3785 | start: 127 |
| 3786 | end: 130 |
| 3787 | kind: 0 |
| 3788 | returns: vector |
| 3789 | operations: |
| 3790 | - node: '[*parser.VectorSelector] deb_package_version' |
| 3791 | op: "" |
| 3792 | - node: '[*parser.AggregateExpr] count by (instance, version, package) (deb_package_version)' |
| 3793 | op: count |
| 3794 | usedLabels: |
| 3795 | - instance |
| 3796 | - version |
| 3797 | - package |
| 3798 | position: |
| 3799 | start: 106 |
| 3800 | end: 125 |
| 3801 | type: aggregation |
| 3802 | fixedLabels: true |
| 3803 | op: 57396 |
| 3804 | depth: 0 |
| 3805 | ison: false |
| 3806 | usedLabels: |
| 3807 | - instance |
| 3808 | - version |
| 3809 | - foo |
| 3810 | position: |
| 3811 | start: 6 |
| 3812 | end: 30 |
| 3813 | type: aggregation |
| 3814 | fixedLabels: true |
| 3815 | isConditional: true |
| 3816 | |
| 3817 | --- |
| 3818 | |
| 3819 | [TestLabelsSource/98 - 1] |
| 3820 | expr: absent(foo) or absent(bar) |
| 3821 | output: |
| 3822 | - labels: |
| 3823 | "": |
| 3824 | reason: |- |
| 3825 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3826 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3827 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3828 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3829 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3830 | kind: excluded |
| 3831 | fragment: |
| 3832 | start: 0 |
| 3833 | end: 6 |
| 3834 | returns: vector |
| 3835 | operations: |
| 3836 | - node: '[*parser.VectorSelector] foo' |
| 3837 | op: "" |
| 3838 | - node: '[*parser.Call] absent(foo)' |
| 3839 | op: absent |
| 3840 | position: |
| 3841 | start: 7 |
| 3842 | end: 10 |
| 3843 | type: function |
| 3844 | fixedLabels: true |
| 3845 | - labels: |
| 3846 | "": |
| 3847 | reason: |- |
| 3848 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3849 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3850 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3851 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3852 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3853 | kind: excluded |
| 3854 | fragment: |
| 3855 | start: 15 |
| 3856 | end: 21 |
| 3857 | returns: vector |
| 3858 | operations: |
| 3859 | - node: '[*parser.VectorSelector] bar' |
| 3860 | op: "" |
| 3861 | - node: '[*parser.Call] absent(bar)' |
| 3862 | op: absent |
| 3863 | position: |
| 3864 | start: 22 |
| 3865 | end: 25 |
| 3866 | type: function |
| 3867 | fixedLabels: true |
| 3868 | |
| 3869 | --- |
| 3870 | |
| 3871 | [TestLabelsSource/99 - 1] |
| 3872 | expr: absent(vector(1)) |
| 3873 | output: |
| 3874 | - labels: |
| 3875 | "": |
| 3876 | reason: |- |
| 3877 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3878 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3879 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3880 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3881 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3882 | kind: excluded |
| 3883 | fragment: |
| 3884 | start: 0 |
| 3885 | end: 6 |
| 3886 | returns: vector |
| 3887 | operations: |
| 3888 | - args: |
| 3889 | - "1" |
| 3890 | node: '[*parser.Call] vector(1)' |
| 3891 | op: vector |
| 3892 | - node: '[*parser.Call] absent(vector(1))' |
| 3893 | op: absent |
| 3894 | returnInfo: |
| 3895 | logicalexpr: "" |
| 3896 | valueposition: |
| 3897 | start: 7 |
| 3898 | end: 16 |
| 3899 | returnednumber: 1 |
| 3900 | alwaysreturns: true |
| 3901 | knownreturn: true |
| 3902 | isreturnbool: false |
| 3903 | position: |
| 3904 | start: 7 |
| 3905 | end: 16 |
| 3906 | type: function |
| 3907 | fixedLabels: true |
| 3908 | |
| 3909 | --- |
| 3910 | |
| 3911 | [TestLabelsSource/100 - 1] |
| 3912 | expr: absent_over_time(foo[5m]) or absent(bar) |
| 3913 | output: |
| 3914 | - labels: |
| 3915 | "": |
| 3916 | reason: |- |
| 3917 | The [absent_over_time()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent_over_time) function is used to check if provided query doesn't match any time series. |
| 3918 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3919 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3920 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3921 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3922 | kind: excluded |
| 3923 | fragment: |
| 3924 | start: 0 |
| 3925 | end: 16 |
| 3926 | returns: vector |
| 3927 | operations: |
| 3928 | - node: '[*parser.VectorSelector] foo' |
| 3929 | op: "" |
| 3930 | - node: '[*parser.Call] absent_over_time(foo[5m])' |
| 3931 | op: absent_over_time |
| 3932 | position: |
| 3933 | start: 17 |
| 3934 | end: 24 |
| 3935 | type: function |
| 3936 | fixedLabels: true |
| 3937 | - labels: |
| 3938 | "": |
| 3939 | reason: |- |
| 3940 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3941 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3942 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3943 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3944 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3945 | kind: excluded |
| 3946 | fragment: |
| 3947 | start: 29 |
| 3948 | end: 35 |
| 3949 | returns: vector |
| 3950 | operations: |
| 3951 | - node: '[*parser.VectorSelector] bar' |
| 3952 | op: "" |
| 3953 | - node: '[*parser.Call] absent(bar)' |
| 3954 | op: absent |
| 3955 | position: |
| 3956 | start: 36 |
| 3957 | end: 39 |
| 3958 | type: function |
| 3959 | fixedLabels: true |
| 3960 | |
| 3961 | --- |
| 3962 | |
| 3963 | [TestLabelsSource/101 - 1] |
| 3964 | expr: bar * on() group_right(cluster, env) absent(foo{job="xxx"}) |
| 3965 | output: |
| 3966 | - labels: |
| 3967 | "": |
| 3968 | reason: |- |
| 3969 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 3970 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 3971 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 3972 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 3973 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 3974 | kind: excluded |
| 3975 | fragment: |
| 3976 | start: 37 |
| 3977 | end: 43 |
| 3978 | __name__: |
| 3979 | reason: Binary operation between two vectors removes metric names. |
| 3980 | kind: excluded |
| 3981 | fragment: |
| 3982 | start: 0 |
| 3983 | end: 59 |
| 3984 | cluster: |
| 3985 | reason: Query is using `group_right(cluster, env)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 3986 | kind: included |
| 3987 | fragment: |
| 3988 | start: 23 |
| 3989 | end: 30 |
| 3990 | env: |
| 3991 | reason: Query is using `group_right(cluster, env)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 3992 | kind: included |
| 3993 | fragment: |
| 3994 | start: 32 |
| 3995 | end: 35 |
| 3996 | job: |
| 3997 | reason: All labels passed to absent() call will be present on the results if the query doesn't match anything. |
| 3998 | kind: guaranteed |
| 3999 | fragment: |
| 4000 | start: 37 |
| 4001 | end: 59 |
| 4002 | returns: vector |
| 4003 | operations: |
| 4004 | - node: '[*parser.VectorSelector] foo{job="xxx"}' |
| 4005 | op: "" |
| 4006 | - node: '[*parser.Call] absent(foo{job="xxx"})' |
| 4007 | op: absent |
| 4008 | joins: |
| 4009 | - matchinglabels: [] |
| 4010 | addedlabels: |
| 4011 | - cluster |
| 4012 | - env |
| 4013 | src: |
| 4014 | returns: vector |
| 4015 | operations: |
| 4016 | - node: '[*parser.VectorSelector] bar' |
| 4017 | op: "" |
| 4018 | position: |
| 4019 | start: 0 |
| 4020 | end: 3 |
| 4021 | type: selector |
| 4022 | op: 57395 |
| 4023 | depth: 0 |
| 4024 | ison: true |
| 4025 | usedLabels: |
| 4026 | - job |
| 4027 | position: |
| 4028 | start: 44 |
| 4029 | end: 58 |
| 4030 | type: function |
| 4031 | fixedLabels: true |
| 4032 | |
| 4033 | --- |
| 4034 | |
| 4035 | [TestLabelsSource/102 - 1] |
| 4036 | expr: bar * on() group_right() absent(foo{job="xxx"}) |
| 4037 | output: |
| 4038 | - labels: |
| 4039 | "": |
| 4040 | reason: |- |
| 4041 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 4042 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 4043 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 4044 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 4045 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 4046 | kind: excluded |
| 4047 | fragment: |
| 4048 | start: 25 |
| 4049 | end: 31 |
| 4050 | __name__: |
| 4051 | reason: Binary operation between two vectors removes metric names. |
| 4052 | kind: excluded |
| 4053 | fragment: |
| 4054 | start: 0 |
| 4055 | end: 47 |
| 4056 | job: |
| 4057 | reason: All labels passed to absent() call will be present on the results if the query doesn't match anything. |
| 4058 | kind: guaranteed |
| 4059 | fragment: |
| 4060 | start: 25 |
| 4061 | end: 47 |
| 4062 | returns: vector |
| 4063 | operations: |
| 4064 | - node: '[*parser.VectorSelector] foo{job="xxx"}' |
| 4065 | op: "" |
| 4066 | - node: '[*parser.Call] absent(foo{job="xxx"})' |
| 4067 | op: absent |
| 4068 | joins: |
| 4069 | - matchinglabels: [] |
| 4070 | addedlabels: [] |
| 4071 | src: |
| 4072 | returns: vector |
| 4073 | operations: |
| 4074 | - node: '[*parser.VectorSelector] bar' |
| 4075 | op: "" |
| 4076 | position: |
| 4077 | start: 0 |
| 4078 | end: 3 |
| 4079 | type: selector |
| 4080 | op: 57395 |
| 4081 | depth: 0 |
| 4082 | ison: true |
| 4083 | usedLabels: |
| 4084 | - job |
| 4085 | position: |
| 4086 | start: 32 |
| 4087 | end: 46 |
| 4088 | type: function |
| 4089 | fixedLabels: true |
| 4090 | |
| 4091 | --- |
| 4092 | |
| 4093 | [TestLabelsSource/103 - 1] |
| 4094 | expr: vector(1) |
| 4095 | output: |
| 4096 | - labels: |
| 4097 | "": |
| 4098 | reason: Calling `vector()` will return a vector value with no labels. |
| 4099 | kind: excluded |
| 4100 | fragment: |
| 4101 | start: 0 |
| 4102 | end: 6 |
| 4103 | returns: vector |
| 4104 | operations: |
| 4105 | - args: |
| 4106 | - "1" |
| 4107 | node: '[*parser.Call] vector(1)' |
| 4108 | op: vector |
| 4109 | returnInfo: |
| 4110 | logicalexpr: "" |
| 4111 | valueposition: |
| 4112 | start: 0 |
| 4113 | end: 9 |
| 4114 | returnednumber: 1 |
| 4115 | alwaysreturns: true |
| 4116 | knownreturn: true |
| 4117 | isreturnbool: false |
| 4118 | position: |
| 4119 | start: 0 |
| 4120 | end: 9 |
| 4121 | type: function |
| 4122 | fixedLabels: true |
| 4123 | |
| 4124 | --- |
| 4125 | |
| 4126 | [TestLabelsSource/104 - 1] |
| 4127 | expr: vector(scalar(foo)) |
| 4128 | output: |
| 4129 | - labels: |
| 4130 | "": |
| 4131 | reason: Calling `vector()` will return a vector value with no labels. |
| 4132 | kind: excluded |
| 4133 | fragment: |
| 4134 | start: 0 |
| 4135 | end: 6 |
| 4136 | returns: vector |
| 4137 | operations: |
| 4138 | - args: |
| 4139 | - scalar(foo) |
| 4140 | node: '[*parser.Call] vector(scalar(foo))' |
| 4141 | op: vector |
| 4142 | returnInfo: |
| 4143 | logicalexpr: "" |
| 4144 | valueposition: |
| 4145 | start: 0 |
| 4146 | end: 19 |
| 4147 | returnednumber: 0 |
| 4148 | alwaysreturns: true |
| 4149 | knownreturn: false |
| 4150 | isreturnbool: false |
| 4151 | position: |
| 4152 | start: 0 |
| 4153 | end: 19 |
| 4154 | type: function |
| 4155 | fixedLabels: true |
| 4156 | |
| 4157 | --- |
| 4158 | |
| 4159 | [TestLabelsSource/105 - 1] |
| 4160 | expr: vector(0.0 >= bool 0.5) == 1 |
| 4161 | output: |
| 4162 | - labels: |
| 4163 | "": |
| 4164 | reason: Calling `vector()` will return a vector value with no labels. |
| 4165 | kind: excluded |
| 4166 | fragment: |
| 4167 | start: 0 |
| 4168 | end: 6 |
| 4169 | deadInfo: |
| 4170 | reason: '`vector(0.0 >= bool 0.5) == 1` always evaluates to `0 == 1` which is not possible, so it will never return anything.' |
| 4171 | fragment: |
| 4172 | start: 0 |
| 4173 | end: 24 |
| 4174 | returns: vector |
| 4175 | operations: |
| 4176 | - args: |
| 4177 | - 0 >= bool 0.5 |
| 4178 | node: '[*parser.Call] vector(0 >= bool 0.5)' |
| 4179 | op: vector |
| 4180 | returnInfo: |
| 4181 | logicalexpr: "" |
| 4182 | valueposition: |
| 4183 | start: 0 |
| 4184 | end: 24 |
| 4185 | returnednumber: 0 |
| 4186 | alwaysreturns: true |
| 4187 | knownreturn: true |
| 4188 | isreturnbool: false |
| 4189 | position: |
| 4190 | start: 0 |
| 4191 | end: 24 |
| 4192 | type: function |
| 4193 | fixedLabels: true |
| 4194 | isConditional: true |
| 4195 | |
| 4196 | --- |
| 4197 | |
| 4198 | [TestLabelsSource/106 - 1] |
| 4199 | expr: sum_over_time(foo{job="myjob"}[5m]) |
| 4200 | output: |
| 4201 | - labels: |
| 4202 | job: |
| 4203 | reason: Query will only return series where these labels are present. |
| 4204 | kind: guaranteed |
| 4205 | fragment: |
| 4206 | start: 0 |
| 4207 | end: 35 |
| 4208 | returns: vector |
| 4209 | operations: |
| 4210 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 4211 | op: "" |
| 4212 | - node: '[*parser.Call] sum_over_time(foo{job="myjob"}[5m])' |
| 4213 | op: sum_over_time |
| 4214 | position: |
| 4215 | start: 14 |
| 4216 | end: 34 |
| 4217 | type: function |
| 4218 | |
| 4219 | --- |
| 4220 | |
| 4221 | [TestLabelsSource/107 - 1] |
| 4222 | expr: days_in_month() |
| 4223 | output: |
| 4224 | - labels: |
| 4225 | "": |
| 4226 | reason: Calling `days_in_month()` with no arguments will return an empty time series with no labels. |
| 4227 | kind: excluded |
| 4228 | fragment: |
| 4229 | start: 0 |
| 4230 | end: 15 |
| 4231 | returns: vector |
| 4232 | operations: |
| 4233 | - node: '[*parser.Call] days_in_month()' |
| 4234 | op: days_in_month |
| 4235 | returnInfo: |
| 4236 | logicalexpr: "" |
| 4237 | valueposition: |
| 4238 | start: 0 |
| 4239 | end: 0 |
| 4240 | returnednumber: 0 |
| 4241 | alwaysreturns: true |
| 4242 | knownreturn: false |
| 4243 | isreturnbool: false |
| 4244 | position: |
| 4245 | start: 0 |
| 4246 | end: 15 |
| 4247 | type: function |
| 4248 | fixedLabels: true |
| 4249 | |
| 4250 | --- |
| 4251 | |
| 4252 | [TestLabelsSource/108 - 1] |
| 4253 | expr: days_in_month(foo{job="foo"}) |
| 4254 | output: |
| 4255 | - labels: |
| 4256 | job: |
| 4257 | reason: Query will only return series where these labels are present. |
| 4258 | kind: guaranteed |
| 4259 | fragment: |
| 4260 | start: 0 |
| 4261 | end: 29 |
| 4262 | returns: vector |
| 4263 | operations: |
| 4264 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 4265 | op: "" |
| 4266 | - node: '[*parser.Call] days_in_month(foo{job="foo"})' |
| 4267 | op: days_in_month |
| 4268 | position: |
| 4269 | start: 14 |
| 4270 | end: 28 |
| 4271 | type: function |
| 4272 | |
| 4273 | --- |
| 4274 | |
| 4275 | [TestLabelsSource/109 - 1] |
| 4276 | expr: label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*") |
| 4277 | output: |
| 4278 | - labels: |
| 4279 | foo: |
| 4280 | reason: This label will be added to the result by label_replace() call. |
| 4281 | kind: guaranteed |
| 4282 | fragment: |
| 4283 | start: 0 |
| 4284 | end: 84 |
| 4285 | job: |
| 4286 | reason: Query will only return series where these labels are present. |
| 4287 | kind: guaranteed |
| 4288 | fragment: |
| 4289 | start: 14 |
| 4290 | end: 48 |
| 4291 | service: |
| 4292 | reason: Query will only return series where these labels are present. |
| 4293 | kind: guaranteed |
| 4294 | fragment: |
| 4295 | start: 14 |
| 4296 | end: 48 |
| 4297 | returns: vector |
| 4298 | operations: |
| 4299 | - node: '[*parser.VectorSelector] up{job="api-server",service="a:c"}' |
| 4300 | op: "" |
| 4301 | - args: |
| 4302 | - '"foo"' |
| 4303 | - '"$1"' |
| 4304 | - '"service"' |
| 4305 | - '"(.*):.*"' |
| 4306 | node: '[*parser.Call] label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*")' |
| 4307 | op: label_replace |
| 4308 | usedLabels: |
| 4309 | - service |
| 4310 | position: |
| 4311 | start: 14 |
| 4312 | end: 48 |
| 4313 | type: function |
| 4314 | |
| 4315 | --- |
| 4316 | |
| 4317 | [TestLabelsSource/110 - 1] |
| 4318 | expr: label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)") |
| 4319 | output: |
| 4320 | - labels: |
| 4321 | "": |
| 4322 | reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results. |
| 4323 | kind: excluded |
| 4324 | fragment: |
| 4325 | start: 18 |
| 4326 | end: 21 |
| 4327 | __name__: |
| 4328 | reason: Aggregation removes metric name. |
| 4329 | kind: excluded |
| 4330 | fragment: |
| 4331 | start: 14 |
| 4332 | end: 39 |
| 4333 | cluster: |
| 4334 | reason: This label will be added to the result by label_replace() call. |
| 4335 | kind: guaranteed |
| 4336 | fragment: |
| 4337 | start: 0 |
| 4338 | end: 76 |
| 4339 | pod: |
| 4340 | reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results. |
| 4341 | kind: included |
| 4342 | fragment: |
| 4343 | start: 22 |
| 4344 | end: 25 |
| 4345 | returns: vector |
| 4346 | operations: |
| 4347 | - node: '[*parser.VectorSelector] pod_status' |
| 4348 | op: "" |
| 4349 | - node: '[*parser.AggregateExpr] sum by (pod) (pod_status)' |
| 4350 | op: sum |
| 4351 | - args: |
| 4352 | - '"cluster"' |
| 4353 | - '"$1"' |
| 4354 | - '"pod"' |
| 4355 | - '"(.*)"' |
| 4356 | node: '[*parser.Call] label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)")' |
| 4357 | op: label_replace |
| 4358 | usedLabels: |
| 4359 | - pod |
| 4360 | position: |
| 4361 | start: 14 |
| 4362 | end: 43 |
| 4363 | type: function |
| 4364 | fixedLabels: true |
| 4365 | isConditional: true |
| 4366 | |
| 4367 | --- |
| 4368 | |
| 4369 | [TestLabelsSource/111 - 1] |
| 4370 | expr: (time() - my_metric) > 5*3600 |
| 4371 | output: |
| 4372 | - returns: vector |
| 4373 | operations: |
| 4374 | - node: '[*parser.VectorSelector] my_metric' |
| 4375 | op: "" |
| 4376 | position: |
| 4377 | start: 10 |
| 4378 | end: 19 |
| 4379 | type: selector |
| 4380 | isConditional: true |
| 4381 | |
| 4382 | --- |
| 4383 | |
| 4384 | [TestLabelsSource/112 - 1] |
| 4385 | expr: up{instance="a", job="prometheus"} * ignoring(job) up{instance="a", job="pint"} |
| 4386 | output: |
| 4387 | - labels: |
| 4388 | __name__: |
| 4389 | reason: Binary operation between two vectors removes metric names. |
| 4390 | kind: excluded |
| 4391 | fragment: |
| 4392 | start: 0 |
| 4393 | end: 79 |
| 4394 | instance: |
| 4395 | reason: Query will only return series where these labels are present. |
| 4396 | kind: guaranteed |
| 4397 | fragment: |
| 4398 | start: 0 |
| 4399 | end: 34 |
| 4400 | job: |
| 4401 | reason: Query is using one-to-one vector matching with `ignoring(job)`, all labels included inside `ignoring(...)` will be removed on the results. |
| 4402 | kind: excluded |
| 4403 | fragment: |
| 4404 | start: 46 |
| 4405 | end: 49 |
| 4406 | returns: vector |
| 4407 | operations: |
| 4408 | - node: '[*parser.VectorSelector] up{instance="a",job="prometheus"}' |
| 4409 | op: "" |
| 4410 | joins: |
| 4411 | - matchinglabels: |
| 4412 | - job |
| 4413 | addedlabels: [] |
| 4414 | src: |
| 4415 | labels: |
| 4416 | instance: |
| 4417 | reason: Query will only return series where these labels are present. |
| 4418 | kind: guaranteed |
| 4419 | fragment: |
| 4420 | start: 51 |
| 4421 | end: 79 |
| 4422 | job: |
| 4423 | reason: Query will only return series where these labels are present. |
| 4424 | kind: guaranteed |
| 4425 | fragment: |
| 4426 | start: 51 |
| 4427 | end: 79 |
| 4428 | returns: vector |
| 4429 | operations: |
| 4430 | - node: '[*parser.VectorSelector] up{instance="a",job="pint"}' |
| 4431 | op: "" |
| 4432 | position: |
| 4433 | start: 51 |
| 4434 | end: 79 |
| 4435 | type: selector |
| 4436 | op: 57395 |
| 4437 | depth: 0 |
| 4438 | ison: false |
| 4439 | usedLabels: |
| 4440 | - instance |
| 4441 | position: |
| 4442 | start: 0 |
| 4443 | end: 34 |
| 4444 | type: selector |
| 4445 | |
| 4446 | --- |
| 4447 | |
| 4448 | [TestLabelsSource/113 - 1] |
| 4449 | expr: |4 |
| 4450 | |
| 4451 | avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"}) |
| 4452 | < 0.5 > 0 |
| 4453 | or sum without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"}) |
| 4454 | < on() count(colo_router_tier:disabled_pops:max{tier="1",router=~"edge.*"}) * 0.4 > 0 |
| 4455 | or avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"}) |
| 4456 | < 0.1 > 0 |
| 4457 | output: |
| 4458 | - labels: |
| 4459 | __name__: |
| 4460 | reason: Aggregation removes metric name. |
| 4461 | kind: excluded |
| 4462 | fragment: |
| 4463 | start: 1 |
| 4464 | end: 101 |
| 4465 | colo_id: |
| 4466 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4467 | kind: excluded |
| 4468 | fragment: |
| 4469 | start: 21 |
| 4470 | end: 28 |
| 4471 | instance: |
| 4472 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4473 | kind: excluded |
| 4474 | fragment: |
| 4475 | start: 30 |
| 4476 | end: 38 |
| 4477 | router: |
| 4478 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4479 | kind: excluded |
| 4480 | fragment: |
| 4481 | start: 13 |
| 4482 | end: 19 |
| 4483 | returns: vector |
| 4484 | operations: |
| 4485 | - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"}' |
| 4486 | op: "" |
| 4487 | - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"})' |
| 4488 | op: avg |
| 4489 | position: |
| 4490 | start: 41 |
| 4491 | end: 100 |
| 4492 | type: aggregation |
| 4493 | isConditional: true |
| 4494 | - labels: |
| 4495 | "": |
| 4496 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 4497 | kind: excluded |
| 4498 | fragment: |
| 4499 | start: 216 |
| 4500 | end: 220 |
| 4501 | __name__: |
| 4502 | reason: Binary operation between two vectors removes metric names. |
| 4503 | kind: excluded |
| 4504 | fragment: |
| 4505 | start: 115 |
| 4506 | end: 295 |
| 4507 | cidr_use_case: |
| 4508 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 4509 | kind: excluded |
| 4510 | fragment: |
| 4511 | start: 216 |
| 4512 | end: 220 |
| 4513 | colo_id: |
| 4514 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4515 | kind: excluded |
| 4516 | fragment: |
| 4517 | start: 135 |
| 4518 | end: 142 |
| 4519 | instance: |
| 4520 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4521 | kind: excluded |
| 4522 | fragment: |
| 4523 | start: 144 |
| 4524 | end: 152 |
| 4525 | router: |
| 4526 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4527 | kind: excluded |
| 4528 | fragment: |
| 4529 | start: 127 |
| 4530 | end: 133 |
| 4531 | returns: vector |
| 4532 | operations: |
| 4533 | - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"}' |
| 4534 | op: "" |
| 4535 | - node: '[*parser.AggregateExpr] sum without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"})' |
| 4536 | op: sum |
| 4537 | joins: |
| 4538 | - matchinglabels: [] |
| 4539 | addedlabels: [] |
| 4540 | src: |
| 4541 | labels: |
| 4542 | "": |
| 4543 | reason: Query is using aggregation that removes all labels. |
| 4544 | kind: excluded |
| 4545 | fragment: |
| 4546 | start: 221 |
| 4547 | end: 226 |
| 4548 | __name__: |
| 4549 | reason: Aggregation removes metric name. |
| 4550 | kind: excluded |
| 4551 | fragment: |
| 4552 | start: 221 |
| 4553 | end: 289 |
| 4554 | router: |
| 4555 | reason: Query is using aggregation that removes all labels. |
| 4556 | kind: excluded |
| 4557 | fragment: |
| 4558 | start: 221 |
| 4559 | end: 226 |
| 4560 | tier: |
| 4561 | reason: Query is using aggregation that removes all labels. |
| 4562 | kind: excluded |
| 4563 | fragment: |
| 4564 | start: 221 |
| 4565 | end: 226 |
| 4566 | returns: vector |
| 4567 | operations: |
| 4568 | - node: '[*parser.VectorSelector] colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"}' |
| 4569 | op: "" |
| 4570 | - node: '[*parser.AggregateExpr] count(colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"})' |
| 4571 | op: count |
| 4572 | position: |
| 4573 | start: 227 |
| 4574 | end: 288 |
| 4575 | type: aggregation |
| 4576 | fixedLabels: true |
| 4577 | op: 57391 |
| 4578 | depth: 0 |
| 4579 | ison: true |
| 4580 | position: |
| 4581 | start: 155 |
| 4582 | end: 212 |
| 4583 | type: aggregation |
| 4584 | fixedLabels: true |
| 4585 | isConditional: true |
| 4586 | - labels: |
| 4587 | __name__: |
| 4588 | reason: Aggregation removes metric name. |
| 4589 | kind: excluded |
| 4590 | fragment: |
| 4591 | start: 303 |
| 4592 | end: 404 |
| 4593 | cidr_use_case: |
| 4594 | reason: Query will only return series where these labels are present. |
| 4595 | kind: guaranteed |
| 4596 | fragment: |
| 4597 | start: 343 |
| 4598 | end: 403 |
| 4599 | colo_id: |
| 4600 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4601 | kind: excluded |
| 4602 | fragment: |
| 4603 | start: 323 |
| 4604 | end: 330 |
| 4605 | instance: |
| 4606 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4607 | kind: excluded |
| 4608 | fragment: |
| 4609 | start: 332 |
| 4610 | end: 340 |
| 4611 | router: |
| 4612 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 4613 | kind: excluded |
| 4614 | fragment: |
| 4615 | start: 315 |
| 4616 | end: 321 |
| 4617 | returns: vector |
| 4618 | operations: |
| 4619 | - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"}' |
| 4620 | op: "" |
| 4621 | - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"})' |
| 4622 | op: avg |
| 4623 | position: |
| 4624 | start: 343 |
| 4625 | end: 403 |
| 4626 | type: aggregation |
| 4627 | isConditional: true |
| 4628 | |
| 4629 | --- |
| 4630 | |
| 4631 | [TestLabelsSource/114 - 1] |
| 4632 | expr: label_replace(sum(foo) without(instance), "instance", "none", "", "") |
| 4633 | output: |
| 4634 | - labels: |
| 4635 | __name__: |
| 4636 | reason: Aggregation removes metric name. |
| 4637 | kind: excluded |
| 4638 | fragment: |
| 4639 | start: 14 |
| 4640 | end: 40 |
| 4641 | instance: |
| 4642 | reason: This label will be added to the result by label_replace() call. |
| 4643 | kind: guaranteed |
| 4644 | fragment: |
| 4645 | start: 0 |
| 4646 | end: 69 |
| 4647 | returns: vector |
| 4648 | operations: |
| 4649 | - node: '[*parser.VectorSelector] foo' |
| 4650 | op: "" |
| 4651 | - node: '[*parser.AggregateExpr] sum without (instance) (foo)' |
| 4652 | op: sum |
| 4653 | - args: |
| 4654 | - '"instance"' |
| 4655 | - '"none"' |
| 4656 | - '""' |
| 4657 | - '""' |
| 4658 | node: '[*parser.Call] label_replace(sum without (instance) (foo), "instance", "none", "", "")' |
| 4659 | op: label_replace |
| 4660 | usedLabels: |
| 4661 | - "" |
| 4662 | position: |
| 4663 | start: 14 |
| 4664 | end: 40 |
| 4665 | type: function |
| 4666 | |
| 4667 | --- |
| 4668 | |
| 4669 | [TestLabelsSource/115 - 1] |
| 4670 | expr: |4- |
| 4671 | |
| 4672 | sum by (region, target, colo_name) ( |
| 4673 | sum_over_time(probe_success{job="abc"}[5m]) |
| 4674 | or |
| 4675 | vector(1) |
| 4676 | ) == 0 |
| 4677 | output: |
| 4678 | - labels: |
| 4679 | "": |
| 4680 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 4681 | kind: excluded |
| 4682 | fragment: |
| 4683 | start: 5 |
| 4684 | end: 8 |
| 4685 | __name__: |
| 4686 | reason: Aggregation removes metric name. |
| 4687 | kind: excluded |
| 4688 | fragment: |
| 4689 | start: 1 |
| 4690 | end: 102 |
| 4691 | colo_name: |
| 4692 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 4693 | kind: included |
| 4694 | fragment: |
| 4695 | start: 25 |
| 4696 | end: 34 |
| 4697 | job: |
| 4698 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 4699 | kind: excluded |
| 4700 | fragment: |
| 4701 | start: 5 |
| 4702 | end: 35 |
| 4703 | region: |
| 4704 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 4705 | kind: included |
| 4706 | fragment: |
| 4707 | start: 9 |
| 4708 | end: 15 |
| 4709 | target: |
| 4710 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 4711 | kind: included |
| 4712 | fragment: |
| 4713 | start: 17 |
| 4714 | end: 23 |
| 4715 | returns: vector |
| 4716 | operations: |
| 4717 | - node: '[*parser.VectorSelector] probe_success{job="abc"}' |
| 4718 | op: "" |
| 4719 | - node: '[*parser.Call] sum_over_time(probe_success{job="abc"}[5m])' |
| 4720 | op: sum_over_time |
| 4721 | - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))' |
| 4722 | op: sum |
| 4723 | usedLabels: |
| 4724 | - region |
| 4725 | - target |
| 4726 | - colo_name |
| 4727 | position: |
| 4728 | start: 56 |
| 4729 | end: 84 |
| 4730 | type: aggregation |
| 4731 | fixedLabels: true |
| 4732 | isConditional: true |
| 4733 | - labels: |
| 4734 | "": |
| 4735 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 4736 | kind: excluded |
| 4737 | fragment: |
| 4738 | start: 5 |
| 4739 | end: 8 |
| 4740 | __name__: |
| 4741 | reason: Aggregation removes metric name. |
| 4742 | kind: excluded |
| 4743 | fragment: |
| 4744 | start: 1 |
| 4745 | end: 102 |
| 4746 | colo_name: |
| 4747 | reason: Calling `vector()` will return a vector value with no labels. |
| 4748 | kind: excluded |
| 4749 | fragment: |
| 4750 | start: 91 |
| 4751 | end: 97 |
| 4752 | region: |
| 4753 | reason: Calling `vector()` will return a vector value with no labels. |
| 4754 | kind: excluded |
| 4755 | fragment: |
| 4756 | start: 91 |
| 4757 | end: 97 |
| 4758 | target: |
| 4759 | reason: Calling `vector()` will return a vector value with no labels. |
| 4760 | kind: excluded |
| 4761 | fragment: |
| 4762 | start: 91 |
| 4763 | end: 97 |
| 4764 | deadInfo: |
| 4765 | reason: '`vector(1) == 0` always evaluates to `1 == 0` which is not possible, so it will never return anything.' |
| 4766 | fragment: |
| 4767 | start: 91 |
| 4768 | end: 100 |
| 4769 | deadLabels: |
| 4770 | - name: region |
| 4771 | reason: You can't use `region` because this label is not possible here. |
| 4772 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 4773 | usagefragment: |
| 4774 | start: 9 |
| 4775 | end: 15 |
| 4776 | labelfragment: |
| 4777 | start: 91 |
| 4778 | end: 97 |
| 4779 | kind: 0 |
| 4780 | - name: target |
| 4781 | reason: You can't use `target` because this label is not possible here. |
| 4782 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 4783 | usagefragment: |
| 4784 | start: 17 |
| 4785 | end: 23 |
| 4786 | labelfragment: |
| 4787 | start: 91 |
| 4788 | end: 97 |
| 4789 | kind: 0 |
| 4790 | - name: colo_name |
| 4791 | reason: You can't use `colo_name` because this label is not possible here. |
| 4792 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 4793 | usagefragment: |
| 4794 | start: 25 |
| 4795 | end: 34 |
| 4796 | labelfragment: |
| 4797 | start: 91 |
| 4798 | end: 97 |
| 4799 | kind: 0 |
| 4800 | returns: vector |
| 4801 | operations: |
| 4802 | - args: |
| 4803 | - "1" |
| 4804 | node: '[*parser.Call] vector(1)' |
| 4805 | op: vector |
| 4806 | - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))' |
| 4807 | op: sum |
| 4808 | usedLabels: |
| 4809 | - region |
| 4810 | - target |
| 4811 | - colo_name |
| 4812 | returnInfo: |
| 4813 | logicalexpr: "" |
| 4814 | valueposition: |
| 4815 | start: 91 |
| 4816 | end: 100 |
| 4817 | returnednumber: 1 |
| 4818 | alwaysreturns: true |
| 4819 | knownreturn: true |
| 4820 | isreturnbool: false |
| 4821 | position: |
| 4822 | start: 91 |
| 4823 | end: 100 |
| 4824 | type: aggregation |
| 4825 | fixedLabels: true |
| 4826 | isConditional: true |
| 4827 | |
| 4828 | --- |
| 4829 | |
| 4830 | [TestLabelsSource/116 - 1] |
| 4831 | expr: vector(1) or foo |
| 4832 | output: |
| 4833 | - labels: |
| 4834 | "": |
| 4835 | reason: Calling `vector()` will return a vector value with no labels. |
| 4836 | kind: excluded |
| 4837 | fragment: |
| 4838 | start: 0 |
| 4839 | end: 6 |
| 4840 | returns: vector |
| 4841 | operations: |
| 4842 | - args: |
| 4843 | - "1" |
| 4844 | node: '[*parser.Call] vector(1)' |
| 4845 | op: vector |
| 4846 | returnInfo: |
| 4847 | logicalexpr: "" |
| 4848 | valueposition: |
| 4849 | start: 0 |
| 4850 | end: 9 |
| 4851 | returnednumber: 1 |
| 4852 | alwaysreturns: true |
| 4853 | knownreturn: true |
| 4854 | isreturnbool: false |
| 4855 | position: |
| 4856 | start: 0 |
| 4857 | end: 9 |
| 4858 | type: function |
| 4859 | fixedLabels: true |
| 4860 | - deadInfo: |
| 4861 | reason: The left hand side always returns something and so the right hand side is never used. |
| 4862 | fragment: |
| 4863 | start: 13 |
| 4864 | end: 16 |
| 4865 | returns: vector |
| 4866 | operations: |
| 4867 | - node: '[*parser.VectorSelector] foo' |
| 4868 | op: "" |
| 4869 | position: |
| 4870 | start: 13 |
| 4871 | end: 16 |
| 4872 | type: selector |
| 4873 | |
| 4874 | --- |
| 4875 | |
| 4876 | [TestLabelsSource/117 - 1] |
| 4877 | expr: vector(0) > 0 |
| 4878 | output: |
| 4879 | - labels: |
| 4880 | "": |
| 4881 | reason: Calling `vector()` will return a vector value with no labels. |
| 4882 | kind: excluded |
| 4883 | fragment: |
| 4884 | start: 0 |
| 4885 | end: 6 |
| 4886 | deadInfo: |
| 4887 | reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.' |
| 4888 | fragment: |
| 4889 | start: 0 |
| 4890 | end: 9 |
| 4891 | returns: vector |
| 4892 | operations: |
| 4893 | - args: |
| 4894 | - "0" |
| 4895 | node: '[*parser.Call] vector(0)' |
| 4896 | op: vector |
| 4897 | returnInfo: |
| 4898 | logicalexpr: "" |
| 4899 | valueposition: |
| 4900 | start: 0 |
| 4901 | end: 9 |
| 4902 | returnednumber: 0 |
| 4903 | alwaysreturns: true |
| 4904 | knownreturn: true |
| 4905 | isreturnbool: false |
| 4906 | position: |
| 4907 | start: 0 |
| 4908 | end: 9 |
| 4909 | type: function |
| 4910 | fixedLabels: true |
| 4911 | isConditional: true |
| 4912 | |
| 4913 | --- |
| 4914 | |
| 4915 | [TestLabelsSource/118 - 1] |
| 4916 | expr: vector(0) > vector(1) |
| 4917 | output: |
| 4918 | - labels: |
| 4919 | "": |
| 4920 | reason: Calling `vector()` will return a vector value with no labels. |
| 4921 | kind: excluded |
| 4922 | fragment: |
| 4923 | start: 0 |
| 4924 | end: 6 |
| 4925 | __name__: |
| 4926 | reason: Binary operation between two vectors removes metric names. |
| 4927 | kind: excluded |
| 4928 | fragment: |
| 4929 | start: 0 |
| 4930 | end: 21 |
| 4931 | deadInfo: |
| 4932 | reason: '`vector(0) > vector(1)` always evaluates to `0 > 1` which is not possible, so it will never return anything.' |
| 4933 | fragment: |
| 4934 | start: 0 |
| 4935 | end: 9 |
| 4936 | returns: vector |
| 4937 | operations: |
| 4938 | - args: |
| 4939 | - "0" |
| 4940 | node: '[*parser.Call] vector(0)' |
| 4941 | op: vector |
| 4942 | joins: |
| 4943 | - matchinglabels: [] |
| 4944 | addedlabels: [] |
| 4945 | src: |
| 4946 | labels: |
| 4947 | "": |
| 4948 | reason: Calling `vector()` will return a vector value with no labels. |
| 4949 | kind: excluded |
| 4950 | fragment: |
| 4951 | start: 12 |
| 4952 | end: 18 |
| 4953 | returns: vector |
| 4954 | operations: |
| 4955 | - args: |
| 4956 | - "1" |
| 4957 | node: '[*parser.Call] vector(1)' |
| 4958 | op: vector |
| 4959 | returnInfo: |
| 4960 | logicalexpr: "" |
| 4961 | valueposition: |
| 4962 | start: 12 |
| 4963 | end: 21 |
| 4964 | returnednumber: 1 |
| 4965 | alwaysreturns: true |
| 4966 | knownreturn: true |
| 4967 | isreturnbool: false |
| 4968 | position: |
| 4969 | start: 12 |
| 4970 | end: 21 |
| 4971 | type: function |
| 4972 | fixedLabels: true |
| 4973 | op: 57388 |
| 4974 | depth: 0 |
| 4975 | ison: false |
| 4976 | returnInfo: |
| 4977 | logicalexpr: "" |
| 4978 | valueposition: |
| 4979 | start: 0 |
| 4980 | end: 9 |
| 4981 | returnednumber: 0 |
| 4982 | alwaysreturns: true |
| 4983 | knownreturn: true |
| 4984 | isreturnbool: false |
| 4985 | position: |
| 4986 | start: 0 |
| 4987 | end: 9 |
| 4988 | type: function |
| 4989 | fixedLabels: true |
| 4990 | isConditional: true |
| 4991 | |
| 4992 | --- |
| 4993 | |
| 4994 | [TestLabelsSource/119 - 1] |
| 4995 | expr: sum(foo or vector(0)) > 0 |
| 4996 | output: |
| 4997 | - labels: |
| 4998 | "": |
| 4999 | reason: Query is using aggregation that removes all labels. |
| 5000 | kind: excluded |
| 5001 | fragment: |
| 5002 | start: 0 |
| 5003 | end: 3 |
| 5004 | __name__: |
| 5005 | reason: Aggregation removes metric name. |
| 5006 | kind: excluded |
| 5007 | fragment: |
| 5008 | start: 0 |
| 5009 | end: 21 |
| 5010 | returns: vector |
| 5011 | operations: |
| 5012 | - node: '[*parser.VectorSelector] foo' |
| 5013 | op: "" |
| 5014 | - node: '[*parser.AggregateExpr] sum(foo or vector(0))' |
| 5015 | op: sum |
| 5016 | position: |
| 5017 | start: 4 |
| 5018 | end: 7 |
| 5019 | type: aggregation |
| 5020 | fixedLabels: true |
| 5021 | isConditional: true |
| 5022 | - labels: |
| 5023 | "": |
| 5024 | reason: Query is using aggregation that removes all labels. |
| 5025 | kind: excluded |
| 5026 | fragment: |
| 5027 | start: 0 |
| 5028 | end: 3 |
| 5029 | __name__: |
| 5030 | reason: Aggregation removes metric name. |
| 5031 | kind: excluded |
| 5032 | fragment: |
| 5033 | start: 0 |
| 5034 | end: 21 |
| 5035 | deadInfo: |
| 5036 | reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.' |
| 5037 | fragment: |
| 5038 | start: 11 |
| 5039 | end: 20 |
| 5040 | returns: vector |
| 5041 | operations: |
| 5042 | - args: |
| 5043 | - "0" |
| 5044 | node: '[*parser.Call] vector(0)' |
| 5045 | op: vector |
| 5046 | - node: '[*parser.AggregateExpr] sum(foo or vector(0))' |
| 5047 | op: sum |
| 5048 | returnInfo: |
| 5049 | logicalexpr: "" |
| 5050 | valueposition: |
| 5051 | start: 11 |
| 5052 | end: 20 |
| 5053 | returnednumber: 0 |
| 5054 | alwaysreturns: true |
| 5055 | knownreturn: true |
| 5056 | isreturnbool: false |
| 5057 | position: |
| 5058 | start: 11 |
| 5059 | end: 20 |
| 5060 | type: aggregation |
| 5061 | fixedLabels: true |
| 5062 | isConditional: true |
| 5063 | |
| 5064 | --- |
| 5065 | |
| 5066 | [TestLabelsSource/120 - 1] |
| 5067 | expr: (sum(foo or vector(1)) > 0) == 2 |
| 5068 | output: |
| 5069 | - labels: |
| 5070 | "": |
| 5071 | reason: Query is using aggregation that removes all labels. |
| 5072 | kind: excluded |
| 5073 | fragment: |
| 5074 | start: 1 |
| 5075 | end: 4 |
| 5076 | __name__: |
| 5077 | reason: Aggregation removes metric name. |
| 5078 | kind: excluded |
| 5079 | fragment: |
| 5080 | start: 1 |
| 5081 | end: 22 |
| 5082 | returns: vector |
| 5083 | operations: |
| 5084 | - node: '[*parser.VectorSelector] foo' |
| 5085 | op: "" |
| 5086 | - node: '[*parser.AggregateExpr] sum(foo or vector(1))' |
| 5087 | op: sum |
| 5088 | position: |
| 5089 | start: 5 |
| 5090 | end: 8 |
| 5091 | type: aggregation |
| 5092 | fixedLabels: true |
| 5093 | isConditional: true |
| 5094 | - labels: |
| 5095 | "": |
| 5096 | reason: Query is using aggregation that removes all labels. |
| 5097 | kind: excluded |
| 5098 | fragment: |
| 5099 | start: 1 |
| 5100 | end: 4 |
| 5101 | __name__: |
| 5102 | reason: Aggregation removes metric name. |
| 5103 | kind: excluded |
| 5104 | fragment: |
| 5105 | start: 1 |
| 5106 | end: 22 |
| 5107 | deadInfo: |
| 5108 | reason: '`vector(1) == 2` always evaluates to `1 == 2` which is not possible, so it will never return anything.' |
| 5109 | fragment: |
| 5110 | start: 12 |
| 5111 | end: 21 |
| 5112 | returns: vector |
| 5113 | operations: |
| 5114 | - args: |
| 5115 | - "1" |
| 5116 | node: '[*parser.Call] vector(1)' |
| 5117 | op: vector |
| 5118 | - node: '[*parser.AggregateExpr] sum(foo or vector(1))' |
| 5119 | op: sum |
| 5120 | returnInfo: |
| 5121 | logicalexpr: "" |
| 5122 | valueposition: |
| 5123 | start: 12 |
| 5124 | end: 21 |
| 5125 | returnednumber: 1 |
| 5126 | alwaysreturns: true |
| 5127 | knownreturn: true |
| 5128 | isreturnbool: false |
| 5129 | position: |
| 5130 | start: 12 |
| 5131 | end: 21 |
| 5132 | type: aggregation |
| 5133 | fixedLabels: true |
| 5134 | isConditional: true |
| 5135 | |
| 5136 | --- |
| 5137 | |
| 5138 | [TestLabelsSource/121 - 1] |
| 5139 | expr: (sum(foo or vector(1)) > 0) != 2 |
| 5140 | output: |
| 5141 | - labels: |
| 5142 | "": |
| 5143 | reason: Query is using aggregation that removes all labels. |
| 5144 | kind: excluded |
| 5145 | fragment: |
| 5146 | start: 1 |
| 5147 | end: 4 |
| 5148 | __name__: |
| 5149 | reason: Aggregation removes metric name. |
| 5150 | kind: excluded |
| 5151 | fragment: |
| 5152 | start: 1 |
| 5153 | end: 22 |
| 5154 | returns: vector |
| 5155 | operations: |
| 5156 | - node: '[*parser.VectorSelector] foo' |
| 5157 | op: "" |
| 5158 | - node: '[*parser.AggregateExpr] sum(foo or vector(1))' |
| 5159 | op: sum |
| 5160 | position: |
| 5161 | start: 5 |
| 5162 | end: 8 |
| 5163 | type: aggregation |
| 5164 | fixedLabels: true |
| 5165 | isConditional: true |
| 5166 | - labels: |
| 5167 | "": |
| 5168 | reason: Query is using aggregation that removes all labels. |
| 5169 | kind: excluded |
| 5170 | fragment: |
| 5171 | start: 1 |
| 5172 | end: 4 |
| 5173 | __name__: |
| 5174 | reason: Aggregation removes metric name. |
| 5175 | kind: excluded |
| 5176 | fragment: |
| 5177 | start: 1 |
| 5178 | end: 22 |
| 5179 | returns: vector |
| 5180 | operations: |
| 5181 | - args: |
| 5182 | - "1" |
| 5183 | node: '[*parser.Call] vector(1)' |
| 5184 | op: vector |
| 5185 | - node: '[*parser.AggregateExpr] sum(foo or vector(1))' |
| 5186 | op: sum |
| 5187 | returnInfo: |
| 5188 | logicalexpr: "" |
| 5189 | valueposition: |
| 5190 | start: 12 |
| 5191 | end: 21 |
| 5192 | returnednumber: 1 |
| 5193 | alwaysreturns: true |
| 5194 | knownreturn: true |
| 5195 | isreturnbool: false |
| 5196 | position: |
| 5197 | start: 12 |
| 5198 | end: 21 |
| 5199 | type: aggregation |
| 5200 | fixedLabels: true |
| 5201 | isConditional: true |
| 5202 | |
| 5203 | --- |
| 5204 | |
| 5205 | [TestLabelsSource/122 - 1] |
| 5206 | expr: (sum(foo or vector(2)) > 0) != 2 |
| 5207 | output: |
| 5208 | - labels: |
| 5209 | "": |
| 5210 | reason: Query is using aggregation that removes all labels. |
| 5211 | kind: excluded |
| 5212 | fragment: |
| 5213 | start: 1 |
| 5214 | end: 4 |
| 5215 | __name__: |
| 5216 | reason: Aggregation removes metric name. |
| 5217 | kind: excluded |
| 5218 | fragment: |
| 5219 | start: 1 |
| 5220 | end: 22 |
| 5221 | returns: vector |
| 5222 | operations: |
| 5223 | - node: '[*parser.VectorSelector] foo' |
| 5224 | op: "" |
| 5225 | - node: '[*parser.AggregateExpr] sum(foo or vector(2))' |
| 5226 | op: sum |
| 5227 | position: |
| 5228 | start: 5 |
| 5229 | end: 8 |
| 5230 | type: aggregation |
| 5231 | fixedLabels: true |
| 5232 | isConditional: true |
| 5233 | - labels: |
| 5234 | "": |
| 5235 | reason: Query is using aggregation that removes all labels. |
| 5236 | kind: excluded |
| 5237 | fragment: |
| 5238 | start: 1 |
| 5239 | end: 4 |
| 5240 | __name__: |
| 5241 | reason: Aggregation removes metric name. |
| 5242 | kind: excluded |
| 5243 | fragment: |
| 5244 | start: 1 |
| 5245 | end: 22 |
| 5246 | deadInfo: |
| 5247 | reason: '`vector(2) != 2` always evaluates to `2 != 2` which is not possible, so it will never return anything.' |
| 5248 | fragment: |
| 5249 | start: 12 |
| 5250 | end: 21 |
| 5251 | returns: vector |
| 5252 | operations: |
| 5253 | - args: |
| 5254 | - "2" |
| 5255 | node: '[*parser.Call] vector(2)' |
| 5256 | op: vector |
| 5257 | - node: '[*parser.AggregateExpr] sum(foo or vector(2))' |
| 5258 | op: sum |
| 5259 | returnInfo: |
| 5260 | logicalexpr: "" |
| 5261 | valueposition: |
| 5262 | start: 12 |
| 5263 | end: 21 |
| 5264 | returnednumber: 2 |
| 5265 | alwaysreturns: true |
| 5266 | knownreturn: true |
| 5267 | isreturnbool: false |
| 5268 | position: |
| 5269 | start: 12 |
| 5270 | end: 21 |
| 5271 | type: aggregation |
| 5272 | fixedLabels: true |
| 5273 | isConditional: true |
| 5274 | |
| 5275 | --- |
| 5276 | |
| 5277 | [TestLabelsSource/123 - 1] |
| 5278 | expr: |- |
| 5279 | (sum(sometimes{foo!="bar"} or vector(0))) |
| 5280 | or |
| 5281 | ((bob > 10) or sum(foo) or vector(1)) |
| 5282 | output: |
| 5283 | - labels: |
| 5284 | "": |
| 5285 | reason: Query is using aggregation that removes all labels. |
| 5286 | kind: excluded |
| 5287 | fragment: |
| 5288 | start: 1 |
| 5289 | end: 4 |
| 5290 | __name__: |
| 5291 | reason: Aggregation removes metric name. |
| 5292 | kind: excluded |
| 5293 | fragment: |
| 5294 | start: 1 |
| 5295 | end: 40 |
| 5296 | returns: vector |
| 5297 | operations: |
| 5298 | - node: '[*parser.VectorSelector] sometimes{foo!="bar"}' |
| 5299 | op: "" |
| 5300 | - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))' |
| 5301 | op: sum |
| 5302 | position: |
| 5303 | start: 5 |
| 5304 | end: 26 |
| 5305 | type: aggregation |
| 5306 | fixedLabels: true |
| 5307 | - labels: |
| 5308 | "": |
| 5309 | reason: Query is using aggregation that removes all labels. |
| 5310 | kind: excluded |
| 5311 | fragment: |
| 5312 | start: 1 |
| 5313 | end: 4 |
| 5314 | __name__: |
| 5315 | reason: Aggregation removes metric name. |
| 5316 | kind: excluded |
| 5317 | fragment: |
| 5318 | start: 1 |
| 5319 | end: 40 |
| 5320 | returns: vector |
| 5321 | operations: |
| 5322 | - args: |
| 5323 | - "0" |
| 5324 | node: '[*parser.Call] vector(0)' |
| 5325 | op: vector |
| 5326 | - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))' |
| 5327 | op: sum |
| 5328 | returnInfo: |
| 5329 | logicalexpr: "" |
| 5330 | valueposition: |
| 5331 | start: 30 |
| 5332 | end: 39 |
| 5333 | returnednumber: 0 |
| 5334 | alwaysreturns: true |
| 5335 | knownreturn: true |
| 5336 | isreturnbool: false |
| 5337 | position: |
| 5338 | start: 30 |
| 5339 | end: 39 |
| 5340 | type: aggregation |
| 5341 | fixedLabels: true |
| 5342 | - returns: vector |
| 5343 | operations: |
| 5344 | - node: '[*parser.VectorSelector] bob' |
| 5345 | op: "" |
| 5346 | position: |
| 5347 | start: 47 |
| 5348 | end: 50 |
| 5349 | type: selector |
| 5350 | isConditional: true |
| 5351 | - labels: |
| 5352 | "": |
| 5353 | reason: Query is using aggregation that removes all labels. |
| 5354 | kind: excluded |
| 5355 | fragment: |
| 5356 | start: 60 |
| 5357 | end: 63 |
| 5358 | __name__: |
| 5359 | reason: Aggregation removes metric name. |
| 5360 | kind: excluded |
| 5361 | fragment: |
| 5362 | start: 60 |
| 5363 | end: 68 |
| 5364 | returns: vector |
| 5365 | operations: |
| 5366 | - node: '[*parser.VectorSelector] foo' |
| 5367 | op: "" |
| 5368 | - node: '[*parser.AggregateExpr] sum(foo)' |
| 5369 | op: sum |
| 5370 | position: |
| 5371 | start: 64 |
| 5372 | end: 67 |
| 5373 | type: aggregation |
| 5374 | fixedLabels: true |
| 5375 | - labels: |
| 5376 | "": |
| 5377 | reason: Calling `vector()` will return a vector value with no labels. |
| 5378 | kind: excluded |
| 5379 | fragment: |
| 5380 | start: 72 |
| 5381 | end: 78 |
| 5382 | returns: vector |
| 5383 | operations: |
| 5384 | - args: |
| 5385 | - "1" |
| 5386 | node: '[*parser.Call] vector(1)' |
| 5387 | op: vector |
| 5388 | returnInfo: |
| 5389 | logicalexpr: "" |
| 5390 | valueposition: |
| 5391 | start: 72 |
| 5392 | end: 81 |
| 5393 | returnednumber: 1 |
| 5394 | alwaysreturns: true |
| 5395 | knownreturn: true |
| 5396 | isreturnbool: false |
| 5397 | position: |
| 5398 | start: 72 |
| 5399 | end: 81 |
| 5400 | type: function |
| 5401 | fixedLabels: true |
| 5402 | |
| 5403 | --- |
| 5404 | |
| 5405 | [TestLabelsSource/124 - 1] |
| 5406 | expr: |4- |
| 5407 | |
| 5408 | ( |
| 5409 | sum(sometimes{foo!="bar"}) |
| 5410 | or |
| 5411 | vector(1) |
| 5412 | ) and ( |
| 5413 | ((bob > 10) or sum(bar)) |
| 5414 | or |
| 5415 | notfound > 0 |
| 5416 | ) |
| 5417 | output: |
| 5418 | - labels: |
| 5419 | "": |
| 5420 | reason: Query is using aggregation that removes all labels. |
| 5421 | kind: excluded |
| 5422 | fragment: |
| 5423 | start: 4 |
| 5424 | end: 7 |
| 5425 | __name__: |
| 5426 | reason: Aggregation removes metric name. |
| 5427 | kind: excluded |
| 5428 | fragment: |
| 5429 | start: 4 |
| 5430 | end: 30 |
| 5431 | returns: vector |
| 5432 | operations: |
| 5433 | - node: '[*parser.VectorSelector] sometimes{foo!="bar"}' |
| 5434 | op: "" |
| 5435 | - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"})' |
| 5436 | op: sum |
| 5437 | joins: |
| 5438 | - matchinglabels: [] |
| 5439 | addedlabels: [] |
| 5440 | src: |
| 5441 | returns: vector |
| 5442 | operations: |
| 5443 | - node: '[*parser.VectorSelector] bob' |
| 5444 | op: "" |
| 5445 | position: |
| 5446 | start: 57 |
| 5447 | end: 60 |
| 5448 | type: selector |
| 5449 | isConditional: true |
| 5450 | op: 57389 |
| 5451 | depth: 0 |
| 5452 | ison: false |
| 5453 | - matchinglabels: [] |
| 5454 | addedlabels: [] |
| 5455 | src: |
| 5456 | labels: |
| 5457 | "": |
| 5458 | reason: Query is using aggregation that removes all labels. |
| 5459 | kind: excluded |
| 5460 | fragment: |
| 5461 | start: 70 |
| 5462 | end: 73 |
| 5463 | __name__: |
| 5464 | reason: Aggregation removes metric name. |
| 5465 | kind: excluded |
| 5466 | fragment: |
| 5467 | start: 70 |
| 5468 | end: 78 |
| 5469 | returns: vector |
| 5470 | operations: |
| 5471 | - node: '[*parser.VectorSelector] bar' |
| 5472 | op: "" |
| 5473 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 5474 | op: sum |
| 5475 | position: |
| 5476 | start: 74 |
| 5477 | end: 77 |
| 5478 | type: aggregation |
| 5479 | fixedLabels: true |
| 5480 | op: 57389 |
| 5481 | depth: 0 |
| 5482 | ison: false |
| 5483 | - matchinglabels: [] |
| 5484 | addedlabels: [] |
| 5485 | src: |
| 5486 | returns: vector |
| 5487 | operations: |
| 5488 | - node: '[*parser.VectorSelector] notfound' |
| 5489 | op: "" |
| 5490 | position: |
| 5491 | start: 85 |
| 5492 | end: 93 |
| 5493 | type: selector |
| 5494 | isConditional: true |
| 5495 | op: 57389 |
| 5496 | depth: 0 |
| 5497 | ison: false |
| 5498 | position: |
| 5499 | start: 8 |
| 5500 | end: 29 |
| 5501 | type: aggregation |
| 5502 | fixedLabels: true |
| 5503 | isConditional: true |
| 5504 | - labels: |
| 5505 | "": |
| 5506 | reason: Calling `vector()` will return a vector value with no labels. |
| 5507 | kind: excluded |
| 5508 | fragment: |
| 5509 | start: 36 |
| 5510 | end: 42 |
| 5511 | returns: vector |
| 5512 | operations: |
| 5513 | - args: |
| 5514 | - "1" |
| 5515 | node: '[*parser.Call] vector(1)' |
| 5516 | op: vector |
| 5517 | joins: |
| 5518 | - matchinglabels: [] |
| 5519 | addedlabels: [] |
| 5520 | src: |
| 5521 | returns: vector |
| 5522 | operations: |
| 5523 | - node: '[*parser.VectorSelector] bob' |
| 5524 | op: "" |
| 5525 | position: |
| 5526 | start: 57 |
| 5527 | end: 60 |
| 5528 | type: selector |
| 5529 | isConditional: true |
| 5530 | op: 57389 |
| 5531 | depth: 0 |
| 5532 | ison: false |
| 5533 | - matchinglabels: [] |
| 5534 | addedlabels: [] |
| 5535 | src: |
| 5536 | labels: |
| 5537 | "": |
| 5538 | reason: Query is using aggregation that removes all labels. |
| 5539 | kind: excluded |
| 5540 | fragment: |
| 5541 | start: 70 |
| 5542 | end: 73 |
| 5543 | __name__: |
| 5544 | reason: Aggregation removes metric name. |
| 5545 | kind: excluded |
| 5546 | fragment: |
| 5547 | start: 70 |
| 5548 | end: 78 |
| 5549 | returns: vector |
| 5550 | operations: |
| 5551 | - node: '[*parser.VectorSelector] bar' |
| 5552 | op: "" |
| 5553 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 5554 | op: sum |
| 5555 | position: |
| 5556 | start: 74 |
| 5557 | end: 77 |
| 5558 | type: aggregation |
| 5559 | fixedLabels: true |
| 5560 | op: 57389 |
| 5561 | depth: 0 |
| 5562 | ison: false |
| 5563 | - matchinglabels: [] |
| 5564 | addedlabels: [] |
| 5565 | src: |
| 5566 | returns: vector |
| 5567 | operations: |
| 5568 | - node: '[*parser.VectorSelector] notfound' |
| 5569 | op: "" |
| 5570 | position: |
| 5571 | start: 85 |
| 5572 | end: 93 |
| 5573 | type: selector |
| 5574 | isConditional: true |
| 5575 | op: 57389 |
| 5576 | depth: 0 |
| 5577 | ison: false |
| 5578 | returnInfo: |
| 5579 | logicalexpr: "" |
| 5580 | valueposition: |
| 5581 | start: 36 |
| 5582 | end: 45 |
| 5583 | returnednumber: 1 |
| 5584 | alwaysreturns: true |
| 5585 | knownreturn: true |
| 5586 | isreturnbool: false |
| 5587 | position: |
| 5588 | start: 36 |
| 5589 | end: 45 |
| 5590 | type: function |
| 5591 | fixedLabels: true |
| 5592 | isConditional: true |
| 5593 | |
| 5594 | --- |
| 5595 | |
| 5596 | [TestLabelsSource/125 - 1] |
| 5597 | expr: foo offset 5m > 5 |
| 5598 | output: |
| 5599 | - returns: vector |
| 5600 | operations: |
| 5601 | - node: '[*parser.VectorSelector] foo offset 5m' |
| 5602 | op: "" |
| 5603 | position: |
| 5604 | start: 0 |
| 5605 | end: 13 |
| 5606 | type: selector |
| 5607 | isConditional: true |
| 5608 | |
| 5609 | --- |
| 5610 | |
| 5611 | [TestLabelsSource/126 - 1] |
| 5612 | expr: |4 |
| 5613 | |
| 5614 | (rate(metric2[5m]) or vector(0)) + |
| 5615 | (rate(metric1[5m]) or vector(1)) + |
| 5616 | (rate(metric3{log_name="samplerd"}[5m]) or vector(2)) > 0 |
| 5617 | output: |
| 5618 | - labels: |
| 5619 | __name__: |
| 5620 | reason: Binary operation between two vectors removes metric names. |
| 5621 | kind: excluded |
| 5622 | fragment: |
| 5623 | start: 1 |
| 5624 | end: 124 |
| 5625 | returns: vector |
| 5626 | operations: |
| 5627 | - node: '[*parser.VectorSelector] metric2' |
| 5628 | op: "" |
| 5629 | - node: '[*parser.Call] rate(metric2[5m])' |
| 5630 | op: rate |
| 5631 | joins: |
| 5632 | - matchinglabels: [] |
| 5633 | addedlabels: [] |
| 5634 | src: |
| 5635 | returns: vector |
| 5636 | operations: |
| 5637 | - node: '[*parser.VectorSelector] metric1' |
| 5638 | op: "" |
| 5639 | - node: '[*parser.Call] rate(metric1[5m])' |
| 5640 | op: rate |
| 5641 | position: |
| 5642 | start: 42 |
| 5643 | end: 53 |
| 5644 | type: function |
| 5645 | op: 57383 |
| 5646 | depth: 0 |
| 5647 | ison: false |
| 5648 | - matchinglabels: [] |
| 5649 | addedlabels: [] |
| 5650 | src: |
| 5651 | labels: |
| 5652 | "": |
| 5653 | reason: Calling `vector()` will return a vector value with no labels. |
| 5654 | kind: excluded |
| 5655 | fragment: |
| 5656 | start: 58 |
| 5657 | end: 64 |
| 5658 | returns: vector |
| 5659 | operations: |
| 5660 | - args: |
| 5661 | - "1" |
| 5662 | node: '[*parser.Call] vector(1)' |
| 5663 | op: vector |
| 5664 | returnInfo: |
| 5665 | logicalexpr: "" |
| 5666 | valueposition: |
| 5667 | start: 58 |
| 5668 | end: 67 |
| 5669 | returnednumber: 1 |
| 5670 | alwaysreturns: true |
| 5671 | knownreturn: true |
| 5672 | isreturnbool: false |
| 5673 | position: |
| 5674 | start: 58 |
| 5675 | end: 67 |
| 5676 | type: function |
| 5677 | fixedLabels: true |
| 5678 | op: 57383 |
| 5679 | depth: 0 |
| 5680 | ison: false |
| 5681 | - matchinglabels: [] |
| 5682 | addedlabels: [] |
| 5683 | src: |
| 5684 | labels: |
| 5685 | log_name: |
| 5686 | reason: Query will only return series where these labels are present. |
| 5687 | kind: guaranteed |
| 5688 | fragment: |
| 5689 | start: 72 |
| 5690 | end: 110 |
| 5691 | returns: vector |
| 5692 | operations: |
| 5693 | - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}' |
| 5694 | op: "" |
| 5695 | - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])' |
| 5696 | op: rate |
| 5697 | usedLabels: |
| 5698 | - log_name |
| 5699 | position: |
| 5700 | start: 77 |
| 5701 | end: 109 |
| 5702 | type: function |
| 5703 | op: 57383 |
| 5704 | depth: 0 |
| 5705 | ison: false |
| 5706 | - matchinglabels: [] |
| 5707 | addedlabels: [] |
| 5708 | src: |
| 5709 | labels: |
| 5710 | "": |
| 5711 | reason: Calling `vector()` will return a vector value with no labels. |
| 5712 | kind: excluded |
| 5713 | fragment: |
| 5714 | start: 114 |
| 5715 | end: 120 |
| 5716 | returns: vector |
| 5717 | operations: |
| 5718 | - args: |
| 5719 | - "2" |
| 5720 | node: '[*parser.Call] vector(2)' |
| 5721 | op: vector |
| 5722 | returnInfo: |
| 5723 | logicalexpr: "" |
| 5724 | valueposition: |
| 5725 | start: 114 |
| 5726 | end: 123 |
| 5727 | returnednumber: 2 |
| 5728 | alwaysreturns: true |
| 5729 | knownreturn: true |
| 5730 | isreturnbool: false |
| 5731 | position: |
| 5732 | start: 114 |
| 5733 | end: 123 |
| 5734 | type: function |
| 5735 | fixedLabels: true |
| 5736 | op: 57383 |
| 5737 | depth: 0 |
| 5738 | ison: false |
| 5739 | position: |
| 5740 | start: 7 |
| 5741 | end: 18 |
| 5742 | type: function |
| 5743 | isConditional: true |
| 5744 | - labels: |
| 5745 | "": |
| 5746 | reason: Calling `vector()` will return a vector value with no labels. |
| 5747 | kind: excluded |
| 5748 | fragment: |
| 5749 | start: 23 |
| 5750 | end: 29 |
| 5751 | __name__: |
| 5752 | reason: Binary operation between two vectors removes metric names. |
| 5753 | kind: excluded |
| 5754 | fragment: |
| 5755 | start: 1 |
| 5756 | end: 124 |
| 5757 | returns: vector |
| 5758 | operations: |
| 5759 | - args: |
| 5760 | - "0" |
| 5761 | node: '[*parser.Call] vector(0)' |
| 5762 | op: vector |
| 5763 | joins: |
| 5764 | - matchinglabels: [] |
| 5765 | addedlabels: [] |
| 5766 | src: |
| 5767 | returns: vector |
| 5768 | operations: |
| 5769 | - node: '[*parser.VectorSelector] metric1' |
| 5770 | op: "" |
| 5771 | - node: '[*parser.Call] rate(metric1[5m])' |
| 5772 | op: rate |
| 5773 | position: |
| 5774 | start: 42 |
| 5775 | end: 53 |
| 5776 | type: function |
| 5777 | op: 57383 |
| 5778 | depth: 0 |
| 5779 | ison: false |
| 5780 | - matchinglabels: [] |
| 5781 | addedlabels: [] |
| 5782 | src: |
| 5783 | labels: |
| 5784 | "": |
| 5785 | reason: Calling `vector()` will return a vector value with no labels. |
| 5786 | kind: excluded |
| 5787 | fragment: |
| 5788 | start: 58 |
| 5789 | end: 64 |
| 5790 | returns: vector |
| 5791 | operations: |
| 5792 | - args: |
| 5793 | - "1" |
| 5794 | node: '[*parser.Call] vector(1)' |
| 5795 | op: vector |
| 5796 | returnInfo: |
| 5797 | logicalexpr: "" |
| 5798 | valueposition: |
| 5799 | start: 58 |
| 5800 | end: 67 |
| 5801 | returnednumber: 1 |
| 5802 | alwaysreturns: true |
| 5803 | knownreturn: true |
| 5804 | isreturnbool: false |
| 5805 | position: |
| 5806 | start: 58 |
| 5807 | end: 67 |
| 5808 | type: function |
| 5809 | fixedLabels: true |
| 5810 | op: 57383 |
| 5811 | depth: 0 |
| 5812 | ison: false |
| 5813 | - matchinglabels: [] |
| 5814 | addedlabels: [] |
| 5815 | src: |
| 5816 | labels: |
| 5817 | log_name: |
| 5818 | reason: Query will only return series where these labels are present. |
| 5819 | kind: guaranteed |
| 5820 | fragment: |
| 5821 | start: 72 |
| 5822 | end: 110 |
| 5823 | returns: vector |
| 5824 | operations: |
| 5825 | - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}' |
| 5826 | op: "" |
| 5827 | - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])' |
| 5828 | op: rate |
| 5829 | usedLabels: |
| 5830 | - log_name |
| 5831 | position: |
| 5832 | start: 77 |
| 5833 | end: 109 |
| 5834 | type: function |
| 5835 | op: 57383 |
| 5836 | depth: 0 |
| 5837 | ison: false |
| 5838 | - matchinglabels: [] |
| 5839 | addedlabels: [] |
| 5840 | src: |
| 5841 | labels: |
| 5842 | "": |
| 5843 | reason: Calling `vector()` will return a vector value with no labels. |
| 5844 | kind: excluded |
| 5845 | fragment: |
| 5846 | start: 114 |
| 5847 | end: 120 |
| 5848 | returns: vector |
| 5849 | operations: |
| 5850 | - args: |
| 5851 | - "2" |
| 5852 | node: '[*parser.Call] vector(2)' |
| 5853 | op: vector |
| 5854 | returnInfo: |
| 5855 | logicalexpr: "" |
| 5856 | valueposition: |
| 5857 | start: 114 |
| 5858 | end: 123 |
| 5859 | returnednumber: 2 |
| 5860 | alwaysreturns: true |
| 5861 | knownreturn: true |
| 5862 | isreturnbool: false |
| 5863 | position: |
| 5864 | start: 114 |
| 5865 | end: 123 |
| 5866 | type: function |
| 5867 | fixedLabels: true |
| 5868 | op: 57383 |
| 5869 | depth: 0 |
| 5870 | ison: false |
| 5871 | returnInfo: |
| 5872 | logicalexpr: vector(0) + vector(1) + vector(2) |
| 5873 | valueposition: |
| 5874 | start: 23 |
| 5875 | end: 32 |
| 5876 | returnednumber: 3 |
| 5877 | alwaysreturns: true |
| 5878 | knownreturn: true |
| 5879 | isreturnbool: false |
| 5880 | position: |
| 5881 | start: 23 |
| 5882 | end: 32 |
| 5883 | type: function |
| 5884 | fixedLabels: true |
| 5885 | isConditional: true |
| 5886 | |
| 5887 | --- |
| 5888 | |
| 5889 | [TestLabelsSource/127 - 1] |
| 5890 | expr: label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)") |
| 5891 | output: |
| 5892 | - labels: |
| 5893 | "": |
| 5894 | reason: Calling `vector()` will return a vector value with no labels. |
| 5895 | kind: excluded |
| 5896 | fragment: |
| 5897 | start: 14 |
| 5898 | end: 20 |
| 5899 | nexthop_tag: |
| 5900 | reason: This label will be added to the result by label_replace() call. |
| 5901 | kind: guaranteed |
| 5902 | fragment: |
| 5903 | start: 0 |
| 5904 | end: 64 |
| 5905 | returns: vector |
| 5906 | operations: |
| 5907 | - args: |
| 5908 | - "1" |
| 5909 | node: '[*parser.Call] vector(1)' |
| 5910 | op: vector |
| 5911 | - args: |
| 5912 | - '"nexthop_tag"' |
| 5913 | - '"$1"' |
| 5914 | - '"nexthop"' |
| 5915 | - '"(.+)"' |
| 5916 | node: '[*parser.Call] label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)")' |
| 5917 | op: label_replace |
| 5918 | usedLabels: |
| 5919 | - nexthop |
| 5920 | returnInfo: |
| 5921 | logicalexpr: "" |
| 5922 | valueposition: |
| 5923 | start: 14 |
| 5924 | end: 23 |
| 5925 | returnednumber: 1 |
| 5926 | alwaysreturns: true |
| 5927 | knownreturn: true |
| 5928 | isreturnbool: false |
| 5929 | position: |
| 5930 | start: 14 |
| 5931 | end: 23 |
| 5932 | type: function |
| 5933 | fixedLabels: true |
| 5934 | |
| 5935 | --- |
| 5936 | |
| 5937 | [TestLabelsSource/128 - 1] |
| 5938 | expr: (sum(foo{job="myjob"})) |
| 5939 | output: |
| 5940 | - labels: |
| 5941 | "": |
| 5942 | reason: Query is using aggregation that removes all labels. |
| 5943 | kind: excluded |
| 5944 | fragment: |
| 5945 | start: 1 |
| 5946 | end: 4 |
| 5947 | __name__: |
| 5948 | reason: Aggregation removes metric name. |
| 5949 | kind: excluded |
| 5950 | fragment: |
| 5951 | start: 1 |
| 5952 | end: 22 |
| 5953 | job: |
| 5954 | reason: Query is using aggregation that removes all labels. |
| 5955 | kind: excluded |
| 5956 | fragment: |
| 5957 | start: 1 |
| 5958 | end: 4 |
| 5959 | returns: vector |
| 5960 | operations: |
| 5961 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 5962 | op: "" |
| 5963 | - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})' |
| 5964 | op: sum |
| 5965 | position: |
| 5966 | start: 5 |
| 5967 | end: 21 |
| 5968 | type: aggregation |
| 5969 | fixedLabels: true |
| 5970 | |
| 5971 | --- |
| 5972 | |
| 5973 | [TestLabelsSource/129 - 1] |
| 5974 | expr: (-foo{job="myjob"}) |
| 5975 | output: |
| 5976 | - labels: |
| 5977 | job: |
| 5978 | reason: Query will only return series where these labels are present. |
| 5979 | kind: guaranteed |
| 5980 | fragment: |
| 5981 | start: 2 |
| 5982 | end: 18 |
| 5983 | returns: vector |
| 5984 | operations: |
| 5985 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 5986 | op: "" |
| 5987 | position: |
| 5988 | start: 2 |
| 5989 | end: 18 |
| 5990 | type: selector |
| 5991 | |
| 5992 | --- |
| 5993 | |
| 5994 | [TestLabelsSource/130 - 1] |
| 5995 | expr: |4- |
| 5996 | |
| 5997 | ((( group(vector(0)) ))) > 0 |
| 5998 | output: |
| 5999 | - labels: |
| 6000 | "": |
| 6001 | reason: Query is using aggregation that removes all labels. |
| 6002 | kind: excluded |
| 6003 | fragment: |
| 6004 | start: 5 |
| 6005 | end: 10 |
| 6006 | __name__: |
| 6007 | reason: Aggregation removes metric name. |
| 6008 | kind: excluded |
| 6009 | fragment: |
| 6010 | start: 5 |
| 6011 | end: 21 |
| 6012 | deadInfo: |
| 6013 | reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.' |
| 6014 | fragment: |
| 6015 | start: 11 |
| 6016 | end: 20 |
| 6017 | returns: vector |
| 6018 | operations: |
| 6019 | - args: |
| 6020 | - "0" |
| 6021 | node: '[*parser.Call] vector(0)' |
| 6022 | op: vector |
| 6023 | - node: '[*parser.AggregateExpr] group(vector(0))' |
| 6024 | op: group |
| 6025 | returnInfo: |
| 6026 | logicalexpr: "" |
| 6027 | valueposition: |
| 6028 | start: 11 |
| 6029 | end: 20 |
| 6030 | returnednumber: 0 |
| 6031 | alwaysreturns: true |
| 6032 | knownreturn: true |
| 6033 | isreturnbool: false |
| 6034 | position: |
| 6035 | start: 11 |
| 6036 | end: 20 |
| 6037 | type: aggregation |
| 6038 | fixedLabels: true |
| 6039 | isConditional: true |
| 6040 | |
| 6041 | --- |
| 6042 | |
| 6043 | [TestLabelsSource/131 - 1] |
| 6044 | expr: 1 > bool 5 |
| 6045 | output: |
| 6046 | - labels: |
| 6047 | "": |
| 6048 | reason: This query returns a number value with no labels. |
| 6049 | kind: excluded |
| 6050 | fragment: |
| 6051 | start: 0 |
| 6052 | end: 1 |
| 6053 | deadInfo: |
| 6054 | reason: '`1 > 5` always evaluates to `1 > 5` and uses the `bool` modifier which means it will always return 0' |
| 6055 | fragment: |
| 6056 | start: 0 |
| 6057 | end: 1 |
| 6058 | returns: scalar |
| 6059 | returnInfo: |
| 6060 | logicalexpr: "" |
| 6061 | valueposition: |
| 6062 | start: 0 |
| 6063 | end: 1 |
| 6064 | returnednumber: 1 |
| 6065 | alwaysreturns: true |
| 6066 | knownreturn: true |
| 6067 | isreturnbool: true |
| 6068 | position: |
| 6069 | start: 0 |
| 6070 | end: 1 |
| 6071 | type: number |
| 6072 | fixedLabels: true |
| 6073 | isConditional: true |
| 6074 | |
| 6075 | --- |
| 6076 | |
| 6077 | [TestLabelsSource/132 - 1] |
| 6078 | expr: prometheus_ready{job="prometheus"} unless vector(0) |
| 6079 | output: |
| 6080 | - labels: |
| 6081 | job: |
| 6082 | reason: Query will only return series where these labels are present. |
| 6083 | kind: guaranteed |
| 6084 | fragment: |
| 6085 | start: 0 |
| 6086 | end: 34 |
| 6087 | returns: vector |
| 6088 | operations: |
| 6089 | - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}' |
| 6090 | op: "" |
| 6091 | unless: |
| 6092 | - matchinglabels: [] |
| 6093 | src: |
| 6094 | labels: |
| 6095 | "": |
| 6096 | reason: Calling `vector()` will return a vector value with no labels. |
| 6097 | kind: excluded |
| 6098 | fragment: |
| 6099 | start: 42 |
| 6100 | end: 48 |
| 6101 | deadInfo: |
| 6102 | reason: The right hand side will never be matched because it doesn't have the `job` label while the left hand side will. Calling `vector()` will return a vector value with no labels. |
| 6103 | fragment: |
| 6104 | start: 42 |
| 6105 | end: 48 |
| 6106 | returns: vector |
| 6107 | operations: |
| 6108 | - args: |
| 6109 | - "0" |
| 6110 | node: '[*parser.Call] vector(0)' |
| 6111 | op: vector |
| 6112 | returnInfo: |
| 6113 | logicalexpr: "" |
| 6114 | valueposition: |
| 6115 | start: 42 |
| 6116 | end: 51 |
| 6117 | returnednumber: 0 |
| 6118 | alwaysreturns: true |
| 6119 | knownreturn: true |
| 6120 | isreturnbool: false |
| 6121 | position: |
| 6122 | start: 42 |
| 6123 | end: 51 |
| 6124 | type: function |
| 6125 | fixedLabels: true |
| 6126 | ison: false |
| 6127 | usedLabels: |
| 6128 | - job |
| 6129 | position: |
| 6130 | start: 0 |
| 6131 | end: 34 |
| 6132 | type: selector |
| 6133 | |
| 6134 | --- |
| 6135 | |
| 6136 | [TestLabelsSource/133 - 1] |
| 6137 | expr: prometheus_ready{job="prometheus"} unless on() vector(0) |
| 6138 | output: |
| 6139 | - labels: |
| 6140 | job: |
| 6141 | reason: Query will only return series where these labels are present. |
| 6142 | kind: guaranteed |
| 6143 | fragment: |
| 6144 | start: 0 |
| 6145 | end: 34 |
| 6146 | deadInfo: |
| 6147 | reason: This query will never return anything because the `unless` query always returns something. |
| 6148 | fragment: |
| 6149 | start: 47 |
| 6150 | end: 56 |
| 6151 | returns: vector |
| 6152 | operations: |
| 6153 | - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}' |
| 6154 | op: "" |
| 6155 | unless: |
| 6156 | - matchinglabels: [] |
| 6157 | src: |
| 6158 | labels: |
| 6159 | "": |
| 6160 | reason: Calling `vector()` will return a vector value with no labels. |
| 6161 | kind: excluded |
| 6162 | fragment: |
| 6163 | start: 47 |
| 6164 | end: 53 |
| 6165 | returns: vector |
| 6166 | operations: |
| 6167 | - args: |
| 6168 | - "0" |
| 6169 | node: '[*parser.Call] vector(0)' |
| 6170 | op: vector |
| 6171 | returnInfo: |
| 6172 | logicalexpr: "" |
| 6173 | valueposition: |
| 6174 | start: 47 |
| 6175 | end: 56 |
| 6176 | returnednumber: 0 |
| 6177 | alwaysreturns: true |
| 6178 | knownreturn: true |
| 6179 | isreturnbool: false |
| 6180 | position: |
| 6181 | start: 47 |
| 6182 | end: 56 |
| 6183 | type: function |
| 6184 | fixedLabels: true |
| 6185 | ison: true |
| 6186 | position: |
| 6187 | start: 0 |
| 6188 | end: 34 |
| 6189 | type: selector |
| 6190 | |
| 6191 | --- |
| 6192 | |
| 6193 | [TestLabelsSource/134 - 1] |
| 6194 | expr: prometheus_ready{job="prometheus"} unless on(job) vector(0) |
| 6195 | output: |
| 6196 | - labels: |
| 6197 | job: |
| 6198 | reason: Query will only return series where these labels are present. |
| 6199 | kind: guaranteed |
| 6200 | fragment: |
| 6201 | start: 0 |
| 6202 | end: 34 |
| 6203 | returns: vector |
| 6204 | operations: |
| 6205 | - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}' |
| 6206 | op: "" |
| 6207 | unless: |
| 6208 | - matchinglabels: |
| 6209 | - job |
| 6210 | src: |
| 6211 | labels: |
| 6212 | "": |
| 6213 | reason: Calling `vector()` will return a vector value with no labels. |
| 6214 | kind: excluded |
| 6215 | fragment: |
| 6216 | start: 50 |
| 6217 | end: 56 |
| 6218 | deadInfo: |
| 6219 | reason: The right hand side will never be matched because it doesn't have the `job` label from `on(...)`. Calling `vector()` will return a vector value with no labels. |
| 6220 | fragment: |
| 6221 | start: 50 |
| 6222 | end: 56 |
| 6223 | returns: vector |
| 6224 | operations: |
| 6225 | - args: |
| 6226 | - "0" |
| 6227 | node: '[*parser.Call] vector(0)' |
| 6228 | op: vector |
| 6229 | returnInfo: |
| 6230 | logicalexpr: "" |
| 6231 | valueposition: |
| 6232 | start: 50 |
| 6233 | end: 59 |
| 6234 | returnednumber: 0 |
| 6235 | alwaysreturns: true |
| 6236 | knownreturn: true |
| 6237 | isreturnbool: false |
| 6238 | position: |
| 6239 | start: 50 |
| 6240 | end: 59 |
| 6241 | type: function |
| 6242 | fixedLabels: true |
| 6243 | ison: true |
| 6244 | usedLabels: |
| 6245 | - job |
| 6246 | position: |
| 6247 | start: 0 |
| 6248 | end: 34 |
| 6249 | type: selector |
| 6250 | |
| 6251 | --- |
| 6252 | |
| 6253 | [TestLabelsSource/135 - 1] |
| 6254 | expr: |4 |
| 6255 | |
| 6256 | max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"}) |
| 6257 | unless |
| 6258 | sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"}) |
| 6259 | * on (instance) group_left (cluster) |
| 6260 | cf_node_role{kubernetes_role="master",role="kubernetes"} |
| 6261 | output: |
| 6262 | - labels: |
| 6263 | "": |
| 6264 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 6265 | kind: excluded |
| 6266 | fragment: |
| 6267 | start: 5 |
| 6268 | end: 8 |
| 6269 | __name__: |
| 6270 | reason: Aggregation removes metric name. |
| 6271 | kind: excluded |
| 6272 | fragment: |
| 6273 | start: 1 |
| 6274 | end: 86 |
| 6275 | cluster: |
| 6276 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 6277 | kind: included |
| 6278 | fragment: |
| 6279 | start: 19 |
| 6280 | end: 26 |
| 6281 | instance: |
| 6282 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 6283 | kind: included |
| 6284 | fragment: |
| 6285 | start: 9 |
| 6286 | end: 17 |
| 6287 | kubernetes_role: |
| 6288 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 6289 | kind: excluded |
| 6290 | fragment: |
| 6291 | start: 5 |
| 6292 | end: 27 |
| 6293 | role: |
| 6294 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 6295 | kind: excluded |
| 6296 | fragment: |
| 6297 | start: 5 |
| 6298 | end: 27 |
| 6299 | returns: vector |
| 6300 | operations: |
| 6301 | - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}' |
| 6302 | op: "" |
| 6303 | - node: '[*parser.AggregateExpr] max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"})' |
| 6304 | op: max |
| 6305 | unless: |
| 6306 | - matchinglabels: [] |
| 6307 | src: |
| 6308 | labels: |
| 6309 | "": |
| 6310 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 6311 | kind: excluded |
| 6312 | fragment: |
| 6313 | start: 99 |
| 6314 | end: 102 |
| 6315 | __name__: |
| 6316 | reason: Binary operation between two vectors removes metric names. |
| 6317 | kind: excluded |
| 6318 | fragment: |
| 6319 | start: 95 |
| 6320 | end: 303 |
| 6321 | cluster: |
| 6322 | reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 6323 | kind: included |
| 6324 | fragment: |
| 6325 | start: 234 |
| 6326 | end: 241 |
| 6327 | instance: |
| 6328 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 6329 | kind: included |
| 6330 | fragment: |
| 6331 | start: 212 |
| 6332 | end: 220 |
| 6333 | name: |
| 6334 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 6335 | kind: excluded |
| 6336 | fragment: |
| 6337 | start: 99 |
| 6338 | end: 121 |
| 6339 | returns: vector |
| 6340 | operations: |
| 6341 | - node: '[*parser.VectorSelector] node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"}' |
| 6342 | op: "" |
| 6343 | - node: '[*parser.AggregateExpr] sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"})' |
| 6344 | op: sum |
| 6345 | joins: |
| 6346 | - matchinglabels: |
| 6347 | - instance |
| 6348 | addedlabels: |
| 6349 | - cluster |
| 6350 | src: |
| 6351 | labels: |
| 6352 | kubernetes_role: |
| 6353 | reason: Query will only return series where these labels are present. |
| 6354 | kind: guaranteed |
| 6355 | fragment: |
| 6356 | start: 247 |
| 6357 | end: 303 |
| 6358 | role: |
| 6359 | reason: Query will only return series where these labels are present. |
| 6360 | kind: guaranteed |
| 6361 | fragment: |
| 6362 | start: 247 |
| 6363 | end: 303 |
| 6364 | returns: vector |
| 6365 | operations: |
| 6366 | - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}' |
| 6367 | op: "" |
| 6368 | position: |
| 6369 | start: 247 |
| 6370 | end: 303 |
| 6371 | type: selector |
| 6372 | op: 57395 |
| 6373 | depth: 0 |
| 6374 | ison: true |
| 6375 | usedLabels: |
| 6376 | - instance |
| 6377 | - cluster |
| 6378 | position: |
| 6379 | start: 132 |
| 6380 | end: 201 |
| 6381 | type: aggregation |
| 6382 | fixedLabels: true |
| 6383 | ison: false |
| 6384 | usedLabels: |
| 6385 | - instance |
| 6386 | - cluster |
| 6387 | position: |
| 6388 | start: 29 |
| 6389 | end: 85 |
| 6390 | type: aggregation |
| 6391 | fixedLabels: true |
| 6392 | |
| 6393 | --- |
| 6394 | |
| 6395 | [TestLabelsSource/136 - 1] |
| 6396 | expr: foo{a="1"} * on() bar{b="2"} |
| 6397 | output: |
| 6398 | - labels: |
| 6399 | "": |
| 6400 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 6401 | kind: excluded |
| 6402 | fragment: |
| 6403 | start: 13 |
| 6404 | end: 17 |
| 6405 | __name__: |
| 6406 | reason: Binary operation between two vectors removes metric names. |
| 6407 | kind: excluded |
| 6408 | fragment: |
| 6409 | start: 0 |
| 6410 | end: 28 |
| 6411 | a: |
| 6412 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 6413 | kind: excluded |
| 6414 | fragment: |
| 6415 | start: 13 |
| 6416 | end: 17 |
| 6417 | returns: vector |
| 6418 | operations: |
| 6419 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 6420 | op: "" |
| 6421 | joins: |
| 6422 | - matchinglabels: [] |
| 6423 | addedlabels: [] |
| 6424 | src: |
| 6425 | labels: |
| 6426 | b: |
| 6427 | reason: Query will only return series where these labels are present. |
| 6428 | kind: guaranteed |
| 6429 | fragment: |
| 6430 | start: 18 |
| 6431 | end: 28 |
| 6432 | returns: vector |
| 6433 | operations: |
| 6434 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 6435 | op: "" |
| 6436 | position: |
| 6437 | start: 18 |
| 6438 | end: 28 |
| 6439 | type: selector |
| 6440 | op: 57395 |
| 6441 | depth: 0 |
| 6442 | ison: true |
| 6443 | position: |
| 6444 | start: 0 |
| 6445 | end: 10 |
| 6446 | type: selector |
| 6447 | fixedLabels: true |
| 6448 | |
| 6449 | --- |
| 6450 | |
| 6451 | [TestLabelsSource/137 - 1] |
| 6452 | expr: foo{a="1"} * on(instance) group_left(c,d) bar{b="2"} |
| 6453 | output: |
| 6454 | - labels: |
| 6455 | __name__: |
| 6456 | reason: Binary operation between two vectors removes metric names. |
| 6457 | kind: excluded |
| 6458 | fragment: |
| 6459 | start: 0 |
| 6460 | end: 52 |
| 6461 | a: |
| 6462 | reason: Query will only return series where these labels are present. |
| 6463 | kind: guaranteed |
| 6464 | fragment: |
| 6465 | start: 0 |
| 6466 | end: 10 |
| 6467 | c: |
| 6468 | reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 6469 | kind: included |
| 6470 | fragment: |
| 6471 | start: 37 |
| 6472 | end: 38 |
| 6473 | d: |
| 6474 | reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 6475 | kind: included |
| 6476 | fragment: |
| 6477 | start: 39 |
| 6478 | end: 40 |
| 6479 | instance: |
| 6480 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 6481 | kind: included |
| 6482 | fragment: |
| 6483 | start: 16 |
| 6484 | end: 24 |
| 6485 | returns: vector |
| 6486 | operations: |
| 6487 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 6488 | op: "" |
| 6489 | joins: |
| 6490 | - matchinglabels: |
| 6491 | - instance |
| 6492 | addedlabels: |
| 6493 | - c |
| 6494 | - d |
| 6495 | src: |
| 6496 | labels: |
| 6497 | b: |
| 6498 | reason: Query will only return series where these labels are present. |
| 6499 | kind: guaranteed |
| 6500 | fragment: |
| 6501 | start: 42 |
| 6502 | end: 52 |
| 6503 | returns: vector |
| 6504 | operations: |
| 6505 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 6506 | op: "" |
| 6507 | position: |
| 6508 | start: 42 |
| 6509 | end: 52 |
| 6510 | type: selector |
| 6511 | op: 57395 |
| 6512 | depth: 0 |
| 6513 | ison: true |
| 6514 | usedLabels: |
| 6515 | - instance |
| 6516 | position: |
| 6517 | start: 0 |
| 6518 | end: 10 |
| 6519 | type: selector |
| 6520 | |
| 6521 | --- |
| 6522 | |
| 6523 | [TestLabelsSource/138 - 1] |
| 6524 | expr: foo{a="1"} * on(instance) group_right(c,d) bar{b="2"} |
| 6525 | output: |
| 6526 | - labels: |
| 6527 | __name__: |
| 6528 | reason: Binary operation between two vectors removes metric names. |
| 6529 | kind: excluded |
| 6530 | fragment: |
| 6531 | start: 0 |
| 6532 | end: 53 |
| 6533 | b: |
| 6534 | reason: Query will only return series where these labels are present. |
| 6535 | kind: guaranteed |
| 6536 | fragment: |
| 6537 | start: 43 |
| 6538 | end: 53 |
| 6539 | c: |
| 6540 | reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 6541 | kind: included |
| 6542 | fragment: |
| 6543 | start: 38 |
| 6544 | end: 39 |
| 6545 | d: |
| 6546 | reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 6547 | kind: included |
| 6548 | fragment: |
| 6549 | start: 40 |
| 6550 | end: 41 |
| 6551 | instance: |
| 6552 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 6553 | kind: included |
| 6554 | fragment: |
| 6555 | start: 16 |
| 6556 | end: 24 |
| 6557 | returns: vector |
| 6558 | operations: |
| 6559 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 6560 | op: "" |
| 6561 | joins: |
| 6562 | - matchinglabels: |
| 6563 | - instance |
| 6564 | addedlabels: |
| 6565 | - c |
| 6566 | - d |
| 6567 | src: |
| 6568 | labels: |
| 6569 | a: |
| 6570 | reason: Query will only return series where these labels are present. |
| 6571 | kind: guaranteed |
| 6572 | fragment: |
| 6573 | start: 0 |
| 6574 | end: 10 |
| 6575 | returns: vector |
| 6576 | operations: |
| 6577 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 6578 | op: "" |
| 6579 | position: |
| 6580 | start: 0 |
| 6581 | end: 10 |
| 6582 | type: selector |
| 6583 | op: 57395 |
| 6584 | depth: 0 |
| 6585 | ison: true |
| 6586 | usedLabels: |
| 6587 | - instance |
| 6588 | position: |
| 6589 | start: 43 |
| 6590 | end: 53 |
| 6591 | type: selector |
| 6592 | |
| 6593 | --- |
| 6594 | |
| 6595 | [TestLabelsSource/139 - 1] |
| 6596 | expr: foo{a="1"} * on(instance) sum(bar{b="2"}) |
| 6597 | output: |
| 6598 | - labels: |
| 6599 | "": |
| 6600 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 6601 | kind: excluded |
| 6602 | fragment: |
| 6603 | start: 13 |
| 6604 | end: 25 |
| 6605 | __name__: |
| 6606 | reason: Binary operation between two vectors removes metric names. |
| 6607 | kind: excluded |
| 6608 | fragment: |
| 6609 | start: 0 |
| 6610 | end: 41 |
| 6611 | a: |
| 6612 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 6613 | kind: excluded |
| 6614 | fragment: |
| 6615 | start: 13 |
| 6616 | end: 25 |
| 6617 | instance: |
| 6618 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 6619 | kind: included |
| 6620 | fragment: |
| 6621 | start: 16 |
| 6622 | end: 24 |
| 6623 | returns: vector |
| 6624 | operations: |
| 6625 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 6626 | op: "" |
| 6627 | joins: |
| 6628 | - matchinglabels: |
| 6629 | - instance |
| 6630 | addedlabels: [] |
| 6631 | src: |
| 6632 | labels: |
| 6633 | "": |
| 6634 | reason: Query is using aggregation that removes all labels. |
| 6635 | kind: excluded |
| 6636 | fragment: |
| 6637 | start: 26 |
| 6638 | end: 29 |
| 6639 | __name__: |
| 6640 | reason: Aggregation removes metric name. |
| 6641 | kind: excluded |
| 6642 | fragment: |
| 6643 | start: 26 |
| 6644 | end: 41 |
| 6645 | b: |
| 6646 | reason: Query is using aggregation that removes all labels. |
| 6647 | kind: excluded |
| 6648 | fragment: |
| 6649 | start: 26 |
| 6650 | end: 29 |
| 6651 | deadInfo: |
| 6652 | reason: The right hand side will never be matched because it doesn't have the `instance` label from `on(...)`. Query is using aggregation that removes all labels. |
| 6653 | fragment: |
| 6654 | start: 26 |
| 6655 | end: 29 |
| 6656 | returns: vector |
| 6657 | operations: |
| 6658 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 6659 | op: "" |
| 6660 | - node: '[*parser.AggregateExpr] sum(bar{b="2"})' |
| 6661 | op: sum |
| 6662 | position: |
| 6663 | start: 30 |
| 6664 | end: 40 |
| 6665 | type: aggregation |
| 6666 | fixedLabels: true |
| 6667 | op: 57395 |
| 6668 | depth: 0 |
| 6669 | ison: true |
| 6670 | usedLabels: |
| 6671 | - instance |
| 6672 | position: |
| 6673 | start: 0 |
| 6674 | end: 10 |
| 6675 | type: selector |
| 6676 | fixedLabels: true |
| 6677 | |
| 6678 | --- |
| 6679 | |
| 6680 | [TestLabelsSource/140 - 1] |
| 6681 | expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"}) |
| 6682 | output: |
| 6683 | - labels: |
| 6684 | __name__: |
| 6685 | reason: Binary operation between two vectors removes metric names. |
| 6686 | kind: excluded |
| 6687 | fragment: |
| 6688 | start: 0 |
| 6689 | end: 57 |
| 6690 | a: |
| 6691 | reason: Query will only return series where these labels are present. |
| 6692 | kind: guaranteed |
| 6693 | fragment: |
| 6694 | start: 0 |
| 6695 | end: 10 |
| 6696 | c: |
| 6697 | reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 6698 | kind: included |
| 6699 | fragment: |
| 6700 | start: 37 |
| 6701 | end: 38 |
| 6702 | d: |
| 6703 | reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 6704 | kind: included |
| 6705 | fragment: |
| 6706 | start: 39 |
| 6707 | end: 40 |
| 6708 | instance: |
| 6709 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 6710 | kind: included |
| 6711 | fragment: |
| 6712 | start: 16 |
| 6713 | end: 24 |
| 6714 | returns: vector |
| 6715 | operations: |
| 6716 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 6717 | op: "" |
| 6718 | joins: |
| 6719 | - matchinglabels: |
| 6720 | - instance |
| 6721 | addedlabels: |
| 6722 | - c |
| 6723 | - d |
| 6724 | src: |
| 6725 | labels: |
| 6726 | "": |
| 6727 | reason: Query is using aggregation that removes all labels. |
| 6728 | kind: excluded |
| 6729 | fragment: |
| 6730 | start: 42 |
| 6731 | end: 45 |
| 6732 | __name__: |
| 6733 | reason: Aggregation removes metric name. |
| 6734 | kind: excluded |
| 6735 | fragment: |
| 6736 | start: 42 |
| 6737 | end: 57 |
| 6738 | b: |
| 6739 | reason: Query is using aggregation that removes all labels. |
| 6740 | kind: excluded |
| 6741 | fragment: |
| 6742 | start: 42 |
| 6743 | end: 45 |
| 6744 | deadInfo: |
| 6745 | reason: The right hand side will never be matched because it doesn't have the `instance` label from `on(...)`. Query is using aggregation that removes all labels. |
| 6746 | fragment: |
| 6747 | start: 42 |
| 6748 | end: 45 |
| 6749 | deadLabels: |
| 6750 | - name: c |
| 6751 | reason: You can't use `c` because this label is not possible here. |
| 6752 | labelreason: Query is using aggregation that removes all labels. |
| 6753 | usagefragment: |
| 6754 | start: 37 |
| 6755 | end: 38 |
| 6756 | labelfragment: |
| 6757 | start: 42 |
| 6758 | end: 45 |
| 6759 | kind: 0 |
| 6760 | - name: d |
| 6761 | reason: You can't use `d` because this label is not possible here. |
| 6762 | labelreason: Query is using aggregation that removes all labels. |
| 6763 | usagefragment: |
| 6764 | start: 39 |
| 6765 | end: 40 |
| 6766 | labelfragment: |
| 6767 | start: 42 |
| 6768 | end: 45 |
| 6769 | kind: 0 |
| 6770 | returns: vector |
| 6771 | operations: |
| 6772 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 6773 | op: "" |
| 6774 | - node: '[*parser.AggregateExpr] sum(bar{b="2"})' |
| 6775 | op: sum |
| 6776 | position: |
| 6777 | start: 46 |
| 6778 | end: 56 |
| 6779 | type: aggregation |
| 6780 | fixedLabels: true |
| 6781 | op: 57395 |
| 6782 | depth: 0 |
| 6783 | ison: true |
| 6784 | usedLabels: |
| 6785 | - instance |
| 6786 | position: |
| 6787 | start: 0 |
| 6788 | end: 10 |
| 6789 | type: selector |
| 6790 | |
| 6791 | --- |
| 6792 | |
| 6793 | [TestLabelsSource/141 - 1] |
| 6794 | expr: sum(foo{a="1"}) * on(instance) group_right(c,d) bar{b="2"} |
| 6795 | output: |
| 6796 | - labels: |
| 6797 | __name__: |
| 6798 | reason: Binary operation between two vectors removes metric names. |
| 6799 | kind: excluded |
| 6800 | fragment: |
| 6801 | start: 0 |
| 6802 | end: 58 |
| 6803 | b: |
| 6804 | reason: Query will only return series where these labels are present. |
| 6805 | kind: guaranteed |
| 6806 | fragment: |
| 6807 | start: 48 |
| 6808 | end: 58 |
| 6809 | c: |
| 6810 | reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 6811 | kind: included |
| 6812 | fragment: |
| 6813 | start: 43 |
| 6814 | end: 44 |
| 6815 | d: |
| 6816 | reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 6817 | kind: included |
| 6818 | fragment: |
| 6819 | start: 45 |
| 6820 | end: 46 |
| 6821 | instance: |
| 6822 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 6823 | kind: included |
| 6824 | fragment: |
| 6825 | start: 21 |
| 6826 | end: 29 |
| 6827 | returns: vector |
| 6828 | operations: |
| 6829 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 6830 | op: "" |
| 6831 | joins: |
| 6832 | - matchinglabels: |
| 6833 | - instance |
| 6834 | addedlabels: |
| 6835 | - c |
| 6836 | - d |
| 6837 | src: |
| 6838 | labels: |
| 6839 | "": |
| 6840 | reason: Query is using aggregation that removes all labels. |
| 6841 | kind: excluded |
| 6842 | fragment: |
| 6843 | start: 0 |
| 6844 | end: 3 |
| 6845 | __name__: |
| 6846 | reason: Aggregation removes metric name. |
| 6847 | kind: excluded |
| 6848 | fragment: |
| 6849 | start: 0 |
| 6850 | end: 15 |
| 6851 | a: |
| 6852 | reason: Query is using aggregation that removes all labels. |
| 6853 | kind: excluded |
| 6854 | fragment: |
| 6855 | start: 0 |
| 6856 | end: 3 |
| 6857 | deadInfo: |
| 6858 | reason: The left hand side will never be matched because it doesn't have the `instance` label from `on(...)`. Query is using aggregation that removes all labels. |
| 6859 | fragment: |
| 6860 | start: 0 |
| 6861 | end: 3 |
| 6862 | deadLabels: |
| 6863 | - name: c |
| 6864 | reason: You can't use `c` because this label is not possible here. |
| 6865 | labelreason: Query is using aggregation that removes all labels. |
| 6866 | usagefragment: |
| 6867 | start: 43 |
| 6868 | end: 44 |
| 6869 | labelfragment: |
| 6870 | start: 0 |
| 6871 | end: 3 |
| 6872 | kind: 0 |
| 6873 | - name: d |
| 6874 | reason: You can't use `d` because this label is not possible here. |
| 6875 | labelreason: Query is using aggregation that removes all labels. |
| 6876 | usagefragment: |
| 6877 | start: 45 |
| 6878 | end: 46 |
| 6879 | labelfragment: |
| 6880 | start: 0 |
| 6881 | end: 3 |
| 6882 | kind: 0 |
| 6883 | returns: vector |
| 6884 | operations: |
| 6885 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 6886 | op: "" |
| 6887 | - node: '[*parser.AggregateExpr] sum(foo{a="1"})' |
| 6888 | op: sum |
| 6889 | position: |
| 6890 | start: 4 |
| 6891 | end: 14 |
| 6892 | type: aggregation |
| 6893 | fixedLabels: true |
| 6894 | op: 57395 |
| 6895 | depth: 0 |
| 6896 | ison: true |
| 6897 | usedLabels: |
| 6898 | - instance |
| 6899 | position: |
| 6900 | start: 48 |
| 6901 | end: 58 |
| 6902 | type: selector |
| 6903 | |
| 6904 | --- |
| 6905 | |
| 6906 | [TestLabelsSource/142 - 1] |
| 6907 | expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"}) without(instance) |
| 6908 | output: |
| 6909 | - labels: |
| 6910 | __name__: |
| 6911 | reason: Binary operation between two vectors removes metric names. |
| 6912 | kind: excluded |
| 6913 | fragment: |
| 6914 | start: 0 |
| 6915 | end: 75 |
| 6916 | a: |
| 6917 | reason: Query will only return series where these labels are present. |
| 6918 | kind: guaranteed |
| 6919 | fragment: |
| 6920 | start: 0 |
| 6921 | end: 10 |
| 6922 | c: |
| 6923 | reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 6924 | kind: included |
| 6925 | fragment: |
| 6926 | start: 37 |
| 6927 | end: 38 |
| 6928 | d: |
| 6929 | reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 6930 | kind: included |
| 6931 | fragment: |
| 6932 | start: 39 |
| 6933 | end: 40 |
| 6934 | instance: |
| 6935 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 6936 | kind: included |
| 6937 | fragment: |
| 6938 | start: 16 |
| 6939 | end: 24 |
| 6940 | returns: vector |
| 6941 | operations: |
| 6942 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 6943 | op: "" |
| 6944 | joins: |
| 6945 | - matchinglabels: |
| 6946 | - instance |
| 6947 | addedlabels: |
| 6948 | - c |
| 6949 | - d |
| 6950 | src: |
| 6951 | labels: |
| 6952 | __name__: |
| 6953 | reason: Aggregation removes metric name. |
| 6954 | kind: excluded |
| 6955 | fragment: |
| 6956 | start: 42 |
| 6957 | end: 75 |
| 6958 | b: |
| 6959 | reason: Query will only return series where these labels are present. |
| 6960 | kind: guaranteed |
| 6961 | fragment: |
| 6962 | start: 46 |
| 6963 | end: 56 |
| 6964 | instance: |
| 6965 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6966 | kind: excluded |
| 6967 | fragment: |
| 6968 | start: 66 |
| 6969 | end: 74 |
| 6970 | deadInfo: |
| 6971 | reason: The right hand side will never be matched because it doesn't have the `instance` label from `on(...)`. Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6972 | fragment: |
| 6973 | start: 66 |
| 6974 | end: 74 |
| 6975 | returns: vector |
| 6976 | operations: |
| 6977 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 6978 | op: "" |
| 6979 | - node: '[*parser.AggregateExpr] sum without (instance) (bar{b="2"})' |
| 6980 | op: sum |
| 6981 | position: |
| 6982 | start: 46 |
| 6983 | end: 56 |
| 6984 | type: aggregation |
| 6985 | op: 57395 |
| 6986 | depth: 0 |
| 6987 | ison: true |
| 6988 | usedLabels: |
| 6989 | - instance |
| 6990 | position: |
| 6991 | start: 0 |
| 6992 | end: 10 |
| 6993 | type: selector |
| 6994 | |
| 6995 | --- |
| 6996 | |
| 6997 | [TestLabelsSource/143 - 1] |
| 6998 | expr: sum(foo{a="1"}) without(instance) * on(instance) group_right(c,d) bar{b="2"} |
| 6999 | output: |
| 7000 | - labels: |
| 7001 | __name__: |
| 7002 | reason: Binary operation between two vectors removes metric names. |
| 7003 | kind: excluded |
| 7004 | fragment: |
| 7005 | start: 0 |
| 7006 | end: 76 |
| 7007 | b: |
| 7008 | reason: Query will only return series where these labels are present. |
| 7009 | kind: guaranteed |
| 7010 | fragment: |
| 7011 | start: 66 |
| 7012 | end: 76 |
| 7013 | c: |
| 7014 | reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 7015 | kind: included |
| 7016 | fragment: |
| 7017 | start: 61 |
| 7018 | end: 62 |
| 7019 | d: |
| 7020 | reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 7021 | kind: included |
| 7022 | fragment: |
| 7023 | start: 63 |
| 7024 | end: 64 |
| 7025 | instance: |
| 7026 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 7027 | kind: included |
| 7028 | fragment: |
| 7029 | start: 39 |
| 7030 | end: 47 |
| 7031 | returns: vector |
| 7032 | operations: |
| 7033 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 7034 | op: "" |
| 7035 | joins: |
| 7036 | - matchinglabels: |
| 7037 | - instance |
| 7038 | addedlabels: |
| 7039 | - c |
| 7040 | - d |
| 7041 | src: |
| 7042 | labels: |
| 7043 | __name__: |
| 7044 | reason: Aggregation removes metric name. |
| 7045 | kind: excluded |
| 7046 | fragment: |
| 7047 | start: 0 |
| 7048 | end: 33 |
| 7049 | a: |
| 7050 | reason: Query will only return series where these labels are present. |
| 7051 | kind: guaranteed |
| 7052 | fragment: |
| 7053 | start: 4 |
| 7054 | end: 14 |
| 7055 | instance: |
| 7056 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 7057 | kind: excluded |
| 7058 | fragment: |
| 7059 | start: 24 |
| 7060 | end: 32 |
| 7061 | deadInfo: |
| 7062 | reason: The left hand side will never be matched because it doesn't have the `instance` label from `on(...)`. Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 7063 | fragment: |
| 7064 | start: 24 |
| 7065 | end: 32 |
| 7066 | returns: vector |
| 7067 | operations: |
| 7068 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 7069 | op: "" |
| 7070 | - node: '[*parser.AggregateExpr] sum without (instance) (foo{a="1"})' |
| 7071 | op: sum |
| 7072 | position: |
| 7073 | start: 4 |
| 7074 | end: 14 |
| 7075 | type: aggregation |
| 7076 | op: 57395 |
| 7077 | depth: 0 |
| 7078 | ison: true |
| 7079 | usedLabels: |
| 7080 | - instance |
| 7081 | position: |
| 7082 | start: 66 |
| 7083 | end: 76 |
| 7084 | type: selector |
| 7085 | |
| 7086 | --- |
| 7087 | |
| 7088 | [TestLabelsSource/144 - 1] |
| 7089 | expr: |4 |
| 7090 | |
| 7091 | max without (source_instance) ( |
| 7092 | increase(kernel_device_io_errors_total{device!~"loop.+"}[120m]) > 3 unless on(instance, device) ( |
| 7093 | increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[125m])*2 > increase(kernel_device_io_errors_total[120m]) |
| 7094 | ) |
| 7095 | and on(device, instance) absent(node_disk_info) |
| 7096 | ) * on(instance) group_left(group) label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)") |
| 7097 | output: |
| 7098 | - labels: |
| 7099 | __name__: |
| 7100 | reason: Binary operation between two vectors removes metric names. |
| 7101 | kind: excluded |
| 7102 | fragment: |
| 7103 | start: 2 |
| 7104 | end: 442 |
| 7105 | device: |
| 7106 | reason: Query is using many-to-many vector matching with `on(device, instance)`, labels included inside `on(...)` will be present on the results if matched time series have them. |
| 7107 | kind: included |
| 7108 | fragment: |
| 7109 | start: 274 |
| 7110 | end: 280 |
| 7111 | group: |
| 7112 | reason: Query is using `group_left(group)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 7113 | kind: included |
| 7114 | fragment: |
| 7115 | start: 344 |
| 7116 | end: 349 |
| 7117 | instance: |
| 7118 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 7119 | kind: included |
| 7120 | fragment: |
| 7121 | start: 323 |
| 7122 | end: 331 |
| 7123 | source_instance: |
| 7124 | reason: Query is using aggregation with `without(source_instance)`, all labels included inside `without(...)` will be removed from the results. |
| 7125 | kind: excluded |
| 7126 | fragment: |
| 7127 | start: 15 |
| 7128 | end: 30 |
| 7129 | returns: vector |
| 7130 | operations: |
| 7131 | - node: '[*parser.VectorSelector] kernel_device_io_errors_total{device!~"loop.+"}' |
| 7132 | op: "" |
| 7133 | - node: '[*parser.Call] increase(kernel_device_io_errors_total{device!~"loop.+"}[2h])' |
| 7134 | op: increase |
| 7135 | - node: '[*parser.AggregateExpr] max without (source_instance) (increase(kernel_device_io_errors_total{device!~"loop.+"}[2h]) > 3 unless on (instance, device) (increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[2h5m]) * 2 > increase(kernel_device_io_errors_total[2h])) and on (device, instance) absent(node_disk_info))' |
| 7136 | op: max |
| 7137 | joins: |
| 7138 | - matchinglabels: |
| 7139 | - device |
| 7140 | - instance |
| 7141 | addedlabels: [] |
| 7142 | src: |
| 7143 | labels: |
| 7144 | "": |
| 7145 | reason: |- |
| 7146 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 7147 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 7148 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 7149 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 7150 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 7151 | kind: excluded |
| 7152 | fragment: |
| 7153 | start: 292 |
| 7154 | end: 298 |
| 7155 | deadInfo: |
| 7156 | reason: |- |
| 7157 | The right hand side will never be matched because it doesn't have the `device` label from `on(...)`. The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series. |
| 7158 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 7159 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 7160 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 7161 | If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead. |
| 7162 | fragment: |
| 7163 | start: 292 |
| 7164 | end: 298 |
| 7165 | returns: vector |
| 7166 | operations: |
| 7167 | - node: '[*parser.VectorSelector] node_disk_info' |
| 7168 | op: "" |
| 7169 | - node: '[*parser.Call] absent(node_disk_info)' |
| 7170 | op: absent |
| 7171 | position: |
| 7172 | start: 299 |
| 7173 | end: 313 |
| 7174 | type: function |
| 7175 | fixedLabels: true |
| 7176 | op: 57389 |
| 7177 | depth: 1 |
| 7178 | ison: true |
| 7179 | - matchinglabels: |
| 7180 | - instance |
| 7181 | addedlabels: |
| 7182 | - group |
| 7183 | src: |
| 7184 | labels: |
| 7185 | instance: |
| 7186 | reason: This label will be added to the result by label_replace() call. |
| 7187 | kind: guaranteed |
| 7188 | fragment: |
| 7189 | start: 351 |
| 7190 | end: 442 |
| 7191 | returns: vector |
| 7192 | operations: |
| 7193 | - node: '[*parser.VectorSelector] salt_highstate_runner_configured_minions' |
| 7194 | op: "" |
| 7195 | - args: |
| 7196 | - '"instance"' |
| 7197 | - '"$1"' |
| 7198 | - '"minion"' |
| 7199 | - '"(.+)"' |
| 7200 | node: '[*parser.Call] label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)")' |
| 7201 | op: label_replace |
| 7202 | usedLabels: |
| 7203 | - minion |
| 7204 | position: |
| 7205 | start: 365 |
| 7206 | end: 405 |
| 7207 | type: function |
| 7208 | op: 57395 |
| 7209 | depth: 0 |
| 7210 | ison: true |
| 7211 | unless: |
| 7212 | - matchinglabels: |
| 7213 | - instance |
| 7214 | - device |
| 7215 | src: |
| 7216 | labels: |
| 7217 | __name__: |
| 7218 | reason: Binary operation between two vectors removes metric names. |
| 7219 | kind: excluded |
| 7220 | fragment: |
| 7221 | start: 140 |
| 7222 | end: 258 |
| 7223 | returns: vector |
| 7224 | operations: |
| 7225 | - node: '[*parser.VectorSelector] kernel_device_io_soft_errors_total{device!~"loop.+"}' |
| 7226 | op: "" |
| 7227 | - node: '[*parser.Call] increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[2h5m])' |
| 7228 | op: increase |
| 7229 | joins: |
| 7230 | - matchinglabels: [] |
| 7231 | addedlabels: [] |
| 7232 | src: |
| 7233 | returns: vector |
| 7234 | operations: |
| 7235 | - node: '[*parser.VectorSelector] kernel_device_io_errors_total' |
| 7236 | op: "" |
| 7237 | - node: '[*parser.Call] increase(kernel_device_io_errors_total[2h])' |
| 7238 | op: increase |
| 7239 | position: |
| 7240 | start: 222 |
| 7241 | end: 257 |
| 7242 | type: function |
| 7243 | op: 57388 |
| 7244 | depth: 0 |
| 7245 | ison: false |
| 7246 | position: |
| 7247 | start: 149 |
| 7248 | end: 207 |
| 7249 | type: function |
| 7250 | isConditional: true |
| 7251 | ison: true |
| 7252 | usedLabels: |
| 7253 | - instance |
| 7254 | - device |
| 7255 | position: |
| 7256 | start: 46 |
| 7257 | end: 99 |
| 7258 | type: aggregation |
| 7259 | isConditional: true |
| 7260 | |
| 7261 | --- |
| 7262 | |
| 7263 | [TestLabelsSource/145 - 1] |
| 7264 | expr: sum(foo{a="1"}) by(job) * on() bar{b="2"} |
| 7265 | output: |
| 7266 | - labels: |
| 7267 | "": |
| 7268 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 7269 | kind: excluded |
| 7270 | fragment: |
| 7271 | start: 26 |
| 7272 | end: 30 |
| 7273 | __name__: |
| 7274 | reason: Binary operation between two vectors removes metric names. |
| 7275 | kind: excluded |
| 7276 | fragment: |
| 7277 | start: 0 |
| 7278 | end: 41 |
| 7279 | a: |
| 7280 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 7281 | kind: excluded |
| 7282 | fragment: |
| 7283 | start: 16 |
| 7284 | end: 23 |
| 7285 | job: |
| 7286 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 7287 | kind: excluded |
| 7288 | fragment: |
| 7289 | start: 26 |
| 7290 | end: 30 |
| 7291 | returns: vector |
| 7292 | operations: |
| 7293 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 7294 | op: "" |
| 7295 | - node: '[*parser.AggregateExpr] sum by (job) (foo{a="1"})' |
| 7296 | op: sum |
| 7297 | joins: |
| 7298 | - matchinglabels: [] |
| 7299 | addedlabels: [] |
| 7300 | src: |
| 7301 | labels: |
| 7302 | b: |
| 7303 | reason: Query will only return series where these labels are present. |
| 7304 | kind: guaranteed |
| 7305 | fragment: |
| 7306 | start: 31 |
| 7307 | end: 41 |
| 7308 | returns: vector |
| 7309 | operations: |
| 7310 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 7311 | op: "" |
| 7312 | position: |
| 7313 | start: 31 |
| 7314 | end: 41 |
| 7315 | type: selector |
| 7316 | op: 57395 |
| 7317 | depth: 0 |
| 7318 | ison: true |
| 7319 | position: |
| 7320 | start: 4 |
| 7321 | end: 14 |
| 7322 | type: aggregation |
| 7323 | fixedLabels: true |
| 7324 | |
| 7325 | --- |
| 7326 | |
| 7327 | [TestLabelsSource/146 - 1] |
| 7328 | expr: sum(sum(foo) without(job)) by(job) |
| 7329 | output: |
| 7330 | - labels: |
| 7331 | "": |
| 7332 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 7333 | kind: excluded |
| 7334 | fragment: |
| 7335 | start: 27 |
| 7336 | end: 29 |
| 7337 | __name__: |
| 7338 | reason: Aggregation removes metric name. |
| 7339 | kind: excluded |
| 7340 | fragment: |
| 7341 | start: 0 |
| 7342 | end: 34 |
| 7343 | job: |
| 7344 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 7345 | kind: excluded |
| 7346 | fragment: |
| 7347 | start: 21 |
| 7348 | end: 24 |
| 7349 | deadLabels: |
| 7350 | - name: job |
| 7351 | reason: You can't use `job` because this label is not possible here. |
| 7352 | labelreason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 7353 | usagefragment: |
| 7354 | start: 30 |
| 7355 | end: 33 |
| 7356 | labelfragment: |
| 7357 | start: 21 |
| 7358 | end: 24 |
| 7359 | kind: 0 |
| 7360 | returns: vector |
| 7361 | operations: |
| 7362 | - node: '[*parser.VectorSelector] foo' |
| 7363 | op: "" |
| 7364 | - node: '[*parser.AggregateExpr] sum without (job) (foo)' |
| 7365 | op: sum |
| 7366 | - node: '[*parser.AggregateExpr] sum by (job) (sum without (job) (foo))' |
| 7367 | op: sum |
| 7368 | usedLabels: |
| 7369 | - job |
| 7370 | position: |
| 7371 | start: 8 |
| 7372 | end: 11 |
| 7373 | type: aggregation |
| 7374 | fixedLabels: true |
| 7375 | |
| 7376 | --- |
| 7377 | |
| 7378 | [TestLabelsSource/147 - 1] |
| 7379 | expr: |4 |
| 7380 | |
| 7381 | prometheus:scrape_series_added:since_gc:sum |
| 7382 | * on(prometheus) group_left() |
| 7383 | label_replace( |
| 7384 | max(max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])) by(instance) |
| 7385 | / |
| 7386 | max(max_over_time(prometheus_tsdb_head_series[2h])) by(instance), |
| 7387 | "prometheus", "$1", |
| 7388 | "instance", "(.+)" |
| 7389 | ) |
| 7390 | output: |
| 7391 | - labels: |
| 7392 | __name__: |
| 7393 | reason: Binary operation between two vectors removes metric names. |
| 7394 | kind: excluded |
| 7395 | fragment: |
| 7396 | start: 1 |
| 7397 | end: 287 |
| 7398 | prometheus: |
| 7399 | reason: Query is using many-to-one vector matching with `on(prometheus)`, labels included inside `on(...)` will be present on the results. |
| 7400 | kind: included |
| 7401 | fragment: |
| 7402 | start: 50 |
| 7403 | end: 60 |
| 7404 | returns: vector |
| 7405 | operations: |
| 7406 | - node: '[*parser.VectorSelector] prometheus:scrape_series_added:since_gc:sum' |
| 7407 | op: "" |
| 7408 | joins: |
| 7409 | - matchinglabels: |
| 7410 | - prometheus |
| 7411 | addedlabels: [] |
| 7412 | src: |
| 7413 | labels: |
| 7414 | "": |
| 7415 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 7416 | kind: excluded |
| 7417 | fragment: |
| 7418 | start: 158 |
| 7419 | end: 160 |
| 7420 | __name__: |
| 7421 | reason: Binary operation between two vectors removes metric names. |
| 7422 | kind: excluded |
| 7423 | fragment: |
| 7424 | start: 92 |
| 7425 | end: 241 |
| 7426 | instance: |
| 7427 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 7428 | kind: included |
| 7429 | fragment: |
| 7430 | start: 161 |
| 7431 | end: 169 |
| 7432 | job: |
| 7433 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 7434 | kind: excluded |
| 7435 | fragment: |
| 7436 | start: 158 |
| 7437 | end: 170 |
| 7438 | prometheus: |
| 7439 | reason: This label will be added to the result by label_replace() call. |
| 7440 | kind: guaranteed |
| 7441 | fragment: |
| 7442 | start: 75 |
| 7443 | end: 287 |
| 7444 | returns: vector |
| 7445 | operations: |
| 7446 | - node: '[*parser.VectorSelector] go_memstats_alloc_bytes{job="prometheus"}' |
| 7447 | op: "" |
| 7448 | - node: '[*parser.Call] max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])' |
| 7449 | op: max_over_time |
| 7450 | - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h]))' |
| 7451 | op: max |
| 7452 | - args: |
| 7453 | - '"prometheus"' |
| 7454 | - '"$1"' |
| 7455 | - '"instance"' |
| 7456 | - '"(.+)"' |
| 7457 | node: '[*parser.Call] label_replace(max by (instance) (max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])) / max by (instance) (max_over_time(prometheus_tsdb_head_series[2h])), "prometheus", "$1", "instance", "(.+)")' |
| 7458 | op: label_replace |
| 7459 | joins: |
| 7460 | - matchinglabels: [] |
| 7461 | addedlabels: [] |
| 7462 | src: |
| 7463 | labels: |
| 7464 | "": |
| 7465 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 7466 | kind: excluded |
| 7467 | fragment: |
| 7468 | start: 229 |
| 7469 | end: 231 |
| 7470 | __name__: |
| 7471 | reason: Aggregation removes metric name. |
| 7472 | kind: excluded |
| 7473 | fragment: |
| 7474 | start: 177 |
| 7475 | end: 241 |
| 7476 | instance: |
| 7477 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 7478 | kind: included |
| 7479 | fragment: |
| 7480 | start: 232 |
| 7481 | end: 240 |
| 7482 | returns: vector |
| 7483 | operations: |
| 7484 | - node: '[*parser.VectorSelector] prometheus_tsdb_head_series' |
| 7485 | op: "" |
| 7486 | - node: '[*parser.Call] max_over_time(prometheus_tsdb_head_series[2h])' |
| 7487 | op: max_over_time |
| 7488 | - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(prometheus_tsdb_head_series[2h]))' |
| 7489 | op: max |
| 7490 | usedLabels: |
| 7491 | - instance |
| 7492 | position: |
| 7493 | start: 195 |
| 7494 | end: 226 |
| 7495 | type: aggregation |
| 7496 | fixedLabels: true |
| 7497 | op: 57384 |
| 7498 | depth: 0 |
| 7499 | ison: false |
| 7500 | usedLabels: |
| 7501 | - instance |
| 7502 | position: |
| 7503 | start: 92 |
| 7504 | end: 241 |
| 7505 | type: function |
| 7506 | fixedLabels: true |
| 7507 | op: 57395 |
| 7508 | depth: 0 |
| 7509 | ison: true |
| 7510 | usedLabels: |
| 7511 | - prometheus |
| 7512 | position: |
| 7513 | start: 1 |
| 7514 | end: 44 |
| 7515 | type: selector |
| 7516 | |
| 7517 | --- |
| 7518 | |
| 7519 | [TestLabelsSource/148 - 1] |
| 7520 | expr: (day_of_week() == 6 and hour() < 1) or vector(1) |
| 7521 | output: |
| 7522 | - labels: |
| 7523 | "": |
| 7524 | reason: Calling `day_of_week()` with no arguments will return an empty time series with no labels. |
| 7525 | kind: excluded |
| 7526 | fragment: |
| 7527 | start: 1 |
| 7528 | end: 14 |
| 7529 | returns: vector |
| 7530 | operations: |
| 7531 | - node: '[*parser.Call] day_of_week()' |
| 7532 | op: day_of_week |
| 7533 | joins: |
| 7534 | - matchinglabels: [] |
| 7535 | addedlabels: [] |
| 7536 | src: |
| 7537 | labels: |
| 7538 | "": |
| 7539 | reason: Calling `hour()` with no arguments will return an empty time series with no labels. |
| 7540 | kind: excluded |
| 7541 | fragment: |
| 7542 | start: 24 |
| 7543 | end: 30 |
| 7544 | returns: vector |
| 7545 | operations: |
| 7546 | - node: '[*parser.Call] hour()' |
| 7547 | op: hour |
| 7548 | returnInfo: |
| 7549 | logicalexpr: "" |
| 7550 | valueposition: |
| 7551 | start: 0 |
| 7552 | end: 0 |
| 7553 | returnednumber: 0 |
| 7554 | alwaysreturns: true |
| 7555 | knownreturn: false |
| 7556 | isreturnbool: false |
| 7557 | position: |
| 7558 | start: 24 |
| 7559 | end: 30 |
| 7560 | type: function |
| 7561 | fixedLabels: true |
| 7562 | isConditional: true |
| 7563 | op: 57389 |
| 7564 | depth: 0 |
| 7565 | ison: false |
| 7566 | returnInfo: |
| 7567 | logicalexpr: "" |
| 7568 | valueposition: |
| 7569 | start: 0 |
| 7570 | end: 0 |
| 7571 | returnednumber: 0 |
| 7572 | alwaysreturns: true |
| 7573 | knownreturn: false |
| 7574 | isreturnbool: false |
| 7575 | position: |
| 7576 | start: 1 |
| 7577 | end: 14 |
| 7578 | type: function |
| 7579 | fixedLabels: true |
| 7580 | isConditional: true |
| 7581 | - labels: |
| 7582 | "": |
| 7583 | reason: Calling `vector()` will return a vector value with no labels. |
| 7584 | kind: excluded |
| 7585 | fragment: |
| 7586 | start: 39 |
| 7587 | end: 45 |
| 7588 | returns: vector |
| 7589 | operations: |
| 7590 | - args: |
| 7591 | - "1" |
| 7592 | node: '[*parser.Call] vector(1)' |
| 7593 | op: vector |
| 7594 | returnInfo: |
| 7595 | logicalexpr: "" |
| 7596 | valueposition: |
| 7597 | start: 39 |
| 7598 | end: 48 |
| 7599 | returnednumber: 1 |
| 7600 | alwaysreturns: true |
| 7601 | knownreturn: true |
| 7602 | isreturnbool: false |
| 7603 | position: |
| 7604 | start: 39 |
| 7605 | end: 48 |
| 7606 | type: function |
| 7607 | fixedLabels: true |
| 7608 | |
| 7609 | --- |
| 7610 | |
| 7611 | [TestLabelsSource/149 - 1] |
| 7612 | expr: |4- |
| 7613 | |
| 7614 | sum by (foo, bar) ( |
| 7615 | rate(errors_total[5m]) |
| 7616 | * on (instance) group_left (bob, alice) |
| 7617 | server_errors_total |
| 7618 | ) |
| 7619 | output: |
| 7620 | - labels: |
| 7621 | "": |
| 7622 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 7623 | kind: excluded |
| 7624 | fragment: |
| 7625 | start: 5 |
| 7626 | end: 8 |
| 7627 | __name__: |
| 7628 | reason: Aggregation removes metric name. |
| 7629 | kind: excluded |
| 7630 | fragment: |
| 7631 | start: 1 |
| 7632 | end: 115 |
| 7633 | alice: |
| 7634 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 7635 | kind: excluded |
| 7636 | fragment: |
| 7637 | start: 5 |
| 7638 | end: 18 |
| 7639 | bar: |
| 7640 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 7641 | kind: included |
| 7642 | fragment: |
| 7643 | start: 14 |
| 7644 | end: 17 |
| 7645 | bob: |
| 7646 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 7647 | kind: excluded |
| 7648 | fragment: |
| 7649 | start: 5 |
| 7650 | end: 18 |
| 7651 | foo: |
| 7652 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 7653 | kind: included |
| 7654 | fragment: |
| 7655 | start: 9 |
| 7656 | end: 12 |
| 7657 | instance: |
| 7658 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 7659 | kind: excluded |
| 7660 | fragment: |
| 7661 | start: 5 |
| 7662 | end: 18 |
| 7663 | deadLabels: |
| 7664 | - name: bob |
| 7665 | reason: Previously joined label `bob` is being removed from the results. |
| 7666 | labelreason: Query is using `group_left(bob, alice)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 7667 | usagefragment: |
| 7668 | start: 5 |
| 7669 | end: 18 |
| 7670 | labelfragment: |
| 7671 | start: 78 |
| 7672 | end: 81 |
| 7673 | kind: 3 |
| 7674 | - name: alice |
| 7675 | reason: Previously joined label `alice` is being removed from the results. |
| 7676 | labelreason: Query is using `group_left(bob, alice)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 7677 | usagefragment: |
| 7678 | start: 5 |
| 7679 | end: 18 |
| 7680 | labelfragment: |
| 7681 | start: 83 |
| 7682 | end: 88 |
| 7683 | kind: 3 |
| 7684 | returns: vector |
| 7685 | operations: |
| 7686 | - node: '[*parser.VectorSelector] errors_total' |
| 7687 | op: "" |
| 7688 | - node: '[*parser.Call] rate(errors_total[5m])' |
| 7689 | op: rate |
| 7690 | - node: '[*parser.AggregateExpr] sum by (foo, bar) (rate(errors_total[5m]) * on (instance) group_left (bob, alice) server_errors_total)' |
| 7691 | op: sum |
| 7692 | joins: |
| 7693 | - matchinglabels: |
| 7694 | - instance |
| 7695 | addedlabels: |
| 7696 | - bob |
| 7697 | - alice |
| 7698 | src: |
| 7699 | returns: vector |
| 7700 | operations: |
| 7701 | - node: '[*parser.VectorSelector] server_errors_total' |
| 7702 | op: "" |
| 7703 | position: |
| 7704 | start: 94 |
| 7705 | end: 113 |
| 7706 | type: selector |
| 7707 | op: 57395 |
| 7708 | depth: 1 |
| 7709 | ison: true |
| 7710 | usedLabels: |
| 7711 | - foo |
| 7712 | - bar |
| 7713 | position: |
| 7714 | start: 30 |
| 7715 | end: 46 |
| 7716 | type: aggregation |
| 7717 | fixedLabels: true |
| 7718 | |
| 7719 | --- |
| 7720 | |
| 7721 | [TestLabelsSource/150 - 1] |
| 7722 | expr: 1 - (foo or vector(0)) < 0.999 |
| 7723 | output: |
| 7724 | - returns: vector |
| 7725 | operations: |
| 7726 | - node: '[*parser.VectorSelector] foo' |
| 7727 | op: "" |
| 7728 | position: |
| 7729 | start: 5 |
| 7730 | end: 8 |
| 7731 | type: selector |
| 7732 | isConditional: true |
| 7733 | - labels: |
| 7734 | "": |
| 7735 | reason: Calling `vector()` will return a vector value with no labels. |
| 7736 | kind: excluded |
| 7737 | fragment: |
| 7738 | start: 12 |
| 7739 | end: 18 |
| 7740 | deadInfo: |
| 7741 | reason: '`1 - vector(0) < 0.999` always evaluates to `1 < 0.999` which is not possible, so it will never return anything.' |
| 7742 | fragment: |
| 7743 | start: 12 |
| 7744 | end: 21 |
| 7745 | returns: vector |
| 7746 | operations: |
| 7747 | - args: |
| 7748 | - "0" |
| 7749 | node: '[*parser.Call] vector(0)' |
| 7750 | op: vector |
| 7751 | returnInfo: |
| 7752 | logicalexpr: 1 - vector(0) |
| 7753 | valueposition: |
| 7754 | start: 0 |
| 7755 | end: 1 |
| 7756 | returnednumber: 1 |
| 7757 | alwaysreturns: true |
| 7758 | knownreturn: true |
| 7759 | isreturnbool: false |
| 7760 | position: |
| 7761 | start: 12 |
| 7762 | end: 21 |
| 7763 | type: function |
| 7764 | fixedLabels: true |
| 7765 | isConditional: true |
| 7766 | |
| 7767 | --- |
| 7768 | |
| 7769 | [TestLabelsSource/151 - 1] |
| 7770 | expr: |4 |
| 7771 | |
| 7772 | ( |
| 7773 | vector(1) and month() == 2 |
| 7774 | ) or vector(0) |
| 7775 | output: |
| 7776 | - labels: |
| 7777 | "": |
| 7778 | reason: Calling `vector()` will return a vector value with no labels. |
| 7779 | kind: excluded |
| 7780 | fragment: |
| 7781 | start: 5 |
| 7782 | end: 11 |
| 7783 | returns: vector |
| 7784 | operations: |
| 7785 | - args: |
| 7786 | - "1" |
| 7787 | node: '[*parser.Call] vector(1)' |
| 7788 | op: vector |
| 7789 | joins: |
| 7790 | - matchinglabels: [] |
| 7791 | addedlabels: [] |
| 7792 | src: |
| 7793 | labels: |
| 7794 | "": |
| 7795 | reason: Calling `month()` with no arguments will return an empty time series with no labels. |
| 7796 | kind: excluded |
| 7797 | fragment: |
| 7798 | start: 19 |
| 7799 | end: 26 |
| 7800 | returns: vector |
| 7801 | operations: |
| 7802 | - node: '[*parser.Call] month()' |
| 7803 | op: month |
| 7804 | returnInfo: |
| 7805 | logicalexpr: "" |
| 7806 | valueposition: |
| 7807 | start: 0 |
| 7808 | end: 0 |
| 7809 | returnednumber: 0 |
| 7810 | alwaysreturns: true |
| 7811 | knownreturn: false |
| 7812 | isreturnbool: false |
| 7813 | position: |
| 7814 | start: 19 |
| 7815 | end: 26 |
| 7816 | type: function |
| 7817 | fixedLabels: true |
| 7818 | isConditional: true |
| 7819 | op: 57389 |
| 7820 | depth: 0 |
| 7821 | ison: false |
| 7822 | returnInfo: |
| 7823 | logicalexpr: "" |
| 7824 | valueposition: |
| 7825 | start: 5 |
| 7826 | end: 14 |
| 7827 | returnednumber: 1 |
| 7828 | alwaysreturns: true |
| 7829 | knownreturn: true |
| 7830 | isreturnbool: false |
| 7831 | position: |
| 7832 | start: 5 |
| 7833 | end: 14 |
| 7834 | type: function |
| 7835 | fixedLabels: true |
| 7836 | isConditional: true |
| 7837 | - labels: |
| 7838 | "": |
| 7839 | reason: Calling `vector()` will return a vector value with no labels. |
| 7840 | kind: excluded |
| 7841 | fragment: |
| 7842 | start: 37 |
| 7843 | end: 43 |
| 7844 | returns: vector |
| 7845 | operations: |
| 7846 | - args: |
| 7847 | - "0" |
| 7848 | node: '[*parser.Call] vector(0)' |
| 7849 | op: vector |
| 7850 | returnInfo: |
| 7851 | logicalexpr: "" |
| 7852 | valueposition: |
| 7853 | start: 37 |
| 7854 | end: 46 |
| 7855 | returnednumber: 0 |
| 7856 | alwaysreturns: true |
| 7857 | knownreturn: true |
| 7858 | isreturnbool: false |
| 7859 | position: |
| 7860 | start: 37 |
| 7861 | end: 46 |
| 7862 | type: function |
| 7863 | fixedLabels: true |
| 7864 | |
| 7865 | --- |
| 7866 | |
| 7867 | [TestLabelsSource/152 - 1] |
| 7868 | expr: count by (region) (stddev by (colo_name, region) (error_total)) |
| 7869 | output: |
| 7870 | - labels: |
| 7871 | "": |
| 7872 | reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results. |
| 7873 | kind: excluded |
| 7874 | fragment: |
| 7875 | start: 6 |
| 7876 | end: 9 |
| 7877 | __name__: |
| 7878 | reason: Aggregation removes metric name. |
| 7879 | kind: excluded |
| 7880 | fragment: |
| 7881 | start: 0 |
| 7882 | end: 63 |
| 7883 | colo_name: |
| 7884 | reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results. |
| 7885 | kind: excluded |
| 7886 | fragment: |
| 7887 | start: 6 |
| 7888 | end: 17 |
| 7889 | region: |
| 7890 | reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results. |
| 7891 | kind: included |
| 7892 | fragment: |
| 7893 | start: 10 |
| 7894 | end: 16 |
| 7895 | returns: vector |
| 7896 | operations: |
| 7897 | - node: '[*parser.VectorSelector] error_total' |
| 7898 | op: "" |
| 7899 | - node: '[*parser.AggregateExpr] stddev by (colo_name, region) (error_total)' |
| 7900 | op: stddev |
| 7901 | - node: '[*parser.AggregateExpr] count by (region) (stddev by (colo_name, region) (error_total))' |
| 7902 | op: count |
| 7903 | usedLabels: |
| 7904 | - region |
| 7905 | position: |
| 7906 | start: 50 |
| 7907 | end: 61 |
| 7908 | type: aggregation |
| 7909 | fixedLabels: true |
| 7910 | |
| 7911 | --- |
| 7912 | |
| 7913 | [TestLabelsSource/153 - 1] |
| 7914 | expr: |4 |
| 7915 | |
| 7916 | ( |
| 7917 | avg( |
| 7918 | rate(foo_rejections[6h]) |
| 7919 | or |
| 7920 | vector(0) |
| 7921 | ) by (colo_name) |
| 7922 | / |
| 7923 | ( |
| 7924 | avg( |
| 7925 | rate(foo_total[6h]) |
| 7926 | or |
| 7927 | vector(1) |
| 7928 | ) by (colo_name) |
| 7929 | ) |
| 7930 | ) > 5 |
| 7931 | * |
| 7932 | ( |
| 7933 | avg( |
| 7934 | rate(foo_rejections[6h] offset 1d) |
| 7935 | or |
| 7936 | vector(0) |
| 7937 | ) by (colo_name) |
| 7938 | / |
| 7939 | avg( |
| 7940 | rate(foo_total[6h] offset 1d) |
| 7941 | or |
| 7942 | vector(1) |
| 7943 | ) by (colo_name) |
| 7944 | ) and on (colo_name) (colo_job:foo_total:rate2m or vector(0)) > 80 |
| 7945 | and on (colo_name) (colo_job:foo_total:rate2m offset 1d or vector(0)) > 80 |
| 7946 | output: |
| 7947 | - labels: |
| 7948 | "": |
| 7949 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 7950 | kind: excluded |
| 7951 | fragment: |
| 7952 | start: 64 |
| 7953 | end: 67 |
| 7954 | __name__: |
| 7955 | reason: Binary operation between two vectors removes metric names. |
| 7956 | kind: excluded |
| 7957 | fragment: |
| 7958 | start: 1 |
| 7959 | end: 336 |
| 7960 | colo_name: |
| 7961 | reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results if matched time series have them. |
| 7962 | kind: included |
| 7963 | fragment: |
| 7964 | start: 412 |
| 7965 | end: 421 |
| 7966 | returns: vector |
| 7967 | operations: |
| 7968 | - node: '[*parser.VectorSelector] foo_rejections' |
| 7969 | op: "" |
| 7970 | - node: '[*parser.Call] rate(foo_rejections[6h])' |
| 7971 | op: rate |
| 7972 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))' |
| 7973 | op: avg |
| 7974 | joins: |
| 7975 | - matchinglabels: [] |
| 7976 | addedlabels: [] |
| 7977 | src: |
| 7978 | labels: |
| 7979 | "": |
| 7980 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 7981 | kind: excluded |
| 7982 | fragment: |
| 7983 | start: 147 |
| 7984 | end: 150 |
| 7985 | __name__: |
| 7986 | reason: Aggregation removes metric name. |
| 7987 | kind: excluded |
| 7988 | fragment: |
| 7989 | start: 91 |
| 7990 | end: 161 |
| 7991 | colo_name: |
| 7992 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 7993 | kind: included |
| 7994 | fragment: |
| 7995 | start: 151 |
| 7996 | end: 160 |
| 7997 | returns: vector |
| 7998 | operations: |
| 7999 | - node: '[*parser.VectorSelector] foo_total' |
| 8000 | op: "" |
| 8001 | - node: '[*parser.Call] rate(foo_total[6h])' |
| 8002 | op: rate |
| 8003 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))' |
| 8004 | op: avg |
| 8005 | usedLabels: |
| 8006 | - colo_name |
| 8007 | position: |
| 8008 | start: 107 |
| 8009 | end: 120 |
| 8010 | type: aggregation |
| 8011 | fixedLabels: true |
| 8012 | op: 57384 |
| 8013 | depth: 0 |
| 8014 | ison: false |
| 8015 | - matchinglabels: [] |
| 8016 | addedlabels: [] |
| 8017 | src: |
| 8018 | labels: |
| 8019 | "": |
| 8020 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8021 | kind: excluded |
| 8022 | fragment: |
| 8023 | start: 147 |
| 8024 | end: 150 |
| 8025 | __name__: |
| 8026 | reason: Aggregation removes metric name. |
| 8027 | kind: excluded |
| 8028 | fragment: |
| 8029 | start: 91 |
| 8030 | end: 161 |
| 8031 | colo_name: |
| 8032 | reason: Calling `vector()` will return a vector value with no labels. |
| 8033 | kind: excluded |
| 8034 | fragment: |
| 8035 | start: 131 |
| 8036 | end: 137 |
| 8037 | deadLabels: |
| 8038 | - name: colo_name |
| 8039 | reason: You can't use `colo_name` because this label is not possible here. |
| 8040 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8041 | usagefragment: |
| 8042 | start: 151 |
| 8043 | end: 160 |
| 8044 | labelfragment: |
| 8045 | start: 131 |
| 8046 | end: 137 |
| 8047 | kind: 0 |
| 8048 | returns: vector |
| 8049 | operations: |
| 8050 | - args: |
| 8051 | - "1" |
| 8052 | node: '[*parser.Call] vector(1)' |
| 8053 | op: vector |
| 8054 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))' |
| 8055 | op: avg |
| 8056 | usedLabels: |
| 8057 | - colo_name |
| 8058 | returnInfo: |
| 8059 | logicalexpr: "" |
| 8060 | valueposition: |
| 8061 | start: 131 |
| 8062 | end: 140 |
| 8063 | returnednumber: 1 |
| 8064 | alwaysreturns: true |
| 8065 | knownreturn: true |
| 8066 | isreturnbool: false |
| 8067 | position: |
| 8068 | start: 131 |
| 8069 | end: 140 |
| 8070 | type: aggregation |
| 8071 | fixedLabels: true |
| 8072 | op: 57384 |
| 8073 | depth: 0 |
| 8074 | ison: false |
| 8075 | - matchinglabels: [] |
| 8076 | addedlabels: [] |
| 8077 | src: |
| 8078 | labels: |
| 8079 | "": |
| 8080 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8081 | kind: excluded |
| 8082 | fragment: |
| 8083 | start: 241 |
| 8084 | end: 244 |
| 8085 | __name__: |
| 8086 | reason: Binary operation between two vectors removes metric names. |
| 8087 | kind: excluded |
| 8088 | fragment: |
| 8089 | start: 178 |
| 8090 | end: 334 |
| 8091 | colo_name: |
| 8092 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8093 | kind: included |
| 8094 | fragment: |
| 8095 | start: 245 |
| 8096 | end: 254 |
| 8097 | returns: vector |
| 8098 | operations: |
| 8099 | - node: '[*parser.VectorSelector] foo_rejections offset 1d' |
| 8100 | op: "" |
| 8101 | - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)' |
| 8102 | op: rate |
| 8103 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))' |
| 8104 | op: avg |
| 8105 | joins: |
| 8106 | - matchinglabels: [] |
| 8107 | addedlabels: [] |
| 8108 | src: |
| 8109 | labels: |
| 8110 | "": |
| 8111 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8112 | kind: excluded |
| 8113 | fragment: |
| 8114 | start: 320 |
| 8115 | end: 323 |
| 8116 | __name__: |
| 8117 | reason: Aggregation removes metric name. |
| 8118 | kind: excluded |
| 8119 | fragment: |
| 8120 | start: 262 |
| 8121 | end: 334 |
| 8122 | colo_name: |
| 8123 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8124 | kind: included |
| 8125 | fragment: |
| 8126 | start: 324 |
| 8127 | end: 333 |
| 8128 | returns: vector |
| 8129 | operations: |
| 8130 | - node: '[*parser.VectorSelector] foo_total offset 1d' |
| 8131 | op: "" |
| 8132 | - node: '[*parser.Call] rate(foo_total[6h] offset 1d)' |
| 8133 | op: rate |
| 8134 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 8135 | op: avg |
| 8136 | usedLabels: |
| 8137 | - colo_name |
| 8138 | position: |
| 8139 | start: 276 |
| 8140 | end: 299 |
| 8141 | type: aggregation |
| 8142 | fixedLabels: true |
| 8143 | op: 57384 |
| 8144 | depth: 0 |
| 8145 | ison: false |
| 8146 | - matchinglabels: [] |
| 8147 | addedlabels: [] |
| 8148 | src: |
| 8149 | labels: |
| 8150 | "": |
| 8151 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8152 | kind: excluded |
| 8153 | fragment: |
| 8154 | start: 320 |
| 8155 | end: 323 |
| 8156 | __name__: |
| 8157 | reason: Aggregation removes metric name. |
| 8158 | kind: excluded |
| 8159 | fragment: |
| 8160 | start: 262 |
| 8161 | end: 334 |
| 8162 | colo_name: |
| 8163 | reason: Calling `vector()` will return a vector value with no labels. |
| 8164 | kind: excluded |
| 8165 | fragment: |
| 8166 | start: 306 |
| 8167 | end: 312 |
| 8168 | deadLabels: |
| 8169 | - name: colo_name |
| 8170 | reason: You can't use `colo_name` because this label is not possible here. |
| 8171 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8172 | usagefragment: |
| 8173 | start: 324 |
| 8174 | end: 333 |
| 8175 | labelfragment: |
| 8176 | start: 306 |
| 8177 | end: 312 |
| 8178 | kind: 0 |
| 8179 | returns: vector |
| 8180 | operations: |
| 8181 | - args: |
| 8182 | - "1" |
| 8183 | node: '[*parser.Call] vector(1)' |
| 8184 | op: vector |
| 8185 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 8186 | op: avg |
| 8187 | usedLabels: |
| 8188 | - colo_name |
| 8189 | returnInfo: |
| 8190 | logicalexpr: "" |
| 8191 | valueposition: |
| 8192 | start: 306 |
| 8193 | end: 315 |
| 8194 | returnednumber: 1 |
| 8195 | alwaysreturns: true |
| 8196 | knownreturn: true |
| 8197 | isreturnbool: false |
| 8198 | position: |
| 8199 | start: 306 |
| 8200 | end: 315 |
| 8201 | type: aggregation |
| 8202 | fixedLabels: true |
| 8203 | op: 57384 |
| 8204 | depth: 0 |
| 8205 | ison: false |
| 8206 | usedLabels: |
| 8207 | - colo_name |
| 8208 | position: |
| 8209 | start: 192 |
| 8210 | end: 220 |
| 8211 | type: aggregation |
| 8212 | fixedLabels: true |
| 8213 | op: 57388 |
| 8214 | depth: 0 |
| 8215 | ison: false |
| 8216 | - matchinglabels: [] |
| 8217 | addedlabels: [] |
| 8218 | src: |
| 8219 | labels: |
| 8220 | "": |
| 8221 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8222 | kind: excluded |
| 8223 | fragment: |
| 8224 | start: 241 |
| 8225 | end: 244 |
| 8226 | __name__: |
| 8227 | reason: Binary operation between two vectors removes metric names. |
| 8228 | kind: excluded |
| 8229 | fragment: |
| 8230 | start: 178 |
| 8231 | end: 334 |
| 8232 | colo_name: |
| 8233 | reason: Calling `vector()` will return a vector value with no labels. |
| 8234 | kind: excluded |
| 8235 | fragment: |
| 8236 | start: 227 |
| 8237 | end: 233 |
| 8238 | deadLabels: |
| 8239 | - name: colo_name |
| 8240 | reason: You can't use `colo_name` because this label is not possible here. |
| 8241 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8242 | usagefragment: |
| 8243 | start: 245 |
| 8244 | end: 254 |
| 8245 | labelfragment: |
| 8246 | start: 227 |
| 8247 | end: 233 |
| 8248 | kind: 0 |
| 8249 | returns: vector |
| 8250 | operations: |
| 8251 | - args: |
| 8252 | - "0" |
| 8253 | node: '[*parser.Call] vector(0)' |
| 8254 | op: vector |
| 8255 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))' |
| 8256 | op: avg |
| 8257 | joins: |
| 8258 | - matchinglabels: [] |
| 8259 | addedlabels: [] |
| 8260 | src: |
| 8261 | labels: |
| 8262 | "": |
| 8263 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8264 | kind: excluded |
| 8265 | fragment: |
| 8266 | start: 320 |
| 8267 | end: 323 |
| 8268 | __name__: |
| 8269 | reason: Aggregation removes metric name. |
| 8270 | kind: excluded |
| 8271 | fragment: |
| 8272 | start: 262 |
| 8273 | end: 334 |
| 8274 | colo_name: |
| 8275 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8276 | kind: included |
| 8277 | fragment: |
| 8278 | start: 324 |
| 8279 | end: 333 |
| 8280 | returns: vector |
| 8281 | operations: |
| 8282 | - node: '[*parser.VectorSelector] foo_total offset 1d' |
| 8283 | op: "" |
| 8284 | - node: '[*parser.Call] rate(foo_total[6h] offset 1d)' |
| 8285 | op: rate |
| 8286 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 8287 | op: avg |
| 8288 | usedLabels: |
| 8289 | - colo_name |
| 8290 | position: |
| 8291 | start: 276 |
| 8292 | end: 299 |
| 8293 | type: aggregation |
| 8294 | fixedLabels: true |
| 8295 | op: 57384 |
| 8296 | depth: 0 |
| 8297 | ison: false |
| 8298 | - matchinglabels: [] |
| 8299 | addedlabels: [] |
| 8300 | src: |
| 8301 | labels: |
| 8302 | "": |
| 8303 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8304 | kind: excluded |
| 8305 | fragment: |
| 8306 | start: 320 |
| 8307 | end: 323 |
| 8308 | __name__: |
| 8309 | reason: Aggregation removes metric name. |
| 8310 | kind: excluded |
| 8311 | fragment: |
| 8312 | start: 262 |
| 8313 | end: 334 |
| 8314 | colo_name: |
| 8315 | reason: Calling `vector()` will return a vector value with no labels. |
| 8316 | kind: excluded |
| 8317 | fragment: |
| 8318 | start: 306 |
| 8319 | end: 312 |
| 8320 | deadLabels: |
| 8321 | - name: colo_name |
| 8322 | reason: You can't use `colo_name` because this label is not possible here. |
| 8323 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8324 | usagefragment: |
| 8325 | start: 324 |
| 8326 | end: 333 |
| 8327 | labelfragment: |
| 8328 | start: 306 |
| 8329 | end: 312 |
| 8330 | kind: 0 |
| 8331 | returns: vector |
| 8332 | operations: |
| 8333 | - args: |
| 8334 | - "1" |
| 8335 | node: '[*parser.Call] vector(1)' |
| 8336 | op: vector |
| 8337 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 8338 | op: avg |
| 8339 | usedLabels: |
| 8340 | - colo_name |
| 8341 | returnInfo: |
| 8342 | logicalexpr: "" |
| 8343 | valueposition: |
| 8344 | start: 306 |
| 8345 | end: 315 |
| 8346 | returnednumber: 1 |
| 8347 | alwaysreturns: true |
| 8348 | knownreturn: true |
| 8349 | isreturnbool: false |
| 8350 | position: |
| 8351 | start: 306 |
| 8352 | end: 315 |
| 8353 | type: aggregation |
| 8354 | fixedLabels: true |
| 8355 | op: 57384 |
| 8356 | depth: 0 |
| 8357 | ison: false |
| 8358 | usedLabels: |
| 8359 | - colo_name |
| 8360 | returnInfo: |
| 8361 | logicalexpr: 5 * vector(0) / vector(1) |
| 8362 | valueposition: |
| 8363 | start: 170 |
| 8364 | end: 171 |
| 8365 | returnednumber: 0 |
| 8366 | alwaysreturns: true |
| 8367 | knownreturn: true |
| 8368 | isreturnbool: false |
| 8369 | position: |
| 8370 | start: 227 |
| 8371 | end: 236 |
| 8372 | type: aggregation |
| 8373 | fixedLabels: true |
| 8374 | op: 57388 |
| 8375 | depth: 0 |
| 8376 | ison: false |
| 8377 | - matchinglabels: |
| 8378 | - colo_name |
| 8379 | addedlabels: [] |
| 8380 | src: |
| 8381 | returns: vector |
| 8382 | operations: |
| 8383 | - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m' |
| 8384 | op: "" |
| 8385 | position: |
| 8386 | start: 357 |
| 8387 | end: 382 |
| 8388 | type: selector |
| 8389 | isConditional: true |
| 8390 | op: 57389 |
| 8391 | depth: 0 |
| 8392 | ison: true |
| 8393 | - matchinglabels: |
| 8394 | - colo_name |
| 8395 | addedlabels: [] |
| 8396 | src: |
| 8397 | labels: |
| 8398 | "": |
| 8399 | reason: Calling `vector()` will return a vector value with no labels. |
| 8400 | kind: excluded |
| 8401 | fragment: |
| 8402 | start: 386 |
| 8403 | end: 392 |
| 8404 | deadInfo: |
| 8405 | reason: The right hand side will never be matched because it doesn't have the `colo_name` label from `on(...)`. Calling `vector()` will return a vector value with no labels. |
| 8406 | fragment: |
| 8407 | start: 386 |
| 8408 | end: 392 |
| 8409 | returns: vector |
| 8410 | operations: |
| 8411 | - args: |
| 8412 | - "0" |
| 8413 | node: '[*parser.Call] vector(0)' |
| 8414 | op: vector |
| 8415 | returnInfo: |
| 8416 | logicalexpr: "" |
| 8417 | valueposition: |
| 8418 | start: 386 |
| 8419 | end: 395 |
| 8420 | returnednumber: 0 |
| 8421 | alwaysreturns: true |
| 8422 | knownreturn: true |
| 8423 | isreturnbool: false |
| 8424 | position: |
| 8425 | start: 386 |
| 8426 | end: 395 |
| 8427 | type: function |
| 8428 | fixedLabels: true |
| 8429 | isConditional: true |
| 8430 | op: 57389 |
| 8431 | depth: 0 |
| 8432 | ison: true |
| 8433 | - matchinglabels: |
| 8434 | - colo_name |
| 8435 | addedlabels: [] |
| 8436 | src: |
| 8437 | returns: vector |
| 8438 | operations: |
| 8439 | - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d' |
| 8440 | op: "" |
| 8441 | position: |
| 8442 | start: 424 |
| 8443 | end: 459 |
| 8444 | type: selector |
| 8445 | isConditional: true |
| 8446 | op: 57389 |
| 8447 | depth: 0 |
| 8448 | ison: true |
| 8449 | - matchinglabels: |
| 8450 | - colo_name |
| 8451 | addedlabels: [] |
| 8452 | src: |
| 8453 | labels: |
| 8454 | "": |
| 8455 | reason: Calling `vector()` will return a vector value with no labels. |
| 8456 | kind: excluded |
| 8457 | fragment: |
| 8458 | start: 463 |
| 8459 | end: 469 |
| 8460 | deadInfo: |
| 8461 | reason: The right hand side will never be matched because it doesn't have the `colo_name` label from `on(...)`. Calling `vector()` will return a vector value with no labels. |
| 8462 | fragment: |
| 8463 | start: 463 |
| 8464 | end: 469 |
| 8465 | returns: vector |
| 8466 | operations: |
| 8467 | - args: |
| 8468 | - "0" |
| 8469 | node: '[*parser.Call] vector(0)' |
| 8470 | op: vector |
| 8471 | returnInfo: |
| 8472 | logicalexpr: "" |
| 8473 | valueposition: |
| 8474 | start: 463 |
| 8475 | end: 472 |
| 8476 | returnednumber: 0 |
| 8477 | alwaysreturns: true |
| 8478 | knownreturn: true |
| 8479 | isreturnbool: false |
| 8480 | position: |
| 8481 | start: 463 |
| 8482 | end: 472 |
| 8483 | type: function |
| 8484 | fixedLabels: true |
| 8485 | isConditional: true |
| 8486 | op: 57389 |
| 8487 | depth: 0 |
| 8488 | ison: true |
| 8489 | usedLabels: |
| 8490 | - colo_name |
| 8491 | position: |
| 8492 | start: 19 |
| 8493 | end: 37 |
| 8494 | type: aggregation |
| 8495 | fixedLabels: true |
| 8496 | isConditional: true |
| 8497 | - labels: |
| 8498 | "": |
| 8499 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8500 | kind: excluded |
| 8501 | fragment: |
| 8502 | start: 64 |
| 8503 | end: 67 |
| 8504 | __name__: |
| 8505 | reason: Binary operation between two vectors removes metric names. |
| 8506 | kind: excluded |
| 8507 | fragment: |
| 8508 | start: 1 |
| 8509 | end: 336 |
| 8510 | colo_name: |
| 8511 | reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results if matched time series have them. |
| 8512 | kind: included |
| 8513 | fragment: |
| 8514 | start: 412 |
| 8515 | end: 421 |
| 8516 | deadInfo: |
| 8517 | reason: '`vector(0) / vector(1) > 5 * vector(0) / vector(1)` always evaluates to `0 > 0` which is not possible, so it will never return anything.' |
| 8518 | fragment: |
| 8519 | start: 50 |
| 8520 | end: 59 |
| 8521 | deadLabels: |
| 8522 | - name: colo_name |
| 8523 | reason: You can't use `colo_name` because this label is not possible here. |
| 8524 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8525 | usagefragment: |
| 8526 | start: 68 |
| 8527 | end: 77 |
| 8528 | labelfragment: |
| 8529 | start: 50 |
| 8530 | end: 56 |
| 8531 | kind: 0 |
| 8532 | - name: colo_name |
| 8533 | reason: You can't use `colo_name` because this label is not possible here. |
| 8534 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8535 | usagefragment: |
| 8536 | start: 345 |
| 8537 | end: 354 |
| 8538 | labelfragment: |
| 8539 | start: 50 |
| 8540 | end: 56 |
| 8541 | kind: 0 |
| 8542 | returns: vector |
| 8543 | operations: |
| 8544 | - args: |
| 8545 | - "0" |
| 8546 | node: '[*parser.Call] vector(0)' |
| 8547 | op: vector |
| 8548 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))' |
| 8549 | op: avg |
| 8550 | joins: |
| 8551 | - matchinglabels: [] |
| 8552 | addedlabels: [] |
| 8553 | src: |
| 8554 | labels: |
| 8555 | "": |
| 8556 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8557 | kind: excluded |
| 8558 | fragment: |
| 8559 | start: 147 |
| 8560 | end: 150 |
| 8561 | __name__: |
| 8562 | reason: Aggregation removes metric name. |
| 8563 | kind: excluded |
| 8564 | fragment: |
| 8565 | start: 91 |
| 8566 | end: 161 |
| 8567 | colo_name: |
| 8568 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8569 | kind: included |
| 8570 | fragment: |
| 8571 | start: 151 |
| 8572 | end: 160 |
| 8573 | returns: vector |
| 8574 | operations: |
| 8575 | - node: '[*parser.VectorSelector] foo_total' |
| 8576 | op: "" |
| 8577 | - node: '[*parser.Call] rate(foo_total[6h])' |
| 8578 | op: rate |
| 8579 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))' |
| 8580 | op: avg |
| 8581 | usedLabels: |
| 8582 | - colo_name |
| 8583 | position: |
| 8584 | start: 107 |
| 8585 | end: 120 |
| 8586 | type: aggregation |
| 8587 | fixedLabels: true |
| 8588 | op: 57384 |
| 8589 | depth: 0 |
| 8590 | ison: false |
| 8591 | - matchinglabels: [] |
| 8592 | addedlabels: [] |
| 8593 | src: |
| 8594 | labels: |
| 8595 | "": |
| 8596 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8597 | kind: excluded |
| 8598 | fragment: |
| 8599 | start: 147 |
| 8600 | end: 150 |
| 8601 | __name__: |
| 8602 | reason: Aggregation removes metric name. |
| 8603 | kind: excluded |
| 8604 | fragment: |
| 8605 | start: 91 |
| 8606 | end: 161 |
| 8607 | colo_name: |
| 8608 | reason: Calling `vector()` will return a vector value with no labels. |
| 8609 | kind: excluded |
| 8610 | fragment: |
| 8611 | start: 131 |
| 8612 | end: 137 |
| 8613 | deadLabels: |
| 8614 | - name: colo_name |
| 8615 | reason: You can't use `colo_name` because this label is not possible here. |
| 8616 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8617 | usagefragment: |
| 8618 | start: 151 |
| 8619 | end: 160 |
| 8620 | labelfragment: |
| 8621 | start: 131 |
| 8622 | end: 137 |
| 8623 | kind: 0 |
| 8624 | returns: vector |
| 8625 | operations: |
| 8626 | - args: |
| 8627 | - "1" |
| 8628 | node: '[*parser.Call] vector(1)' |
| 8629 | op: vector |
| 8630 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))' |
| 8631 | op: avg |
| 8632 | usedLabels: |
| 8633 | - colo_name |
| 8634 | returnInfo: |
| 8635 | logicalexpr: "" |
| 8636 | valueposition: |
| 8637 | start: 131 |
| 8638 | end: 140 |
| 8639 | returnednumber: 1 |
| 8640 | alwaysreturns: true |
| 8641 | knownreturn: true |
| 8642 | isreturnbool: false |
| 8643 | position: |
| 8644 | start: 131 |
| 8645 | end: 140 |
| 8646 | type: aggregation |
| 8647 | fixedLabels: true |
| 8648 | op: 57384 |
| 8649 | depth: 0 |
| 8650 | ison: false |
| 8651 | - matchinglabels: [] |
| 8652 | addedlabels: [] |
| 8653 | src: |
| 8654 | labels: |
| 8655 | "": |
| 8656 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8657 | kind: excluded |
| 8658 | fragment: |
| 8659 | start: 241 |
| 8660 | end: 244 |
| 8661 | __name__: |
| 8662 | reason: Binary operation between two vectors removes metric names. |
| 8663 | kind: excluded |
| 8664 | fragment: |
| 8665 | start: 178 |
| 8666 | end: 334 |
| 8667 | colo_name: |
| 8668 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8669 | kind: included |
| 8670 | fragment: |
| 8671 | start: 245 |
| 8672 | end: 254 |
| 8673 | returns: vector |
| 8674 | operations: |
| 8675 | - node: '[*parser.VectorSelector] foo_rejections offset 1d' |
| 8676 | op: "" |
| 8677 | - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)' |
| 8678 | op: rate |
| 8679 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))' |
| 8680 | op: avg |
| 8681 | joins: |
| 8682 | - matchinglabels: [] |
| 8683 | addedlabels: [] |
| 8684 | src: |
| 8685 | labels: |
| 8686 | "": |
| 8687 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8688 | kind: excluded |
| 8689 | fragment: |
| 8690 | start: 320 |
| 8691 | end: 323 |
| 8692 | __name__: |
| 8693 | reason: Aggregation removes metric name. |
| 8694 | kind: excluded |
| 8695 | fragment: |
| 8696 | start: 262 |
| 8697 | end: 334 |
| 8698 | colo_name: |
| 8699 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8700 | kind: included |
| 8701 | fragment: |
| 8702 | start: 324 |
| 8703 | end: 333 |
| 8704 | returns: vector |
| 8705 | operations: |
| 8706 | - node: '[*parser.VectorSelector] foo_total offset 1d' |
| 8707 | op: "" |
| 8708 | - node: '[*parser.Call] rate(foo_total[6h] offset 1d)' |
| 8709 | op: rate |
| 8710 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 8711 | op: avg |
| 8712 | usedLabels: |
| 8713 | - colo_name |
| 8714 | position: |
| 8715 | start: 276 |
| 8716 | end: 299 |
| 8717 | type: aggregation |
| 8718 | fixedLabels: true |
| 8719 | op: 57384 |
| 8720 | depth: 0 |
| 8721 | ison: false |
| 8722 | - matchinglabels: [] |
| 8723 | addedlabels: [] |
| 8724 | src: |
| 8725 | labels: |
| 8726 | "": |
| 8727 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8728 | kind: excluded |
| 8729 | fragment: |
| 8730 | start: 320 |
| 8731 | end: 323 |
| 8732 | __name__: |
| 8733 | reason: Aggregation removes metric name. |
| 8734 | kind: excluded |
| 8735 | fragment: |
| 8736 | start: 262 |
| 8737 | end: 334 |
| 8738 | colo_name: |
| 8739 | reason: Calling `vector()` will return a vector value with no labels. |
| 8740 | kind: excluded |
| 8741 | fragment: |
| 8742 | start: 306 |
| 8743 | end: 312 |
| 8744 | deadLabels: |
| 8745 | - name: colo_name |
| 8746 | reason: You can't use `colo_name` because this label is not possible here. |
| 8747 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8748 | usagefragment: |
| 8749 | start: 324 |
| 8750 | end: 333 |
| 8751 | labelfragment: |
| 8752 | start: 306 |
| 8753 | end: 312 |
| 8754 | kind: 0 |
| 8755 | returns: vector |
| 8756 | operations: |
| 8757 | - args: |
| 8758 | - "1" |
| 8759 | node: '[*parser.Call] vector(1)' |
| 8760 | op: vector |
| 8761 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 8762 | op: avg |
| 8763 | usedLabels: |
| 8764 | - colo_name |
| 8765 | returnInfo: |
| 8766 | logicalexpr: "" |
| 8767 | valueposition: |
| 8768 | start: 306 |
| 8769 | end: 315 |
| 8770 | returnednumber: 1 |
| 8771 | alwaysreturns: true |
| 8772 | knownreturn: true |
| 8773 | isreturnbool: false |
| 8774 | position: |
| 8775 | start: 306 |
| 8776 | end: 315 |
| 8777 | type: aggregation |
| 8778 | fixedLabels: true |
| 8779 | op: 57384 |
| 8780 | depth: 0 |
| 8781 | ison: false |
| 8782 | usedLabels: |
| 8783 | - colo_name |
| 8784 | position: |
| 8785 | start: 192 |
| 8786 | end: 220 |
| 8787 | type: aggregation |
| 8788 | fixedLabels: true |
| 8789 | op: 57388 |
| 8790 | depth: 0 |
| 8791 | ison: false |
| 8792 | - matchinglabels: [] |
| 8793 | addedlabels: [] |
| 8794 | src: |
| 8795 | labels: |
| 8796 | "": |
| 8797 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8798 | kind: excluded |
| 8799 | fragment: |
| 8800 | start: 241 |
| 8801 | end: 244 |
| 8802 | __name__: |
| 8803 | reason: Binary operation between two vectors removes metric names. |
| 8804 | kind: excluded |
| 8805 | fragment: |
| 8806 | start: 178 |
| 8807 | end: 334 |
| 8808 | colo_name: |
| 8809 | reason: Calling `vector()` will return a vector value with no labels. |
| 8810 | kind: excluded |
| 8811 | fragment: |
| 8812 | start: 227 |
| 8813 | end: 233 |
| 8814 | deadLabels: |
| 8815 | - name: colo_name |
| 8816 | reason: You can't use `colo_name` because this label is not possible here. |
| 8817 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8818 | usagefragment: |
| 8819 | start: 245 |
| 8820 | end: 254 |
| 8821 | labelfragment: |
| 8822 | start: 227 |
| 8823 | end: 233 |
| 8824 | kind: 0 |
| 8825 | returns: vector |
| 8826 | operations: |
| 8827 | - args: |
| 8828 | - "0" |
| 8829 | node: '[*parser.Call] vector(0)' |
| 8830 | op: vector |
| 8831 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))' |
| 8832 | op: avg |
| 8833 | joins: |
| 8834 | - matchinglabels: [] |
| 8835 | addedlabels: [] |
| 8836 | src: |
| 8837 | labels: |
| 8838 | "": |
| 8839 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8840 | kind: excluded |
| 8841 | fragment: |
| 8842 | start: 320 |
| 8843 | end: 323 |
| 8844 | __name__: |
| 8845 | reason: Aggregation removes metric name. |
| 8846 | kind: excluded |
| 8847 | fragment: |
| 8848 | start: 262 |
| 8849 | end: 334 |
| 8850 | colo_name: |
| 8851 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8852 | kind: included |
| 8853 | fragment: |
| 8854 | start: 324 |
| 8855 | end: 333 |
| 8856 | returns: vector |
| 8857 | operations: |
| 8858 | - node: '[*parser.VectorSelector] foo_total offset 1d' |
| 8859 | op: "" |
| 8860 | - node: '[*parser.Call] rate(foo_total[6h] offset 1d)' |
| 8861 | op: rate |
| 8862 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 8863 | op: avg |
| 8864 | usedLabels: |
| 8865 | - colo_name |
| 8866 | position: |
| 8867 | start: 276 |
| 8868 | end: 299 |
| 8869 | type: aggregation |
| 8870 | fixedLabels: true |
| 8871 | op: 57384 |
| 8872 | depth: 0 |
| 8873 | ison: false |
| 8874 | - matchinglabels: [] |
| 8875 | addedlabels: [] |
| 8876 | src: |
| 8877 | labels: |
| 8878 | "": |
| 8879 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 8880 | kind: excluded |
| 8881 | fragment: |
| 8882 | start: 320 |
| 8883 | end: 323 |
| 8884 | __name__: |
| 8885 | reason: Aggregation removes metric name. |
| 8886 | kind: excluded |
| 8887 | fragment: |
| 8888 | start: 262 |
| 8889 | end: 334 |
| 8890 | colo_name: |
| 8891 | reason: Calling `vector()` will return a vector value with no labels. |
| 8892 | kind: excluded |
| 8893 | fragment: |
| 8894 | start: 306 |
| 8895 | end: 312 |
| 8896 | deadLabels: |
| 8897 | - name: colo_name |
| 8898 | reason: You can't use `colo_name` because this label is not possible here. |
| 8899 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 8900 | usagefragment: |
| 8901 | start: 324 |
| 8902 | end: 333 |
| 8903 | labelfragment: |
| 8904 | start: 306 |
| 8905 | end: 312 |
| 8906 | kind: 0 |
| 8907 | returns: vector |
| 8908 | operations: |
| 8909 | - args: |
| 8910 | - "1" |
| 8911 | node: '[*parser.Call] vector(1)' |
| 8912 | op: vector |
| 8913 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 8914 | op: avg |
| 8915 | usedLabels: |
| 8916 | - colo_name |
| 8917 | returnInfo: |
| 8918 | logicalexpr: "" |
| 8919 | valueposition: |
| 8920 | start: 306 |
| 8921 | end: 315 |
| 8922 | returnednumber: 1 |
| 8923 | alwaysreturns: true |
| 8924 | knownreturn: true |
| 8925 | isreturnbool: false |
| 8926 | position: |
| 8927 | start: 306 |
| 8928 | end: 315 |
| 8929 | type: aggregation |
| 8930 | fixedLabels: true |
| 8931 | op: 57384 |
| 8932 | depth: 0 |
| 8933 | ison: false |
| 8934 | usedLabels: |
| 8935 | - colo_name |
| 8936 | returnInfo: |
| 8937 | logicalexpr: 5 * vector(0) / vector(1) |
| 8938 | valueposition: |
| 8939 | start: 170 |
| 8940 | end: 171 |
| 8941 | returnednumber: 0 |
| 8942 | alwaysreturns: true |
| 8943 | knownreturn: true |
| 8944 | isreturnbool: false |
| 8945 | position: |
| 8946 | start: 227 |
| 8947 | end: 236 |
| 8948 | type: aggregation |
| 8949 | fixedLabels: true |
| 8950 | op: 57388 |
| 8951 | depth: 0 |
| 8952 | ison: false |
| 8953 | - matchinglabels: |
| 8954 | - colo_name |
| 8955 | addedlabels: [] |
| 8956 | src: |
| 8957 | returns: vector |
| 8958 | operations: |
| 8959 | - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m' |
| 8960 | op: "" |
| 8961 | position: |
| 8962 | start: 357 |
| 8963 | end: 382 |
| 8964 | type: selector |
| 8965 | isConditional: true |
| 8966 | op: 57389 |
| 8967 | depth: 0 |
| 8968 | ison: true |
| 8969 | - matchinglabels: |
| 8970 | - colo_name |
| 8971 | addedlabels: [] |
| 8972 | src: |
| 8973 | labels: |
| 8974 | "": |
| 8975 | reason: Calling `vector()` will return a vector value with no labels. |
| 8976 | kind: excluded |
| 8977 | fragment: |
| 8978 | start: 386 |
| 8979 | end: 392 |
| 8980 | deadInfo: |
| 8981 | reason: The right hand side will never be matched because it doesn't have the `colo_name` label from `on(...)`. Calling `vector()` will return a vector value with no labels. |
| 8982 | fragment: |
| 8983 | start: 386 |
| 8984 | end: 392 |
| 8985 | returns: vector |
| 8986 | operations: |
| 8987 | - args: |
| 8988 | - "0" |
| 8989 | node: '[*parser.Call] vector(0)' |
| 8990 | op: vector |
| 8991 | returnInfo: |
| 8992 | logicalexpr: "" |
| 8993 | valueposition: |
| 8994 | start: 386 |
| 8995 | end: 395 |
| 8996 | returnednumber: 0 |
| 8997 | alwaysreturns: true |
| 8998 | knownreturn: true |
| 8999 | isreturnbool: false |
| 9000 | position: |
| 9001 | start: 386 |
| 9002 | end: 395 |
| 9003 | type: function |
| 9004 | fixedLabels: true |
| 9005 | isConditional: true |
| 9006 | op: 57389 |
| 9007 | depth: 0 |
| 9008 | ison: true |
| 9009 | - matchinglabels: |
| 9010 | - colo_name |
| 9011 | addedlabels: [] |
| 9012 | src: |
| 9013 | returns: vector |
| 9014 | operations: |
| 9015 | - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d' |
| 9016 | op: "" |
| 9017 | position: |
| 9018 | start: 424 |
| 9019 | end: 459 |
| 9020 | type: selector |
| 9021 | isConditional: true |
| 9022 | op: 57389 |
| 9023 | depth: 0 |
| 9024 | ison: true |
| 9025 | - matchinglabels: |
| 9026 | - colo_name |
| 9027 | addedlabels: [] |
| 9028 | src: |
| 9029 | labels: |
| 9030 | "": |
| 9031 | reason: Calling `vector()` will return a vector value with no labels. |
| 9032 | kind: excluded |
| 9033 | fragment: |
| 9034 | start: 463 |
| 9035 | end: 469 |
| 9036 | deadInfo: |
| 9037 | reason: The right hand side will never be matched because it doesn't have the `colo_name` label from `on(...)`. Calling `vector()` will return a vector value with no labels. |
| 9038 | fragment: |
| 9039 | start: 463 |
| 9040 | end: 469 |
| 9041 | returns: vector |
| 9042 | operations: |
| 9043 | - args: |
| 9044 | - "0" |
| 9045 | node: '[*parser.Call] vector(0)' |
| 9046 | op: vector |
| 9047 | returnInfo: |
| 9048 | logicalexpr: "" |
| 9049 | valueposition: |
| 9050 | start: 463 |
| 9051 | end: 472 |
| 9052 | returnednumber: 0 |
| 9053 | alwaysreturns: true |
| 9054 | knownreturn: true |
| 9055 | isreturnbool: false |
| 9056 | position: |
| 9057 | start: 463 |
| 9058 | end: 472 |
| 9059 | type: function |
| 9060 | fixedLabels: true |
| 9061 | isConditional: true |
| 9062 | op: 57389 |
| 9063 | depth: 0 |
| 9064 | ison: true |
| 9065 | usedLabels: |
| 9066 | - colo_name |
| 9067 | returnInfo: |
| 9068 | logicalexpr: vector(0) / vector(1) |
| 9069 | valueposition: |
| 9070 | start: 50 |
| 9071 | end: 59 |
| 9072 | returnednumber: 0 |
| 9073 | alwaysreturns: true |
| 9074 | knownreturn: true |
| 9075 | isreturnbool: false |
| 9076 | position: |
| 9077 | start: 50 |
| 9078 | end: 59 |
| 9079 | type: aggregation |
| 9080 | fixedLabels: true |
| 9081 | isConditional: true |
| 9082 | |
| 9083 | --- |
| 9084 | |
| 9085 | [TestLabelsSource/154 - 1] |
| 9086 | expr: sum(selector) / sum(selector offset 30m) > 5 |
| 9087 | output: |
| 9088 | - labels: |
| 9089 | "": |
| 9090 | reason: Query is using aggregation that removes all labels. |
| 9091 | kind: excluded |
| 9092 | fragment: |
| 9093 | start: 0 |
| 9094 | end: 3 |
| 9095 | __name__: |
| 9096 | reason: Binary operation between two vectors removes metric names. |
| 9097 | kind: excluded |
| 9098 | fragment: |
| 9099 | start: 0 |
| 9100 | end: 40 |
| 9101 | returns: vector |
| 9102 | operations: |
| 9103 | - node: '[*parser.VectorSelector] selector' |
| 9104 | op: "" |
| 9105 | - node: '[*parser.AggregateExpr] sum(selector)' |
| 9106 | op: sum |
| 9107 | joins: |
| 9108 | - matchinglabels: [] |
| 9109 | addedlabels: [] |
| 9110 | src: |
| 9111 | labels: |
| 9112 | "": |
| 9113 | reason: Query is using aggregation that removes all labels. |
| 9114 | kind: excluded |
| 9115 | fragment: |
| 9116 | start: 16 |
| 9117 | end: 19 |
| 9118 | __name__: |
| 9119 | reason: Aggregation removes metric name. |
| 9120 | kind: excluded |
| 9121 | fragment: |
| 9122 | start: 16 |
| 9123 | end: 40 |
| 9124 | returns: vector |
| 9125 | operations: |
| 9126 | - node: '[*parser.VectorSelector] selector offset 30m' |
| 9127 | op: "" |
| 9128 | - node: '[*parser.AggregateExpr] sum(selector offset 30m)' |
| 9129 | op: sum |
| 9130 | position: |
| 9131 | start: 20 |
| 9132 | end: 39 |
| 9133 | type: aggregation |
| 9134 | fixedLabels: true |
| 9135 | op: 57384 |
| 9136 | depth: 0 |
| 9137 | ison: false |
| 9138 | position: |
| 9139 | start: 4 |
| 9140 | end: 12 |
| 9141 | type: aggregation |
| 9142 | fixedLabels: true |
| 9143 | isConditional: true |
| 9144 | |
| 9145 | --- |
| 9146 | |
| 9147 | [TestLabelsSource/155 - 1] |
| 9148 | expr: |4- |
| 9149 | |
| 9150 | count by (dc) ( |
| 9151 | max(0 < (token_expiration - time()) < (6*60*60)) by (instance) |
| 9152 | * on (instance) group_right label_replace( |
| 9153 | configured_minions, "instance", "$1", "minion", "(.+)") |
| 9154 | ) > 5 |
| 9155 | output: |
| 9156 | - labels: |
| 9157 | "": |
| 9158 | reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results. |
| 9159 | kind: excluded |
| 9160 | fragment: |
| 9161 | start: 7 |
| 9162 | end: 10 |
| 9163 | __name__: |
| 9164 | reason: Aggregation removes metric name. |
| 9165 | kind: excluded |
| 9166 | fragment: |
| 9167 | start: 1 |
| 9168 | end: 190 |
| 9169 | dc: |
| 9170 | reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results. |
| 9171 | kind: included |
| 9172 | fragment: |
| 9173 | start: 11 |
| 9174 | end: 13 |
| 9175 | instance: |
| 9176 | reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results. |
| 9177 | kind: excluded |
| 9178 | fragment: |
| 9179 | start: 7 |
| 9180 | end: 14 |
| 9181 | returns: vector |
| 9182 | operations: |
| 9183 | - node: '[*parser.VectorSelector] configured_minions' |
| 9184 | op: "" |
| 9185 | - args: |
| 9186 | - '"instance"' |
| 9187 | - '"$1"' |
| 9188 | - '"minion"' |
| 9189 | - '"(.+)"' |
| 9190 | node: '[*parser.Call] label_replace(configured_minions, "instance", "$1", "minion", "(.+)")' |
| 9191 | op: label_replace |
| 9192 | - node: '[*parser.AggregateExpr] count by (dc) (max by (instance) (0 < (token_expiration - time()) < (6 * 60 * 60)) * on (instance) group_right () label_replace(configured_minions, "instance", "$1", "minion", "(.+)"))' |
| 9193 | op: count |
| 9194 | joins: |
| 9195 | - matchinglabels: |
| 9196 | - instance |
| 9197 | addedlabels: [] |
| 9198 | src: |
| 9199 | labels: |
| 9200 | "": |
| 9201 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 9202 | kind: excluded |
| 9203 | fragment: |
| 9204 | start: 68 |
| 9205 | end: 71 |
| 9206 | __name__: |
| 9207 | reason: Aggregation removes metric name. |
| 9208 | kind: excluded |
| 9209 | fragment: |
| 9210 | start: 19 |
| 9211 | end: 81 |
| 9212 | instance: |
| 9213 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 9214 | kind: included |
| 9215 | fragment: |
| 9216 | start: 72 |
| 9217 | end: 80 |
| 9218 | returns: vector |
| 9219 | operations: |
| 9220 | - node: '[*parser.VectorSelector] token_expiration' |
| 9221 | op: "" |
| 9222 | - node: '[*parser.AggregateExpr] max by (instance) (0 < (token_expiration - time()) < (6 * 60 * 60))' |
| 9223 | op: max |
| 9224 | usedLabels: |
| 9225 | - instance |
| 9226 | position: |
| 9227 | start: 28 |
| 9228 | end: 44 |
| 9229 | type: aggregation |
| 9230 | fixedLabels: true |
| 9231 | isConditional: true |
| 9232 | op: 57395 |
| 9233 | depth: 1 |
| 9234 | ison: true |
| 9235 | usedLabels: |
| 9236 | - dc |
| 9237 | position: |
| 9238 | start: 131 |
| 9239 | end: 149 |
| 9240 | type: aggregation |
| 9241 | fixedLabels: true |
| 9242 | isConditional: true |
| 9243 | |
| 9244 | --- |
| 9245 | |
| 9246 | [TestLabelsSource/156 - 1] |
| 9247 | expr: topk(10, prometheus_build_info*prometheus_ready) |
| 9248 | output: |
| 9249 | - labels: |
| 9250 | __name__: |
| 9251 | reason: Binary operation between two vectors removes metric names. |
| 9252 | kind: excluded |
| 9253 | fragment: |
| 9254 | start: 9 |
| 9255 | end: 47 |
| 9256 | returns: vector |
| 9257 | operations: |
| 9258 | - node: '[*parser.VectorSelector] prometheus_build_info' |
| 9259 | op: "" |
| 9260 | - args: |
| 9261 | - "10" |
| 9262 | node: '[*parser.AggregateExpr] topk(10, prometheus_build_info * prometheus_ready)' |
| 9263 | op: topk |
| 9264 | joins: |
| 9265 | - matchinglabels: [] |
| 9266 | addedlabels: [] |
| 9267 | src: |
| 9268 | returns: vector |
| 9269 | operations: |
| 9270 | - node: '[*parser.VectorSelector] prometheus_ready' |
| 9271 | op: "" |
| 9272 | position: |
| 9273 | start: 31 |
| 9274 | end: 47 |
| 9275 | type: selector |
| 9276 | op: 57395 |
| 9277 | depth: 1 |
| 9278 | ison: false |
| 9279 | position: |
| 9280 | start: 9 |
| 9281 | end: 30 |
| 9282 | type: aggregation |
| 9283 | |
| 9284 | --- |
| 9285 | |
| 9286 | [TestLabelsSource/157 - 1] |
| 9287 | expr: bottomk(10, prometheus_build_info*prometheus_ready) |
| 9288 | output: |
| 9289 | - labels: |
| 9290 | __name__: |
| 9291 | reason: Binary operation between two vectors removes metric names. |
| 9292 | kind: excluded |
| 9293 | fragment: |
| 9294 | start: 12 |
| 9295 | end: 50 |
| 9296 | returns: vector |
| 9297 | operations: |
| 9298 | - node: '[*parser.VectorSelector] prometheus_build_info' |
| 9299 | op: "" |
| 9300 | - args: |
| 9301 | - "10" |
| 9302 | node: '[*parser.AggregateExpr] bottomk(10, prometheus_build_info * prometheus_ready)' |
| 9303 | op: bottomk |
| 9304 | joins: |
| 9305 | - matchinglabels: [] |
| 9306 | addedlabels: [] |
| 9307 | src: |
| 9308 | returns: vector |
| 9309 | operations: |
| 9310 | - node: '[*parser.VectorSelector] prometheus_ready' |
| 9311 | op: "" |
| 9312 | position: |
| 9313 | start: 34 |
| 9314 | end: 50 |
| 9315 | type: selector |
| 9316 | op: 57395 |
| 9317 | depth: 1 |
| 9318 | ison: false |
| 9319 | position: |
| 9320 | start: 12 |
| 9321 | end: 33 |
| 9322 | type: aggregation |
| 9323 | |
| 9324 | --- |
| 9325 | |
| 9326 | [TestLabelsSource/158 - 1] |
| 9327 | expr: histogram_fraction(0, 0.1, metric) |
| 9328 | output: |
| 9329 | - returns: vector |
| 9330 | operations: |
| 9331 | - node: '[*parser.VectorSelector] metric' |
| 9332 | op: "" |
| 9333 | - args: |
| 9334 | - "0" |
| 9335 | - "0.1" |
| 9336 | node: '[*parser.Call] histogram_fraction(0, 0.1, metric)' |
| 9337 | op: histogram_fraction |
| 9338 | position: |
| 9339 | start: 27 |
| 9340 | end: 33 |
| 9341 | type: function |
| 9342 | |
| 9343 | --- |
| 9344 | |
| 9345 | [TestLabelsSource/159 - 1] |
| 9346 | expr: 'foo * foo ' |
| 9347 | output: |
| 9348 | - labels: |
| 9349 | __name__: |
| 9350 | reason: Binary operation between two vectors removes metric names. |
| 9351 | kind: excluded |
| 9352 | fragment: |
| 9353 | start: 0 |
| 9354 | end: 9 |
| 9355 | returns: vector |
| 9356 | operations: |
| 9357 | - node: '[*parser.VectorSelector] foo' |
| 9358 | op: "" |
| 9359 | joins: |
| 9360 | - matchinglabels: [] |
| 9361 | addedlabels: [] |
| 9362 | src: |
| 9363 | returns: vector |
| 9364 | operations: |
| 9365 | - node: '[*parser.VectorSelector] foo' |
| 9366 | op: "" |
| 9367 | position: |
| 9368 | start: 6 |
| 9369 | end: 9 |
| 9370 | type: selector |
| 9371 | op: 57395 |
| 9372 | depth: 0 |
| 9373 | ison: false |
| 9374 | position: |
| 9375 | start: 0 |
| 9376 | end: 3 |
| 9377 | type: selector |
| 9378 | |
| 9379 | --- |
| 9380 | |
| 9381 | [TestLabelsSource/160 - 1] |
| 9382 | expr: 'foo + on(__name__, job) foo ' |
| 9383 | output: |
| 9384 | - labels: |
| 9385 | "": |
| 9386 | reason: Query is using one-to-one vector matching with `on(__name__, job)`, only labels included inside `on(...)` will be present on the results. |
| 9387 | kind: excluded |
| 9388 | fragment: |
| 9389 | start: 6 |
| 9390 | end: 23 |
| 9391 | __name__: |
| 9392 | reason: Binary operation between two vectors removes metric names. |
| 9393 | kind: excluded |
| 9394 | fragment: |
| 9395 | start: 0 |
| 9396 | end: 27 |
| 9397 | job: |
| 9398 | reason: Query is using one-to-one vector matching with `on(__name__, job)`, only labels included inside `on(...)` will be present on the results. |
| 9399 | kind: included |
| 9400 | fragment: |
| 9401 | start: 19 |
| 9402 | end: 22 |
| 9403 | returns: vector |
| 9404 | operations: |
| 9405 | - node: '[*parser.VectorSelector] foo' |
| 9406 | op: "" |
| 9407 | joins: |
| 9408 | - matchinglabels: |
| 9409 | - __name__ |
| 9410 | - job |
| 9411 | addedlabels: [] |
| 9412 | src: |
| 9413 | returns: vector |
| 9414 | operations: |
| 9415 | - node: '[*parser.VectorSelector] foo' |
| 9416 | op: "" |
| 9417 | position: |
| 9418 | start: 24 |
| 9419 | end: 27 |
| 9420 | type: selector |
| 9421 | op: 57383 |
| 9422 | depth: 0 |
| 9423 | ison: true |
| 9424 | usedLabels: |
| 9425 | - job |
| 9426 | position: |
| 9427 | start: 0 |
| 9428 | end: 3 |
| 9429 | type: selector |
| 9430 | fixedLabels: true |
| 9431 | |
| 9432 | --- |
| 9433 | |
| 9434 | [TestLabelsSource/161 - 1] |
| 9435 | expr: 'foo + on(__name__, job) group_left foo ' |
| 9436 | output: |
| 9437 | - labels: |
| 9438 | __name__: |
| 9439 | reason: Binary operation between two vectors removes metric names. |
| 9440 | kind: excluded |
| 9441 | fragment: |
| 9442 | start: 0 |
| 9443 | end: 38 |
| 9444 | job: |
| 9445 | reason: Query is using many-to-one vector matching with `on(__name__, job)`, labels included inside `on(...)` will be present on the results. |
| 9446 | kind: included |
| 9447 | fragment: |
| 9448 | start: 19 |
| 9449 | end: 22 |
| 9450 | returns: vector |
| 9451 | operations: |
| 9452 | - node: '[*parser.VectorSelector] foo' |
| 9453 | op: "" |
| 9454 | joins: |
| 9455 | - matchinglabels: |
| 9456 | - __name__ |
| 9457 | - job |
| 9458 | addedlabels: [] |
| 9459 | src: |
| 9460 | returns: vector |
| 9461 | operations: |
| 9462 | - node: '[*parser.VectorSelector] foo' |
| 9463 | op: "" |
| 9464 | position: |
| 9465 | start: 35 |
| 9466 | end: 38 |
| 9467 | type: selector |
| 9468 | op: 57383 |
| 9469 | depth: 0 |
| 9470 | ison: true |
| 9471 | usedLabels: |
| 9472 | - job |
| 9473 | position: |
| 9474 | start: 0 |
| 9475 | end: 3 |
| 9476 | type: selector |
| 9477 | |
| 9478 | --- |
| 9479 | |
| 9480 | [TestLabelsSource/162 - 1] |
| 9481 | expr: 'foo + on(__name__, job) group_right foo ' |
| 9482 | output: |
| 9483 | - labels: |
| 9484 | __name__: |
| 9485 | reason: Binary operation between two vectors removes metric names. |
| 9486 | kind: excluded |
| 9487 | fragment: |
| 9488 | start: 0 |
| 9489 | end: 39 |
| 9490 | job: |
| 9491 | reason: Query is using one-to-many vector matching with `on(__name__, job)`, labels included inside `on(...)` will be present on the results. |
| 9492 | kind: included |
| 9493 | fragment: |
| 9494 | start: 19 |
| 9495 | end: 22 |
| 9496 | returns: vector |
| 9497 | operations: |
| 9498 | - node: '[*parser.VectorSelector] foo' |
| 9499 | op: "" |
| 9500 | joins: |
| 9501 | - matchinglabels: |
| 9502 | - __name__ |
| 9503 | - job |
| 9504 | addedlabels: [] |
| 9505 | src: |
| 9506 | returns: vector |
| 9507 | operations: |
| 9508 | - node: '[*parser.VectorSelector] foo' |
| 9509 | op: "" |
| 9510 | position: |
| 9511 | start: 0 |
| 9512 | end: 3 |
| 9513 | type: selector |
| 9514 | op: 57383 |
| 9515 | depth: 0 |
| 9516 | ison: true |
| 9517 | usedLabels: |
| 9518 | - job |
| 9519 | position: |
| 9520 | start: 36 |
| 9521 | end: 39 |
| 9522 | type: selector |
| 9523 | |
| 9524 | --- |
| 9525 | |
| 9526 | [TestLabelsSource/163 - 1] |
| 9527 | expr: |- |
| 9528 | group by (env, cluster) ( |
| 9529 | up{env="prod", job="foo"} and on (instance) (services_enabled == 999) |
| 9530 | ) |
| 9531 | output: |
| 9532 | - labels: |
| 9533 | "": |
| 9534 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9535 | kind: excluded |
| 9536 | fragment: |
| 9537 | start: 6 |
| 9538 | end: 9 |
| 9539 | __name__: |
| 9540 | reason: Aggregation removes metric name. |
| 9541 | kind: excluded |
| 9542 | fragment: |
| 9543 | start: 0 |
| 9544 | end: 104 |
| 9545 | cluster: |
| 9546 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9547 | kind: included |
| 9548 | fragment: |
| 9549 | start: 15 |
| 9550 | end: 22 |
| 9551 | env: |
| 9552 | reason: Query will only return series where these labels are present. |
| 9553 | kind: guaranteed |
| 9554 | fragment: |
| 9555 | start: 32 |
| 9556 | end: 57 |
| 9557 | instance: |
| 9558 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9559 | kind: excluded |
| 9560 | fragment: |
| 9561 | start: 6 |
| 9562 | end: 23 |
| 9563 | job: |
| 9564 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9565 | kind: excluded |
| 9566 | fragment: |
| 9567 | start: 6 |
| 9568 | end: 23 |
| 9569 | returns: vector |
| 9570 | operations: |
| 9571 | - node: '[*parser.VectorSelector] up{env="prod",job="foo"}' |
| 9572 | op: "" |
| 9573 | - node: '[*parser.AggregateExpr] group by (env, cluster) (up{env="prod",job="foo"} and on (instance) (services_enabled == 999))' |
| 9574 | op: group |
| 9575 | joins: |
| 9576 | - matchinglabels: |
| 9577 | - instance |
| 9578 | addedlabels: [] |
| 9579 | src: |
| 9580 | returns: vector |
| 9581 | operations: |
| 9582 | - node: '[*parser.VectorSelector] services_enabled' |
| 9583 | op: "" |
| 9584 | position: |
| 9585 | start: 77 |
| 9586 | end: 93 |
| 9587 | type: selector |
| 9588 | isConditional: true |
| 9589 | op: 57389 |
| 9590 | depth: 1 |
| 9591 | ison: true |
| 9592 | usedLabels: |
| 9593 | - env |
| 9594 | - cluster |
| 9595 | position: |
| 9596 | start: 32 |
| 9597 | end: 57 |
| 9598 | type: aggregation |
| 9599 | fixedLabels: true |
| 9600 | isConditional: true |
| 9601 | |
| 9602 | --- |
| 9603 | |
| 9604 | [TestLabelsSource/164 - 1] |
| 9605 | expr: |- |
| 9606 | group by (env, cluster) ( |
| 9607 | up{env="prod", job="foo"} * on (instance) (services_enabled == 999) |
| 9608 | ) |
| 9609 | output: |
| 9610 | - labels: |
| 9611 | "": |
| 9612 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9613 | kind: excluded |
| 9614 | fragment: |
| 9615 | start: 6 |
| 9616 | end: 9 |
| 9617 | __name__: |
| 9618 | reason: Aggregation removes metric name. |
| 9619 | kind: excluded |
| 9620 | fragment: |
| 9621 | start: 0 |
| 9622 | end: 102 |
| 9623 | cluster: |
| 9624 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 9625 | kind: excluded |
| 9626 | fragment: |
| 9627 | start: 60 |
| 9628 | end: 73 |
| 9629 | env: |
| 9630 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 9631 | kind: excluded |
| 9632 | fragment: |
| 9633 | start: 60 |
| 9634 | end: 73 |
| 9635 | instance: |
| 9636 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9637 | kind: excluded |
| 9638 | fragment: |
| 9639 | start: 6 |
| 9640 | end: 23 |
| 9641 | job: |
| 9642 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 9643 | kind: excluded |
| 9644 | fragment: |
| 9645 | start: 60 |
| 9646 | end: 73 |
| 9647 | deadLabels: |
| 9648 | - name: env |
| 9649 | reason: You can't use `env` because this label is not possible here. |
| 9650 | labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 9651 | usagefragment: |
| 9652 | start: 10 |
| 9653 | end: 13 |
| 9654 | labelfragment: |
| 9655 | start: 60 |
| 9656 | end: 73 |
| 9657 | kind: 0 |
| 9658 | - name: cluster |
| 9659 | reason: You can't use `cluster` because this label is not possible here. |
| 9660 | labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 9661 | usagefragment: |
| 9662 | start: 15 |
| 9663 | end: 22 |
| 9664 | labelfragment: |
| 9665 | start: 60 |
| 9666 | end: 73 |
| 9667 | kind: 0 |
| 9668 | returns: vector |
| 9669 | operations: |
| 9670 | - node: '[*parser.VectorSelector] up{env="prod",job="foo"}' |
| 9671 | op: "" |
| 9672 | - node: '[*parser.AggregateExpr] group by (env, cluster) (up{env="prod",job="foo"} * on (instance) (services_enabled == 999))' |
| 9673 | op: group |
| 9674 | joins: |
| 9675 | - matchinglabels: |
| 9676 | - instance |
| 9677 | addedlabels: [] |
| 9678 | src: |
| 9679 | returns: vector |
| 9680 | operations: |
| 9681 | - node: '[*parser.VectorSelector] services_enabled' |
| 9682 | op: "" |
| 9683 | position: |
| 9684 | start: 75 |
| 9685 | end: 91 |
| 9686 | type: selector |
| 9687 | isConditional: true |
| 9688 | op: 57395 |
| 9689 | depth: 1 |
| 9690 | ison: true |
| 9691 | usedLabels: |
| 9692 | - env |
| 9693 | - cluster |
| 9694 | position: |
| 9695 | start: 32 |
| 9696 | end: 57 |
| 9697 | type: aggregation |
| 9698 | fixedLabels: true |
| 9699 | |
| 9700 | --- |
| 9701 | |
| 9702 | [TestLabelsSource/165 - 1] |
| 9703 | expr: foo / on(instance) sum(bar) |
| 9704 | output: |
| 9705 | - labels: |
| 9706 | "": |
| 9707 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 9708 | kind: excluded |
| 9709 | fragment: |
| 9710 | start: 6 |
| 9711 | end: 18 |
| 9712 | __name__: |
| 9713 | reason: Binary operation between two vectors removes metric names. |
| 9714 | kind: excluded |
| 9715 | fragment: |
| 9716 | start: 0 |
| 9717 | end: 27 |
| 9718 | instance: |
| 9719 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 9720 | kind: included |
| 9721 | fragment: |
| 9722 | start: 9 |
| 9723 | end: 17 |
| 9724 | returns: vector |
| 9725 | operations: |
| 9726 | - node: '[*parser.VectorSelector] foo' |
| 9727 | op: "" |
| 9728 | joins: |
| 9729 | - matchinglabels: |
| 9730 | - instance |
| 9731 | addedlabels: [] |
| 9732 | src: |
| 9733 | labels: |
| 9734 | "": |
| 9735 | reason: Query is using aggregation that removes all labels. |
| 9736 | kind: excluded |
| 9737 | fragment: |
| 9738 | start: 19 |
| 9739 | end: 22 |
| 9740 | __name__: |
| 9741 | reason: Aggregation removes metric name. |
| 9742 | kind: excluded |
| 9743 | fragment: |
| 9744 | start: 19 |
| 9745 | end: 27 |
| 9746 | deadInfo: |
| 9747 | reason: The right hand side will never be matched because it doesn't have the `instance` label from `on(...)`. Query is using aggregation that removes all labels. |
| 9748 | fragment: |
| 9749 | start: 19 |
| 9750 | end: 22 |
| 9751 | returns: vector |
| 9752 | operations: |
| 9753 | - node: '[*parser.VectorSelector] bar' |
| 9754 | op: "" |
| 9755 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 9756 | op: sum |
| 9757 | position: |
| 9758 | start: 23 |
| 9759 | end: 26 |
| 9760 | type: aggregation |
| 9761 | fixedLabels: true |
| 9762 | op: 57384 |
| 9763 | depth: 0 |
| 9764 | ison: true |
| 9765 | usedLabels: |
| 9766 | - instance |
| 9767 | position: |
| 9768 | start: 0 |
| 9769 | end: 3 |
| 9770 | type: selector |
| 9771 | fixedLabels: true |
| 9772 | |
| 9773 | --- |
| 9774 | |
| 9775 | [TestLabelsSource/166 - 1] |
| 9776 | expr: foo / on(instance) group_left(cluster) sum(bar) |
| 9777 | output: |
| 9778 | - labels: |
| 9779 | __name__: |
| 9780 | reason: Binary operation between two vectors removes metric names. |
| 9781 | kind: excluded |
| 9782 | fragment: |
| 9783 | start: 0 |
| 9784 | end: 47 |
| 9785 | cluster: |
| 9786 | reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 9787 | kind: included |
| 9788 | fragment: |
| 9789 | start: 30 |
| 9790 | end: 37 |
| 9791 | instance: |
| 9792 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 9793 | kind: included |
| 9794 | fragment: |
| 9795 | start: 9 |
| 9796 | end: 17 |
| 9797 | returns: vector |
| 9798 | operations: |
| 9799 | - node: '[*parser.VectorSelector] foo' |
| 9800 | op: "" |
| 9801 | joins: |
| 9802 | - matchinglabels: |
| 9803 | - instance |
| 9804 | addedlabels: |
| 9805 | - cluster |
| 9806 | src: |
| 9807 | labels: |
| 9808 | "": |
| 9809 | reason: Query is using aggregation that removes all labels. |
| 9810 | kind: excluded |
| 9811 | fragment: |
| 9812 | start: 39 |
| 9813 | end: 42 |
| 9814 | __name__: |
| 9815 | reason: Aggregation removes metric name. |
| 9816 | kind: excluded |
| 9817 | fragment: |
| 9818 | start: 39 |
| 9819 | end: 47 |
| 9820 | deadInfo: |
| 9821 | reason: The right hand side will never be matched because it doesn't have the `instance` label from `on(...)`. Query is using aggregation that removes all labels. |
| 9822 | fragment: |
| 9823 | start: 39 |
| 9824 | end: 42 |
| 9825 | deadLabels: |
| 9826 | - name: cluster |
| 9827 | reason: You can't use `cluster` because this label is not possible here. |
| 9828 | labelreason: Query is using aggregation that removes all labels. |
| 9829 | usagefragment: |
| 9830 | start: 30 |
| 9831 | end: 37 |
| 9832 | labelfragment: |
| 9833 | start: 39 |
| 9834 | end: 42 |
| 9835 | kind: 0 |
| 9836 | returns: vector |
| 9837 | operations: |
| 9838 | - node: '[*parser.VectorSelector] bar' |
| 9839 | op: "" |
| 9840 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 9841 | op: sum |
| 9842 | position: |
| 9843 | start: 43 |
| 9844 | end: 46 |
| 9845 | type: aggregation |
| 9846 | fixedLabels: true |
| 9847 | op: 57384 |
| 9848 | depth: 0 |
| 9849 | ison: true |
| 9850 | usedLabels: |
| 9851 | - instance |
| 9852 | position: |
| 9853 | start: 0 |
| 9854 | end: 3 |
| 9855 | type: selector |
| 9856 | |
| 9857 | --- |
| 9858 | |
| 9859 | [TestLabelsSource/167 - 1] |
| 9860 | expr: sum(bar) / on(instance) group_right(cluster) foo |
| 9861 | output: |
| 9862 | - labels: |
| 9863 | __name__: |
| 9864 | reason: Binary operation between two vectors removes metric names. |
| 9865 | kind: excluded |
| 9866 | fragment: |
| 9867 | start: 0 |
| 9868 | end: 48 |
| 9869 | cluster: |
| 9870 | reason: Query is using `group_right(cluster)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 9871 | kind: included |
| 9872 | fragment: |
| 9873 | start: 36 |
| 9874 | end: 43 |
| 9875 | instance: |
| 9876 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 9877 | kind: included |
| 9878 | fragment: |
| 9879 | start: 14 |
| 9880 | end: 22 |
| 9881 | returns: vector |
| 9882 | operations: |
| 9883 | - node: '[*parser.VectorSelector] foo' |
| 9884 | op: "" |
| 9885 | joins: |
| 9886 | - matchinglabels: |
| 9887 | - instance |
| 9888 | addedlabels: |
| 9889 | - cluster |
| 9890 | src: |
| 9891 | labels: |
| 9892 | "": |
| 9893 | reason: Query is using aggregation that removes all labels. |
| 9894 | kind: excluded |
| 9895 | fragment: |
| 9896 | start: 0 |
| 9897 | end: 3 |
| 9898 | __name__: |
| 9899 | reason: Aggregation removes metric name. |
| 9900 | kind: excluded |
| 9901 | fragment: |
| 9902 | start: 0 |
| 9903 | end: 8 |
| 9904 | deadInfo: |
| 9905 | reason: The left hand side will never be matched because it doesn't have the `instance` label from `on(...)`. Query is using aggregation that removes all labels. |
| 9906 | fragment: |
| 9907 | start: 0 |
| 9908 | end: 3 |
| 9909 | deadLabels: |
| 9910 | - name: cluster |
| 9911 | reason: You can't use `cluster` because this label is not possible here. |
| 9912 | labelreason: Query is using aggregation that removes all labels. |
| 9913 | usagefragment: |
| 9914 | start: 36 |
| 9915 | end: 43 |
| 9916 | labelfragment: |
| 9917 | start: 0 |
| 9918 | end: 3 |
| 9919 | kind: 0 |
| 9920 | returns: vector |
| 9921 | operations: |
| 9922 | - node: '[*parser.VectorSelector] bar' |
| 9923 | op: "" |
| 9924 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 9925 | op: sum |
| 9926 | position: |
| 9927 | start: 4 |
| 9928 | end: 7 |
| 9929 | type: aggregation |
| 9930 | fixedLabels: true |
| 9931 | op: 57384 |
| 9932 | depth: 0 |
| 9933 | ison: true |
| 9934 | usedLabels: |
| 9935 | - instance |
| 9936 | position: |
| 9937 | start: 45 |
| 9938 | end: 48 |
| 9939 | type: selector |
| 9940 | |
| 9941 | --- |
| 9942 | |
| 9943 | [TestLabelsSource/168 - 1] |
| 9944 | expr: sum(bar) * on(cluster) sum(foo) |
| 9945 | output: |
| 9946 | - labels: |
| 9947 | "": |
| 9948 | reason: Query is using one-to-one vector matching with `on(cluster)`, only labels included inside `on(...)` will be present on the results. |
| 9949 | kind: excluded |
| 9950 | fragment: |
| 9951 | start: 11 |
| 9952 | end: 22 |
| 9953 | __name__: |
| 9954 | reason: Binary operation between two vectors removes metric names. |
| 9955 | kind: excluded |
| 9956 | fragment: |
| 9957 | start: 0 |
| 9958 | end: 31 |
| 9959 | cluster: |
| 9960 | reason: Query is using aggregation that removes all labels. |
| 9961 | kind: excluded |
| 9962 | fragment: |
| 9963 | start: 0 |
| 9964 | end: 3 |
| 9965 | deadLabels: |
| 9966 | - name: cluster |
| 9967 | reason: You can't use `cluster` because this label is not possible here. |
| 9968 | labelreason: Query is using aggregation that removes all labels. |
| 9969 | usagefragment: |
| 9970 | start: 14 |
| 9971 | end: 21 |
| 9972 | labelfragment: |
| 9973 | start: 0 |
| 9974 | end: 3 |
| 9975 | kind: 0 |
| 9976 | returns: vector |
| 9977 | operations: |
| 9978 | - node: '[*parser.VectorSelector] bar' |
| 9979 | op: "" |
| 9980 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 9981 | op: sum |
| 9982 | joins: |
| 9983 | - matchinglabels: |
| 9984 | - cluster |
| 9985 | addedlabels: [] |
| 9986 | src: |
| 9987 | labels: |
| 9988 | "": |
| 9989 | reason: Query is using aggregation that removes all labels. |
| 9990 | kind: excluded |
| 9991 | fragment: |
| 9992 | start: 23 |
| 9993 | end: 26 |
| 9994 | __name__: |
| 9995 | reason: Aggregation removes metric name. |
| 9996 | kind: excluded |
| 9997 | fragment: |
| 9998 | start: 23 |
| 9999 | end: 31 |
| 10000 | returns: vector |
| 10001 | operations: |
| 10002 | - node: '[*parser.VectorSelector] foo' |
| 10003 | op: "" |
| 10004 | - node: '[*parser.AggregateExpr] sum(foo)' |
| 10005 | op: sum |
| 10006 | position: |
| 10007 | start: 27 |
| 10008 | end: 30 |
| 10009 | type: aggregation |
| 10010 | fixedLabels: true |
| 10011 | op: 57395 |
| 10012 | depth: 0 |
| 10013 | ison: true |
| 10014 | usedLabels: |
| 10015 | - cluster |
| 10016 | position: |
| 10017 | start: 4 |
| 10018 | end: 7 |
| 10019 | type: aggregation |
| 10020 | fixedLabels: true |
| 10021 | |
| 10022 | --- |
| 10023 | |
| 10024 | [TestLabelsSource/169 - 1] |
| 10025 | expr: |4- |
| 10026 | |
| 10027 | group by (colo_name, instance, tier, animal, brand, sliver, pop_name) ( |
| 10028 | up{node_status="v", job="node_exporter"} |
| 10029 | and on (instance) (metal_services_enabled == 999) |
| 10030 | * on (colo_name) group_left(tier, animal, brand, pop_name) colo_metadata{colo_status="v"} |
| 10031 | * on (instance) group_left (sliver) sliver_metadata{node_status="v"} |
| 10032 | ) |
| 10033 | output: |
| 10034 | - labels: |
| 10035 | "": |
| 10036 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10037 | kind: excluded |
| 10038 | fragment: |
| 10039 | start: 7 |
| 10040 | end: 10 |
| 10041 | __name__: |
| 10042 | reason: Aggregation removes metric name. |
| 10043 | kind: excluded |
| 10044 | fragment: |
| 10045 | start: 1 |
| 10046 | end: 332 |
| 10047 | animal: |
| 10048 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10049 | kind: included |
| 10050 | fragment: |
| 10051 | start: 38 |
| 10052 | end: 44 |
| 10053 | brand: |
| 10054 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10055 | kind: included |
| 10056 | fragment: |
| 10057 | start: 46 |
| 10058 | end: 51 |
| 10059 | colo_name: |
| 10060 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10061 | kind: included |
| 10062 | fragment: |
| 10063 | start: 11 |
| 10064 | end: 20 |
| 10065 | instance: |
| 10066 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10067 | kind: included |
| 10068 | fragment: |
| 10069 | start: 22 |
| 10070 | end: 30 |
| 10071 | job: |
| 10072 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10073 | kind: excluded |
| 10074 | fragment: |
| 10075 | start: 7 |
| 10076 | end: 70 |
| 10077 | node_status: |
| 10078 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10079 | kind: excluded |
| 10080 | fragment: |
| 10081 | start: 7 |
| 10082 | end: 70 |
| 10083 | pop_name: |
| 10084 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10085 | kind: included |
| 10086 | fragment: |
| 10087 | start: 61 |
| 10088 | end: 69 |
| 10089 | sliver: |
| 10090 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10091 | kind: included |
| 10092 | fragment: |
| 10093 | start: 53 |
| 10094 | end: 59 |
| 10095 | tier: |
| 10096 | reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results. |
| 10097 | kind: included |
| 10098 | fragment: |
| 10099 | start: 32 |
| 10100 | end: 36 |
| 10101 | deadLabels: |
| 10102 | - name: tier |
| 10103 | reason: This binary operation prevents previously joined label `tier` from being added to the results. |
| 10104 | labelreason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10105 | usagefragment: |
| 10106 | start: 118 |
| 10107 | end: 121 |
| 10108 | labelfragment: |
| 10109 | start: 198 |
| 10110 | end: 202 |
| 10111 | kind: 1 |
| 10112 | - name: animal |
| 10113 | reason: This binary operation prevents previously joined label `animal` from being added to the results. |
| 10114 | labelreason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10115 | usagefragment: |
| 10116 | start: 118 |
| 10117 | end: 121 |
| 10118 | labelfragment: |
| 10119 | start: 204 |
| 10120 | end: 210 |
| 10121 | kind: 1 |
| 10122 | - name: brand |
| 10123 | reason: This binary operation prevents previously joined label `brand` from being added to the results. |
| 10124 | labelreason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10125 | usagefragment: |
| 10126 | start: 118 |
| 10127 | end: 121 |
| 10128 | labelfragment: |
| 10129 | start: 212 |
| 10130 | end: 217 |
| 10131 | kind: 1 |
| 10132 | - name: pop_name |
| 10133 | reason: This binary operation prevents previously joined label `pop_name` from being added to the results. |
| 10134 | labelreason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10135 | usagefragment: |
| 10136 | start: 118 |
| 10137 | end: 121 |
| 10138 | labelfragment: |
| 10139 | start: 219 |
| 10140 | end: 227 |
| 10141 | kind: 1 |
| 10142 | - name: sliver |
| 10143 | reason: This binary operation prevents previously joined label `sliver` from being added to the results. |
| 10144 | labelreason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10145 | usagefragment: |
| 10146 | start: 118 |
| 10147 | end: 121 |
| 10148 | labelfragment: |
| 10149 | start: 290 |
| 10150 | end: 296 |
| 10151 | kind: 1 |
| 10152 | returns: vector |
| 10153 | operations: |
| 10154 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 10155 | op: "" |
| 10156 | - node: '[*parser.AggregateExpr] group by (colo_name, instance, tier, animal, brand, sliver, pop_name) (up{job="node_exporter",node_status="v"} and on (instance) (metal_services_enabled == 999) * on (colo_name) group_left (tier, animal, brand, pop_name) colo_metadata{colo_status="v"} * on (instance) group_left (sliver) sliver_metadata{node_status="v"})' |
| 10157 | op: group |
| 10158 | joins: |
| 10159 | - matchinglabels: |
| 10160 | - instance |
| 10161 | addedlabels: [] |
| 10162 | src: |
| 10163 | labels: |
| 10164 | __name__: |
| 10165 | reason: Binary operation between two vectors removes metric names. |
| 10166 | kind: excluded |
| 10167 | fragment: |
| 10168 | start: 136 |
| 10169 | end: 330 |
| 10170 | animal: |
| 10171 | reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10172 | kind: included |
| 10173 | fragment: |
| 10174 | start: 204 |
| 10175 | end: 210 |
| 10176 | brand: |
| 10177 | reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10178 | kind: included |
| 10179 | fragment: |
| 10180 | start: 212 |
| 10181 | end: 217 |
| 10182 | colo_name: |
| 10183 | reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 10184 | kind: included |
| 10185 | fragment: |
| 10186 | start: 176 |
| 10187 | end: 185 |
| 10188 | instance: |
| 10189 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10190 | kind: included |
| 10191 | fragment: |
| 10192 | start: 268 |
| 10193 | end: 276 |
| 10194 | pop_name: |
| 10195 | reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10196 | kind: included |
| 10197 | fragment: |
| 10198 | start: 219 |
| 10199 | end: 227 |
| 10200 | sliver: |
| 10201 | reason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10202 | kind: included |
| 10203 | fragment: |
| 10204 | start: 290 |
| 10205 | end: 296 |
| 10206 | tier: |
| 10207 | reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10208 | kind: included |
| 10209 | fragment: |
| 10210 | start: 198 |
| 10211 | end: 202 |
| 10212 | returns: vector |
| 10213 | operations: |
| 10214 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 10215 | op: "" |
| 10216 | joins: |
| 10217 | - matchinglabels: |
| 10218 | - colo_name |
| 10219 | addedlabels: |
| 10220 | - tier |
| 10221 | - animal |
| 10222 | - brand |
| 10223 | - pop_name |
| 10224 | src: |
| 10225 | labels: |
| 10226 | colo_status: |
| 10227 | reason: Query will only return series where these labels are present. |
| 10228 | kind: guaranteed |
| 10229 | fragment: |
| 10230 | start: 229 |
| 10231 | end: 259 |
| 10232 | returns: vector |
| 10233 | operations: |
| 10234 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 10235 | op: "" |
| 10236 | position: |
| 10237 | start: 229 |
| 10238 | end: 259 |
| 10239 | type: selector |
| 10240 | op: 57395 |
| 10241 | depth: 0 |
| 10242 | ison: true |
| 10243 | - matchinglabels: |
| 10244 | - instance |
| 10245 | addedlabels: |
| 10246 | - sliver |
| 10247 | src: |
| 10248 | labels: |
| 10249 | node_status: |
| 10250 | reason: Query will only return series where these labels are present. |
| 10251 | kind: guaranteed |
| 10252 | fragment: |
| 10253 | start: 298 |
| 10254 | end: 330 |
| 10255 | returns: vector |
| 10256 | operations: |
| 10257 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 10258 | op: "" |
| 10259 | position: |
| 10260 | start: 298 |
| 10261 | end: 330 |
| 10262 | type: selector |
| 10263 | op: 57395 |
| 10264 | depth: 0 |
| 10265 | ison: true |
| 10266 | usedLabels: |
| 10267 | - colo_name |
| 10268 | - instance |
| 10269 | position: |
| 10270 | start: 137 |
| 10271 | end: 159 |
| 10272 | type: selector |
| 10273 | isConditional: true |
| 10274 | op: 57389 |
| 10275 | depth: 1 |
| 10276 | ison: true |
| 10277 | usedLabels: |
| 10278 | - instance |
| 10279 | - colo_name |
| 10280 | - tier |
| 10281 | - animal |
| 10282 | - brand |
| 10283 | - sliver |
| 10284 | - pop_name |
| 10285 | position: |
| 10286 | start: 75 |
| 10287 | end: 115 |
| 10288 | type: aggregation |
| 10289 | fixedLabels: true |
| 10290 | isConditional: true |
| 10291 | |
| 10292 | --- |
| 10293 | |
| 10294 | [TestLabelsSource/170 - 1] |
| 10295 | expr: |4 |
| 10296 | |
| 10297 | up{node_status="v", job="node_exporter"} |
| 10298 | * on (colo_name) group_left(tier) colo_metadata{colo_status="v"} |
| 10299 | * on (instance) group_left (sliver) sliver_metadata{node_status="v"} |
| 10300 | output: |
| 10301 | - labels: |
| 10302 | __name__: |
| 10303 | reason: Binary operation between two vectors removes metric names. |
| 10304 | kind: excluded |
| 10305 | fragment: |
| 10306 | start: 1 |
| 10307 | end: 175 |
| 10308 | colo_name: |
| 10309 | reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 10310 | kind: included |
| 10311 | fragment: |
| 10312 | start: 48 |
| 10313 | end: 57 |
| 10314 | instance: |
| 10315 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10316 | kind: included |
| 10317 | fragment: |
| 10318 | start: 113 |
| 10319 | end: 121 |
| 10320 | job: |
| 10321 | reason: Query will only return series where these labels are present. |
| 10322 | kind: guaranteed |
| 10323 | fragment: |
| 10324 | start: 1 |
| 10325 | end: 41 |
| 10326 | node_status: |
| 10327 | reason: Query will only return series where these labels are present. |
| 10328 | kind: guaranteed |
| 10329 | fragment: |
| 10330 | start: 1 |
| 10331 | end: 41 |
| 10332 | sliver: |
| 10333 | reason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10334 | kind: included |
| 10335 | fragment: |
| 10336 | start: 135 |
| 10337 | end: 141 |
| 10338 | tier: |
| 10339 | reason: Query is using `group_left(tier)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10340 | kind: included |
| 10341 | fragment: |
| 10342 | start: 70 |
| 10343 | end: 74 |
| 10344 | returns: vector |
| 10345 | operations: |
| 10346 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 10347 | op: "" |
| 10348 | joins: |
| 10349 | - matchinglabels: |
| 10350 | - colo_name |
| 10351 | addedlabels: |
| 10352 | - tier |
| 10353 | src: |
| 10354 | labels: |
| 10355 | colo_status: |
| 10356 | reason: Query will only return series where these labels are present. |
| 10357 | kind: guaranteed |
| 10358 | fragment: |
| 10359 | start: 76 |
| 10360 | end: 106 |
| 10361 | returns: vector |
| 10362 | operations: |
| 10363 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 10364 | op: "" |
| 10365 | position: |
| 10366 | start: 76 |
| 10367 | end: 106 |
| 10368 | type: selector |
| 10369 | op: 57395 |
| 10370 | depth: 0 |
| 10371 | ison: true |
| 10372 | - matchinglabels: |
| 10373 | - instance |
| 10374 | addedlabels: |
| 10375 | - sliver |
| 10376 | src: |
| 10377 | labels: |
| 10378 | node_status: |
| 10379 | reason: Query will only return series where these labels are present. |
| 10380 | kind: guaranteed |
| 10381 | fragment: |
| 10382 | start: 143 |
| 10383 | end: 175 |
| 10384 | returns: vector |
| 10385 | operations: |
| 10386 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 10387 | op: "" |
| 10388 | position: |
| 10389 | start: 143 |
| 10390 | end: 175 |
| 10391 | type: selector |
| 10392 | op: 57395 |
| 10393 | depth: 0 |
| 10394 | ison: true |
| 10395 | usedLabels: |
| 10396 | - colo_name |
| 10397 | - instance |
| 10398 | position: |
| 10399 | start: 1 |
| 10400 | end: 41 |
| 10401 | type: selector |
| 10402 | |
| 10403 | --- |
| 10404 | |
| 10405 | [TestLabelsSource/171 - 1] |
| 10406 | expr: |4 |
| 10407 | |
| 10408 | up{node_status="v", job="node_exporter"} |
| 10409 | and on (colo_name) colo_metadata{colo_status="v"} |
| 10410 | * on (instance) group_left (sliver) sliver_metadata{node_status="v"} |
| 10411 | output: |
| 10412 | - labels: |
| 10413 | colo_name: |
| 10414 | reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results if matched time series have them. |
| 10415 | kind: included |
| 10416 | fragment: |
| 10417 | start: 50 |
| 10418 | end: 59 |
| 10419 | job: |
| 10420 | reason: Query will only return series where these labels are present. |
| 10421 | kind: guaranteed |
| 10422 | fragment: |
| 10423 | start: 1 |
| 10424 | end: 41 |
| 10425 | node_status: |
| 10426 | reason: Query will only return series where these labels are present. |
| 10427 | kind: guaranteed |
| 10428 | fragment: |
| 10429 | start: 1 |
| 10430 | end: 41 |
| 10431 | deadLabels: |
| 10432 | - name: sliver |
| 10433 | reason: This binary operation prevents previously joined label `sliver` from being added to the results. |
| 10434 | labelreason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10435 | usagefragment: |
| 10436 | start: 42 |
| 10437 | end: 45 |
| 10438 | labelfragment: |
| 10439 | start: 120 |
| 10440 | end: 126 |
| 10441 | kind: 1 |
| 10442 | returns: vector |
| 10443 | operations: |
| 10444 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 10445 | op: "" |
| 10446 | joins: |
| 10447 | - matchinglabels: |
| 10448 | - colo_name |
| 10449 | addedlabels: [] |
| 10450 | src: |
| 10451 | labels: |
| 10452 | __name__: |
| 10453 | reason: Binary operation between two vectors removes metric names. |
| 10454 | kind: excluded |
| 10455 | fragment: |
| 10456 | start: 61 |
| 10457 | end: 160 |
| 10458 | colo_status: |
| 10459 | reason: Query will only return series where these labels are present. |
| 10460 | kind: guaranteed |
| 10461 | fragment: |
| 10462 | start: 61 |
| 10463 | end: 91 |
| 10464 | instance: |
| 10465 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10466 | kind: included |
| 10467 | fragment: |
| 10468 | start: 98 |
| 10469 | end: 106 |
| 10470 | sliver: |
| 10471 | reason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10472 | kind: included |
| 10473 | fragment: |
| 10474 | start: 120 |
| 10475 | end: 126 |
| 10476 | returns: vector |
| 10477 | operations: |
| 10478 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 10479 | op: "" |
| 10480 | joins: |
| 10481 | - matchinglabels: |
| 10482 | - instance |
| 10483 | addedlabels: |
| 10484 | - sliver |
| 10485 | src: |
| 10486 | labels: |
| 10487 | node_status: |
| 10488 | reason: Query will only return series where these labels are present. |
| 10489 | kind: guaranteed |
| 10490 | fragment: |
| 10491 | start: 128 |
| 10492 | end: 160 |
| 10493 | returns: vector |
| 10494 | operations: |
| 10495 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 10496 | op: "" |
| 10497 | position: |
| 10498 | start: 128 |
| 10499 | end: 160 |
| 10500 | type: selector |
| 10501 | op: 57395 |
| 10502 | depth: 0 |
| 10503 | ison: true |
| 10504 | usedLabels: |
| 10505 | - instance |
| 10506 | position: |
| 10507 | start: 61 |
| 10508 | end: 91 |
| 10509 | type: selector |
| 10510 | op: 57389 |
| 10511 | depth: 0 |
| 10512 | ison: true |
| 10513 | usedLabels: |
| 10514 | - colo_name |
| 10515 | position: |
| 10516 | start: 1 |
| 10517 | end: 41 |
| 10518 | type: selector |
| 10519 | |
| 10520 | --- |
| 10521 | |
| 10522 | [TestLabelsSource/172 - 1] |
| 10523 | expr: |4 |
| 10524 | |
| 10525 | colo_metadata{colo_status="v"} * on (colo_name) group_right(tier, animal, brand, pop_name) |
| 10526 | sliver_metadata{node_status="v"} * on (instance) group_right (sliver) |
| 10527 | (metal_services_enabled == 999) * on (instance) |
| 10528 | up{node_status="v", job="node_exporter"} |
| 10529 | output: |
| 10530 | - labels: |
| 10531 | "": |
| 10532 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 10533 | kind: excluded |
| 10534 | fragment: |
| 10535 | start: 1 |
| 10536 | end: 250 |
| 10537 | __name__: |
| 10538 | reason: Binary operation between two vectors removes metric names. |
| 10539 | kind: excluded |
| 10540 | fragment: |
| 10541 | start: 1 |
| 10542 | end: 250 |
| 10543 | instance: |
| 10544 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 10545 | kind: included |
| 10546 | fragment: |
| 10547 | start: 200 |
| 10548 | end: 208 |
| 10549 | sliver: |
| 10550 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 10551 | kind: excluded |
| 10552 | fragment: |
| 10553 | start: 1 |
| 10554 | end: 250 |
| 10555 | deadLabels: |
| 10556 | - name: tier |
| 10557 | reason: This binary operation prevents previously joined label `tier` from being added to the results. |
| 10558 | labelreason: "" |
| 10559 | usagefragment: |
| 10560 | start: 125 |
| 10561 | end: 126 |
| 10562 | labelfragment: |
| 10563 | start: 125 |
| 10564 | end: 126 |
| 10565 | kind: 1 |
| 10566 | - name: animal |
| 10567 | reason: This binary operation prevents previously joined label `animal` from being added to the results. |
| 10568 | labelreason: "" |
| 10569 | usagefragment: |
| 10570 | start: 125 |
| 10571 | end: 126 |
| 10572 | labelfragment: |
| 10573 | start: 125 |
| 10574 | end: 126 |
| 10575 | kind: 1 |
| 10576 | - name: brand |
| 10577 | reason: This binary operation prevents previously joined label `brand` from being added to the results. |
| 10578 | labelreason: "" |
| 10579 | usagefragment: |
| 10580 | start: 125 |
| 10581 | end: 126 |
| 10582 | labelfragment: |
| 10583 | start: 125 |
| 10584 | end: 126 |
| 10585 | kind: 1 |
| 10586 | - name: pop_name |
| 10587 | reason: This binary operation prevents previously joined label `pop_name` from being added to the results. |
| 10588 | labelreason: "" |
| 10589 | usagefragment: |
| 10590 | start: 125 |
| 10591 | end: 126 |
| 10592 | labelfragment: |
| 10593 | start: 125 |
| 10594 | end: 126 |
| 10595 | kind: 1 |
| 10596 | - name: sliver |
| 10597 | reason: This binary operation prevents previously joined label `sliver` from being added to the results. |
| 10598 | labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 10599 | usagefragment: |
| 10600 | start: 194 |
| 10601 | end: 195 |
| 10602 | labelfragment: |
| 10603 | start: 1 |
| 10604 | end: 250 |
| 10605 | kind: 1 |
| 10606 | returns: vector |
| 10607 | operations: |
| 10608 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 10609 | op: "" |
| 10610 | joins: |
| 10611 | - matchinglabels: |
| 10612 | - instance |
| 10613 | addedlabels: |
| 10614 | - sliver |
| 10615 | src: |
| 10616 | labels: |
| 10617 | __name__: |
| 10618 | reason: Binary operation between two vectors removes metric names. |
| 10619 | kind: excluded |
| 10620 | fragment: |
| 10621 | start: 1 |
| 10622 | end: 124 |
| 10623 | animal: |
| 10624 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10625 | kind: included |
| 10626 | fragment: |
| 10627 | start: 67 |
| 10628 | end: 73 |
| 10629 | brand: |
| 10630 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10631 | kind: included |
| 10632 | fragment: |
| 10633 | start: 75 |
| 10634 | end: 80 |
| 10635 | colo_name: |
| 10636 | reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 10637 | kind: included |
| 10638 | fragment: |
| 10639 | start: 38 |
| 10640 | end: 47 |
| 10641 | node_status: |
| 10642 | reason: Query will only return series where these labels are present. |
| 10643 | kind: guaranteed |
| 10644 | fragment: |
| 10645 | start: 92 |
| 10646 | end: 124 |
| 10647 | pop_name: |
| 10648 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10649 | kind: included |
| 10650 | fragment: |
| 10651 | start: 82 |
| 10652 | end: 90 |
| 10653 | tier: |
| 10654 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10655 | kind: included |
| 10656 | fragment: |
| 10657 | start: 61 |
| 10658 | end: 65 |
| 10659 | returns: vector |
| 10660 | operations: |
| 10661 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 10662 | op: "" |
| 10663 | joins: |
| 10664 | - matchinglabels: |
| 10665 | - colo_name |
| 10666 | addedlabels: |
| 10667 | - tier |
| 10668 | - animal |
| 10669 | - brand |
| 10670 | - pop_name |
| 10671 | src: |
| 10672 | labels: |
| 10673 | colo_status: |
| 10674 | reason: Query will only return series where these labels are present. |
| 10675 | kind: guaranteed |
| 10676 | fragment: |
| 10677 | start: 1 |
| 10678 | end: 31 |
| 10679 | returns: vector |
| 10680 | operations: |
| 10681 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 10682 | op: "" |
| 10683 | position: |
| 10684 | start: 1 |
| 10685 | end: 31 |
| 10686 | type: selector |
| 10687 | op: 57395 |
| 10688 | depth: 0 |
| 10689 | ison: true |
| 10690 | usedLabels: |
| 10691 | - colo_name |
| 10692 | position: |
| 10693 | start: 92 |
| 10694 | end: 124 |
| 10695 | type: selector |
| 10696 | op: 57395 |
| 10697 | depth: 0 |
| 10698 | ison: true |
| 10699 | - matchinglabels: |
| 10700 | - instance |
| 10701 | addedlabels: [] |
| 10702 | src: |
| 10703 | labels: |
| 10704 | job: |
| 10705 | reason: Query will only return series where these labels are present. |
| 10706 | kind: guaranteed |
| 10707 | fragment: |
| 10708 | start: 210 |
| 10709 | end: 250 |
| 10710 | node_status: |
| 10711 | reason: Query will only return series where these labels are present. |
| 10712 | kind: guaranteed |
| 10713 | fragment: |
| 10714 | start: 210 |
| 10715 | end: 250 |
| 10716 | returns: vector |
| 10717 | operations: |
| 10718 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 10719 | op: "" |
| 10720 | position: |
| 10721 | start: 210 |
| 10722 | end: 250 |
| 10723 | type: selector |
| 10724 | op: 57395 |
| 10725 | depth: 0 |
| 10726 | ison: true |
| 10727 | usedLabels: |
| 10728 | - instance |
| 10729 | position: |
| 10730 | start: 163 |
| 10731 | end: 185 |
| 10732 | type: selector |
| 10733 | fixedLabels: true |
| 10734 | isConditional: true |
| 10735 | |
| 10736 | --- |
| 10737 | |
| 10738 | [TestLabelsSource/173 - 1] |
| 10739 | expr: |4 |
| 10740 | |
| 10741 | colo_metadata{colo_status="v"} * on (colo_name) group_right(tier, animal, brand, pop_name) |
| 10742 | sliver_metadata{node_status="v"} * on (instance) group_right (sliver) |
| 10743 | (metal_services_enabled == 999) * on (instance) group_right() |
| 10744 | up{node_status="v", job="node_exporter"} |
| 10745 | output: |
| 10746 | - labels: |
| 10747 | __name__: |
| 10748 | reason: Binary operation between two vectors removes metric names. |
| 10749 | kind: excluded |
| 10750 | fragment: |
| 10751 | start: 1 |
| 10752 | end: 264 |
| 10753 | instance: |
| 10754 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10755 | kind: included |
| 10756 | fragment: |
| 10757 | start: 200 |
| 10758 | end: 208 |
| 10759 | job: |
| 10760 | reason: Query will only return series where these labels are present. |
| 10761 | kind: guaranteed |
| 10762 | fragment: |
| 10763 | start: 224 |
| 10764 | end: 264 |
| 10765 | node_status: |
| 10766 | reason: Query will only return series where these labels are present. |
| 10767 | kind: guaranteed |
| 10768 | fragment: |
| 10769 | start: 224 |
| 10770 | end: 264 |
| 10771 | deadLabels: |
| 10772 | - name: sliver |
| 10773 | reason: This binary operation prevents previously joined label `sliver` from being added to the results. |
| 10774 | labelreason: "" |
| 10775 | usagefragment: |
| 10776 | start: 194 |
| 10777 | end: 195 |
| 10778 | labelfragment: |
| 10779 | start: 194 |
| 10780 | end: 195 |
| 10781 | kind: 1 |
| 10782 | returns: vector |
| 10783 | operations: |
| 10784 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 10785 | op: "" |
| 10786 | joins: |
| 10787 | - matchinglabels: |
| 10788 | - instance |
| 10789 | addedlabels: [] |
| 10790 | src: |
| 10791 | labels: |
| 10792 | __name__: |
| 10793 | reason: Binary operation between two vectors removes metric names. |
| 10794 | kind: excluded |
| 10795 | fragment: |
| 10796 | start: 1 |
| 10797 | end: 193 |
| 10798 | instance: |
| 10799 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10800 | kind: included |
| 10801 | fragment: |
| 10802 | start: 131 |
| 10803 | end: 139 |
| 10804 | sliver: |
| 10805 | reason: Query is using `group_right(sliver)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10806 | kind: included |
| 10807 | fragment: |
| 10808 | start: 154 |
| 10809 | end: 160 |
| 10810 | deadLabels: |
| 10811 | - name: tier |
| 10812 | reason: This binary operation prevents previously joined label `tier` from being added to the results. |
| 10813 | labelreason: "" |
| 10814 | usagefragment: |
| 10815 | start: 125 |
| 10816 | end: 126 |
| 10817 | labelfragment: |
| 10818 | start: 125 |
| 10819 | end: 126 |
| 10820 | kind: 1 |
| 10821 | - name: animal |
| 10822 | reason: This binary operation prevents previously joined label `animal` from being added to the results. |
| 10823 | labelreason: "" |
| 10824 | usagefragment: |
| 10825 | start: 125 |
| 10826 | end: 126 |
| 10827 | labelfragment: |
| 10828 | start: 125 |
| 10829 | end: 126 |
| 10830 | kind: 1 |
| 10831 | - name: brand |
| 10832 | reason: This binary operation prevents previously joined label `brand` from being added to the results. |
| 10833 | labelreason: "" |
| 10834 | usagefragment: |
| 10835 | start: 125 |
| 10836 | end: 126 |
| 10837 | labelfragment: |
| 10838 | start: 125 |
| 10839 | end: 126 |
| 10840 | kind: 1 |
| 10841 | - name: pop_name |
| 10842 | reason: This binary operation prevents previously joined label `pop_name` from being added to the results. |
| 10843 | labelreason: "" |
| 10844 | usagefragment: |
| 10845 | start: 125 |
| 10846 | end: 126 |
| 10847 | labelfragment: |
| 10848 | start: 125 |
| 10849 | end: 126 |
| 10850 | kind: 1 |
| 10851 | returns: vector |
| 10852 | operations: |
| 10853 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 10854 | op: "" |
| 10855 | joins: |
| 10856 | - matchinglabels: |
| 10857 | - instance |
| 10858 | addedlabels: |
| 10859 | - sliver |
| 10860 | src: |
| 10861 | labels: |
| 10862 | __name__: |
| 10863 | reason: Binary operation between two vectors removes metric names. |
| 10864 | kind: excluded |
| 10865 | fragment: |
| 10866 | start: 1 |
| 10867 | end: 124 |
| 10868 | animal: |
| 10869 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10870 | kind: included |
| 10871 | fragment: |
| 10872 | start: 67 |
| 10873 | end: 73 |
| 10874 | brand: |
| 10875 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10876 | kind: included |
| 10877 | fragment: |
| 10878 | start: 75 |
| 10879 | end: 80 |
| 10880 | colo_name: |
| 10881 | reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 10882 | kind: included |
| 10883 | fragment: |
| 10884 | start: 38 |
| 10885 | end: 47 |
| 10886 | node_status: |
| 10887 | reason: Query will only return series where these labels are present. |
| 10888 | kind: guaranteed |
| 10889 | fragment: |
| 10890 | start: 92 |
| 10891 | end: 124 |
| 10892 | pop_name: |
| 10893 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10894 | kind: included |
| 10895 | fragment: |
| 10896 | start: 82 |
| 10897 | end: 90 |
| 10898 | tier: |
| 10899 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 10900 | kind: included |
| 10901 | fragment: |
| 10902 | start: 61 |
| 10903 | end: 65 |
| 10904 | returns: vector |
| 10905 | operations: |
| 10906 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 10907 | op: "" |
| 10908 | joins: |
| 10909 | - matchinglabels: |
| 10910 | - colo_name |
| 10911 | addedlabels: |
| 10912 | - tier |
| 10913 | - animal |
| 10914 | - brand |
| 10915 | - pop_name |
| 10916 | src: |
| 10917 | labels: |
| 10918 | colo_status: |
| 10919 | reason: Query will only return series where these labels are present. |
| 10920 | kind: guaranteed |
| 10921 | fragment: |
| 10922 | start: 1 |
| 10923 | end: 31 |
| 10924 | returns: vector |
| 10925 | operations: |
| 10926 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 10927 | op: "" |
| 10928 | position: |
| 10929 | start: 1 |
| 10930 | end: 31 |
| 10931 | type: selector |
| 10932 | op: 57395 |
| 10933 | depth: 0 |
| 10934 | ison: true |
| 10935 | usedLabels: |
| 10936 | - colo_name |
| 10937 | position: |
| 10938 | start: 92 |
| 10939 | end: 124 |
| 10940 | type: selector |
| 10941 | op: 57395 |
| 10942 | depth: 0 |
| 10943 | ison: true |
| 10944 | usedLabels: |
| 10945 | - instance |
| 10946 | position: |
| 10947 | start: 163 |
| 10948 | end: 185 |
| 10949 | type: selector |
| 10950 | isConditional: true |
| 10951 | op: 57395 |
| 10952 | depth: 0 |
| 10953 | ison: true |
| 10954 | usedLabels: |
| 10955 | - instance |
| 10956 | position: |
| 10957 | start: 224 |
| 10958 | end: 264 |
| 10959 | type: selector |
| 10960 | |
| 10961 | --- |
| 10962 | |
| 10963 | [TestLabelsSource/174 - 1] |
| 10964 | expr: |4 |
| 10965 | |
| 10966 | sliver_metadata{node_status="v"} * on (instance) group_right (sliver) |
| 10967 | (metal_services_enabled == 999) * on (colo_name) group_left(tier, animal, brand, pop_name) |
| 10968 | colo_metadata{colo_status="v"} |
| 10969 | output: |
| 10970 | - labels: |
| 10971 | __name__: |
| 10972 | reason: Binary operation between two vectors removes metric names. |
| 10973 | kind: excluded |
| 10974 | fragment: |
| 10975 | start: 1 |
| 10976 | end: 192 |
| 10977 | animal: |
| 10978 | reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10979 | kind: included |
| 10980 | fragment: |
| 10981 | start: 137 |
| 10982 | end: 143 |
| 10983 | brand: |
| 10984 | reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 10985 | kind: included |
| 10986 | fragment: |
| 10987 | start: 145 |
| 10988 | end: 150 |
| 10989 | colo_name: |
| 10990 | reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 10991 | kind: included |
| 10992 | fragment: |
| 10993 | start: 109 |
| 10994 | end: 118 |
| 10995 | instance: |
| 10996 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10997 | kind: included |
| 10998 | fragment: |
| 10999 | start: 40 |
| 11000 | end: 48 |
| 11001 | pop_name: |
| 11002 | reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 11003 | kind: included |
| 11004 | fragment: |
| 11005 | start: 152 |
| 11006 | end: 160 |
| 11007 | sliver: |
| 11008 | reason: Query is using `group_right(sliver)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11009 | kind: included |
| 11010 | fragment: |
| 11011 | start: 63 |
| 11012 | end: 69 |
| 11013 | tier: |
| 11014 | reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query. |
| 11015 | kind: included |
| 11016 | fragment: |
| 11017 | start: 131 |
| 11018 | end: 135 |
| 11019 | returns: vector |
| 11020 | operations: |
| 11021 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 11022 | op: "" |
| 11023 | joins: |
| 11024 | - matchinglabels: |
| 11025 | - instance |
| 11026 | addedlabels: |
| 11027 | - sliver |
| 11028 | src: |
| 11029 | labels: |
| 11030 | node_status: |
| 11031 | reason: Query will only return series where these labels are present. |
| 11032 | kind: guaranteed |
| 11033 | fragment: |
| 11034 | start: 1 |
| 11035 | end: 33 |
| 11036 | returns: vector |
| 11037 | operations: |
| 11038 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 11039 | op: "" |
| 11040 | position: |
| 11041 | start: 1 |
| 11042 | end: 33 |
| 11043 | type: selector |
| 11044 | op: 57395 |
| 11045 | depth: 0 |
| 11046 | ison: true |
| 11047 | - matchinglabels: |
| 11048 | - colo_name |
| 11049 | addedlabels: |
| 11050 | - tier |
| 11051 | - animal |
| 11052 | - brand |
| 11053 | - pop_name |
| 11054 | src: |
| 11055 | labels: |
| 11056 | colo_status: |
| 11057 | reason: Query will only return series where these labels are present. |
| 11058 | kind: guaranteed |
| 11059 | fragment: |
| 11060 | start: 162 |
| 11061 | end: 192 |
| 11062 | returns: vector |
| 11063 | operations: |
| 11064 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 11065 | op: "" |
| 11066 | position: |
| 11067 | start: 162 |
| 11068 | end: 192 |
| 11069 | type: selector |
| 11070 | op: 57395 |
| 11071 | depth: 0 |
| 11072 | ison: true |
| 11073 | usedLabels: |
| 11074 | - instance |
| 11075 | - colo_name |
| 11076 | position: |
| 11077 | start: 72 |
| 11078 | end: 94 |
| 11079 | type: selector |
| 11080 | isConditional: true |
| 11081 | |
| 11082 | --- |
| 11083 | |
| 11084 | [TestLabelsSource/175 - 1] |
| 11085 | expr: |4 |
| 11086 | |
| 11087 | colo_metadata * on (colo_name) group_right(tier, animal, brand, pop_name) |
| 11088 | sliver_metadata * on (instance) group_right (sliver) |
| 11089 | metal_services_enabled |
| 11090 | output: |
| 11091 | - labels: |
| 11092 | __name__: |
| 11093 | reason: Binary operation between two vectors removes metric names. |
| 11094 | kind: excluded |
| 11095 | fragment: |
| 11096 | start: 1 |
| 11097 | end: 150 |
| 11098 | instance: |
| 11099 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 11100 | kind: included |
| 11101 | fragment: |
| 11102 | start: 97 |
| 11103 | end: 105 |
| 11104 | sliver: |
| 11105 | reason: Query is using `group_right(sliver)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11106 | kind: included |
| 11107 | fragment: |
| 11108 | start: 120 |
| 11109 | end: 126 |
| 11110 | deadLabels: |
| 11111 | - name: tier |
| 11112 | reason: This binary operation prevents previously joined label `tier` from being added to the results. |
| 11113 | labelreason: "" |
| 11114 | usagefragment: |
| 11115 | start: 91 |
| 11116 | end: 92 |
| 11117 | labelfragment: |
| 11118 | start: 91 |
| 11119 | end: 92 |
| 11120 | kind: 1 |
| 11121 | - name: animal |
| 11122 | reason: This binary operation prevents previously joined label `animal` from being added to the results. |
| 11123 | labelreason: "" |
| 11124 | usagefragment: |
| 11125 | start: 91 |
| 11126 | end: 92 |
| 11127 | labelfragment: |
| 11128 | start: 91 |
| 11129 | end: 92 |
| 11130 | kind: 1 |
| 11131 | - name: brand |
| 11132 | reason: This binary operation prevents previously joined label `brand` from being added to the results. |
| 11133 | labelreason: "" |
| 11134 | usagefragment: |
| 11135 | start: 91 |
| 11136 | end: 92 |
| 11137 | labelfragment: |
| 11138 | start: 91 |
| 11139 | end: 92 |
| 11140 | kind: 1 |
| 11141 | - name: pop_name |
| 11142 | reason: This binary operation prevents previously joined label `pop_name` from being added to the results. |
| 11143 | labelreason: "" |
| 11144 | usagefragment: |
| 11145 | start: 91 |
| 11146 | end: 92 |
| 11147 | labelfragment: |
| 11148 | start: 91 |
| 11149 | end: 92 |
| 11150 | kind: 1 |
| 11151 | returns: vector |
| 11152 | operations: |
| 11153 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 11154 | op: "" |
| 11155 | joins: |
| 11156 | - matchinglabels: |
| 11157 | - instance |
| 11158 | addedlabels: |
| 11159 | - sliver |
| 11160 | src: |
| 11161 | labels: |
| 11162 | __name__: |
| 11163 | reason: Binary operation between two vectors removes metric names. |
| 11164 | kind: excluded |
| 11165 | fragment: |
| 11166 | start: 1 |
| 11167 | end: 90 |
| 11168 | animal: |
| 11169 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11170 | kind: included |
| 11171 | fragment: |
| 11172 | start: 50 |
| 11173 | end: 56 |
| 11174 | brand: |
| 11175 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11176 | kind: included |
| 11177 | fragment: |
| 11178 | start: 58 |
| 11179 | end: 63 |
| 11180 | colo_name: |
| 11181 | reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 11182 | kind: included |
| 11183 | fragment: |
| 11184 | start: 21 |
| 11185 | end: 30 |
| 11186 | pop_name: |
| 11187 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11188 | kind: included |
| 11189 | fragment: |
| 11190 | start: 65 |
| 11191 | end: 73 |
| 11192 | tier: |
| 11193 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11194 | kind: included |
| 11195 | fragment: |
| 11196 | start: 44 |
| 11197 | end: 48 |
| 11198 | returns: vector |
| 11199 | operations: |
| 11200 | - node: '[*parser.VectorSelector] sliver_metadata' |
| 11201 | op: "" |
| 11202 | joins: |
| 11203 | - matchinglabels: |
| 11204 | - colo_name |
| 11205 | addedlabels: |
| 11206 | - tier |
| 11207 | - animal |
| 11208 | - brand |
| 11209 | - pop_name |
| 11210 | src: |
| 11211 | returns: vector |
| 11212 | operations: |
| 11213 | - node: '[*parser.VectorSelector] colo_metadata' |
| 11214 | op: "" |
| 11215 | position: |
| 11216 | start: 1 |
| 11217 | end: 14 |
| 11218 | type: selector |
| 11219 | op: 57395 |
| 11220 | depth: 0 |
| 11221 | ison: true |
| 11222 | usedLabels: |
| 11223 | - colo_name |
| 11224 | position: |
| 11225 | start: 75 |
| 11226 | end: 90 |
| 11227 | type: selector |
| 11228 | op: 57395 |
| 11229 | depth: 0 |
| 11230 | ison: true |
| 11231 | usedLabels: |
| 11232 | - instance |
| 11233 | position: |
| 11234 | start: 128 |
| 11235 | end: 150 |
| 11236 | type: selector |
| 11237 | |
| 11238 | --- |
| 11239 | |
| 11240 | [TestLabelsSource/176 - 1] |
| 11241 | expr: |4 |
| 11242 | |
| 11243 | colo_metadata * on (colo_name) group_right(tier, animal, brand, pop_name) |
| 11244 | ( |
| 11245 | sliver_metadata * on (instance) group_right (sliver) |
| 11246 | metal_services_enabled |
| 11247 | ) |
| 11248 | output: |
| 11249 | - labels: |
| 11250 | __name__: |
| 11251 | reason: Binary operation between two vectors removes metric names. |
| 11252 | kind: excluded |
| 11253 | fragment: |
| 11254 | start: 1 |
| 11255 | end: 162 |
| 11256 | animal: |
| 11257 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11258 | kind: included |
| 11259 | fragment: |
| 11260 | start: 50 |
| 11261 | end: 56 |
| 11262 | brand: |
| 11263 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11264 | kind: included |
| 11265 | fragment: |
| 11266 | start: 58 |
| 11267 | end: 63 |
| 11268 | colo_name: |
| 11269 | reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 11270 | kind: included |
| 11271 | fragment: |
| 11272 | start: 21 |
| 11273 | end: 30 |
| 11274 | instance: |
| 11275 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 11276 | kind: included |
| 11277 | fragment: |
| 11278 | start: 103 |
| 11279 | end: 111 |
| 11280 | pop_name: |
| 11281 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11282 | kind: included |
| 11283 | fragment: |
| 11284 | start: 65 |
| 11285 | end: 73 |
| 11286 | sliver: |
| 11287 | reason: Query is using `group_right(sliver)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11288 | kind: included |
| 11289 | fragment: |
| 11290 | start: 126 |
| 11291 | end: 132 |
| 11292 | tier: |
| 11293 | reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11294 | kind: included |
| 11295 | fragment: |
| 11296 | start: 44 |
| 11297 | end: 48 |
| 11298 | returns: vector |
| 11299 | operations: |
| 11300 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 11301 | op: "" |
| 11302 | joins: |
| 11303 | - matchinglabels: |
| 11304 | - instance |
| 11305 | addedlabels: |
| 11306 | - sliver |
| 11307 | src: |
| 11308 | returns: vector |
| 11309 | operations: |
| 11310 | - node: '[*parser.VectorSelector] sliver_metadata' |
| 11311 | op: "" |
| 11312 | position: |
| 11313 | start: 81 |
| 11314 | end: 96 |
| 11315 | type: selector |
| 11316 | op: 57395 |
| 11317 | depth: 0 |
| 11318 | ison: true |
| 11319 | - matchinglabels: |
| 11320 | - colo_name |
| 11321 | addedlabels: |
| 11322 | - tier |
| 11323 | - animal |
| 11324 | - brand |
| 11325 | - pop_name |
| 11326 | src: |
| 11327 | returns: vector |
| 11328 | operations: |
| 11329 | - node: '[*parser.VectorSelector] colo_metadata' |
| 11330 | op: "" |
| 11331 | position: |
| 11332 | start: 1 |
| 11333 | end: 14 |
| 11334 | type: selector |
| 11335 | op: 57395 |
| 11336 | depth: 0 |
| 11337 | ison: true |
| 11338 | usedLabels: |
| 11339 | - instance |
| 11340 | - colo_name |
| 11341 | position: |
| 11342 | start: 138 |
| 11343 | end: 160 |
| 11344 | type: selector |
| 11345 | |
| 11346 | --- |
| 11347 | |
| 11348 | [TestLabelsSource/177 - 1] |
| 11349 | expr: |4 |
| 11350 | |
| 11351 | up{node_status="v", job="node_exporter"} |
| 11352 | * on(instance) group_left(node_status) sliver_metadata |
| 11353 | output: |
| 11354 | - labels: |
| 11355 | __name__: |
| 11356 | reason: Binary operation between two vectors removes metric names. |
| 11357 | kind: excluded |
| 11358 | fragment: |
| 11359 | start: 1 |
| 11360 | end: 96 |
| 11361 | instance: |
| 11362 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 11363 | kind: included |
| 11364 | fragment: |
| 11365 | start: 47 |
| 11366 | end: 55 |
| 11367 | job: |
| 11368 | reason: Query will only return series where these labels are present. |
| 11369 | kind: guaranteed |
| 11370 | fragment: |
| 11371 | start: 1 |
| 11372 | end: 41 |
| 11373 | node_status: |
| 11374 | reason: Query will only return series where these labels are present. |
| 11375 | kind: guaranteed |
| 11376 | fragment: |
| 11377 | start: 1 |
| 11378 | end: 41 |
| 11379 | deadLabels: |
| 11380 | - name: node_status |
| 11381 | reason: Query is trying to join the `node_status` label that is already present on the other side of the query. |
| 11382 | labelreason: Query will only return series where these labels are present. |
| 11383 | usagefragment: |
| 11384 | start: 68 |
| 11385 | end: 79 |
| 11386 | labelfragment: |
| 11387 | start: 1 |
| 11388 | end: 41 |
| 11389 | kind: 2 |
| 11390 | returns: vector |
| 11391 | operations: |
| 11392 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 11393 | op: "" |
| 11394 | joins: |
| 11395 | - matchinglabels: |
| 11396 | - instance |
| 11397 | addedlabels: |
| 11398 | - node_status |
| 11399 | src: |
| 11400 | returns: vector |
| 11401 | operations: |
| 11402 | - node: '[*parser.VectorSelector] sliver_metadata' |
| 11403 | op: "" |
| 11404 | position: |
| 11405 | start: 81 |
| 11406 | end: 96 |
| 11407 | type: selector |
| 11408 | op: 57395 |
| 11409 | depth: 0 |
| 11410 | ison: true |
| 11411 | usedLabels: |
| 11412 | - instance |
| 11413 | position: |
| 11414 | start: 1 |
| 11415 | end: 41 |
| 11416 | type: selector |
| 11417 | |
| 11418 | --- |
| 11419 | |
| 11420 | [TestLabelsSource/178 - 1] |
| 11421 | expr: services_enabled{job=""} |
| 11422 | output: |
| 11423 | - labels: |
| 11424 | job: |
| 11425 | reason: Query uses `{job=""}` selector which will filter out any time series with the `job` label set. |
| 11426 | kind: excluded |
| 11427 | fragment: |
| 11428 | start: 0 |
| 11429 | end: 24 |
| 11430 | returns: vector |
| 11431 | operations: |
| 11432 | - node: '[*parser.VectorSelector] services_enabled{job=""}' |
| 11433 | op: "" |
| 11434 | position: |
| 11435 | start: 0 |
| 11436 | end: 24 |
| 11437 | type: selector |
| 11438 | |
| 11439 | --- |
| 11440 | |
| 11441 | [TestLabelsSource/179 - 1] |
| 11442 | expr: |4 |
| 11443 | |
| 11444 | group by (cluster, namespace, workload, workload_type, pod) ( |
| 11445 | label_join( |
| 11446 | label_join( |
| 11447 | group by (cluster, namespace, job_name, pod) ( |
| 11448 | label_join( |
| 11449 | kube_pod_owner{job="kube-state-metrics", owner_kind="Job"} |
| 11450 | , "job_name", "", "owner_name") |
| 11451 | ) |
| 11452 | * on (cluster, namespace, job_name) group_left(owner_kind, owner_name) |
| 11453 | group by (cluster, namespace, job_name, owner_kind, owner_name) ( |
| 11454 | kube_job_owner{job="kube-state-metrics", owner_kind!="Pod", owner_kind!=""} |
| 11455 | ) |
| 11456 | , "workload", "", "owner_name") |
| 11457 | , "workload_type", "", "owner_kind") |
| 11458 | ) |
| 11459 | output: |
| 11460 | - labels: |
| 11461 | "": |
| 11462 | reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results. |
| 11463 | kind: excluded |
| 11464 | fragment: |
| 11465 | start: 7 |
| 11466 | end: 10 |
| 11467 | __name__: |
| 11468 | reason: Aggregation removes metric name. |
| 11469 | kind: excluded |
| 11470 | fragment: |
| 11471 | start: 1 |
| 11472 | end: 600 |
| 11473 | cluster: |
| 11474 | reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results. |
| 11475 | kind: included |
| 11476 | fragment: |
| 11477 | start: 11 |
| 11478 | end: 18 |
| 11479 | job: |
| 11480 | reason: Query is using aggregation with `by(cluster, namespace, job_name, pod)`, only labels included inside `by(...)` will be present on the results. |
| 11481 | kind: excluded |
| 11482 | fragment: |
| 11483 | start: 105 |
| 11484 | end: 143 |
| 11485 | job_name: |
| 11486 | reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results. |
| 11487 | kind: excluded |
| 11488 | fragment: |
| 11489 | start: 7 |
| 11490 | end: 60 |
| 11491 | namespace: |
| 11492 | reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results. |
| 11493 | kind: included |
| 11494 | fragment: |
| 11495 | start: 20 |
| 11496 | end: 29 |
| 11497 | owner_kind: |
| 11498 | reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results. |
| 11499 | kind: excluded |
| 11500 | fragment: |
| 11501 | start: 7 |
| 11502 | end: 60 |
| 11503 | owner_name: |
| 11504 | reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results. |
| 11505 | kind: excluded |
| 11506 | fragment: |
| 11507 | start: 7 |
| 11508 | end: 60 |
| 11509 | pod: |
| 11510 | reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results. |
| 11511 | kind: included |
| 11512 | fragment: |
| 11513 | start: 56 |
| 11514 | end: 59 |
| 11515 | workload: |
| 11516 | reason: This label will be added to the result by label_join() call. |
| 11517 | kind: guaranteed |
| 11518 | fragment: |
| 11519 | start: 81 |
| 11520 | end: 559 |
| 11521 | workload_type: |
| 11522 | reason: This label will be added to the result by label_join() call. |
| 11523 | kind: guaranteed |
| 11524 | fragment: |
| 11525 | start: 65 |
| 11526 | end: 598 |
| 11527 | returns: vector |
| 11528 | operations: |
| 11529 | - node: '[*parser.VectorSelector] kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}' |
| 11530 | op: "" |
| 11531 | - args: |
| 11532 | - '"job_name"' |
| 11533 | - '""' |
| 11534 | - '"owner_name"' |
| 11535 | node: '[*parser.Call] label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name")' |
| 11536 | op: label_join |
| 11537 | - node: '[*parser.AggregateExpr] group by (cluster, namespace, job_name, pod) (label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name"))' |
| 11538 | op: group |
| 11539 | - args: |
| 11540 | - '"workload"' |
| 11541 | - '""' |
| 11542 | - '"owner_name"' |
| 11543 | node: '[*parser.Call] label_join(group by (cluster, namespace, job_name, pod) (label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name")) * on (cluster, namespace, job_name) group_left (owner_kind, owner_name) group by (cluster, namespace, job_name, owner_kind, owner_name) (kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"}), "workload", "", "owner_name")' |
| 11544 | op: label_join |
| 11545 | - args: |
| 11546 | - '"workload_type"' |
| 11547 | - '""' |
| 11548 | - '"owner_kind"' |
| 11549 | node: '[*parser.Call] label_join(label_join(group by (cluster, namespace, job_name, pod) (label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name")) * on (cluster, namespace, job_name) group_left (owner_kind, owner_name) group by (cluster, namespace, job_name, owner_kind, owner_name) (kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"}), "workload", "", "owner_name"), "workload_type", "", "owner_kind")' |
| 11550 | op: label_join |
| 11551 | - node: '[*parser.AggregateExpr] group by (cluster, namespace, workload, workload_type, pod) (label_join(label_join(group by (cluster, namespace, job_name, pod) (label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name")) * on (cluster, namespace, job_name) group_left (owner_kind, owner_name) group by (cluster, namespace, job_name, owner_kind, owner_name) (kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"}), "workload", "", "owner_name"), "workload_type", "", "owner_kind"))' |
| 11552 | op: group |
| 11553 | joins: |
| 11554 | - matchinglabels: |
| 11555 | - cluster |
| 11556 | - namespace |
| 11557 | - job_name |
| 11558 | addedlabels: |
| 11559 | - owner_kind |
| 11560 | - owner_name |
| 11561 | src: |
| 11562 | labels: |
| 11563 | "": |
| 11564 | reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results. |
| 11565 | kind: excluded |
| 11566 | fragment: |
| 11567 | start: 372 |
| 11568 | end: 375 |
| 11569 | __name__: |
| 11570 | reason: Aggregation removes metric name. |
| 11571 | kind: excluded |
| 11572 | fragment: |
| 11573 | start: 366 |
| 11574 | end: 523 |
| 11575 | cluster: |
| 11576 | reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results. |
| 11577 | kind: included |
| 11578 | fragment: |
| 11579 | start: 376 |
| 11580 | end: 383 |
| 11581 | job: |
| 11582 | reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results. |
| 11583 | kind: excluded |
| 11584 | fragment: |
| 11585 | start: 372 |
| 11586 | end: 429 |
| 11587 | job_name: |
| 11588 | reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results. |
| 11589 | kind: included |
| 11590 | fragment: |
| 11591 | start: 396 |
| 11592 | end: 404 |
| 11593 | namespace: |
| 11594 | reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results. |
| 11595 | kind: included |
| 11596 | fragment: |
| 11597 | start: 385 |
| 11598 | end: 394 |
| 11599 | owner_kind: |
| 11600 | reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results. |
| 11601 | kind: included |
| 11602 | fragment: |
| 11603 | start: 406 |
| 11604 | end: 416 |
| 11605 | owner_name: |
| 11606 | reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results. |
| 11607 | kind: included |
| 11608 | fragment: |
| 11609 | start: 418 |
| 11610 | end: 428 |
| 11611 | returns: vector |
| 11612 | operations: |
| 11613 | - node: '[*parser.VectorSelector] kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"}' |
| 11614 | op: "" |
| 11615 | - node: '[*parser.AggregateExpr] group by (cluster, namespace, job_name, owner_kind, owner_name) (kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"})' |
| 11616 | op: group |
| 11617 | usedLabels: |
| 11618 | - cluster |
| 11619 | - namespace |
| 11620 | - job_name |
| 11621 | - owner_kind |
| 11622 | - owner_name |
| 11623 | position: |
| 11624 | start: 440 |
| 11625 | end: 515 |
| 11626 | type: aggregation |
| 11627 | fixedLabels: true |
| 11628 | op: 57395 |
| 11629 | depth: 1 |
| 11630 | ison: true |
| 11631 | usedLabels: |
| 11632 | - cluster |
| 11633 | - namespace |
| 11634 | - pod |
| 11635 | - workload |
| 11636 | - workload_type |
| 11637 | position: |
| 11638 | start: 81 |
| 11639 | end: 559 |
| 11640 | type: aggregation |
| 11641 | fixedLabels: true |
| 11642 | |
| 11643 | --- |
| 11644 | |
| 11645 | [TestLabelsSource/180 - 1] |
| 11646 | expr: foo{job="xxx"} + on(job) group_right(instance) bar{} |
| 11647 | output: |
| 11648 | - labels: |
| 11649 | __name__: |
| 11650 | reason: Binary operation between two vectors removes metric names. |
| 11651 | kind: excluded |
| 11652 | fragment: |
| 11653 | start: 0 |
| 11654 | end: 52 |
| 11655 | instance: |
| 11656 | reason: Query is using `group_right(instance)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11657 | kind: included |
| 11658 | fragment: |
| 11659 | start: 37 |
| 11660 | end: 45 |
| 11661 | job: |
| 11662 | reason: Query is using one-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results. |
| 11663 | kind: included |
| 11664 | fragment: |
| 11665 | start: 20 |
| 11666 | end: 23 |
| 11667 | returns: vector |
| 11668 | operations: |
| 11669 | - node: '[*parser.VectorSelector] bar' |
| 11670 | op: "" |
| 11671 | joins: |
| 11672 | - matchinglabels: |
| 11673 | - job |
| 11674 | addedlabels: |
| 11675 | - instance |
| 11676 | src: |
| 11677 | labels: |
| 11678 | job: |
| 11679 | reason: Query will only return series where these labels are present. |
| 11680 | kind: guaranteed |
| 11681 | fragment: |
| 11682 | start: 0 |
| 11683 | end: 14 |
| 11684 | returns: vector |
| 11685 | operations: |
| 11686 | - node: '[*parser.VectorSelector] foo{job="xxx"}' |
| 11687 | op: "" |
| 11688 | position: |
| 11689 | start: 0 |
| 11690 | end: 14 |
| 11691 | type: selector |
| 11692 | op: 57383 |
| 11693 | depth: 0 |
| 11694 | ison: true |
| 11695 | usedLabels: |
| 11696 | - job |
| 11697 | position: |
| 11698 | start: 47 |
| 11699 | end: 52 |
| 11700 | type: selector |
| 11701 | |
| 11702 | --- |
| 11703 | |
| 11704 | [TestLabelsSource/181 - 1] |
| 11705 | expr: foo{job="xxx"} + ignoring(job) group_right(instance) bar{job="zzz"} |
| 11706 | output: |
| 11707 | - labels: |
| 11708 | __name__: |
| 11709 | reason: Binary operation between two vectors removes metric names. |
| 11710 | kind: excluded |
| 11711 | fragment: |
| 11712 | start: 0 |
| 11713 | end: 67 |
| 11714 | instance: |
| 11715 | reason: Query is using `group_right(instance)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query. |
| 11716 | kind: included |
| 11717 | fragment: |
| 11718 | start: 43 |
| 11719 | end: 51 |
| 11720 | job: |
| 11721 | reason: Query will only return series where these labels are present. |
| 11722 | kind: guaranteed |
| 11723 | fragment: |
| 11724 | start: 53 |
| 11725 | end: 67 |
| 11726 | returns: vector |
| 11727 | operations: |
| 11728 | - node: '[*parser.VectorSelector] bar{job="zzz"}' |
| 11729 | op: "" |
| 11730 | joins: |
| 11731 | - matchinglabels: |
| 11732 | - job |
| 11733 | addedlabels: |
| 11734 | - instance |
| 11735 | src: |
| 11736 | labels: |
| 11737 | job: |
| 11738 | reason: Query will only return series where these labels are present. |
| 11739 | kind: guaranteed |
| 11740 | fragment: |
| 11741 | start: 0 |
| 11742 | end: 14 |
| 11743 | returns: vector |
| 11744 | operations: |
| 11745 | - node: '[*parser.VectorSelector] foo{job="xxx"}' |
| 11746 | op: "" |
| 11747 | position: |
| 11748 | start: 0 |
| 11749 | end: 14 |
| 11750 | type: selector |
| 11751 | op: 57383 |
| 11752 | depth: 0 |
| 11753 | ison: false |
| 11754 | usedLabels: |
| 11755 | - instance |
| 11756 | position: |
| 11757 | start: 53 |
| 11758 | end: 67 |
| 11759 | type: selector |
| 11760 | |
| 11761 | --- |
| 11762 | |
| 11763 | [TestLabelsSource/182 - 1] |
| 11764 | expr: foo or ignoring(job) bar |
| 11765 | output: |
| 11766 | - returns: vector |
| 11767 | operations: |
| 11768 | - node: '[*parser.VectorSelector] foo' |
| 11769 | op: "" |
| 11770 | position: |
| 11771 | start: 0 |
| 11772 | end: 3 |
| 11773 | type: selector |
| 11774 | - returns: vector |
| 11775 | operations: |
| 11776 | - node: '[*parser.VectorSelector] bar' |
| 11777 | op: "" |
| 11778 | position: |
| 11779 | start: 21 |
| 11780 | end: 24 |
| 11781 | type: selector |
| 11782 | |
| 11783 | --- |
| 11784 | |
| 11785 | [TestLabelsSource/183 - 1] |
| 11786 | expr: foo or on(job) bar |
| 11787 | output: |
| 11788 | - labels: |
| 11789 | job: |
| 11790 | reason: Query is using many-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results if matched time series have them. |
| 11791 | kind: included |
| 11792 | fragment: |
| 11793 | start: 10 |
| 11794 | end: 13 |
| 11795 | returns: vector |
| 11796 | operations: |
| 11797 | - node: '[*parser.VectorSelector] foo' |
| 11798 | op: "" |
| 11799 | usedLabels: |
| 11800 | - job |
| 11801 | position: |
| 11802 | start: 0 |
| 11803 | end: 3 |
| 11804 | type: selector |
| 11805 | - returns: vector |
| 11806 | operations: |
| 11807 | - node: '[*parser.VectorSelector] bar' |
| 11808 | op: "" |
| 11809 | position: |
| 11810 | start: 15 |
| 11811 | end: 18 |
| 11812 | type: selector |
| 11813 | |
| 11814 | --- |
| 11815 | |
| 11816 | [TestLabelsSource/184 - 1] |
| 11817 | expr: |4 |
| 11818 | |
| 11819 | ( |
| 11820 | sum(rate(panics_total{module_name=~".+"}[5m])) by (colo_name, module_name) |
| 11821 | / |
| 11822 | ignoring(module_name) group_left |
| 11823 | sum(colo:requests:rate5m) by (colo_name) |
| 11824 | ) > 0.01 |
| 11825 | output: |
| 11826 | - labels: |
| 11827 | "": |
| 11828 | reason: Query is using aggregation with `by(colo_name, module_name)`, only labels included inside `by(...)` will be present on the results. |
| 11829 | kind: excluded |
| 11830 | fragment: |
| 11831 | start: 52 |
| 11832 | end: 55 |
| 11833 | __name__: |
| 11834 | reason: Binary operation between two vectors removes metric names. |
| 11835 | kind: excluded |
| 11836 | fragment: |
| 11837 | start: 5 |
| 11838 | end: 161 |
| 11839 | colo_name: |
| 11840 | reason: Query is using aggregation with `by(colo_name, module_name)`, only labels included inside `by(...)` will be present on the results. |
| 11841 | kind: included |
| 11842 | fragment: |
| 11843 | start: 56 |
| 11844 | end: 65 |
| 11845 | module_name: |
| 11846 | reason: Query will only return series where these labels are present. |
| 11847 | kind: guaranteed |
| 11848 | fragment: |
| 11849 | start: 9 |
| 11850 | end: 50 |
| 11851 | returns: vector |
| 11852 | operations: |
| 11853 | - node: '[*parser.VectorSelector] panics_total{module_name=~".+"}' |
| 11854 | op: "" |
| 11855 | - node: '[*parser.Call] rate(panics_total{module_name=~".+"}[5m])' |
| 11856 | op: rate |
| 11857 | - node: '[*parser.AggregateExpr] sum by (colo_name, module_name) (rate(panics_total{module_name=~".+"}[5m]))' |
| 11858 | op: sum |
| 11859 | joins: |
| 11860 | - matchinglabels: |
| 11861 | - module_name |
| 11862 | addedlabels: [] |
| 11863 | src: |
| 11864 | labels: |
| 11865 | "": |
| 11866 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 11867 | kind: excluded |
| 11868 | fragment: |
| 11869 | start: 147 |
| 11870 | end: 150 |
| 11871 | __name__: |
| 11872 | reason: Aggregation removes metric name. |
| 11873 | kind: excluded |
| 11874 | fragment: |
| 11875 | start: 121 |
| 11876 | end: 161 |
| 11877 | colo_name: |
| 11878 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 11879 | kind: included |
| 11880 | fragment: |
| 11881 | start: 151 |
| 11882 | end: 160 |
| 11883 | returns: vector |
| 11884 | operations: |
| 11885 | - node: '[*parser.VectorSelector] colo:requests:rate5m' |
| 11886 | op: "" |
| 11887 | - node: '[*parser.AggregateExpr] sum by (colo_name) (colo:requests:rate5m)' |
| 11888 | op: sum |
| 11889 | usedLabels: |
| 11890 | - colo_name |
| 11891 | position: |
| 11892 | start: 125 |
| 11893 | end: 145 |
| 11894 | type: aggregation |
| 11895 | fixedLabels: true |
| 11896 | op: 57384 |
| 11897 | depth: 0 |
| 11898 | ison: false |
| 11899 | usedLabels: |
| 11900 | - colo_name |
| 11901 | - module_name |
| 11902 | position: |
| 11903 | start: 14 |
| 11904 | end: 49 |
| 11905 | type: aggregation |
| 11906 | fixedLabels: true |
| 11907 | isConditional: true |
| 11908 | |
| 11909 | --- |