cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
internal/parser/source/source_test.snap
16633lines · 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 | indirect: |
| 41 | - src: |
| 42 | labels: |
| 43 | "": |
| 44 | reason: This query returns a number value with no labels. |
| 45 | kind: excluded |
| 46 | fragment: |
| 47 | start: 4 |
| 48 | end: 5 |
| 49 | returns: scalar |
| 50 | returnInfo: |
| 51 | logicalexpr: "" |
| 52 | valueposition: |
| 53 | start: 4 |
| 54 | end: 5 |
| 55 | returnednumber: 5 |
| 56 | alwaysreturns: true |
| 57 | knownreturn: true |
| 58 | isreturnbool: false |
| 59 | position: |
| 60 | start: 4 |
| 61 | end: 5 |
| 62 | type: number |
| 63 | fixedLabels: true |
| 64 | op: 57384 |
| 65 | side: 1 |
| 66 | returnInfo: |
| 67 | logicalexpr: 1 / 5 |
| 68 | valueposition: |
| 69 | start: 0 |
| 70 | end: 1 |
| 71 | returnednumber: 0.2 |
| 72 | alwaysreturns: true |
| 73 | knownreturn: true |
| 74 | isreturnbool: false |
| 75 | position: |
| 76 | start: 0 |
| 77 | end: 1 |
| 78 | type: number |
| 79 | fixedLabels: true |
| 80 | |
| 81 | --- |
| 82 | |
| 83 | [TestLabelsSource/3 - 1] |
| 84 | expr: (2 ^ 5) == bool 5 |
| 85 | output: |
| 86 | - labels: |
| 87 | "": |
| 88 | reason: This query returns a number value with no labels. |
| 89 | kind: excluded |
| 90 | fragment: |
| 91 | start: 1 |
| 92 | end: 2 |
| 93 | deadInfo: |
| 94 | reason: '`2 ^ 5 == 5` always evaluates to `32 == 5` and uses the `bool` modifier which means it will always return 0' |
| 95 | fragment: |
| 96 | start: 1 |
| 97 | end: 2 |
| 98 | returns: scalar |
| 99 | indirect: |
| 100 | - src: |
| 101 | labels: |
| 102 | "": |
| 103 | reason: This query returns a number value with no labels. |
| 104 | kind: excluded |
| 105 | fragment: |
| 106 | start: 5 |
| 107 | end: 6 |
| 108 | returns: scalar |
| 109 | returnInfo: |
| 110 | logicalexpr: "" |
| 111 | valueposition: |
| 112 | start: 5 |
| 113 | end: 6 |
| 114 | returnednumber: 5 |
| 115 | alwaysreturns: true |
| 116 | knownreturn: true |
| 117 | isreturnbool: false |
| 118 | position: |
| 119 | start: 5 |
| 120 | end: 6 |
| 121 | type: number |
| 122 | fixedLabels: true |
| 123 | op: 57400 |
| 124 | side: 1 |
| 125 | - src: |
| 126 | labels: |
| 127 | "": |
| 128 | reason: This query returns a number value with no labels. |
| 129 | kind: excluded |
| 130 | fragment: |
| 131 | start: 16 |
| 132 | end: 17 |
| 133 | returns: scalar |
| 134 | returnInfo: |
| 135 | logicalexpr: "" |
| 136 | valueposition: |
| 137 | start: 16 |
| 138 | end: 17 |
| 139 | returnednumber: 5 |
| 140 | alwaysreturns: true |
| 141 | knownreturn: true |
| 142 | isreturnbool: false |
| 143 | position: |
| 144 | start: 16 |
| 145 | end: 17 |
| 146 | type: number |
| 147 | fixedLabels: true |
| 148 | op: 57385 |
| 149 | side: 1 |
| 150 | returnInfo: |
| 151 | logicalexpr: 2 ^ 5 |
| 152 | valueposition: |
| 153 | start: 1 |
| 154 | end: 2 |
| 155 | returnednumber: 32 |
| 156 | alwaysreturns: true |
| 157 | knownreturn: true |
| 158 | isreturnbool: false |
| 159 | condition: |
| 160 | op: 57385 |
| 161 | value: 5 |
| 162 | present: true |
| 163 | knownValue: true |
| 164 | position: |
| 165 | start: 1 |
| 166 | end: 2 |
| 167 | type: number |
| 168 | fixedLabels: true |
| 169 | |
| 170 | --- |
| 171 | |
| 172 | [TestLabelsSource/4 - 1] |
| 173 | expr: (2 ^ 5 + 11) % 5 <= bool 2 |
| 174 | output: |
| 175 | - labels: |
| 176 | "": |
| 177 | reason: This query returns a number value with no labels. |
| 178 | kind: excluded |
| 179 | fragment: |
| 180 | start: 1 |
| 181 | end: 2 |
| 182 | deadInfo: |
| 183 | reason: '`2 ^ 5 + 11 % 5 <= 2` always evaluates to `3 <= 2` and uses the `bool` modifier which means it will always return 0' |
| 184 | fragment: |
| 185 | start: 1 |
| 186 | end: 2 |
| 187 | returns: scalar |
| 188 | indirect: |
| 189 | - src: |
| 190 | labels: |
| 191 | "": |
| 192 | reason: This query returns a number value with no labels. |
| 193 | kind: excluded |
| 194 | fragment: |
| 195 | start: 5 |
| 196 | end: 6 |
| 197 | returns: scalar |
| 198 | returnInfo: |
| 199 | logicalexpr: "" |
| 200 | valueposition: |
| 201 | start: 5 |
| 202 | end: 6 |
| 203 | returnednumber: 5 |
| 204 | alwaysreturns: true |
| 205 | knownreturn: true |
| 206 | isreturnbool: false |
| 207 | position: |
| 208 | start: 5 |
| 209 | end: 6 |
| 210 | type: number |
| 211 | fixedLabels: true |
| 212 | op: 57400 |
| 213 | side: 1 |
| 214 | - src: |
| 215 | labels: |
| 216 | "": |
| 217 | reason: This query returns a number value with no labels. |
| 218 | kind: excluded |
| 219 | fragment: |
| 220 | start: 9 |
| 221 | end: 11 |
| 222 | returns: scalar |
| 223 | returnInfo: |
| 224 | logicalexpr: "" |
| 225 | valueposition: |
| 226 | start: 9 |
| 227 | end: 11 |
| 228 | returnednumber: 11 |
| 229 | alwaysreturns: true |
| 230 | knownreturn: true |
| 231 | isreturnbool: false |
| 232 | position: |
| 233 | start: 9 |
| 234 | end: 11 |
| 235 | type: number |
| 236 | fixedLabels: true |
| 237 | op: 57383 |
| 238 | side: 1 |
| 239 | - src: |
| 240 | labels: |
| 241 | "": |
| 242 | reason: This query returns a number value with no labels. |
| 243 | kind: excluded |
| 244 | fragment: |
| 245 | start: 15 |
| 246 | end: 16 |
| 247 | returns: scalar |
| 248 | returnInfo: |
| 249 | logicalexpr: "" |
| 250 | valueposition: |
| 251 | start: 15 |
| 252 | end: 16 |
| 253 | returnednumber: 5 |
| 254 | alwaysreturns: true |
| 255 | knownreturn: true |
| 256 | isreturnbool: false |
| 257 | position: |
| 258 | start: 15 |
| 259 | end: 16 |
| 260 | type: number |
| 261 | fixedLabels: true |
| 262 | op: 57396 |
| 263 | side: 1 |
| 264 | - src: |
| 265 | labels: |
| 266 | "": |
| 267 | reason: This query returns a number value with no labels. |
| 268 | kind: excluded |
| 269 | fragment: |
| 270 | start: 25 |
| 271 | end: 26 |
| 272 | returns: scalar |
| 273 | returnInfo: |
| 274 | logicalexpr: "" |
| 275 | valueposition: |
| 276 | start: 25 |
| 277 | end: 26 |
| 278 | returnednumber: 2 |
| 279 | alwaysreturns: true |
| 280 | knownreturn: true |
| 281 | isreturnbool: false |
| 282 | position: |
| 283 | start: 25 |
| 284 | end: 26 |
| 285 | type: number |
| 286 | fixedLabels: true |
| 287 | op: 57394 |
| 288 | side: 1 |
| 289 | returnInfo: |
| 290 | logicalexpr: 2 ^ 5 + 11 % 5 |
| 291 | valueposition: |
| 292 | start: 1 |
| 293 | end: 2 |
| 294 | returnednumber: 3 |
| 295 | alwaysreturns: true |
| 296 | knownreturn: true |
| 297 | isreturnbool: false |
| 298 | condition: |
| 299 | op: 57394 |
| 300 | value: 2 |
| 301 | present: true |
| 302 | knownValue: true |
| 303 | position: |
| 304 | start: 1 |
| 305 | end: 2 |
| 306 | type: number |
| 307 | fixedLabels: true |
| 308 | |
| 309 | --- |
| 310 | |
| 311 | [TestLabelsSource/5 - 1] |
| 312 | expr: (2 ^ 5 + 11) % 5 >= bool 20 |
| 313 | output: |
| 314 | - labels: |
| 315 | "": |
| 316 | reason: This query returns a number value with no labels. |
| 317 | kind: excluded |
| 318 | fragment: |
| 319 | start: 1 |
| 320 | end: 2 |
| 321 | deadInfo: |
| 322 | reason: '`2 ^ 5 + 11 % 5 >= 20` always evaluates to `3 >= 20` and uses the `bool` modifier which means it will always return 0' |
| 323 | fragment: |
| 324 | start: 1 |
| 325 | end: 2 |
| 326 | returns: scalar |
| 327 | indirect: |
| 328 | - src: |
| 329 | labels: |
| 330 | "": |
| 331 | reason: This query returns a number value with no labels. |
| 332 | kind: excluded |
| 333 | fragment: |
| 334 | start: 5 |
| 335 | end: 6 |
| 336 | returns: scalar |
| 337 | returnInfo: |
| 338 | logicalexpr: "" |
| 339 | valueposition: |
| 340 | start: 5 |
| 341 | end: 6 |
| 342 | returnednumber: 5 |
| 343 | alwaysreturns: true |
| 344 | knownreturn: true |
| 345 | isreturnbool: false |
| 346 | position: |
| 347 | start: 5 |
| 348 | end: 6 |
| 349 | type: number |
| 350 | fixedLabels: true |
| 351 | op: 57400 |
| 352 | side: 1 |
| 353 | - src: |
| 354 | labels: |
| 355 | "": |
| 356 | reason: This query returns a number value with no labels. |
| 357 | kind: excluded |
| 358 | fragment: |
| 359 | start: 9 |
| 360 | end: 11 |
| 361 | returns: scalar |
| 362 | returnInfo: |
| 363 | logicalexpr: "" |
| 364 | valueposition: |
| 365 | start: 9 |
| 366 | end: 11 |
| 367 | returnednumber: 11 |
| 368 | alwaysreturns: true |
| 369 | knownreturn: true |
| 370 | isreturnbool: false |
| 371 | position: |
| 372 | start: 9 |
| 373 | end: 11 |
| 374 | type: number |
| 375 | fixedLabels: true |
| 376 | op: 57383 |
| 377 | side: 1 |
| 378 | - src: |
| 379 | labels: |
| 380 | "": |
| 381 | reason: This query returns a number value with no labels. |
| 382 | kind: excluded |
| 383 | fragment: |
| 384 | start: 15 |
| 385 | end: 16 |
| 386 | returns: scalar |
| 387 | returnInfo: |
| 388 | logicalexpr: "" |
| 389 | valueposition: |
| 390 | start: 15 |
| 391 | end: 16 |
| 392 | returnednumber: 5 |
| 393 | alwaysreturns: true |
| 394 | knownreturn: true |
| 395 | isreturnbool: false |
| 396 | position: |
| 397 | start: 15 |
| 398 | end: 16 |
| 399 | type: number |
| 400 | fixedLabels: true |
| 401 | op: 57396 |
| 402 | side: 1 |
| 403 | - src: |
| 404 | labels: |
| 405 | "": |
| 406 | reason: This query returns a number value with no labels. |
| 407 | kind: excluded |
| 408 | fragment: |
| 409 | start: 25 |
| 410 | end: 27 |
| 411 | returns: scalar |
| 412 | returnInfo: |
| 413 | logicalexpr: "" |
| 414 | valueposition: |
| 415 | start: 25 |
| 416 | end: 27 |
| 417 | returnednumber: 20 |
| 418 | alwaysreturns: true |
| 419 | knownreturn: true |
| 420 | isreturnbool: false |
| 421 | position: |
| 422 | start: 25 |
| 423 | end: 27 |
| 424 | type: number |
| 425 | fixedLabels: true |
| 426 | op: 57387 |
| 427 | side: 1 |
| 428 | returnInfo: |
| 429 | logicalexpr: 2 ^ 5 + 11 % 5 |
| 430 | valueposition: |
| 431 | start: 1 |
| 432 | end: 2 |
| 433 | returnednumber: 3 |
| 434 | alwaysreturns: true |
| 435 | knownreturn: true |
| 436 | isreturnbool: false |
| 437 | condition: |
| 438 | op: 57387 |
| 439 | value: 20 |
| 440 | present: true |
| 441 | knownValue: true |
| 442 | position: |
| 443 | start: 1 |
| 444 | end: 2 |
| 445 | type: number |
| 446 | fixedLabels: true |
| 447 | |
| 448 | --- |
| 449 | |
| 450 | [TestLabelsSource/6 - 1] |
| 451 | expr: (2 ^ 5 + 11) % 5 <= bool 3 |
| 452 | output: |
| 453 | - labels: |
| 454 | "": |
| 455 | reason: This query returns a number value with no labels. |
| 456 | kind: excluded |
| 457 | fragment: |
| 458 | start: 1 |
| 459 | end: 2 |
| 460 | returns: scalar |
| 461 | indirect: |
| 462 | - src: |
| 463 | labels: |
| 464 | "": |
| 465 | reason: This query returns a number value with no labels. |
| 466 | kind: excluded |
| 467 | fragment: |
| 468 | start: 5 |
| 469 | end: 6 |
| 470 | returns: scalar |
| 471 | returnInfo: |
| 472 | logicalexpr: "" |
| 473 | valueposition: |
| 474 | start: 5 |
| 475 | end: 6 |
| 476 | returnednumber: 5 |
| 477 | alwaysreturns: true |
| 478 | knownreturn: true |
| 479 | isreturnbool: false |
| 480 | position: |
| 481 | start: 5 |
| 482 | end: 6 |
| 483 | type: number |
| 484 | fixedLabels: true |
| 485 | op: 57400 |
| 486 | side: 1 |
| 487 | - src: |
| 488 | labels: |
| 489 | "": |
| 490 | reason: This query returns a number value with no labels. |
| 491 | kind: excluded |
| 492 | fragment: |
| 493 | start: 9 |
| 494 | end: 11 |
| 495 | returns: scalar |
| 496 | returnInfo: |
| 497 | logicalexpr: "" |
| 498 | valueposition: |
| 499 | start: 9 |
| 500 | end: 11 |
| 501 | returnednumber: 11 |
| 502 | alwaysreturns: true |
| 503 | knownreturn: true |
| 504 | isreturnbool: false |
| 505 | position: |
| 506 | start: 9 |
| 507 | end: 11 |
| 508 | type: number |
| 509 | fixedLabels: true |
| 510 | op: 57383 |
| 511 | side: 1 |
| 512 | - src: |
| 513 | labels: |
| 514 | "": |
| 515 | reason: This query returns a number value with no labels. |
| 516 | kind: excluded |
| 517 | fragment: |
| 518 | start: 15 |
| 519 | end: 16 |
| 520 | returns: scalar |
| 521 | returnInfo: |
| 522 | logicalexpr: "" |
| 523 | valueposition: |
| 524 | start: 15 |
| 525 | end: 16 |
| 526 | returnednumber: 5 |
| 527 | alwaysreturns: true |
| 528 | knownreturn: true |
| 529 | isreturnbool: false |
| 530 | position: |
| 531 | start: 15 |
| 532 | end: 16 |
| 533 | type: number |
| 534 | fixedLabels: true |
| 535 | op: 57396 |
| 536 | side: 1 |
| 537 | - src: |
| 538 | labels: |
| 539 | "": |
| 540 | reason: This query returns a number value with no labels. |
| 541 | kind: excluded |
| 542 | fragment: |
| 543 | start: 25 |
| 544 | end: 26 |
| 545 | returns: scalar |
| 546 | returnInfo: |
| 547 | logicalexpr: "" |
| 548 | valueposition: |
| 549 | start: 25 |
| 550 | end: 26 |
| 551 | returnednumber: 3 |
| 552 | alwaysreturns: true |
| 553 | knownreturn: true |
| 554 | isreturnbool: false |
| 555 | position: |
| 556 | start: 25 |
| 557 | end: 26 |
| 558 | type: number |
| 559 | fixedLabels: true |
| 560 | op: 57394 |
| 561 | side: 1 |
| 562 | returnInfo: |
| 563 | logicalexpr: 2 ^ 5 + 11 % 5 |
| 564 | valueposition: |
| 565 | start: 1 |
| 566 | end: 2 |
| 567 | returnednumber: 3 |
| 568 | alwaysreturns: true |
| 569 | knownreturn: true |
| 570 | isreturnbool: false |
| 571 | condition: |
| 572 | op: 57394 |
| 573 | value: 3 |
| 574 | present: true |
| 575 | knownValue: true |
| 576 | position: |
| 577 | start: 1 |
| 578 | end: 2 |
| 579 | type: number |
| 580 | fixedLabels: true |
| 581 | |
| 582 | --- |
| 583 | |
| 584 | [TestLabelsSource/7 - 1] |
| 585 | expr: (2 ^ 5 + 11) % 5 < bool 1 |
| 586 | output: |
| 587 | - labels: |
| 588 | "": |
| 589 | reason: This query returns a number value with no labels. |
| 590 | kind: excluded |
| 591 | fragment: |
| 592 | start: 1 |
| 593 | end: 2 |
| 594 | deadInfo: |
| 595 | reason: '`2 ^ 5 + 11 % 5 < 1` always evaluates to `3 < 1` and uses the `bool` modifier which means it will always return 0' |
| 596 | fragment: |
| 597 | start: 1 |
| 598 | end: 2 |
| 599 | returns: scalar |
| 600 | indirect: |
| 601 | - src: |
| 602 | labels: |
| 603 | "": |
| 604 | reason: This query returns a number value with no labels. |
| 605 | kind: excluded |
| 606 | fragment: |
| 607 | start: 5 |
| 608 | end: 6 |
| 609 | returns: scalar |
| 610 | returnInfo: |
| 611 | logicalexpr: "" |
| 612 | valueposition: |
| 613 | start: 5 |
| 614 | end: 6 |
| 615 | returnednumber: 5 |
| 616 | alwaysreturns: true |
| 617 | knownreturn: true |
| 618 | isreturnbool: false |
| 619 | position: |
| 620 | start: 5 |
| 621 | end: 6 |
| 622 | type: number |
| 623 | fixedLabels: true |
| 624 | op: 57400 |
| 625 | side: 1 |
| 626 | - src: |
| 627 | labels: |
| 628 | "": |
| 629 | reason: This query returns a number value with no labels. |
| 630 | kind: excluded |
| 631 | fragment: |
| 632 | start: 9 |
| 633 | end: 11 |
| 634 | returns: scalar |
| 635 | returnInfo: |
| 636 | logicalexpr: "" |
| 637 | valueposition: |
| 638 | start: 9 |
| 639 | end: 11 |
| 640 | returnednumber: 11 |
| 641 | alwaysreturns: true |
| 642 | knownreturn: true |
| 643 | isreturnbool: false |
| 644 | position: |
| 645 | start: 9 |
| 646 | end: 11 |
| 647 | type: number |
| 648 | fixedLabels: true |
| 649 | op: 57383 |
| 650 | side: 1 |
| 651 | - src: |
| 652 | labels: |
| 653 | "": |
| 654 | reason: This query returns a number value with no labels. |
| 655 | kind: excluded |
| 656 | fragment: |
| 657 | start: 15 |
| 658 | end: 16 |
| 659 | returns: scalar |
| 660 | returnInfo: |
| 661 | logicalexpr: "" |
| 662 | valueposition: |
| 663 | start: 15 |
| 664 | end: 16 |
| 665 | returnednumber: 5 |
| 666 | alwaysreturns: true |
| 667 | knownreturn: true |
| 668 | isreturnbool: false |
| 669 | position: |
| 670 | start: 15 |
| 671 | end: 16 |
| 672 | type: number |
| 673 | fixedLabels: true |
| 674 | op: 57396 |
| 675 | side: 1 |
| 676 | - src: |
| 677 | labels: |
| 678 | "": |
| 679 | reason: This query returns a number value with no labels. |
| 680 | kind: excluded |
| 681 | fragment: |
| 682 | start: 24 |
| 683 | end: 25 |
| 684 | returns: scalar |
| 685 | returnInfo: |
| 686 | logicalexpr: "" |
| 687 | valueposition: |
| 688 | start: 24 |
| 689 | end: 25 |
| 690 | returnednumber: 1 |
| 691 | alwaysreturns: true |
| 692 | knownreturn: true |
| 693 | isreturnbool: false |
| 694 | position: |
| 695 | start: 24 |
| 696 | end: 25 |
| 697 | type: number |
| 698 | fixedLabels: true |
| 699 | op: 57393 |
| 700 | side: 1 |
| 701 | returnInfo: |
| 702 | logicalexpr: 2 ^ 5 + 11 % 5 |
| 703 | valueposition: |
| 704 | start: 1 |
| 705 | end: 2 |
| 706 | returnednumber: 3 |
| 707 | alwaysreturns: true |
| 708 | knownreturn: true |
| 709 | isreturnbool: false |
| 710 | condition: |
| 711 | op: 57393 |
| 712 | value: 1 |
| 713 | present: true |
| 714 | knownValue: true |
| 715 | position: |
| 716 | start: 1 |
| 717 | end: 2 |
| 718 | type: number |
| 719 | fixedLabels: true |
| 720 | |
| 721 | --- |
| 722 | |
| 723 | [TestLabelsSource/8 - 1] |
| 724 | expr: 20 - 15 < bool 1 |
| 725 | output: |
| 726 | - labels: |
| 727 | "": |
| 728 | reason: This query returns a number value with no labels. |
| 729 | kind: excluded |
| 730 | fragment: |
| 731 | start: 0 |
| 732 | end: 2 |
| 733 | deadInfo: |
| 734 | reason: '`20 - 15 < 1` always evaluates to `5 < 1` and uses the `bool` modifier which means it will always return 0' |
| 735 | fragment: |
| 736 | start: 0 |
| 737 | end: 2 |
| 738 | returns: scalar |
| 739 | indirect: |
| 740 | - src: |
| 741 | labels: |
| 742 | "": |
| 743 | reason: This query returns a number value with no labels. |
| 744 | kind: excluded |
| 745 | fragment: |
| 746 | start: 5 |
| 747 | end: 7 |
| 748 | returns: scalar |
| 749 | returnInfo: |
| 750 | logicalexpr: "" |
| 751 | valueposition: |
| 752 | start: 5 |
| 753 | end: 7 |
| 754 | returnednumber: 15 |
| 755 | alwaysreturns: true |
| 756 | knownreturn: true |
| 757 | isreturnbool: false |
| 758 | position: |
| 759 | start: 5 |
| 760 | end: 7 |
| 761 | type: number |
| 762 | fixedLabels: true |
| 763 | op: 57401 |
| 764 | side: 1 |
| 765 | - src: |
| 766 | labels: |
| 767 | "": |
| 768 | reason: This query returns a number value with no labels. |
| 769 | kind: excluded |
| 770 | fragment: |
| 771 | start: 15 |
| 772 | end: 16 |
| 773 | returns: scalar |
| 774 | returnInfo: |
| 775 | logicalexpr: "" |
| 776 | valueposition: |
| 777 | start: 15 |
| 778 | end: 16 |
| 779 | returnednumber: 1 |
| 780 | alwaysreturns: true |
| 781 | knownreturn: true |
| 782 | isreturnbool: false |
| 783 | position: |
| 784 | start: 15 |
| 785 | end: 16 |
| 786 | type: number |
| 787 | fixedLabels: true |
| 788 | op: 57393 |
| 789 | side: 1 |
| 790 | returnInfo: |
| 791 | logicalexpr: 20 - 15 |
| 792 | valueposition: |
| 793 | start: 0 |
| 794 | end: 2 |
| 795 | returnednumber: 5 |
| 796 | alwaysreturns: true |
| 797 | knownreturn: true |
| 798 | isreturnbool: false |
| 799 | condition: |
| 800 | op: 57393 |
| 801 | value: 1 |
| 802 | present: true |
| 803 | knownValue: true |
| 804 | position: |
| 805 | start: 0 |
| 806 | end: 2 |
| 807 | type: number |
| 808 | fixedLabels: true |
| 809 | |
| 810 | --- |
| 811 | |
| 812 | [TestLabelsSource/9 - 1] |
| 813 | expr: 2 * 5 |
| 814 | output: |
| 815 | - labels: |
| 816 | "": |
| 817 | reason: This query returns a number value with no labels. |
| 818 | kind: excluded |
| 819 | fragment: |
| 820 | start: 0 |
| 821 | end: 1 |
| 822 | returns: scalar |
| 823 | indirect: |
| 824 | - src: |
| 825 | labels: |
| 826 | "": |
| 827 | reason: This query returns a number value with no labels. |
| 828 | kind: excluded |
| 829 | fragment: |
| 830 | start: 4 |
| 831 | end: 5 |
| 832 | returns: scalar |
| 833 | returnInfo: |
| 834 | logicalexpr: "" |
| 835 | valueposition: |
| 836 | start: 4 |
| 837 | end: 5 |
| 838 | returnednumber: 5 |
| 839 | alwaysreturns: true |
| 840 | knownreturn: true |
| 841 | isreturnbool: false |
| 842 | position: |
| 843 | start: 4 |
| 844 | end: 5 |
| 845 | type: number |
| 846 | fixedLabels: true |
| 847 | op: 57397 |
| 848 | side: 1 |
| 849 | returnInfo: |
| 850 | logicalexpr: 2 * 5 |
| 851 | valueposition: |
| 852 | start: 0 |
| 853 | end: 1 |
| 854 | returnednumber: 10 |
| 855 | alwaysreturns: true |
| 856 | knownreturn: true |
| 857 | isreturnbool: false |
| 858 | position: |
| 859 | start: 0 |
| 860 | end: 1 |
| 861 | type: number |
| 862 | fixedLabels: true |
| 863 | |
| 864 | --- |
| 865 | |
| 866 | [TestLabelsSource/10 - 1] |
| 867 | expr: (foo or bar) * 5 |
| 868 | output: |
| 869 | - returns: vector |
| 870 | operations: |
| 871 | - node: '[*parser.VectorSelector] foo' |
| 872 | op: "" |
| 873 | indirect: |
| 874 | - src: |
| 875 | labels: |
| 876 | "": |
| 877 | reason: This query returns a number value with no labels. |
| 878 | kind: excluded |
| 879 | fragment: |
| 880 | start: 15 |
| 881 | end: 16 |
| 882 | returns: scalar |
| 883 | returnInfo: |
| 884 | logicalexpr: "" |
| 885 | valueposition: |
| 886 | start: 15 |
| 887 | end: 16 |
| 888 | returnednumber: 5 |
| 889 | alwaysreturns: true |
| 890 | knownreturn: true |
| 891 | isreturnbool: false |
| 892 | position: |
| 893 | start: 15 |
| 894 | end: 16 |
| 895 | type: number |
| 896 | fixedLabels: true |
| 897 | op: 57397 |
| 898 | side: 1 |
| 899 | position: |
| 900 | start: 1 |
| 901 | end: 4 |
| 902 | type: selector |
| 903 | - returns: vector |
| 904 | operations: |
| 905 | - node: '[*parser.VectorSelector] bar' |
| 906 | op: "" |
| 907 | indirect: |
| 908 | - src: |
| 909 | labels: |
| 910 | "": |
| 911 | reason: This query returns a number value with no labels. |
| 912 | kind: excluded |
| 913 | fragment: |
| 914 | start: 15 |
| 915 | end: 16 |
| 916 | returns: scalar |
| 917 | returnInfo: |
| 918 | logicalexpr: "" |
| 919 | valueposition: |
| 920 | start: 15 |
| 921 | end: 16 |
| 922 | returnednumber: 5 |
| 923 | alwaysreturns: true |
| 924 | knownreturn: true |
| 925 | isreturnbool: false |
| 926 | position: |
| 927 | start: 15 |
| 928 | end: 16 |
| 929 | type: number |
| 930 | fixedLabels: true |
| 931 | op: 57397 |
| 932 | side: 1 |
| 933 | position: |
| 934 | start: 8 |
| 935 | end: 11 |
| 936 | type: selector |
| 937 | |
| 938 | --- |
| 939 | |
| 940 | [TestLabelsSource/11 - 1] |
| 941 | expr: (foo or vector(2)) * 5 |
| 942 | output: |
| 943 | - returns: vector |
| 944 | operations: |
| 945 | - node: '[*parser.VectorSelector] foo' |
| 946 | op: "" |
| 947 | indirect: |
| 948 | - src: |
| 949 | labels: |
| 950 | "": |
| 951 | reason: This query returns a number value with no labels. |
| 952 | kind: excluded |
| 953 | fragment: |
| 954 | start: 21 |
| 955 | end: 22 |
| 956 | returns: scalar |
| 957 | returnInfo: |
| 958 | logicalexpr: "" |
| 959 | valueposition: |
| 960 | start: 21 |
| 961 | end: 22 |
| 962 | returnednumber: 5 |
| 963 | alwaysreturns: true |
| 964 | knownreturn: true |
| 965 | isreturnbool: false |
| 966 | position: |
| 967 | start: 21 |
| 968 | end: 22 |
| 969 | type: number |
| 970 | fixedLabels: true |
| 971 | op: 57397 |
| 972 | side: 1 |
| 973 | position: |
| 974 | start: 1 |
| 975 | end: 4 |
| 976 | type: selector |
| 977 | - labels: |
| 978 | "": |
| 979 | reason: Calling `vector()` will return a vector value with no labels. |
| 980 | kind: excluded |
| 981 | fragment: |
| 982 | start: 8 |
| 983 | end: 14 |
| 984 | returns: vector |
| 985 | operations: |
| 986 | - args: |
| 987 | - "2" |
| 988 | node: '[*parser.Call] vector(2)' |
| 989 | op: vector |
| 990 | indirect: |
| 991 | - src: |
| 992 | labels: |
| 993 | "": |
| 994 | reason: This query returns a number value with no labels. |
| 995 | kind: excluded |
| 996 | fragment: |
| 997 | start: 15 |
| 998 | end: 16 |
| 999 | returns: scalar |
| 1000 | returnInfo: |
| 1001 | logicalexpr: "" |
| 1002 | valueposition: |
| 1003 | start: 15 |
| 1004 | end: 16 |
| 1005 | returnednumber: 2 |
| 1006 | alwaysreturns: true |
| 1007 | knownreturn: true |
| 1008 | isreturnbool: false |
| 1009 | position: |
| 1010 | start: 15 |
| 1011 | end: 16 |
| 1012 | type: number |
| 1013 | fixedLabels: true |
| 1014 | op: 0 |
| 1015 | side: 0 |
| 1016 | - src: |
| 1017 | labels: |
| 1018 | "": |
| 1019 | reason: This query returns a number value with no labels. |
| 1020 | kind: excluded |
| 1021 | fragment: |
| 1022 | start: 21 |
| 1023 | end: 22 |
| 1024 | returns: scalar |
| 1025 | returnInfo: |
| 1026 | logicalexpr: "" |
| 1027 | valueposition: |
| 1028 | start: 21 |
| 1029 | end: 22 |
| 1030 | returnednumber: 5 |
| 1031 | alwaysreturns: true |
| 1032 | knownreturn: true |
| 1033 | isreturnbool: false |
| 1034 | position: |
| 1035 | start: 21 |
| 1036 | end: 22 |
| 1037 | type: number |
| 1038 | fixedLabels: true |
| 1039 | op: 57397 |
| 1040 | side: 1 |
| 1041 | returnInfo: |
| 1042 | logicalexpr: vector(2) * 5 |
| 1043 | valueposition: |
| 1044 | start: 8 |
| 1045 | end: 17 |
| 1046 | returnednumber: 10 |
| 1047 | alwaysreturns: true |
| 1048 | knownreturn: true |
| 1049 | isreturnbool: false |
| 1050 | position: |
| 1051 | start: 8 |
| 1052 | end: 17 |
| 1053 | type: function |
| 1054 | fixedLabels: true |
| 1055 | |
| 1056 | --- |
| 1057 | |
| 1058 | [TestLabelsSource/12 - 1] |
| 1059 | expr: (foo or vector(5)) * (vector(2) or bar) |
| 1060 | output: |
| 1061 | - labels: |
| 1062 | __name__: |
| 1063 | reason: Binary operation between two vectors removes metric names. |
| 1064 | kind: excluded |
| 1065 | fragment: |
| 1066 | start: 0 |
| 1067 | end: 39 |
| 1068 | returns: vector |
| 1069 | operations: |
| 1070 | - node: '[*parser.VectorSelector] foo' |
| 1071 | op: "" |
| 1072 | joins: |
| 1073 | - addedlabels: [] |
| 1074 | depth: 0 |
| 1075 | ison: false |
| 1076 | matchinglabels: [] |
| 1077 | op: '*' |
| 1078 | src: |
| 1079 | labels: |
| 1080 | "": |
| 1081 | reason: Calling `vector()` will return a vector value with no labels. |
| 1082 | kind: excluded |
| 1083 | fragment: |
| 1084 | start: 22 |
| 1085 | end: 28 |
| 1086 | returns: vector |
| 1087 | operations: |
| 1088 | - args: |
| 1089 | - "2" |
| 1090 | node: '[*parser.Call] vector(2)' |
| 1091 | op: vector |
| 1092 | indirect: |
| 1093 | - src: |
| 1094 | labels: |
| 1095 | "": |
| 1096 | reason: This query returns a number value with no labels. |
| 1097 | kind: excluded |
| 1098 | fragment: |
| 1099 | start: 29 |
| 1100 | end: 30 |
| 1101 | returns: scalar |
| 1102 | returnInfo: |
| 1103 | logicalexpr: "" |
| 1104 | valueposition: |
| 1105 | start: 29 |
| 1106 | end: 30 |
| 1107 | returnednumber: 2 |
| 1108 | alwaysreturns: true |
| 1109 | knownreturn: true |
| 1110 | isreturnbool: false |
| 1111 | position: |
| 1112 | start: 29 |
| 1113 | end: 30 |
| 1114 | type: number |
| 1115 | fixedLabels: true |
| 1116 | op: 0 |
| 1117 | side: 0 |
| 1118 | returnInfo: |
| 1119 | logicalexpr: "" |
| 1120 | valueposition: |
| 1121 | start: 22 |
| 1122 | end: 31 |
| 1123 | returnednumber: 2 |
| 1124 | alwaysreturns: true |
| 1125 | knownreturn: true |
| 1126 | isreturnbool: false |
| 1127 | position: |
| 1128 | start: 22 |
| 1129 | end: 31 |
| 1130 | type: function |
| 1131 | fixedLabels: true |
| 1132 | - addedlabels: [] |
| 1133 | depth: 0 |
| 1134 | ison: false |
| 1135 | matchinglabels: [] |
| 1136 | op: '*' |
| 1137 | src: |
| 1138 | deadInfo: |
| 1139 | reason: The left hand side always returns something and so the right hand side is never used. |
| 1140 | fragment: |
| 1141 | start: 35 |
| 1142 | end: 38 |
| 1143 | returns: vector |
| 1144 | operations: |
| 1145 | - node: '[*parser.VectorSelector] bar' |
| 1146 | op: "" |
| 1147 | position: |
| 1148 | start: 35 |
| 1149 | end: 38 |
| 1150 | type: selector |
| 1151 | position: |
| 1152 | start: 1 |
| 1153 | end: 4 |
| 1154 | type: selector |
| 1155 | - labels: |
| 1156 | "": |
| 1157 | reason: Calling `vector()` will return a vector value with no labels. |
| 1158 | kind: excluded |
| 1159 | fragment: |
| 1160 | start: 8 |
| 1161 | end: 14 |
| 1162 | __name__: |
| 1163 | reason: Binary operation between two vectors removes metric names. |
| 1164 | kind: excluded |
| 1165 | fragment: |
| 1166 | start: 0 |
| 1167 | end: 39 |
| 1168 | returns: vector |
| 1169 | operations: |
| 1170 | - args: |
| 1171 | - "5" |
| 1172 | node: '[*parser.Call] vector(5)' |
| 1173 | op: vector |
| 1174 | joins: |
| 1175 | - addedlabels: [] |
| 1176 | depth: 0 |
| 1177 | ison: false |
| 1178 | matchinglabels: [] |
| 1179 | op: '*' |
| 1180 | src: |
| 1181 | labels: |
| 1182 | "": |
| 1183 | reason: Calling `vector()` will return a vector value with no labels. |
| 1184 | kind: excluded |
| 1185 | fragment: |
| 1186 | start: 22 |
| 1187 | end: 28 |
| 1188 | returns: vector |
| 1189 | operations: |
| 1190 | - args: |
| 1191 | - "2" |
| 1192 | node: '[*parser.Call] vector(2)' |
| 1193 | op: vector |
| 1194 | indirect: |
| 1195 | - src: |
| 1196 | labels: |
| 1197 | "": |
| 1198 | reason: This query returns a number value with no labels. |
| 1199 | kind: excluded |
| 1200 | fragment: |
| 1201 | start: 29 |
| 1202 | end: 30 |
| 1203 | returns: scalar |
| 1204 | returnInfo: |
| 1205 | logicalexpr: "" |
| 1206 | valueposition: |
| 1207 | start: 29 |
| 1208 | end: 30 |
| 1209 | returnednumber: 2 |
| 1210 | alwaysreturns: true |
| 1211 | knownreturn: true |
| 1212 | isreturnbool: false |
| 1213 | position: |
| 1214 | start: 29 |
| 1215 | end: 30 |
| 1216 | type: number |
| 1217 | fixedLabels: true |
| 1218 | op: 0 |
| 1219 | side: 0 |
| 1220 | returnInfo: |
| 1221 | logicalexpr: "" |
| 1222 | valueposition: |
| 1223 | start: 22 |
| 1224 | end: 31 |
| 1225 | returnednumber: 2 |
| 1226 | alwaysreturns: true |
| 1227 | knownreturn: true |
| 1228 | isreturnbool: false |
| 1229 | position: |
| 1230 | start: 22 |
| 1231 | end: 31 |
| 1232 | type: function |
| 1233 | fixedLabels: true |
| 1234 | - addedlabels: [] |
| 1235 | depth: 0 |
| 1236 | ison: false |
| 1237 | matchinglabels: [] |
| 1238 | op: '*' |
| 1239 | src: |
| 1240 | deadInfo: |
| 1241 | reason: The left hand side always returns something and so the right hand side is never used. |
| 1242 | fragment: |
| 1243 | start: 35 |
| 1244 | end: 38 |
| 1245 | returns: vector |
| 1246 | operations: |
| 1247 | - node: '[*parser.VectorSelector] bar' |
| 1248 | op: "" |
| 1249 | position: |
| 1250 | start: 35 |
| 1251 | end: 38 |
| 1252 | type: selector |
| 1253 | indirect: |
| 1254 | - src: |
| 1255 | labels: |
| 1256 | "": |
| 1257 | reason: This query returns a number value with no labels. |
| 1258 | kind: excluded |
| 1259 | fragment: |
| 1260 | start: 15 |
| 1261 | end: 16 |
| 1262 | returns: scalar |
| 1263 | returnInfo: |
| 1264 | logicalexpr: "" |
| 1265 | valueposition: |
| 1266 | start: 15 |
| 1267 | end: 16 |
| 1268 | returnednumber: 5 |
| 1269 | alwaysreturns: true |
| 1270 | knownreturn: true |
| 1271 | isreturnbool: false |
| 1272 | position: |
| 1273 | start: 15 |
| 1274 | end: 16 |
| 1275 | type: number |
| 1276 | fixedLabels: true |
| 1277 | op: 0 |
| 1278 | side: 0 |
| 1279 | returnInfo: |
| 1280 | logicalexpr: vector(5) * vector(2) |
| 1281 | valueposition: |
| 1282 | start: 8 |
| 1283 | end: 17 |
| 1284 | returnednumber: 10 |
| 1285 | alwaysreturns: true |
| 1286 | knownreturn: true |
| 1287 | isreturnbool: false |
| 1288 | position: |
| 1289 | start: 8 |
| 1290 | end: 17 |
| 1291 | type: function |
| 1292 | fixedLabels: true |
| 1293 | |
| 1294 | --- |
| 1295 | |
| 1296 | [TestLabelsSource/13 - 1] |
| 1297 | expr: 1 > bool 0 |
| 1298 | output: |
| 1299 | - labels: |
| 1300 | "": |
| 1301 | reason: This query returns a number value with no labels. |
| 1302 | kind: excluded |
| 1303 | fragment: |
| 1304 | start: 0 |
| 1305 | end: 1 |
| 1306 | returns: scalar |
| 1307 | indirect: |
| 1308 | - src: |
| 1309 | labels: |
| 1310 | "": |
| 1311 | reason: This query returns a number value with no labels. |
| 1312 | kind: excluded |
| 1313 | fragment: |
| 1314 | start: 9 |
| 1315 | end: 10 |
| 1316 | returns: scalar |
| 1317 | returnInfo: |
| 1318 | logicalexpr: "" |
| 1319 | valueposition: |
| 1320 | start: 9 |
| 1321 | end: 10 |
| 1322 | returnednumber: 0 |
| 1323 | alwaysreturns: true |
| 1324 | knownreturn: true |
| 1325 | isreturnbool: false |
| 1326 | position: |
| 1327 | start: 9 |
| 1328 | end: 10 |
| 1329 | type: number |
| 1330 | fixedLabels: true |
| 1331 | op: 57388 |
| 1332 | side: 1 |
| 1333 | returnInfo: |
| 1334 | logicalexpr: "" |
| 1335 | valueposition: |
| 1336 | start: 0 |
| 1337 | end: 1 |
| 1338 | returnednumber: 1 |
| 1339 | alwaysreturns: true |
| 1340 | knownreturn: true |
| 1341 | isreturnbool: false |
| 1342 | condition: |
| 1343 | op: 57388 |
| 1344 | present: true |
| 1345 | knownValue: true |
| 1346 | position: |
| 1347 | start: 0 |
| 1348 | end: 1 |
| 1349 | type: number |
| 1350 | fixedLabels: true |
| 1351 | |
| 1352 | --- |
| 1353 | |
| 1354 | [TestLabelsSource/14 - 1] |
| 1355 | expr: 20 > bool 10 |
| 1356 | output: |
| 1357 | - labels: |
| 1358 | "": |
| 1359 | reason: This query returns a number value with no labels. |
| 1360 | kind: excluded |
| 1361 | fragment: |
| 1362 | start: 0 |
| 1363 | end: 2 |
| 1364 | returns: scalar |
| 1365 | indirect: |
| 1366 | - src: |
| 1367 | labels: |
| 1368 | "": |
| 1369 | reason: This query returns a number value with no labels. |
| 1370 | kind: excluded |
| 1371 | fragment: |
| 1372 | start: 10 |
| 1373 | end: 12 |
| 1374 | returns: scalar |
| 1375 | returnInfo: |
| 1376 | logicalexpr: "" |
| 1377 | valueposition: |
| 1378 | start: 10 |
| 1379 | end: 12 |
| 1380 | returnednumber: 10 |
| 1381 | alwaysreturns: true |
| 1382 | knownreturn: true |
| 1383 | isreturnbool: false |
| 1384 | position: |
| 1385 | start: 10 |
| 1386 | end: 12 |
| 1387 | type: number |
| 1388 | fixedLabels: true |
| 1389 | op: 57388 |
| 1390 | side: 1 |
| 1391 | returnInfo: |
| 1392 | logicalexpr: "" |
| 1393 | valueposition: |
| 1394 | start: 0 |
| 1395 | end: 2 |
| 1396 | returnednumber: 20 |
| 1397 | alwaysreturns: true |
| 1398 | knownreturn: true |
| 1399 | isreturnbool: false |
| 1400 | condition: |
| 1401 | op: 57388 |
| 1402 | value: 10 |
| 1403 | present: true |
| 1404 | knownValue: true |
| 1405 | position: |
| 1406 | start: 0 |
| 1407 | end: 2 |
| 1408 | type: number |
| 1409 | fixedLabels: true |
| 1410 | |
| 1411 | --- |
| 1412 | |
| 1413 | [TestLabelsSource/15 - 1] |
| 1414 | expr: '"test"' |
| 1415 | output: |
| 1416 | - labels: |
| 1417 | "": |
| 1418 | reason: This query returns a string value with no labels. |
| 1419 | kind: excluded |
| 1420 | fragment: |
| 1421 | start: 0 |
| 1422 | end: 6 |
| 1423 | returns: string |
| 1424 | returnInfo: |
| 1425 | logicalexpr: "" |
| 1426 | valueposition: |
| 1427 | start: 0 |
| 1428 | end: 0 |
| 1429 | returnednumber: 0 |
| 1430 | alwaysreturns: true |
| 1431 | knownreturn: false |
| 1432 | isreturnbool: false |
| 1433 | position: |
| 1434 | start: 0 |
| 1435 | end: 6 |
| 1436 | type: string |
| 1437 | fixedLabels: true |
| 1438 | |
| 1439 | --- |
| 1440 | |
| 1441 | [TestLabelsSource/16 - 1] |
| 1442 | expr: foo |
| 1443 | output: |
| 1444 | - returns: vector |
| 1445 | operations: |
| 1446 | - node: '[*parser.VectorSelector] foo' |
| 1447 | op: "" |
| 1448 | position: |
| 1449 | start: 0 |
| 1450 | end: 3 |
| 1451 | type: selector |
| 1452 | |
| 1453 | --- |
| 1454 | |
| 1455 | [TestLabelsSource/17 - 1] |
| 1456 | expr: (foo > 1) > bool 1 |
| 1457 | output: |
| 1458 | - returns: vector |
| 1459 | operations: |
| 1460 | - node: '[*parser.VectorSelector] foo' |
| 1461 | op: "" |
| 1462 | indirect: |
| 1463 | - src: |
| 1464 | labels: |
| 1465 | "": |
| 1466 | reason: This query returns a number value with no labels. |
| 1467 | kind: excluded |
| 1468 | fragment: |
| 1469 | start: 7 |
| 1470 | end: 8 |
| 1471 | returns: scalar |
| 1472 | returnInfo: |
| 1473 | logicalexpr: "" |
| 1474 | valueposition: |
| 1475 | start: 7 |
| 1476 | end: 8 |
| 1477 | returnednumber: 1 |
| 1478 | alwaysreturns: true |
| 1479 | knownreturn: true |
| 1480 | isreturnbool: false |
| 1481 | position: |
| 1482 | start: 7 |
| 1483 | end: 8 |
| 1484 | type: number |
| 1485 | fixedLabels: true |
| 1486 | op: 57388 |
| 1487 | side: 1 |
| 1488 | - src: |
| 1489 | labels: |
| 1490 | "": |
| 1491 | reason: This query returns a number value with no labels. |
| 1492 | kind: excluded |
| 1493 | fragment: |
| 1494 | start: 17 |
| 1495 | end: 18 |
| 1496 | returns: scalar |
| 1497 | returnInfo: |
| 1498 | logicalexpr: "" |
| 1499 | valueposition: |
| 1500 | start: 17 |
| 1501 | end: 18 |
| 1502 | returnednumber: 1 |
| 1503 | alwaysreturns: true |
| 1504 | knownreturn: true |
| 1505 | isreturnbool: false |
| 1506 | position: |
| 1507 | start: 17 |
| 1508 | end: 18 |
| 1509 | type: number |
| 1510 | fixedLabels: true |
| 1511 | op: 57388 |
| 1512 | side: 1 |
| 1513 | condition: |
| 1514 | op: 57388 |
| 1515 | value: 1 |
| 1516 | present: true |
| 1517 | knownValue: true |
| 1518 | position: |
| 1519 | start: 1 |
| 1520 | end: 4 |
| 1521 | type: selector |
| 1522 | |
| 1523 | --- |
| 1524 | |
| 1525 | [TestLabelsSource/18 - 1] |
| 1526 | expr: foo > bool 5 |
| 1527 | output: |
| 1528 | - returns: vector |
| 1529 | operations: |
| 1530 | - node: '[*parser.VectorSelector] foo' |
| 1531 | op: "" |
| 1532 | indirect: |
| 1533 | - src: |
| 1534 | labels: |
| 1535 | "": |
| 1536 | reason: This query returns a number value with no labels. |
| 1537 | kind: excluded |
| 1538 | fragment: |
| 1539 | start: 11 |
| 1540 | end: 12 |
| 1541 | returns: scalar |
| 1542 | returnInfo: |
| 1543 | logicalexpr: "" |
| 1544 | valueposition: |
| 1545 | start: 11 |
| 1546 | end: 12 |
| 1547 | returnednumber: 5 |
| 1548 | alwaysreturns: true |
| 1549 | knownreturn: true |
| 1550 | isreturnbool: false |
| 1551 | position: |
| 1552 | start: 11 |
| 1553 | end: 12 |
| 1554 | type: number |
| 1555 | fixedLabels: true |
| 1556 | op: 57388 |
| 1557 | side: 1 |
| 1558 | returnInfo: |
| 1559 | logicalexpr: "" |
| 1560 | valueposition: |
| 1561 | start: 0 |
| 1562 | end: 0 |
| 1563 | returnednumber: 0 |
| 1564 | alwaysreturns: false |
| 1565 | knownreturn: false |
| 1566 | isreturnbool: true |
| 1567 | condition: |
| 1568 | op: 57388 |
| 1569 | value: 5 |
| 1570 | present: true |
| 1571 | knownValue: true |
| 1572 | position: |
| 1573 | start: 0 |
| 1574 | end: 3 |
| 1575 | type: selector |
| 1576 | |
| 1577 | --- |
| 1578 | |
| 1579 | [TestLabelsSource/19 - 1] |
| 1580 | expr: foo > bool 5 == 1 |
| 1581 | output: |
| 1582 | - returns: vector |
| 1583 | operations: |
| 1584 | - node: '[*parser.VectorSelector] foo' |
| 1585 | op: "" |
| 1586 | indirect: |
| 1587 | - src: |
| 1588 | labels: |
| 1589 | "": |
| 1590 | reason: This query returns a number value with no labels. |
| 1591 | kind: excluded |
| 1592 | fragment: |
| 1593 | start: 11 |
| 1594 | end: 12 |
| 1595 | returns: scalar |
| 1596 | returnInfo: |
| 1597 | logicalexpr: "" |
| 1598 | valueposition: |
| 1599 | start: 11 |
| 1600 | end: 12 |
| 1601 | returnednumber: 5 |
| 1602 | alwaysreturns: true |
| 1603 | knownreturn: true |
| 1604 | isreturnbool: false |
| 1605 | position: |
| 1606 | start: 11 |
| 1607 | end: 12 |
| 1608 | type: number |
| 1609 | fixedLabels: true |
| 1610 | op: 57388 |
| 1611 | side: 1 |
| 1612 | - src: |
| 1613 | labels: |
| 1614 | "": |
| 1615 | reason: This query returns a number value with no labels. |
| 1616 | kind: excluded |
| 1617 | fragment: |
| 1618 | start: 16 |
| 1619 | end: 17 |
| 1620 | returns: scalar |
| 1621 | returnInfo: |
| 1622 | logicalexpr: "" |
| 1623 | valueposition: |
| 1624 | start: 16 |
| 1625 | end: 17 |
| 1626 | returnednumber: 1 |
| 1627 | alwaysreturns: true |
| 1628 | knownreturn: true |
| 1629 | isreturnbool: false |
| 1630 | position: |
| 1631 | start: 16 |
| 1632 | end: 17 |
| 1633 | type: number |
| 1634 | fixedLabels: true |
| 1635 | op: 57385 |
| 1636 | side: 1 |
| 1637 | condition: |
| 1638 | op: 57388 |
| 1639 | value: 5 |
| 1640 | present: true |
| 1641 | knownValue: true |
| 1642 | position: |
| 1643 | start: 0 |
| 1644 | end: 3 |
| 1645 | type: selector |
| 1646 | |
| 1647 | --- |
| 1648 | |
| 1649 | [TestLabelsSource/20 - 1] |
| 1650 | expr: foo > bool bar |
| 1651 | output: |
| 1652 | - labels: |
| 1653 | __name__: |
| 1654 | reason: Binary operation between two vectors removes metric names. |
| 1655 | kind: excluded |
| 1656 | fragment: |
| 1657 | start: 0 |
| 1658 | end: 14 |
| 1659 | returns: vector |
| 1660 | operations: |
| 1661 | - node: '[*parser.VectorSelector] foo' |
| 1662 | op: "" |
| 1663 | joins: |
| 1664 | - addedlabels: [] |
| 1665 | depth: 0 |
| 1666 | ison: false |
| 1667 | matchinglabels: [] |
| 1668 | op: '>' |
| 1669 | src: |
| 1670 | returns: vector |
| 1671 | operations: |
| 1672 | - node: '[*parser.VectorSelector] bar' |
| 1673 | op: "" |
| 1674 | position: |
| 1675 | start: 11 |
| 1676 | end: 14 |
| 1677 | type: selector |
| 1678 | returnInfo: |
| 1679 | logicalexpr: "" |
| 1680 | valueposition: |
| 1681 | start: 0 |
| 1682 | end: 0 |
| 1683 | returnednumber: 0 |
| 1684 | alwaysreturns: false |
| 1685 | knownreturn: false |
| 1686 | isreturnbool: true |
| 1687 | condition: |
| 1688 | op: 57388 |
| 1689 | present: true |
| 1690 | position: |
| 1691 | start: 0 |
| 1692 | end: 3 |
| 1693 | type: selector |
| 1694 | |
| 1695 | --- |
| 1696 | |
| 1697 | [TestLabelsSource/21 - 1] |
| 1698 | expr: (foo > bool bar) == 0 |
| 1699 | output: |
| 1700 | - labels: |
| 1701 | __name__: |
| 1702 | reason: Binary operation between two vectors removes metric names. |
| 1703 | kind: excluded |
| 1704 | fragment: |
| 1705 | start: 1 |
| 1706 | end: 15 |
| 1707 | returns: vector |
| 1708 | operations: |
| 1709 | - node: '[*parser.VectorSelector] foo' |
| 1710 | op: "" |
| 1711 | joins: |
| 1712 | - addedlabels: [] |
| 1713 | depth: 0 |
| 1714 | ison: false |
| 1715 | matchinglabels: [] |
| 1716 | op: '>' |
| 1717 | src: |
| 1718 | returns: vector |
| 1719 | operations: |
| 1720 | - node: '[*parser.VectorSelector] bar' |
| 1721 | op: "" |
| 1722 | position: |
| 1723 | start: 12 |
| 1724 | end: 15 |
| 1725 | type: selector |
| 1726 | indirect: |
| 1727 | - src: |
| 1728 | labels: |
| 1729 | "": |
| 1730 | reason: This query returns a number value with no labels. |
| 1731 | kind: excluded |
| 1732 | fragment: |
| 1733 | start: 20 |
| 1734 | end: 21 |
| 1735 | returns: scalar |
| 1736 | returnInfo: |
| 1737 | logicalexpr: "" |
| 1738 | valueposition: |
| 1739 | start: 20 |
| 1740 | end: 21 |
| 1741 | returnednumber: 0 |
| 1742 | alwaysreturns: true |
| 1743 | knownreturn: true |
| 1744 | isreturnbool: false |
| 1745 | position: |
| 1746 | start: 20 |
| 1747 | end: 21 |
| 1748 | type: number |
| 1749 | fixedLabels: true |
| 1750 | op: 57385 |
| 1751 | side: 1 |
| 1752 | condition: |
| 1753 | op: 57388 |
| 1754 | present: true |
| 1755 | position: |
| 1756 | start: 1 |
| 1757 | end: 4 |
| 1758 | type: selector |
| 1759 | |
| 1760 | --- |
| 1761 | |
| 1762 | [TestLabelsSource/22 - 1] |
| 1763 | expr: foo > bool on(instance) bar |
| 1764 | output: |
| 1765 | - labels: |
| 1766 | "": |
| 1767 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 1768 | kind: excluded |
| 1769 | fragment: |
| 1770 | start: 11 |
| 1771 | end: 23 |
| 1772 | __name__: |
| 1773 | reason: Binary operation between two vectors removes metric names. |
| 1774 | kind: excluded |
| 1775 | fragment: |
| 1776 | start: 0 |
| 1777 | end: 27 |
| 1778 | instance: |
| 1779 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 1780 | kind: included |
| 1781 | fragment: |
| 1782 | start: 14 |
| 1783 | end: 22 |
| 1784 | returns: vector |
| 1785 | operations: |
| 1786 | - node: '[*parser.VectorSelector] foo' |
| 1787 | op: "" |
| 1788 | joins: |
| 1789 | - addedlabels: [] |
| 1790 | depth: 0 |
| 1791 | ison: true |
| 1792 | matchinglabels: |
| 1793 | - instance |
| 1794 | op: '>' |
| 1795 | src: |
| 1796 | returns: vector |
| 1797 | operations: |
| 1798 | - node: '[*parser.VectorSelector] bar' |
| 1799 | op: "" |
| 1800 | position: |
| 1801 | start: 24 |
| 1802 | end: 27 |
| 1803 | type: selector |
| 1804 | usedLabels: |
| 1805 | - instance |
| 1806 | returnInfo: |
| 1807 | logicalexpr: "" |
| 1808 | valueposition: |
| 1809 | start: 0 |
| 1810 | end: 0 |
| 1811 | returnednumber: 0 |
| 1812 | alwaysreturns: false |
| 1813 | knownreturn: false |
| 1814 | isreturnbool: true |
| 1815 | condition: |
| 1816 | op: 57388 |
| 1817 | present: true |
| 1818 | position: |
| 1819 | start: 0 |
| 1820 | end: 3 |
| 1821 | type: selector |
| 1822 | fixedLabels: true |
| 1823 | |
| 1824 | --- |
| 1825 | |
| 1826 | [TestLabelsSource/23 - 1] |
| 1827 | expr: (foo > bool on(instance) bar) == 1 |
| 1828 | output: |
| 1829 | - labels: |
| 1830 | "": |
| 1831 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 1832 | kind: excluded |
| 1833 | fragment: |
| 1834 | start: 12 |
| 1835 | end: 24 |
| 1836 | __name__: |
| 1837 | reason: Binary operation between two vectors removes metric names. |
| 1838 | kind: excluded |
| 1839 | fragment: |
| 1840 | start: 1 |
| 1841 | end: 28 |
| 1842 | instance: |
| 1843 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 1844 | kind: included |
| 1845 | fragment: |
| 1846 | start: 15 |
| 1847 | end: 23 |
| 1848 | returns: vector |
| 1849 | operations: |
| 1850 | - node: '[*parser.VectorSelector] foo' |
| 1851 | op: "" |
| 1852 | joins: |
| 1853 | - addedlabels: [] |
| 1854 | depth: 0 |
| 1855 | ison: true |
| 1856 | matchinglabels: |
| 1857 | - instance |
| 1858 | op: '>' |
| 1859 | src: |
| 1860 | returns: vector |
| 1861 | operations: |
| 1862 | - node: '[*parser.VectorSelector] bar' |
| 1863 | op: "" |
| 1864 | position: |
| 1865 | start: 25 |
| 1866 | end: 28 |
| 1867 | type: selector |
| 1868 | indirect: |
| 1869 | - src: |
| 1870 | labels: |
| 1871 | "": |
| 1872 | reason: This query returns a number value with no labels. |
| 1873 | kind: excluded |
| 1874 | fragment: |
| 1875 | start: 33 |
| 1876 | end: 34 |
| 1877 | returns: scalar |
| 1878 | returnInfo: |
| 1879 | logicalexpr: "" |
| 1880 | valueposition: |
| 1881 | start: 33 |
| 1882 | end: 34 |
| 1883 | returnednumber: 1 |
| 1884 | alwaysreturns: true |
| 1885 | knownreturn: true |
| 1886 | isreturnbool: false |
| 1887 | position: |
| 1888 | start: 33 |
| 1889 | end: 34 |
| 1890 | type: number |
| 1891 | fixedLabels: true |
| 1892 | op: 57385 |
| 1893 | side: 1 |
| 1894 | usedLabels: |
| 1895 | - instance |
| 1896 | condition: |
| 1897 | op: 57388 |
| 1898 | present: true |
| 1899 | position: |
| 1900 | start: 1 |
| 1901 | end: 4 |
| 1902 | type: selector |
| 1903 | fixedLabels: true |
| 1904 | |
| 1905 | --- |
| 1906 | |
| 1907 | [TestLabelsSource/24 - 1] |
| 1908 | expr: foo > bool on(instance) group_left(version) bar |
| 1909 | output: |
| 1910 | - labels: |
| 1911 | __name__: |
| 1912 | reason: Binary operation between two vectors removes metric names. |
| 1913 | kind: excluded |
| 1914 | fragment: |
| 1915 | start: 0 |
| 1916 | end: 47 |
| 1917 | instance: |
| 1918 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 1919 | kind: included |
| 1920 | fragment: |
| 1921 | start: 14 |
| 1922 | end: 22 |
| 1923 | version: |
| 1924 | 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. |
| 1925 | kind: included |
| 1926 | fragment: |
| 1927 | start: 35 |
| 1928 | end: 42 |
| 1929 | returns: vector |
| 1930 | operations: |
| 1931 | - node: '[*parser.VectorSelector] foo' |
| 1932 | op: "" |
| 1933 | joins: |
| 1934 | - addedlabels: |
| 1935 | - version |
| 1936 | depth: 0 |
| 1937 | ison: true |
| 1938 | matchinglabels: |
| 1939 | - instance |
| 1940 | op: '>' |
| 1941 | src: |
| 1942 | returns: vector |
| 1943 | operations: |
| 1944 | - node: '[*parser.VectorSelector] bar' |
| 1945 | op: "" |
| 1946 | position: |
| 1947 | start: 44 |
| 1948 | end: 47 |
| 1949 | type: selector |
| 1950 | usedLabels: |
| 1951 | - instance |
| 1952 | returnInfo: |
| 1953 | logicalexpr: "" |
| 1954 | valueposition: |
| 1955 | start: 0 |
| 1956 | end: 0 |
| 1957 | returnednumber: 0 |
| 1958 | alwaysreturns: false |
| 1959 | knownreturn: false |
| 1960 | isreturnbool: true |
| 1961 | condition: |
| 1962 | op: 57388 |
| 1963 | present: true |
| 1964 | position: |
| 1965 | start: 0 |
| 1966 | end: 3 |
| 1967 | type: selector |
| 1968 | |
| 1969 | --- |
| 1970 | |
| 1971 | [TestLabelsSource/25 - 1] |
| 1972 | expr: bar > bool on(instance) group_right(version) foo |
| 1973 | output: |
| 1974 | - labels: |
| 1975 | __name__: |
| 1976 | reason: Binary operation between two vectors removes metric names. |
| 1977 | kind: excluded |
| 1978 | fragment: |
| 1979 | start: 0 |
| 1980 | end: 48 |
| 1981 | instance: |
| 1982 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 1983 | kind: included |
| 1984 | fragment: |
| 1985 | start: 14 |
| 1986 | end: 22 |
| 1987 | version: |
| 1988 | 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. |
| 1989 | kind: included |
| 1990 | fragment: |
| 1991 | start: 36 |
| 1992 | end: 43 |
| 1993 | returns: vector |
| 1994 | operations: |
| 1995 | - node: '[*parser.VectorSelector] foo' |
| 1996 | op: "" |
| 1997 | joins: |
| 1998 | - addedlabels: |
| 1999 | - version |
| 2000 | depth: 0 |
| 2001 | ison: true |
| 2002 | matchinglabels: |
| 2003 | - instance |
| 2004 | op: '>' |
| 2005 | src: |
| 2006 | returns: vector |
| 2007 | operations: |
| 2008 | - node: '[*parser.VectorSelector] bar' |
| 2009 | op: "" |
| 2010 | position: |
| 2011 | start: 0 |
| 2012 | end: 3 |
| 2013 | type: selector |
| 2014 | usedLabels: |
| 2015 | - instance |
| 2016 | returnInfo: |
| 2017 | logicalexpr: "" |
| 2018 | valueposition: |
| 2019 | start: 0 |
| 2020 | end: 0 |
| 2021 | returnednumber: 0 |
| 2022 | alwaysreturns: false |
| 2023 | knownreturn: false |
| 2024 | isreturnbool: true |
| 2025 | condition: |
| 2026 | op: 57388 |
| 2027 | present: true |
| 2028 | position: |
| 2029 | start: 45 |
| 2030 | end: 48 |
| 2031 | type: selector |
| 2032 | |
| 2033 | --- |
| 2034 | |
| 2035 | [TestLabelsSource/26 - 1] |
| 2036 | expr: foo and bar > bool 0 |
| 2037 | output: |
| 2038 | - returns: vector |
| 2039 | operations: |
| 2040 | - node: '[*parser.VectorSelector] foo' |
| 2041 | op: "" |
| 2042 | joins: |
| 2043 | - addedlabels: [] |
| 2044 | depth: 0 |
| 2045 | ison: false |
| 2046 | matchinglabels: [] |
| 2047 | op: and |
| 2048 | src: |
| 2049 | returns: vector |
| 2050 | operations: |
| 2051 | - node: '[*parser.VectorSelector] bar' |
| 2052 | op: "" |
| 2053 | indirect: |
| 2054 | - src: |
| 2055 | labels: |
| 2056 | "": |
| 2057 | reason: This query returns a number value with no labels. |
| 2058 | kind: excluded |
| 2059 | fragment: |
| 2060 | start: 19 |
| 2061 | end: 20 |
| 2062 | returns: scalar |
| 2063 | returnInfo: |
| 2064 | logicalexpr: "" |
| 2065 | valueposition: |
| 2066 | start: 19 |
| 2067 | end: 20 |
| 2068 | returnednumber: 0 |
| 2069 | alwaysreturns: true |
| 2070 | knownreturn: true |
| 2071 | isreturnbool: false |
| 2072 | position: |
| 2073 | start: 19 |
| 2074 | end: 20 |
| 2075 | type: number |
| 2076 | fixedLabels: true |
| 2077 | op: 57388 |
| 2078 | side: 1 |
| 2079 | returnInfo: |
| 2080 | logicalexpr: "" |
| 2081 | valueposition: |
| 2082 | start: 0 |
| 2083 | end: 0 |
| 2084 | returnednumber: 0 |
| 2085 | alwaysreturns: false |
| 2086 | knownreturn: false |
| 2087 | isreturnbool: true |
| 2088 | condition: |
| 2089 | op: 57388 |
| 2090 | present: true |
| 2091 | knownValue: true |
| 2092 | position: |
| 2093 | start: 8 |
| 2094 | end: 11 |
| 2095 | type: selector |
| 2096 | condition: |
| 2097 | op: 57391 |
| 2098 | present: true |
| 2099 | position: |
| 2100 | start: 0 |
| 2101 | end: 3 |
| 2102 | type: selector |
| 2103 | |
| 2104 | --- |
| 2105 | |
| 2106 | [TestLabelsSource/27 - 1] |
| 2107 | expr: foo offset 5m |
| 2108 | output: |
| 2109 | - returns: vector |
| 2110 | operations: |
| 2111 | - node: '[*parser.VectorSelector] foo offset 5m' |
| 2112 | op: "" |
| 2113 | position: |
| 2114 | start: 0 |
| 2115 | end: 13 |
| 2116 | type: selector |
| 2117 | |
| 2118 | --- |
| 2119 | |
| 2120 | [TestLabelsSource/28 - 1] |
| 2121 | expr: foo{job="bar"} |
| 2122 | output: |
| 2123 | - labels: |
| 2124 | job: |
| 2125 | reason: Query will only return series where these labels are present. |
| 2126 | kind: guaranteed |
| 2127 | fragment: |
| 2128 | start: 0 |
| 2129 | end: 14 |
| 2130 | returns: vector |
| 2131 | operations: |
| 2132 | - node: '[*parser.VectorSelector] foo{job="bar"}' |
| 2133 | op: "" |
| 2134 | position: |
| 2135 | start: 0 |
| 2136 | end: 14 |
| 2137 | type: selector |
| 2138 | |
| 2139 | --- |
| 2140 | |
| 2141 | [TestLabelsSource/29 - 1] |
| 2142 | expr: foo{job=""} |
| 2143 | output: |
| 2144 | - labels: |
| 2145 | job: |
| 2146 | reason: Query uses `{job=""}` selector which will filter out any time series with the `job` label set. |
| 2147 | kind: excluded |
| 2148 | fragment: |
| 2149 | start: 0 |
| 2150 | end: 11 |
| 2151 | returns: vector |
| 2152 | operations: |
| 2153 | - node: '[*parser.VectorSelector] foo{job=""}' |
| 2154 | op: "" |
| 2155 | position: |
| 2156 | start: 0 |
| 2157 | end: 11 |
| 2158 | type: selector |
| 2159 | |
| 2160 | --- |
| 2161 | |
| 2162 | [TestLabelsSource/30 - 1] |
| 2163 | expr: foo{job="bar"} or bar{job="foo"} |
| 2164 | output: |
| 2165 | - labels: |
| 2166 | job: |
| 2167 | reason: Query will only return series where these labels are present. |
| 2168 | kind: guaranteed |
| 2169 | fragment: |
| 2170 | start: 0 |
| 2171 | end: 14 |
| 2172 | returns: vector |
| 2173 | operations: |
| 2174 | - node: '[*parser.VectorSelector] foo{job="bar"}' |
| 2175 | op: "" |
| 2176 | usedLabels: |
| 2177 | - job |
| 2178 | position: |
| 2179 | start: 0 |
| 2180 | end: 14 |
| 2181 | type: selector |
| 2182 | - labels: |
| 2183 | job: |
| 2184 | reason: Query will only return series where these labels are present. |
| 2185 | kind: guaranteed |
| 2186 | fragment: |
| 2187 | start: 18 |
| 2188 | end: 32 |
| 2189 | returns: vector |
| 2190 | operations: |
| 2191 | - node: '[*parser.VectorSelector] bar{job="foo"}' |
| 2192 | op: "" |
| 2193 | position: |
| 2194 | start: 18 |
| 2195 | end: 32 |
| 2196 | type: selector |
| 2197 | |
| 2198 | --- |
| 2199 | |
| 2200 | [TestLabelsSource/31 - 1] |
| 2201 | expr: foo{a="bar"} or bar{b="foo"} |
| 2202 | output: |
| 2203 | - labels: |
| 2204 | a: |
| 2205 | reason: Query will only return series where these labels are present. |
| 2206 | kind: guaranteed |
| 2207 | fragment: |
| 2208 | start: 0 |
| 2209 | end: 12 |
| 2210 | returns: vector |
| 2211 | operations: |
| 2212 | - node: '[*parser.VectorSelector] foo{a="bar"}' |
| 2213 | op: "" |
| 2214 | usedLabels: |
| 2215 | - a |
| 2216 | position: |
| 2217 | start: 0 |
| 2218 | end: 12 |
| 2219 | type: selector |
| 2220 | - labels: |
| 2221 | b: |
| 2222 | reason: Query will only return series where these labels are present. |
| 2223 | kind: guaranteed |
| 2224 | fragment: |
| 2225 | start: 16 |
| 2226 | end: 28 |
| 2227 | returns: vector |
| 2228 | operations: |
| 2229 | - node: '[*parser.VectorSelector] bar{b="foo"}' |
| 2230 | op: "" |
| 2231 | position: |
| 2232 | start: 16 |
| 2233 | end: 28 |
| 2234 | type: selector |
| 2235 | |
| 2236 | --- |
| 2237 | |
| 2238 | [TestLabelsSource/32 - 1] |
| 2239 | expr: foo[5m] |
| 2240 | output: |
| 2241 | - returns: matrix |
| 2242 | operations: |
| 2243 | - node: '[*parser.MatrixSelector] foo[5m]' |
| 2244 | op: "" |
| 2245 | - node: '[*parser.VectorSelector] foo' |
| 2246 | op: "" |
| 2247 | position: |
| 2248 | start: 0 |
| 2249 | end: 3 |
| 2250 | type: selector |
| 2251 | |
| 2252 | --- |
| 2253 | |
| 2254 | [TestLabelsSource/33 - 1] |
| 2255 | expr: prometheus_build_info[2m:1m] |
| 2256 | output: |
| 2257 | - returns: vector |
| 2258 | operations: |
| 2259 | - node: '[*parser.SubqueryExpr] prometheus_build_info[2m:1m]' |
| 2260 | op: "" |
| 2261 | - node: '[*parser.VectorSelector] prometheus_build_info' |
| 2262 | op: "" |
| 2263 | position: |
| 2264 | start: 0 |
| 2265 | end: 21 |
| 2266 | type: selector |
| 2267 | |
| 2268 | --- |
| 2269 | |
| 2270 | [TestLabelsSource/34 - 1] |
| 2271 | expr: deriv(rate(distance_covered_meters_total[1m])[5m:1m]) |
| 2272 | output: |
| 2273 | - returns: vector |
| 2274 | operations: |
| 2275 | - node: '[*parser.SubqueryExpr] rate(distance_covered_meters_total[1m])[5m:1m]' |
| 2276 | op: "" |
| 2277 | - node: '[*parser.MatrixSelector] distance_covered_meters_total[1m]' |
| 2278 | op: "" |
| 2279 | - node: '[*parser.VectorSelector] distance_covered_meters_total' |
| 2280 | op: "" |
| 2281 | - node: '[*parser.Call] rate(distance_covered_meters_total[1m])' |
| 2282 | op: rate |
| 2283 | - node: '[*parser.Call] deriv(rate(distance_covered_meters_total[1m])[5m:1m])' |
| 2284 | op: deriv |
| 2285 | position: |
| 2286 | start: 6 |
| 2287 | end: 52 |
| 2288 | type: function |
| 2289 | |
| 2290 | --- |
| 2291 | |
| 2292 | [TestLabelsSource/35 - 1] |
| 2293 | expr: foo - 1 |
| 2294 | output: |
| 2295 | - returns: vector |
| 2296 | operations: |
| 2297 | - node: '[*parser.VectorSelector] foo' |
| 2298 | op: "" |
| 2299 | indirect: |
| 2300 | - src: |
| 2301 | labels: |
| 2302 | "": |
| 2303 | reason: This query returns a number value with no labels. |
| 2304 | kind: excluded |
| 2305 | fragment: |
| 2306 | start: 6 |
| 2307 | end: 7 |
| 2308 | returns: scalar |
| 2309 | returnInfo: |
| 2310 | logicalexpr: "" |
| 2311 | valueposition: |
| 2312 | start: 6 |
| 2313 | end: 7 |
| 2314 | returnednumber: 1 |
| 2315 | alwaysreturns: true |
| 2316 | knownreturn: true |
| 2317 | isreturnbool: false |
| 2318 | position: |
| 2319 | start: 6 |
| 2320 | end: 7 |
| 2321 | type: number |
| 2322 | fixedLabels: true |
| 2323 | op: 57401 |
| 2324 | side: 1 |
| 2325 | position: |
| 2326 | start: 0 |
| 2327 | end: 3 |
| 2328 | type: selector |
| 2329 | |
| 2330 | --- |
| 2331 | |
| 2332 | [TestLabelsSource/36 - 1] |
| 2333 | expr: foo / 5 |
| 2334 | output: |
| 2335 | - returns: vector |
| 2336 | operations: |
| 2337 | - node: '[*parser.VectorSelector] foo' |
| 2338 | op: "" |
| 2339 | indirect: |
| 2340 | - src: |
| 2341 | labels: |
| 2342 | "": |
| 2343 | reason: This query returns a number value with no labels. |
| 2344 | kind: excluded |
| 2345 | fragment: |
| 2346 | start: 6 |
| 2347 | end: 7 |
| 2348 | returns: scalar |
| 2349 | returnInfo: |
| 2350 | logicalexpr: "" |
| 2351 | valueposition: |
| 2352 | start: 6 |
| 2353 | end: 7 |
| 2354 | returnednumber: 5 |
| 2355 | alwaysreturns: true |
| 2356 | knownreturn: true |
| 2357 | isreturnbool: false |
| 2358 | position: |
| 2359 | start: 6 |
| 2360 | end: 7 |
| 2361 | type: number |
| 2362 | fixedLabels: true |
| 2363 | op: 57384 |
| 2364 | side: 1 |
| 2365 | position: |
| 2366 | start: 0 |
| 2367 | end: 3 |
| 2368 | type: selector |
| 2369 | |
| 2370 | --- |
| 2371 | |
| 2372 | [TestLabelsSource/37 - 1] |
| 2373 | expr: -foo |
| 2374 | output: |
| 2375 | - returns: vector |
| 2376 | operations: |
| 2377 | - node: '[*parser.VectorSelector] foo' |
| 2378 | op: "" |
| 2379 | position: |
| 2380 | start: 1 |
| 2381 | end: 4 |
| 2382 | type: selector |
| 2383 | |
| 2384 | --- |
| 2385 | |
| 2386 | [TestLabelsSource/38 - 1] |
| 2387 | expr: sum(foo{job="myjob"}) |
| 2388 | output: |
| 2389 | - labels: |
| 2390 | "": |
| 2391 | reason: Query is using aggregation that removes all labels. |
| 2392 | kind: excluded |
| 2393 | fragment: |
| 2394 | start: 0 |
| 2395 | end: 3 |
| 2396 | __name__: |
| 2397 | reason: Aggregation removes metric name. |
| 2398 | kind: excluded |
| 2399 | fragment: |
| 2400 | start: 0 |
| 2401 | end: 21 |
| 2402 | job: |
| 2403 | reason: Query is using aggregation that removes all labels. |
| 2404 | kind: excluded |
| 2405 | fragment: |
| 2406 | start: 0 |
| 2407 | end: 3 |
| 2408 | returns: vector |
| 2409 | operations: |
| 2410 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2411 | op: "" |
| 2412 | - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})' |
| 2413 | op: sum |
| 2414 | position: |
| 2415 | start: 4 |
| 2416 | end: 20 |
| 2417 | type: aggregation |
| 2418 | fixedLabels: true |
| 2419 | |
| 2420 | --- |
| 2421 | |
| 2422 | [TestLabelsSource/39 - 1] |
| 2423 | expr: sum(count(foo{job="myjob"}) by(instance)) |
| 2424 | output: |
| 2425 | - labels: |
| 2426 | "": |
| 2427 | reason: Query is using aggregation that removes all labels. |
| 2428 | kind: excluded |
| 2429 | fragment: |
| 2430 | start: 0 |
| 2431 | end: 3 |
| 2432 | __name__: |
| 2433 | reason: Aggregation removes metric name. |
| 2434 | kind: excluded |
| 2435 | fragment: |
| 2436 | start: 0 |
| 2437 | end: 41 |
| 2438 | instance: |
| 2439 | reason: Query is using aggregation that removes all labels. |
| 2440 | kind: excluded |
| 2441 | fragment: |
| 2442 | start: 0 |
| 2443 | end: 3 |
| 2444 | job: |
| 2445 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 2446 | kind: excluded |
| 2447 | fragment: |
| 2448 | start: 28 |
| 2449 | end: 40 |
| 2450 | returns: vector |
| 2451 | operations: |
| 2452 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2453 | op: "" |
| 2454 | - node: '[*parser.AggregateExpr] count by (instance) (foo{job="myjob"})' |
| 2455 | op: count |
| 2456 | - node: '[*parser.AggregateExpr] sum(count by (instance) (foo{job="myjob"}))' |
| 2457 | op: sum |
| 2458 | position: |
| 2459 | start: 10 |
| 2460 | end: 26 |
| 2461 | type: aggregation |
| 2462 | fixedLabels: true |
| 2463 | |
| 2464 | --- |
| 2465 | |
| 2466 | [TestLabelsSource/40 - 1] |
| 2467 | expr: sum(foo{job="myjob"}) > 20 |
| 2468 | output: |
| 2469 | - labels: |
| 2470 | "": |
| 2471 | reason: Query is using aggregation that removes all labels. |
| 2472 | kind: excluded |
| 2473 | fragment: |
| 2474 | start: 0 |
| 2475 | end: 3 |
| 2476 | __name__: |
| 2477 | reason: Aggregation removes metric name. |
| 2478 | kind: excluded |
| 2479 | fragment: |
| 2480 | start: 0 |
| 2481 | end: 21 |
| 2482 | job: |
| 2483 | reason: Query is using aggregation that removes all labels. |
| 2484 | kind: excluded |
| 2485 | fragment: |
| 2486 | start: 0 |
| 2487 | end: 3 |
| 2488 | returns: vector |
| 2489 | operations: |
| 2490 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2491 | op: "" |
| 2492 | - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})' |
| 2493 | op: sum |
| 2494 | indirect: |
| 2495 | - src: |
| 2496 | labels: |
| 2497 | "": |
| 2498 | reason: This query returns a number value with no labels. |
| 2499 | kind: excluded |
| 2500 | fragment: |
| 2501 | start: 24 |
| 2502 | end: 26 |
| 2503 | returns: scalar |
| 2504 | returnInfo: |
| 2505 | logicalexpr: "" |
| 2506 | valueposition: |
| 2507 | start: 24 |
| 2508 | end: 26 |
| 2509 | returnednumber: 20 |
| 2510 | alwaysreturns: true |
| 2511 | knownreturn: true |
| 2512 | isreturnbool: false |
| 2513 | position: |
| 2514 | start: 24 |
| 2515 | end: 26 |
| 2516 | type: number |
| 2517 | fixedLabels: true |
| 2518 | op: 57388 |
| 2519 | side: 1 |
| 2520 | condition: |
| 2521 | op: 57388 |
| 2522 | value: 20 |
| 2523 | present: true |
| 2524 | knownValue: true |
| 2525 | position: |
| 2526 | start: 4 |
| 2527 | end: 20 |
| 2528 | type: aggregation |
| 2529 | fixedLabels: true |
| 2530 | |
| 2531 | --- |
| 2532 | |
| 2533 | [TestLabelsSource/41 - 1] |
| 2534 | expr: sum(foo{job="myjob"}) without(job) |
| 2535 | output: |
| 2536 | - labels: |
| 2537 | __name__: |
| 2538 | reason: Aggregation removes metric name. |
| 2539 | kind: excluded |
| 2540 | fragment: |
| 2541 | start: 0 |
| 2542 | end: 34 |
| 2543 | job: |
| 2544 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 2545 | kind: excluded |
| 2546 | fragment: |
| 2547 | start: 30 |
| 2548 | end: 33 |
| 2549 | returns: vector |
| 2550 | operations: |
| 2551 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2552 | op: "" |
| 2553 | - node: '[*parser.AggregateExpr] sum without (job) (foo{job="myjob"})' |
| 2554 | op: sum |
| 2555 | position: |
| 2556 | start: 4 |
| 2557 | end: 20 |
| 2558 | type: aggregation |
| 2559 | |
| 2560 | --- |
| 2561 | |
| 2562 | [TestLabelsSource/42 - 1] |
| 2563 | expr: sum(foo) by(job) |
| 2564 | output: |
| 2565 | - labels: |
| 2566 | "": |
| 2567 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 2568 | kind: excluded |
| 2569 | fragment: |
| 2570 | start: 9 |
| 2571 | end: 11 |
| 2572 | __name__: |
| 2573 | reason: Aggregation removes metric name. |
| 2574 | kind: excluded |
| 2575 | fragment: |
| 2576 | start: 0 |
| 2577 | end: 16 |
| 2578 | job: |
| 2579 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 2580 | kind: included |
| 2581 | fragment: |
| 2582 | start: 12 |
| 2583 | end: 15 |
| 2584 | returns: vector |
| 2585 | operations: |
| 2586 | - node: '[*parser.VectorSelector] foo' |
| 2587 | op: "" |
| 2588 | - node: '[*parser.AggregateExpr] sum by (job) (foo)' |
| 2589 | op: sum |
| 2590 | usedLabels: |
| 2591 | - job |
| 2592 | position: |
| 2593 | start: 4 |
| 2594 | end: 7 |
| 2595 | type: aggregation |
| 2596 | fixedLabels: true |
| 2597 | |
| 2598 | --- |
| 2599 | |
| 2600 | [TestLabelsSource/43 - 1] |
| 2601 | expr: sum(foo{job="myjob"}) by(job) |
| 2602 | output: |
| 2603 | - labels: |
| 2604 | "": |
| 2605 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 2606 | kind: excluded |
| 2607 | fragment: |
| 2608 | start: 22 |
| 2609 | end: 24 |
| 2610 | __name__: |
| 2611 | reason: Aggregation removes metric name. |
| 2612 | kind: excluded |
| 2613 | fragment: |
| 2614 | start: 0 |
| 2615 | end: 29 |
| 2616 | job: |
| 2617 | reason: Query will only return series where these labels are present. |
| 2618 | kind: guaranteed |
| 2619 | fragment: |
| 2620 | start: 4 |
| 2621 | end: 20 |
| 2622 | returns: vector |
| 2623 | operations: |
| 2624 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2625 | op: "" |
| 2626 | - node: '[*parser.AggregateExpr] sum by (job) (foo{job="myjob"})' |
| 2627 | op: sum |
| 2628 | usedLabels: |
| 2629 | - job |
| 2630 | position: |
| 2631 | start: 4 |
| 2632 | end: 20 |
| 2633 | type: aggregation |
| 2634 | fixedLabels: true |
| 2635 | |
| 2636 | --- |
| 2637 | |
| 2638 | [TestLabelsSource/44 - 1] |
| 2639 | expr: abs(foo{job="myjob"} offset 5m) |
| 2640 | output: |
| 2641 | - labels: |
| 2642 | job: |
| 2643 | reason: Query will only return series where these labels are present. |
| 2644 | kind: guaranteed |
| 2645 | fragment: |
| 2646 | start: 4 |
| 2647 | end: 30 |
| 2648 | returns: vector |
| 2649 | operations: |
| 2650 | - node: '[*parser.VectorSelector] foo{job="myjob"} offset 5m' |
| 2651 | op: "" |
| 2652 | - node: '[*parser.Call] abs(foo{job="myjob"} offset 5m)' |
| 2653 | op: abs |
| 2654 | position: |
| 2655 | start: 4 |
| 2656 | end: 30 |
| 2657 | type: function |
| 2658 | |
| 2659 | --- |
| 2660 | |
| 2661 | [TestLabelsSource/45 - 1] |
| 2662 | expr: abs(foo{job="myjob"} or bar{cluster="dev"}) |
| 2663 | output: |
| 2664 | - labels: |
| 2665 | job: |
| 2666 | reason: Query will only return series where these labels are present. |
| 2667 | kind: guaranteed |
| 2668 | fragment: |
| 2669 | start: 4 |
| 2670 | end: 20 |
| 2671 | returns: vector |
| 2672 | operations: |
| 2673 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2674 | op: "" |
| 2675 | - node: '[*parser.Call] abs(foo{job="myjob"} or bar{cluster="dev"})' |
| 2676 | op: abs |
| 2677 | usedLabels: |
| 2678 | - job |
| 2679 | position: |
| 2680 | start: 4 |
| 2681 | end: 42 |
| 2682 | type: function |
| 2683 | - labels: |
| 2684 | cluster: |
| 2685 | reason: Query will only return series where these labels are present. |
| 2686 | kind: guaranteed |
| 2687 | fragment: |
| 2688 | start: 24 |
| 2689 | end: 42 |
| 2690 | returns: vector |
| 2691 | operations: |
| 2692 | - node: '[*parser.VectorSelector] bar{cluster="dev"}' |
| 2693 | op: "" |
| 2694 | - node: '[*parser.Call] abs(foo{job="myjob"} or bar{cluster="dev"})' |
| 2695 | op: abs |
| 2696 | position: |
| 2697 | start: 4 |
| 2698 | end: 42 |
| 2699 | type: function |
| 2700 | |
| 2701 | --- |
| 2702 | |
| 2703 | [TestLabelsSource/46 - 1] |
| 2704 | expr: sum(foo{job="myjob"} or bar{cluster="dev"}) without(instance) |
| 2705 | output: |
| 2706 | - labels: |
| 2707 | __name__: |
| 2708 | reason: Aggregation removes metric name. |
| 2709 | kind: excluded |
| 2710 | fragment: |
| 2711 | start: 0 |
| 2712 | end: 61 |
| 2713 | instance: |
| 2714 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 2715 | kind: excluded |
| 2716 | fragment: |
| 2717 | start: 52 |
| 2718 | end: 60 |
| 2719 | job: |
| 2720 | reason: Query will only return series where these labels are present. |
| 2721 | kind: guaranteed |
| 2722 | fragment: |
| 2723 | start: 4 |
| 2724 | end: 20 |
| 2725 | returns: vector |
| 2726 | operations: |
| 2727 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2728 | op: "" |
| 2729 | - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"} or bar{cluster="dev"})' |
| 2730 | op: sum |
| 2731 | usedLabels: |
| 2732 | - job |
| 2733 | position: |
| 2734 | start: 4 |
| 2735 | end: 20 |
| 2736 | type: aggregation |
| 2737 | - labels: |
| 2738 | __name__: |
| 2739 | reason: Aggregation removes metric name. |
| 2740 | kind: excluded |
| 2741 | fragment: |
| 2742 | start: 0 |
| 2743 | end: 61 |
| 2744 | cluster: |
| 2745 | reason: Query will only return series where these labels are present. |
| 2746 | kind: guaranteed |
| 2747 | fragment: |
| 2748 | start: 24 |
| 2749 | end: 42 |
| 2750 | instance: |
| 2751 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 2752 | kind: excluded |
| 2753 | fragment: |
| 2754 | start: 52 |
| 2755 | end: 60 |
| 2756 | returns: vector |
| 2757 | operations: |
| 2758 | - node: '[*parser.VectorSelector] bar{cluster="dev"}' |
| 2759 | op: "" |
| 2760 | - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"} or bar{cluster="dev"})' |
| 2761 | op: sum |
| 2762 | position: |
| 2763 | start: 24 |
| 2764 | end: 42 |
| 2765 | type: aggregation |
| 2766 | |
| 2767 | --- |
| 2768 | |
| 2769 | [TestLabelsSource/47 - 1] |
| 2770 | expr: sum(foo{job="myjob"}) without(instance) |
| 2771 | output: |
| 2772 | - labels: |
| 2773 | __name__: |
| 2774 | reason: Aggregation removes metric name. |
| 2775 | kind: excluded |
| 2776 | fragment: |
| 2777 | start: 0 |
| 2778 | end: 39 |
| 2779 | instance: |
| 2780 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 2781 | kind: excluded |
| 2782 | fragment: |
| 2783 | start: 30 |
| 2784 | end: 38 |
| 2785 | job: |
| 2786 | reason: Query will only return series where these labels are present. |
| 2787 | kind: guaranteed |
| 2788 | fragment: |
| 2789 | start: 4 |
| 2790 | end: 20 |
| 2791 | returns: vector |
| 2792 | operations: |
| 2793 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2794 | op: "" |
| 2795 | - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"})' |
| 2796 | op: sum |
| 2797 | position: |
| 2798 | start: 4 |
| 2799 | end: 20 |
| 2800 | type: aggregation |
| 2801 | |
| 2802 | --- |
| 2803 | |
| 2804 | [TestLabelsSource/48 - 1] |
| 2805 | expr: min(foo{job="myjob"}) / max(foo{job="myjob"}) |
| 2806 | output: |
| 2807 | - labels: |
| 2808 | "": |
| 2809 | reason: Query is using aggregation that removes all labels. |
| 2810 | kind: excluded |
| 2811 | fragment: |
| 2812 | start: 0 |
| 2813 | end: 3 |
| 2814 | __name__: |
| 2815 | reason: Binary operation between two vectors removes metric names. |
| 2816 | kind: excluded |
| 2817 | fragment: |
| 2818 | start: 0 |
| 2819 | end: 45 |
| 2820 | job: |
| 2821 | reason: Query is using aggregation that removes all labels. |
| 2822 | kind: excluded |
| 2823 | fragment: |
| 2824 | start: 0 |
| 2825 | end: 3 |
| 2826 | returns: vector |
| 2827 | operations: |
| 2828 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2829 | op: "" |
| 2830 | - node: '[*parser.AggregateExpr] min(foo{job="myjob"})' |
| 2831 | op: min |
| 2832 | joins: |
| 2833 | - addedlabels: [] |
| 2834 | depth: 0 |
| 2835 | ison: false |
| 2836 | matchinglabels: [] |
| 2837 | op: / |
| 2838 | src: |
| 2839 | labels: |
| 2840 | "": |
| 2841 | reason: Query is using aggregation that removes all labels. |
| 2842 | kind: excluded |
| 2843 | fragment: |
| 2844 | start: 24 |
| 2845 | end: 27 |
| 2846 | __name__: |
| 2847 | reason: Aggregation removes metric name. |
| 2848 | kind: excluded |
| 2849 | fragment: |
| 2850 | start: 24 |
| 2851 | end: 45 |
| 2852 | job: |
| 2853 | reason: Query is using aggregation that removes all labels. |
| 2854 | kind: excluded |
| 2855 | fragment: |
| 2856 | start: 24 |
| 2857 | end: 27 |
| 2858 | returns: vector |
| 2859 | operations: |
| 2860 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2861 | op: "" |
| 2862 | - node: '[*parser.AggregateExpr] max(foo{job="myjob"})' |
| 2863 | op: max |
| 2864 | position: |
| 2865 | start: 28 |
| 2866 | end: 44 |
| 2867 | type: aggregation |
| 2868 | fixedLabels: true |
| 2869 | position: |
| 2870 | start: 4 |
| 2871 | end: 20 |
| 2872 | type: aggregation |
| 2873 | fixedLabels: true |
| 2874 | |
| 2875 | --- |
| 2876 | |
| 2877 | [TestLabelsSource/49 - 1] |
| 2878 | expr: max(foo{job="myjob"}) / min(foo{job="myjob"}) |
| 2879 | output: |
| 2880 | - labels: |
| 2881 | "": |
| 2882 | reason: Query is using aggregation that removes all labels. |
| 2883 | kind: excluded |
| 2884 | fragment: |
| 2885 | start: 0 |
| 2886 | end: 3 |
| 2887 | __name__: |
| 2888 | reason: Binary operation between two vectors removes metric names. |
| 2889 | kind: excluded |
| 2890 | fragment: |
| 2891 | start: 0 |
| 2892 | end: 45 |
| 2893 | job: |
| 2894 | reason: Query is using aggregation that removes all labels. |
| 2895 | kind: excluded |
| 2896 | fragment: |
| 2897 | start: 0 |
| 2898 | end: 3 |
| 2899 | returns: vector |
| 2900 | operations: |
| 2901 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2902 | op: "" |
| 2903 | - node: '[*parser.AggregateExpr] max(foo{job="myjob"})' |
| 2904 | op: max |
| 2905 | joins: |
| 2906 | - addedlabels: [] |
| 2907 | depth: 0 |
| 2908 | ison: false |
| 2909 | matchinglabels: [] |
| 2910 | op: / |
| 2911 | src: |
| 2912 | labels: |
| 2913 | "": |
| 2914 | reason: Query is using aggregation that removes all labels. |
| 2915 | kind: excluded |
| 2916 | fragment: |
| 2917 | start: 24 |
| 2918 | end: 27 |
| 2919 | __name__: |
| 2920 | reason: Aggregation removes metric name. |
| 2921 | kind: excluded |
| 2922 | fragment: |
| 2923 | start: 24 |
| 2924 | end: 45 |
| 2925 | job: |
| 2926 | reason: Query is using aggregation that removes all labels. |
| 2927 | kind: excluded |
| 2928 | fragment: |
| 2929 | start: 24 |
| 2930 | end: 27 |
| 2931 | returns: vector |
| 2932 | operations: |
| 2933 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2934 | op: "" |
| 2935 | - node: '[*parser.AggregateExpr] min(foo{job="myjob"})' |
| 2936 | op: min |
| 2937 | position: |
| 2938 | start: 28 |
| 2939 | end: 44 |
| 2940 | type: aggregation |
| 2941 | fixedLabels: true |
| 2942 | position: |
| 2943 | start: 4 |
| 2944 | end: 20 |
| 2945 | type: aggregation |
| 2946 | fixedLabels: true |
| 2947 | |
| 2948 | --- |
| 2949 | |
| 2950 | [TestLabelsSource/50 - 1] |
| 2951 | expr: avg(foo{job="myjob"}) by(job) |
| 2952 | output: |
| 2953 | - labels: |
| 2954 | "": |
| 2955 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 2956 | kind: excluded |
| 2957 | fragment: |
| 2958 | start: 22 |
| 2959 | end: 24 |
| 2960 | __name__: |
| 2961 | reason: Aggregation removes metric name. |
| 2962 | kind: excluded |
| 2963 | fragment: |
| 2964 | start: 0 |
| 2965 | end: 29 |
| 2966 | job: |
| 2967 | reason: Query will only return series where these labels are present. |
| 2968 | kind: guaranteed |
| 2969 | fragment: |
| 2970 | start: 4 |
| 2971 | end: 20 |
| 2972 | returns: vector |
| 2973 | operations: |
| 2974 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 2975 | op: "" |
| 2976 | - node: '[*parser.AggregateExpr] avg by (job) (foo{job="myjob"})' |
| 2977 | op: avg |
| 2978 | usedLabels: |
| 2979 | - job |
| 2980 | position: |
| 2981 | start: 4 |
| 2982 | end: 20 |
| 2983 | type: aggregation |
| 2984 | fixedLabels: true |
| 2985 | |
| 2986 | --- |
| 2987 | |
| 2988 | [TestLabelsSource/51 - 1] |
| 2989 | expr: group(foo) by(job) |
| 2990 | output: |
| 2991 | - labels: |
| 2992 | "": |
| 2993 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 2994 | kind: excluded |
| 2995 | fragment: |
| 2996 | start: 11 |
| 2997 | end: 13 |
| 2998 | __name__: |
| 2999 | reason: Aggregation removes metric name. |
| 3000 | kind: excluded |
| 3001 | fragment: |
| 3002 | start: 0 |
| 3003 | end: 18 |
| 3004 | job: |
| 3005 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 3006 | kind: included |
| 3007 | fragment: |
| 3008 | start: 14 |
| 3009 | end: 17 |
| 3010 | returns: vector |
| 3011 | operations: |
| 3012 | - node: '[*parser.VectorSelector] foo' |
| 3013 | op: "" |
| 3014 | - node: '[*parser.AggregateExpr] group by (job) (foo)' |
| 3015 | op: group |
| 3016 | usedLabels: |
| 3017 | - job |
| 3018 | position: |
| 3019 | start: 6 |
| 3020 | end: 9 |
| 3021 | type: aggregation |
| 3022 | fixedLabels: true |
| 3023 | |
| 3024 | --- |
| 3025 | |
| 3026 | [TestLabelsSource/52 - 1] |
| 3027 | expr: stddev(rate(foo[5m])) |
| 3028 | output: |
| 3029 | - labels: |
| 3030 | "": |
| 3031 | reason: Query is using aggregation that removes all labels. |
| 3032 | kind: excluded |
| 3033 | fragment: |
| 3034 | start: 0 |
| 3035 | end: 6 |
| 3036 | __name__: |
| 3037 | reason: Aggregation removes metric name. |
| 3038 | kind: excluded |
| 3039 | fragment: |
| 3040 | start: 0 |
| 3041 | end: 21 |
| 3042 | returns: vector |
| 3043 | operations: |
| 3044 | - node: '[*parser.MatrixSelector] foo[5m]' |
| 3045 | op: "" |
| 3046 | - node: '[*parser.VectorSelector] foo' |
| 3047 | op: "" |
| 3048 | - node: '[*parser.Call] rate(foo[5m])' |
| 3049 | op: rate |
| 3050 | - node: '[*parser.AggregateExpr] stddev(rate(foo[5m]))' |
| 3051 | op: stddev |
| 3052 | position: |
| 3053 | start: 12 |
| 3054 | end: 19 |
| 3055 | type: aggregation |
| 3056 | fixedLabels: true |
| 3057 | |
| 3058 | --- |
| 3059 | |
| 3060 | [TestLabelsSource/53 - 1] |
| 3061 | expr: stdvar(rate(foo[5m])) |
| 3062 | output: |
| 3063 | - labels: |
| 3064 | "": |
| 3065 | reason: Query is using aggregation that removes all labels. |
| 3066 | kind: excluded |
| 3067 | fragment: |
| 3068 | start: 0 |
| 3069 | end: 6 |
| 3070 | __name__: |
| 3071 | reason: Aggregation removes metric name. |
| 3072 | kind: excluded |
| 3073 | fragment: |
| 3074 | start: 0 |
| 3075 | end: 21 |
| 3076 | returns: vector |
| 3077 | operations: |
| 3078 | - node: '[*parser.MatrixSelector] foo[5m]' |
| 3079 | op: "" |
| 3080 | - node: '[*parser.VectorSelector] foo' |
| 3081 | op: "" |
| 3082 | - node: '[*parser.Call] rate(foo[5m])' |
| 3083 | op: rate |
| 3084 | - node: '[*parser.AggregateExpr] stdvar(rate(foo[5m]))' |
| 3085 | op: stdvar |
| 3086 | position: |
| 3087 | start: 12 |
| 3088 | end: 19 |
| 3089 | type: aggregation |
| 3090 | fixedLabels: true |
| 3091 | |
| 3092 | --- |
| 3093 | |
| 3094 | [TestLabelsSource/54 - 1] |
| 3095 | expr: stddev_over_time(foo[5m]) |
| 3096 | output: |
| 3097 | - returns: vector |
| 3098 | operations: |
| 3099 | - node: '[*parser.MatrixSelector] foo[5m]' |
| 3100 | op: "" |
| 3101 | - node: '[*parser.VectorSelector] foo' |
| 3102 | op: "" |
| 3103 | - node: '[*parser.Call] stddev_over_time(foo[5m])' |
| 3104 | op: stddev_over_time |
| 3105 | position: |
| 3106 | start: 17 |
| 3107 | end: 24 |
| 3108 | type: function |
| 3109 | |
| 3110 | --- |
| 3111 | |
| 3112 | [TestLabelsSource/55 - 1] |
| 3113 | expr: stdvar_over_time(foo[5m]) |
| 3114 | output: |
| 3115 | - returns: vector |
| 3116 | operations: |
| 3117 | - node: '[*parser.MatrixSelector] foo[5m]' |
| 3118 | op: "" |
| 3119 | - node: '[*parser.VectorSelector] foo' |
| 3120 | op: "" |
| 3121 | - node: '[*parser.Call] stdvar_over_time(foo[5m])' |
| 3122 | op: stdvar_over_time |
| 3123 | position: |
| 3124 | start: 17 |
| 3125 | end: 24 |
| 3126 | type: function |
| 3127 | |
| 3128 | --- |
| 3129 | |
| 3130 | [TestLabelsSource/56 - 1] |
| 3131 | expr: quantile(0.9, rate(foo[5m])) |
| 3132 | output: |
| 3133 | - labels: |
| 3134 | "": |
| 3135 | reason: Query is using aggregation that removes all labels. |
| 3136 | kind: excluded |
| 3137 | fragment: |
| 3138 | start: 0 |
| 3139 | end: 8 |
| 3140 | __name__: |
| 3141 | reason: Aggregation removes metric name. |
| 3142 | kind: excluded |
| 3143 | fragment: |
| 3144 | start: 0 |
| 3145 | end: 28 |
| 3146 | returns: vector |
| 3147 | operations: |
| 3148 | - node: '[*parser.MatrixSelector] foo[5m]' |
| 3149 | op: "" |
| 3150 | - node: '[*parser.VectorSelector] foo' |
| 3151 | op: "" |
| 3152 | - node: '[*parser.Call] rate(foo[5m])' |
| 3153 | op: rate |
| 3154 | - args: |
| 3155 | - "0.9" |
| 3156 | node: '[*parser.AggregateExpr] quantile(0.9, rate(foo[5m]))' |
| 3157 | op: quantile |
| 3158 | position: |
| 3159 | start: 19 |
| 3160 | end: 26 |
| 3161 | type: aggregation |
| 3162 | fixedLabels: true |
| 3163 | |
| 3164 | --- |
| 3165 | |
| 3166 | [TestLabelsSource/57 - 1] |
| 3167 | expr: count_values("version", build_version) |
| 3168 | output: |
| 3169 | - labels: |
| 3170 | "": |
| 3171 | reason: Query is using aggregation that removes all labels. |
| 3172 | kind: excluded |
| 3173 | fragment: |
| 3174 | start: 0 |
| 3175 | end: 12 |
| 3176 | __name__: |
| 3177 | reason: Aggregation removes metric name. |
| 3178 | kind: excluded |
| 3179 | fragment: |
| 3180 | start: 0 |
| 3181 | end: 38 |
| 3182 | version: |
| 3183 | reason: This label will be added to the results by the count_values() call. |
| 3184 | kind: guaranteed |
| 3185 | fragment: |
| 3186 | start: 0 |
| 3187 | end: 38 |
| 3188 | returns: vector |
| 3189 | operations: |
| 3190 | - node: '[*parser.VectorSelector] build_version' |
| 3191 | op: "" |
| 3192 | - args: |
| 3193 | - '"version"' |
| 3194 | node: '[*parser.AggregateExpr] count_values("version", build_version)' |
| 3195 | op: count_values |
| 3196 | position: |
| 3197 | start: 24 |
| 3198 | end: 37 |
| 3199 | type: aggregation |
| 3200 | fixedLabels: true |
| 3201 | |
| 3202 | --- |
| 3203 | |
| 3204 | [TestLabelsSource/58 - 1] |
| 3205 | expr: count_values("version", build_version) without(job) |
| 3206 | output: |
| 3207 | - labels: |
| 3208 | __name__: |
| 3209 | reason: Aggregation removes metric name. |
| 3210 | kind: excluded |
| 3211 | fragment: |
| 3212 | start: 0 |
| 3213 | end: 51 |
| 3214 | job: |
| 3215 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 3216 | kind: excluded |
| 3217 | fragment: |
| 3218 | start: 47 |
| 3219 | end: 50 |
| 3220 | version: |
| 3221 | reason: This label will be added to the results by the count_values() call. |
| 3222 | kind: guaranteed |
| 3223 | fragment: |
| 3224 | start: 0 |
| 3225 | end: 51 |
| 3226 | returns: vector |
| 3227 | operations: |
| 3228 | - node: '[*parser.VectorSelector] build_version' |
| 3229 | op: "" |
| 3230 | - args: |
| 3231 | - '"version"' |
| 3232 | node: '[*parser.AggregateExpr] count_values without (job) ("version", build_version)' |
| 3233 | op: count_values |
| 3234 | position: |
| 3235 | start: 24 |
| 3236 | end: 37 |
| 3237 | type: aggregation |
| 3238 | |
| 3239 | --- |
| 3240 | |
| 3241 | [TestLabelsSource/59 - 1] |
| 3242 | expr: count_values("version", build_version{job="foo"}) without(job) |
| 3243 | output: |
| 3244 | - labels: |
| 3245 | __name__: |
| 3246 | reason: Aggregation removes metric name. |
| 3247 | kind: excluded |
| 3248 | fragment: |
| 3249 | start: 0 |
| 3250 | end: 62 |
| 3251 | job: |
| 3252 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 3253 | kind: excluded |
| 3254 | fragment: |
| 3255 | start: 58 |
| 3256 | end: 61 |
| 3257 | version: |
| 3258 | reason: This label will be added to the results by the count_values() call. |
| 3259 | kind: guaranteed |
| 3260 | fragment: |
| 3261 | start: 0 |
| 3262 | end: 62 |
| 3263 | returns: vector |
| 3264 | operations: |
| 3265 | - node: '[*parser.VectorSelector] build_version{job="foo"}' |
| 3266 | op: "" |
| 3267 | - args: |
| 3268 | - '"version"' |
| 3269 | node: '[*parser.AggregateExpr] count_values without (job) ("version", build_version{job="foo"})' |
| 3270 | op: count_values |
| 3271 | position: |
| 3272 | start: 24 |
| 3273 | end: 48 |
| 3274 | type: aggregation |
| 3275 | |
| 3276 | --- |
| 3277 | |
| 3278 | [TestLabelsSource/60 - 1] |
| 3279 | expr: count_values("version", build_version) by(job) |
| 3280 | output: |
| 3281 | - labels: |
| 3282 | "": |
| 3283 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 3284 | kind: excluded |
| 3285 | fragment: |
| 3286 | start: 39 |
| 3287 | end: 41 |
| 3288 | __name__: |
| 3289 | reason: Aggregation removes metric name. |
| 3290 | kind: excluded |
| 3291 | fragment: |
| 3292 | start: 0 |
| 3293 | end: 46 |
| 3294 | job: |
| 3295 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 3296 | kind: included |
| 3297 | fragment: |
| 3298 | start: 42 |
| 3299 | end: 45 |
| 3300 | version: |
| 3301 | reason: This label will be added to the results by the count_values() call. |
| 3302 | kind: guaranteed |
| 3303 | fragment: |
| 3304 | start: 0 |
| 3305 | end: 46 |
| 3306 | returns: vector |
| 3307 | operations: |
| 3308 | - node: '[*parser.VectorSelector] build_version' |
| 3309 | op: "" |
| 3310 | - args: |
| 3311 | - '"version"' |
| 3312 | node: '[*parser.AggregateExpr] count_values by (job) ("version", build_version)' |
| 3313 | op: count_values |
| 3314 | usedLabels: |
| 3315 | - job |
| 3316 | position: |
| 3317 | start: 24 |
| 3318 | end: 37 |
| 3319 | type: aggregation |
| 3320 | fixedLabels: true |
| 3321 | |
| 3322 | --- |
| 3323 | |
| 3324 | [TestLabelsSource/61 - 1] |
| 3325 | expr: topk(10, foo{job="myjob"}) > 10 |
| 3326 | output: |
| 3327 | - labels: |
| 3328 | job: |
| 3329 | reason: Query will only return series where these labels are present. |
| 3330 | kind: guaranteed |
| 3331 | fragment: |
| 3332 | start: 9 |
| 3333 | end: 25 |
| 3334 | returns: vector |
| 3335 | operations: |
| 3336 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 3337 | op: "" |
| 3338 | - args: |
| 3339 | - "10" |
| 3340 | node: '[*parser.AggregateExpr] topk(10, foo{job="myjob"})' |
| 3341 | op: topk |
| 3342 | indirect: |
| 3343 | - src: |
| 3344 | labels: |
| 3345 | "": |
| 3346 | reason: This query returns a number value with no labels. |
| 3347 | kind: excluded |
| 3348 | fragment: |
| 3349 | start: 29 |
| 3350 | end: 31 |
| 3351 | returns: scalar |
| 3352 | returnInfo: |
| 3353 | logicalexpr: "" |
| 3354 | valueposition: |
| 3355 | start: 29 |
| 3356 | end: 31 |
| 3357 | returnednumber: 10 |
| 3358 | alwaysreturns: true |
| 3359 | knownreturn: true |
| 3360 | isreturnbool: false |
| 3361 | position: |
| 3362 | start: 29 |
| 3363 | end: 31 |
| 3364 | type: number |
| 3365 | fixedLabels: true |
| 3366 | op: 57388 |
| 3367 | side: 1 |
| 3368 | condition: |
| 3369 | op: 57388 |
| 3370 | value: 10 |
| 3371 | present: true |
| 3372 | knownValue: true |
| 3373 | position: |
| 3374 | start: 9 |
| 3375 | end: 25 |
| 3376 | type: aggregation |
| 3377 | |
| 3378 | --- |
| 3379 | |
| 3380 | [TestLabelsSource/62 - 1] |
| 3381 | expr: topk(10, foo or bar) |
| 3382 | output: |
| 3383 | - returns: vector |
| 3384 | operations: |
| 3385 | - node: '[*parser.VectorSelector] foo' |
| 3386 | op: "" |
| 3387 | - args: |
| 3388 | - "10" |
| 3389 | node: '[*parser.AggregateExpr] topk(10, foo or bar)' |
| 3390 | op: topk |
| 3391 | position: |
| 3392 | start: 9 |
| 3393 | end: 12 |
| 3394 | type: aggregation |
| 3395 | - returns: vector |
| 3396 | operations: |
| 3397 | - node: '[*parser.VectorSelector] bar' |
| 3398 | op: "" |
| 3399 | - args: |
| 3400 | - "10" |
| 3401 | node: '[*parser.AggregateExpr] topk(10, foo or bar)' |
| 3402 | op: topk |
| 3403 | position: |
| 3404 | start: 16 |
| 3405 | end: 19 |
| 3406 | type: aggregation |
| 3407 | |
| 3408 | --- |
| 3409 | |
| 3410 | [TestLabelsSource/63 - 1] |
| 3411 | expr: rate(foo[10m]) |
| 3412 | output: |
| 3413 | - returns: vector |
| 3414 | operations: |
| 3415 | - node: '[*parser.MatrixSelector] foo[10m]' |
| 3416 | op: "" |
| 3417 | - node: '[*parser.VectorSelector] foo' |
| 3418 | op: "" |
| 3419 | - node: '[*parser.Call] rate(foo[10m])' |
| 3420 | op: rate |
| 3421 | position: |
| 3422 | start: 5 |
| 3423 | end: 13 |
| 3424 | type: function |
| 3425 | |
| 3426 | --- |
| 3427 | |
| 3428 | [TestLabelsSource/64 - 1] |
| 3429 | expr: sum(rate(foo[10m])) without(instance) |
| 3430 | output: |
| 3431 | - labels: |
| 3432 | __name__: |
| 3433 | reason: Aggregation removes metric name. |
| 3434 | kind: excluded |
| 3435 | fragment: |
| 3436 | start: 0 |
| 3437 | end: 37 |
| 3438 | instance: |
| 3439 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 3440 | kind: excluded |
| 3441 | fragment: |
| 3442 | start: 28 |
| 3443 | end: 36 |
| 3444 | returns: vector |
| 3445 | operations: |
| 3446 | - node: '[*parser.MatrixSelector] foo[10m]' |
| 3447 | op: "" |
| 3448 | - node: '[*parser.VectorSelector] foo' |
| 3449 | op: "" |
| 3450 | - node: '[*parser.Call] rate(foo[10m])' |
| 3451 | op: rate |
| 3452 | - node: '[*parser.AggregateExpr] sum without (instance) (rate(foo[10m]))' |
| 3453 | op: sum |
| 3454 | position: |
| 3455 | start: 9 |
| 3456 | end: 17 |
| 3457 | type: aggregation |
| 3458 | |
| 3459 | --- |
| 3460 | |
| 3461 | [TestLabelsSource/65 - 1] |
| 3462 | expr: foo{job="foo"} / bar |
| 3463 | output: |
| 3464 | - labels: |
| 3465 | __name__: |
| 3466 | reason: Binary operation between two vectors removes metric names. |
| 3467 | kind: excluded |
| 3468 | fragment: |
| 3469 | start: 0 |
| 3470 | end: 20 |
| 3471 | job: |
| 3472 | reason: Query will only return series where these labels are present. |
| 3473 | kind: guaranteed |
| 3474 | fragment: |
| 3475 | start: 0 |
| 3476 | end: 14 |
| 3477 | returns: vector |
| 3478 | operations: |
| 3479 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 3480 | op: "" |
| 3481 | joins: |
| 3482 | - addedlabels: [] |
| 3483 | depth: 0 |
| 3484 | ison: false |
| 3485 | matchinglabels: [] |
| 3486 | op: / |
| 3487 | src: |
| 3488 | returns: vector |
| 3489 | operations: |
| 3490 | - node: '[*parser.VectorSelector] bar' |
| 3491 | op: "" |
| 3492 | position: |
| 3493 | start: 17 |
| 3494 | end: 20 |
| 3495 | type: selector |
| 3496 | usedLabels: |
| 3497 | - job |
| 3498 | position: |
| 3499 | start: 0 |
| 3500 | end: 14 |
| 3501 | type: selector |
| 3502 | |
| 3503 | --- |
| 3504 | |
| 3505 | [TestLabelsSource/66 - 1] |
| 3506 | expr: foo{job="foo"} * on(instance) bar |
| 3507 | output: |
| 3508 | - labels: |
| 3509 | "": |
| 3510 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 3511 | kind: excluded |
| 3512 | fragment: |
| 3513 | start: 17 |
| 3514 | end: 29 |
| 3515 | __name__: |
| 3516 | reason: Binary operation between two vectors removes metric names. |
| 3517 | kind: excluded |
| 3518 | fragment: |
| 3519 | start: 0 |
| 3520 | end: 33 |
| 3521 | instance: |
| 3522 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 3523 | kind: included |
| 3524 | fragment: |
| 3525 | start: 20 |
| 3526 | end: 28 |
| 3527 | job: |
| 3528 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 3529 | kind: excluded |
| 3530 | fragment: |
| 3531 | start: 17 |
| 3532 | end: 29 |
| 3533 | returns: vector |
| 3534 | operations: |
| 3535 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 3536 | op: "" |
| 3537 | joins: |
| 3538 | - addedlabels: [] |
| 3539 | depth: 0 |
| 3540 | ison: true |
| 3541 | matchinglabels: |
| 3542 | - instance |
| 3543 | op: '*' |
| 3544 | src: |
| 3545 | returns: vector |
| 3546 | operations: |
| 3547 | - node: '[*parser.VectorSelector] bar' |
| 3548 | op: "" |
| 3549 | position: |
| 3550 | start: 30 |
| 3551 | end: 33 |
| 3552 | type: selector |
| 3553 | usedLabels: |
| 3554 | - instance |
| 3555 | position: |
| 3556 | start: 0 |
| 3557 | end: 14 |
| 3558 | type: selector |
| 3559 | fixedLabels: true |
| 3560 | |
| 3561 | --- |
| 3562 | |
| 3563 | [TestLabelsSource/67 - 1] |
| 3564 | expr: foo{job="foo"} * on(instance) group_left(bar) bar |
| 3565 | output: |
| 3566 | - labels: |
| 3567 | __name__: |
| 3568 | reason: Binary operation between two vectors removes metric names. |
| 3569 | kind: excluded |
| 3570 | fragment: |
| 3571 | start: 0 |
| 3572 | end: 49 |
| 3573 | bar: |
| 3574 | 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. |
| 3575 | kind: included |
| 3576 | fragment: |
| 3577 | start: 41 |
| 3578 | end: 44 |
| 3579 | instance: |
| 3580 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 3581 | kind: included |
| 3582 | fragment: |
| 3583 | start: 20 |
| 3584 | end: 28 |
| 3585 | job: |
| 3586 | reason: Query will only return series where these labels are present. |
| 3587 | kind: guaranteed |
| 3588 | fragment: |
| 3589 | start: 0 |
| 3590 | end: 14 |
| 3591 | returns: vector |
| 3592 | operations: |
| 3593 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 3594 | op: "" |
| 3595 | joins: |
| 3596 | - addedlabels: |
| 3597 | - bar |
| 3598 | depth: 0 |
| 3599 | ison: true |
| 3600 | matchinglabels: |
| 3601 | - instance |
| 3602 | op: '*' |
| 3603 | src: |
| 3604 | returns: vector |
| 3605 | operations: |
| 3606 | - node: '[*parser.VectorSelector] bar' |
| 3607 | op: "" |
| 3608 | position: |
| 3609 | start: 46 |
| 3610 | end: 49 |
| 3611 | type: selector |
| 3612 | usedLabels: |
| 3613 | - instance |
| 3614 | position: |
| 3615 | start: 0 |
| 3616 | end: 14 |
| 3617 | type: selector |
| 3618 | |
| 3619 | --- |
| 3620 | |
| 3621 | [TestLabelsSource/68 - 1] |
| 3622 | expr: foo{job="foo"} * on(instance) group_left(cluster) bar{cluster="bar", ignored="true"} |
| 3623 | output: |
| 3624 | - labels: |
| 3625 | __name__: |
| 3626 | reason: Binary operation between two vectors removes metric names. |
| 3627 | kind: excluded |
| 3628 | fragment: |
| 3629 | start: 0 |
| 3630 | end: 84 |
| 3631 | cluster: |
| 3632 | 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. |
| 3633 | kind: included |
| 3634 | fragment: |
| 3635 | start: 41 |
| 3636 | end: 48 |
| 3637 | instance: |
| 3638 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 3639 | kind: included |
| 3640 | fragment: |
| 3641 | start: 20 |
| 3642 | end: 28 |
| 3643 | job: |
| 3644 | reason: Query will only return series where these labels are present. |
| 3645 | kind: guaranteed |
| 3646 | fragment: |
| 3647 | start: 0 |
| 3648 | end: 14 |
| 3649 | returns: vector |
| 3650 | operations: |
| 3651 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 3652 | op: "" |
| 3653 | joins: |
| 3654 | - addedlabels: |
| 3655 | - cluster |
| 3656 | depth: 0 |
| 3657 | ison: true |
| 3658 | matchinglabels: |
| 3659 | - instance |
| 3660 | op: '*' |
| 3661 | src: |
| 3662 | labels: |
| 3663 | cluster: |
| 3664 | reason: Query will only return series where these labels are present. |
| 3665 | kind: guaranteed |
| 3666 | fragment: |
| 3667 | start: 50 |
| 3668 | end: 84 |
| 3669 | ignored: |
| 3670 | reason: Query will only return series where these labels are present. |
| 3671 | kind: guaranteed |
| 3672 | fragment: |
| 3673 | start: 50 |
| 3674 | end: 84 |
| 3675 | returns: vector |
| 3676 | operations: |
| 3677 | - node: '[*parser.VectorSelector] bar{cluster="bar",ignored="true"}' |
| 3678 | op: "" |
| 3679 | position: |
| 3680 | start: 50 |
| 3681 | end: 84 |
| 3682 | type: selector |
| 3683 | usedLabels: |
| 3684 | - instance |
| 3685 | position: |
| 3686 | start: 0 |
| 3687 | end: 14 |
| 3688 | type: selector |
| 3689 | |
| 3690 | --- |
| 3691 | |
| 3692 | [TestLabelsSource/69 - 1] |
| 3693 | expr: foo{job="foo", ignored="true"} * on(instance) group_right(job) bar{cluster="bar"} |
| 3694 | output: |
| 3695 | - labels: |
| 3696 | __name__: |
| 3697 | reason: Binary operation between two vectors removes metric names. |
| 3698 | kind: excluded |
| 3699 | fragment: |
| 3700 | start: 0 |
| 3701 | end: 81 |
| 3702 | cluster: |
| 3703 | reason: Query will only return series where these labels are present. |
| 3704 | kind: guaranteed |
| 3705 | fragment: |
| 3706 | start: 63 |
| 3707 | end: 81 |
| 3708 | instance: |
| 3709 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 3710 | kind: included |
| 3711 | fragment: |
| 3712 | start: 36 |
| 3713 | end: 44 |
| 3714 | job: |
| 3715 | 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. |
| 3716 | kind: included |
| 3717 | fragment: |
| 3718 | start: 58 |
| 3719 | end: 61 |
| 3720 | returns: vector |
| 3721 | operations: |
| 3722 | - node: '[*parser.VectorSelector] bar{cluster="bar"}' |
| 3723 | op: "" |
| 3724 | joins: |
| 3725 | - addedlabels: |
| 3726 | - job |
| 3727 | depth: 0 |
| 3728 | ison: true |
| 3729 | matchinglabels: |
| 3730 | - instance |
| 3731 | op: '*' |
| 3732 | src: |
| 3733 | labels: |
| 3734 | ignored: |
| 3735 | reason: Query will only return series where these labels are present. |
| 3736 | kind: guaranteed |
| 3737 | fragment: |
| 3738 | start: 0 |
| 3739 | end: 30 |
| 3740 | job: |
| 3741 | reason: Query will only return series where these labels are present. |
| 3742 | kind: guaranteed |
| 3743 | fragment: |
| 3744 | start: 0 |
| 3745 | end: 30 |
| 3746 | returns: vector |
| 3747 | operations: |
| 3748 | - node: '[*parser.VectorSelector] foo{ignored="true",job="foo"}' |
| 3749 | op: "" |
| 3750 | position: |
| 3751 | start: 0 |
| 3752 | end: 30 |
| 3753 | type: selector |
| 3754 | usedLabels: |
| 3755 | - instance |
| 3756 | position: |
| 3757 | start: 63 |
| 3758 | end: 81 |
| 3759 | type: selector |
| 3760 | |
| 3761 | --- |
| 3762 | |
| 3763 | [TestLabelsSource/70 - 1] |
| 3764 | expr: count(foo / bar) |
| 3765 | output: |
| 3766 | - labels: |
| 3767 | "": |
| 3768 | reason: Query is using aggregation that removes all labels. |
| 3769 | kind: excluded |
| 3770 | fragment: |
| 3771 | start: 0 |
| 3772 | end: 5 |
| 3773 | __name__: |
| 3774 | reason: Aggregation removes metric name. |
| 3775 | kind: excluded |
| 3776 | fragment: |
| 3777 | start: 0 |
| 3778 | end: 16 |
| 3779 | returns: vector |
| 3780 | operations: |
| 3781 | - node: '[*parser.VectorSelector] foo' |
| 3782 | op: "" |
| 3783 | - node: '[*parser.AggregateExpr] count(foo / bar)' |
| 3784 | op: count |
| 3785 | joins: |
| 3786 | - addedlabels: [] |
| 3787 | depth: 1 |
| 3788 | ison: false |
| 3789 | matchinglabels: [] |
| 3790 | op: / |
| 3791 | src: |
| 3792 | returns: vector |
| 3793 | operations: |
| 3794 | - node: '[*parser.VectorSelector] bar' |
| 3795 | op: "" |
| 3796 | position: |
| 3797 | start: 12 |
| 3798 | end: 15 |
| 3799 | type: selector |
| 3800 | position: |
| 3801 | start: 6 |
| 3802 | end: 9 |
| 3803 | type: aggregation |
| 3804 | fixedLabels: true |
| 3805 | |
| 3806 | --- |
| 3807 | |
| 3808 | [TestLabelsSource/71 - 1] |
| 3809 | expr: count(up{job="a"} / on () up{job="b"}) |
| 3810 | output: |
| 3811 | - labels: |
| 3812 | "": |
| 3813 | reason: Query is using aggregation that removes all labels. |
| 3814 | kind: excluded |
| 3815 | fragment: |
| 3816 | start: 0 |
| 3817 | end: 5 |
| 3818 | __name__: |
| 3819 | reason: Aggregation removes metric name. |
| 3820 | kind: excluded |
| 3821 | fragment: |
| 3822 | start: 0 |
| 3823 | end: 38 |
| 3824 | job: |
| 3825 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 3826 | kind: excluded |
| 3827 | fragment: |
| 3828 | start: 20 |
| 3829 | end: 25 |
| 3830 | returns: vector |
| 3831 | operations: |
| 3832 | - node: '[*parser.VectorSelector] up{job="a"}' |
| 3833 | op: "" |
| 3834 | - node: '[*parser.AggregateExpr] count(up{job="a"} / on () up{job="b"})' |
| 3835 | op: count |
| 3836 | joins: |
| 3837 | - addedlabels: [] |
| 3838 | depth: 1 |
| 3839 | ison: true |
| 3840 | matchinglabels: [] |
| 3841 | op: / |
| 3842 | src: |
| 3843 | labels: |
| 3844 | job: |
| 3845 | reason: Query will only return series where these labels are present. |
| 3846 | kind: guaranteed |
| 3847 | fragment: |
| 3848 | start: 26 |
| 3849 | end: 37 |
| 3850 | returns: vector |
| 3851 | operations: |
| 3852 | - node: '[*parser.VectorSelector] up{job="b"}' |
| 3853 | op: "" |
| 3854 | position: |
| 3855 | start: 26 |
| 3856 | end: 37 |
| 3857 | type: selector |
| 3858 | position: |
| 3859 | start: 6 |
| 3860 | end: 17 |
| 3861 | type: aggregation |
| 3862 | fixedLabels: true |
| 3863 | |
| 3864 | --- |
| 3865 | |
| 3866 | [TestLabelsSource/72 - 1] |
| 3867 | expr: count(up{job="a"} / on (env) up{job="b"}) |
| 3868 | output: |
| 3869 | - labels: |
| 3870 | "": |
| 3871 | reason: Query is using aggregation that removes all labels. |
| 3872 | kind: excluded |
| 3873 | fragment: |
| 3874 | start: 0 |
| 3875 | end: 5 |
| 3876 | __name__: |
| 3877 | reason: Aggregation removes metric name. |
| 3878 | kind: excluded |
| 3879 | fragment: |
| 3880 | start: 0 |
| 3881 | end: 41 |
| 3882 | env: |
| 3883 | reason: Query is using aggregation that removes all labels. |
| 3884 | kind: excluded |
| 3885 | fragment: |
| 3886 | start: 0 |
| 3887 | end: 5 |
| 3888 | job: |
| 3889 | reason: Query is using one-to-one vector matching with `on(env)`, only labels included inside `on(...)` will be present on the results. |
| 3890 | kind: excluded |
| 3891 | fragment: |
| 3892 | start: 20 |
| 3893 | end: 28 |
| 3894 | returns: vector |
| 3895 | operations: |
| 3896 | - node: '[*parser.VectorSelector] up{job="a"}' |
| 3897 | op: "" |
| 3898 | - node: '[*parser.AggregateExpr] count(up{job="a"} / on (env) up{job="b"})' |
| 3899 | op: count |
| 3900 | joins: |
| 3901 | - addedlabels: [] |
| 3902 | depth: 1 |
| 3903 | ison: true |
| 3904 | matchinglabels: |
| 3905 | - env |
| 3906 | op: / |
| 3907 | src: |
| 3908 | labels: |
| 3909 | job: |
| 3910 | reason: Query will only return series where these labels are present. |
| 3911 | kind: guaranteed |
| 3912 | fragment: |
| 3913 | start: 29 |
| 3914 | end: 40 |
| 3915 | returns: vector |
| 3916 | operations: |
| 3917 | - node: '[*parser.VectorSelector] up{job="b"}' |
| 3918 | op: "" |
| 3919 | position: |
| 3920 | start: 29 |
| 3921 | end: 40 |
| 3922 | type: selector |
| 3923 | position: |
| 3924 | start: 6 |
| 3925 | end: 17 |
| 3926 | type: aggregation |
| 3927 | fixedLabels: true |
| 3928 | |
| 3929 | --- |
| 3930 | |
| 3931 | [TestLabelsSource/73 - 1] |
| 3932 | expr: foo{job="foo", instance="1"} and bar |
| 3933 | output: |
| 3934 | - labels: |
| 3935 | instance: |
| 3936 | reason: Query will only return series where these labels are present. |
| 3937 | kind: guaranteed |
| 3938 | fragment: |
| 3939 | start: 0 |
| 3940 | end: 28 |
| 3941 | job: |
| 3942 | reason: Query will only return series where these labels are present. |
| 3943 | kind: guaranteed |
| 3944 | fragment: |
| 3945 | start: 0 |
| 3946 | end: 28 |
| 3947 | returns: vector |
| 3948 | operations: |
| 3949 | - node: '[*parser.VectorSelector] foo{instance="1",job="foo"}' |
| 3950 | op: "" |
| 3951 | joins: |
| 3952 | - addedlabels: [] |
| 3953 | depth: 0 |
| 3954 | ison: false |
| 3955 | matchinglabels: [] |
| 3956 | op: and |
| 3957 | src: |
| 3958 | returns: vector |
| 3959 | operations: |
| 3960 | - node: '[*parser.VectorSelector] bar' |
| 3961 | op: "" |
| 3962 | position: |
| 3963 | start: 33 |
| 3964 | end: 36 |
| 3965 | type: selector |
| 3966 | usedLabels: |
| 3967 | - instance |
| 3968 | - job |
| 3969 | position: |
| 3970 | start: 0 |
| 3971 | end: 28 |
| 3972 | type: selector |
| 3973 | |
| 3974 | --- |
| 3975 | |
| 3976 | [TestLabelsSource/74 - 1] |
| 3977 | expr: foo{job="foo", instance="1"} and on(cluster) bar |
| 3978 | output: |
| 3979 | - labels: |
| 3980 | cluster: |
| 3981 | 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. |
| 3982 | kind: included |
| 3983 | fragment: |
| 3984 | start: 36 |
| 3985 | end: 43 |
| 3986 | instance: |
| 3987 | reason: Query will only return series where these labels are present. |
| 3988 | kind: guaranteed |
| 3989 | fragment: |
| 3990 | start: 0 |
| 3991 | end: 28 |
| 3992 | job: |
| 3993 | reason: Query will only return series where these labels are present. |
| 3994 | kind: guaranteed |
| 3995 | fragment: |
| 3996 | start: 0 |
| 3997 | end: 28 |
| 3998 | returns: vector |
| 3999 | operations: |
| 4000 | - node: '[*parser.VectorSelector] foo{instance="1",job="foo"}' |
| 4001 | op: "" |
| 4002 | joins: |
| 4003 | - addedlabels: [] |
| 4004 | depth: 0 |
| 4005 | ison: true |
| 4006 | matchinglabels: |
| 4007 | - cluster |
| 4008 | op: and |
| 4009 | src: |
| 4010 | returns: vector |
| 4011 | operations: |
| 4012 | - node: '[*parser.VectorSelector] bar' |
| 4013 | op: "" |
| 4014 | position: |
| 4015 | start: 45 |
| 4016 | end: 48 |
| 4017 | type: selector |
| 4018 | usedLabels: |
| 4019 | - cluster |
| 4020 | position: |
| 4021 | start: 0 |
| 4022 | end: 28 |
| 4023 | type: selector |
| 4024 | |
| 4025 | --- |
| 4026 | |
| 4027 | [TestLabelsSource/75 - 1] |
| 4028 | expr: topk(10, foo) |
| 4029 | output: |
| 4030 | - returns: vector |
| 4031 | operations: |
| 4032 | - node: '[*parser.VectorSelector] foo' |
| 4033 | op: "" |
| 4034 | - args: |
| 4035 | - "10" |
| 4036 | node: '[*parser.AggregateExpr] topk(10, foo)' |
| 4037 | op: topk |
| 4038 | position: |
| 4039 | start: 9 |
| 4040 | end: 12 |
| 4041 | type: aggregation |
| 4042 | |
| 4043 | --- |
| 4044 | |
| 4045 | [TestLabelsSource/76 - 1] |
| 4046 | expr: topk(10, foo) without(cluster) |
| 4047 | output: |
| 4048 | - returns: vector |
| 4049 | operations: |
| 4050 | - node: '[*parser.VectorSelector] foo' |
| 4051 | op: "" |
| 4052 | - args: |
| 4053 | - "10" |
| 4054 | node: '[*parser.AggregateExpr] topk without (cluster) (10, foo)' |
| 4055 | op: topk |
| 4056 | position: |
| 4057 | start: 9 |
| 4058 | end: 12 |
| 4059 | type: aggregation |
| 4060 | |
| 4061 | --- |
| 4062 | |
| 4063 | [TestLabelsSource/77 - 1] |
| 4064 | expr: topk(10, foo) by(cluster) |
| 4065 | output: |
| 4066 | - returns: vector |
| 4067 | operations: |
| 4068 | - node: '[*parser.VectorSelector] foo' |
| 4069 | op: "" |
| 4070 | - args: |
| 4071 | - "10" |
| 4072 | node: '[*parser.AggregateExpr] topk by (cluster) (10, foo)' |
| 4073 | op: topk |
| 4074 | position: |
| 4075 | start: 9 |
| 4076 | end: 12 |
| 4077 | type: aggregation |
| 4078 | |
| 4079 | --- |
| 4080 | |
| 4081 | [TestLabelsSource/78 - 1] |
| 4082 | expr: bottomk(10, sum(rate(foo[5m])) without(job)) |
| 4083 | output: |
| 4084 | - labels: |
| 4085 | __name__: |
| 4086 | reason: Aggregation removes metric name. |
| 4087 | kind: excluded |
| 4088 | fragment: |
| 4089 | start: 12 |
| 4090 | end: 43 |
| 4091 | job: |
| 4092 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 4093 | kind: excluded |
| 4094 | fragment: |
| 4095 | start: 39 |
| 4096 | end: 42 |
| 4097 | returns: vector |
| 4098 | operations: |
| 4099 | - node: '[*parser.MatrixSelector] foo[5m]' |
| 4100 | op: "" |
| 4101 | - node: '[*parser.VectorSelector] foo' |
| 4102 | op: "" |
| 4103 | - node: '[*parser.Call] rate(foo[5m])' |
| 4104 | op: rate |
| 4105 | - node: '[*parser.AggregateExpr] sum without (job) (rate(foo[5m]))' |
| 4106 | op: sum |
| 4107 | - args: |
| 4108 | - "10" |
| 4109 | node: '[*parser.AggregateExpr] bottomk(10, sum without (job) (rate(foo[5m])))' |
| 4110 | op: bottomk |
| 4111 | position: |
| 4112 | start: 21 |
| 4113 | end: 28 |
| 4114 | type: aggregation |
| 4115 | |
| 4116 | --- |
| 4117 | |
| 4118 | [TestLabelsSource/79 - 1] |
| 4119 | expr: foo or bar |
| 4120 | output: |
| 4121 | - returns: vector |
| 4122 | operations: |
| 4123 | - node: '[*parser.VectorSelector] foo' |
| 4124 | op: "" |
| 4125 | position: |
| 4126 | start: 0 |
| 4127 | end: 3 |
| 4128 | type: selector |
| 4129 | - returns: vector |
| 4130 | operations: |
| 4131 | - node: '[*parser.VectorSelector] bar' |
| 4132 | op: "" |
| 4133 | position: |
| 4134 | start: 7 |
| 4135 | end: 10 |
| 4136 | type: selector |
| 4137 | |
| 4138 | --- |
| 4139 | |
| 4140 | [TestLabelsSource/80 - 1] |
| 4141 | expr: foo or bar or baz |
| 4142 | output: |
| 4143 | - returns: vector |
| 4144 | operations: |
| 4145 | - node: '[*parser.VectorSelector] foo' |
| 4146 | op: "" |
| 4147 | position: |
| 4148 | start: 0 |
| 4149 | end: 3 |
| 4150 | type: selector |
| 4151 | - returns: vector |
| 4152 | operations: |
| 4153 | - node: '[*parser.VectorSelector] bar' |
| 4154 | op: "" |
| 4155 | position: |
| 4156 | start: 7 |
| 4157 | end: 10 |
| 4158 | type: selector |
| 4159 | - returns: vector |
| 4160 | operations: |
| 4161 | - node: '[*parser.VectorSelector] baz' |
| 4162 | op: "" |
| 4163 | position: |
| 4164 | start: 14 |
| 4165 | end: 17 |
| 4166 | type: selector |
| 4167 | |
| 4168 | --- |
| 4169 | |
| 4170 | [TestLabelsSource/81 - 1] |
| 4171 | expr: (foo or bar) or baz |
| 4172 | output: |
| 4173 | - returns: vector |
| 4174 | operations: |
| 4175 | - node: '[*parser.VectorSelector] foo' |
| 4176 | op: "" |
| 4177 | position: |
| 4178 | start: 1 |
| 4179 | end: 4 |
| 4180 | type: selector |
| 4181 | - returns: vector |
| 4182 | operations: |
| 4183 | - node: '[*parser.VectorSelector] bar' |
| 4184 | op: "" |
| 4185 | position: |
| 4186 | start: 8 |
| 4187 | end: 11 |
| 4188 | type: selector |
| 4189 | - returns: vector |
| 4190 | operations: |
| 4191 | - node: '[*parser.VectorSelector] baz' |
| 4192 | op: "" |
| 4193 | position: |
| 4194 | start: 16 |
| 4195 | end: 19 |
| 4196 | type: selector |
| 4197 | |
| 4198 | --- |
| 4199 | |
| 4200 | [TestLabelsSource/82 - 1] |
| 4201 | expr: foo unless bar |
| 4202 | output: |
| 4203 | - returns: vector |
| 4204 | operations: |
| 4205 | - node: '[*parser.VectorSelector] foo' |
| 4206 | op: "" |
| 4207 | unless: |
| 4208 | - ison: false |
| 4209 | matchinglabels: [] |
| 4210 | src: |
| 4211 | returns: vector |
| 4212 | operations: |
| 4213 | - node: '[*parser.VectorSelector] bar' |
| 4214 | op: "" |
| 4215 | position: |
| 4216 | start: 11 |
| 4217 | end: 14 |
| 4218 | type: selector |
| 4219 | position: |
| 4220 | start: 0 |
| 4221 | end: 3 |
| 4222 | type: selector |
| 4223 | |
| 4224 | --- |
| 4225 | |
| 4226 | [TestLabelsSource/83 - 1] |
| 4227 | expr: foo unless bar > 5 |
| 4228 | output: |
| 4229 | - returns: vector |
| 4230 | operations: |
| 4231 | - node: '[*parser.VectorSelector] foo' |
| 4232 | op: "" |
| 4233 | unless: |
| 4234 | - ison: false |
| 4235 | matchinglabels: [] |
| 4236 | src: |
| 4237 | returns: vector |
| 4238 | operations: |
| 4239 | - node: '[*parser.VectorSelector] bar' |
| 4240 | op: "" |
| 4241 | indirect: |
| 4242 | - src: |
| 4243 | labels: |
| 4244 | "": |
| 4245 | reason: This query returns a number value with no labels. |
| 4246 | kind: excluded |
| 4247 | fragment: |
| 4248 | start: 17 |
| 4249 | end: 18 |
| 4250 | returns: scalar |
| 4251 | returnInfo: |
| 4252 | logicalexpr: "" |
| 4253 | valueposition: |
| 4254 | start: 17 |
| 4255 | end: 18 |
| 4256 | returnednumber: 5 |
| 4257 | alwaysreturns: true |
| 4258 | knownreturn: true |
| 4259 | isreturnbool: false |
| 4260 | position: |
| 4261 | start: 17 |
| 4262 | end: 18 |
| 4263 | type: number |
| 4264 | fixedLabels: true |
| 4265 | op: 57388 |
| 4266 | side: 1 |
| 4267 | condition: |
| 4268 | op: 57388 |
| 4269 | value: 5 |
| 4270 | present: true |
| 4271 | knownValue: true |
| 4272 | position: |
| 4273 | start: 11 |
| 4274 | end: 14 |
| 4275 | type: selector |
| 4276 | position: |
| 4277 | start: 0 |
| 4278 | end: 3 |
| 4279 | type: selector |
| 4280 | |
| 4281 | --- |
| 4282 | |
| 4283 | [TestLabelsSource/84 - 1] |
| 4284 | expr: foo unless bar unless baz |
| 4285 | output: |
| 4286 | - returns: vector |
| 4287 | operations: |
| 4288 | - node: '[*parser.VectorSelector] foo' |
| 4289 | op: "" |
| 4290 | unless: |
| 4291 | - ison: false |
| 4292 | matchinglabels: [] |
| 4293 | src: |
| 4294 | returns: vector |
| 4295 | operations: |
| 4296 | - node: '[*parser.VectorSelector] bar' |
| 4297 | op: "" |
| 4298 | position: |
| 4299 | start: 11 |
| 4300 | end: 14 |
| 4301 | type: selector |
| 4302 | - ison: false |
| 4303 | matchinglabels: [] |
| 4304 | src: |
| 4305 | returns: vector |
| 4306 | operations: |
| 4307 | - node: '[*parser.VectorSelector] baz' |
| 4308 | op: "" |
| 4309 | position: |
| 4310 | start: 22 |
| 4311 | end: 25 |
| 4312 | type: selector |
| 4313 | position: |
| 4314 | start: 0 |
| 4315 | end: 3 |
| 4316 | type: selector |
| 4317 | |
| 4318 | --- |
| 4319 | |
| 4320 | [TestLabelsSource/85 - 1] |
| 4321 | expr: count(sum(up{job="foo", cluster="dev"}) by(job, cluster) == 0) without(job, cluster) |
| 4322 | output: |
| 4323 | - labels: |
| 4324 | "": |
| 4325 | reason: Query is using aggregation with `by(job, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 4326 | kind: excluded |
| 4327 | fragment: |
| 4328 | start: 40 |
| 4329 | end: 42 |
| 4330 | __name__: |
| 4331 | reason: Aggregation removes metric name. |
| 4332 | kind: excluded |
| 4333 | fragment: |
| 4334 | start: 0 |
| 4335 | end: 84 |
| 4336 | cluster: |
| 4337 | reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results. |
| 4338 | kind: excluded |
| 4339 | fragment: |
| 4340 | start: 76 |
| 4341 | end: 83 |
| 4342 | job: |
| 4343 | reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results. |
| 4344 | kind: excluded |
| 4345 | fragment: |
| 4346 | start: 71 |
| 4347 | end: 74 |
| 4348 | returns: vector |
| 4349 | operations: |
| 4350 | - node: '[*parser.VectorSelector] up{cluster="dev",job="foo"}' |
| 4351 | op: "" |
| 4352 | - node: '[*parser.AggregateExpr] sum by (job, cluster) (up{cluster="dev",job="foo"})' |
| 4353 | op: sum |
| 4354 | - node: '[*parser.AggregateExpr] count without (job, cluster) (sum by (job, cluster) (up{cluster="dev",job="foo"}) == 0)' |
| 4355 | op: count |
| 4356 | indirect: |
| 4357 | - src: |
| 4358 | labels: |
| 4359 | "": |
| 4360 | reason: This query returns a number value with no labels. |
| 4361 | kind: excluded |
| 4362 | fragment: |
| 4363 | start: 60 |
| 4364 | end: 61 |
| 4365 | returns: scalar |
| 4366 | returnInfo: |
| 4367 | logicalexpr: "" |
| 4368 | valueposition: |
| 4369 | start: 60 |
| 4370 | end: 61 |
| 4371 | returnednumber: 0 |
| 4372 | alwaysreturns: true |
| 4373 | knownreturn: true |
| 4374 | isreturnbool: false |
| 4375 | position: |
| 4376 | start: 60 |
| 4377 | end: 61 |
| 4378 | type: number |
| 4379 | fixedLabels: true |
| 4380 | op: 57385 |
| 4381 | side: 1 |
| 4382 | condition: |
| 4383 | op: 57385 |
| 4384 | present: true |
| 4385 | knownValue: true |
| 4386 | position: |
| 4387 | start: 10 |
| 4388 | end: 38 |
| 4389 | type: aggregation |
| 4390 | fixedLabels: true |
| 4391 | |
| 4392 | --- |
| 4393 | |
| 4394 | [TestLabelsSource/86 - 1] |
| 4395 | expr: year() |
| 4396 | output: |
| 4397 | - labels: |
| 4398 | "": |
| 4399 | reason: Calling `year()` with no arguments will return an empty time series with no labels. |
| 4400 | kind: excluded |
| 4401 | fragment: |
| 4402 | start: 0 |
| 4403 | end: 6 |
| 4404 | returns: vector |
| 4405 | operations: |
| 4406 | - node: '[*parser.Call] year()' |
| 4407 | op: year |
| 4408 | returnInfo: |
| 4409 | logicalexpr: "" |
| 4410 | valueposition: |
| 4411 | start: 0 |
| 4412 | end: 0 |
| 4413 | returnednumber: 0 |
| 4414 | alwaysreturns: true |
| 4415 | knownreturn: false |
| 4416 | isreturnbool: false |
| 4417 | position: |
| 4418 | start: 0 |
| 4419 | end: 6 |
| 4420 | type: function |
| 4421 | fixedLabels: true |
| 4422 | |
| 4423 | --- |
| 4424 | |
| 4425 | [TestLabelsSource/87 - 1] |
| 4426 | expr: year(foo) |
| 4427 | output: |
| 4428 | - returns: vector |
| 4429 | operations: |
| 4430 | - node: '[*parser.VectorSelector] foo' |
| 4431 | op: "" |
| 4432 | - node: '[*parser.Call] year(foo)' |
| 4433 | op: year |
| 4434 | position: |
| 4435 | start: 5 |
| 4436 | end: 8 |
| 4437 | type: function |
| 4438 | |
| 4439 | --- |
| 4440 | |
| 4441 | [TestLabelsSource/88 - 1] |
| 4442 | expr: label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3") |
| 4443 | output: |
| 4444 | - labels: |
| 4445 | foo: |
| 4446 | reason: This label will be added to the result by a label_join() call. |
| 4447 | kind: guaranteed |
| 4448 | fragment: |
| 4449 | start: 0 |
| 4450 | end: 95 |
| 4451 | job: |
| 4452 | reason: Query will only return series where these labels are present. |
| 4453 | kind: guaranteed |
| 4454 | fragment: |
| 4455 | start: 11 |
| 4456 | end: 58 |
| 4457 | src1: |
| 4458 | reason: Query will only return series where these labels are present. |
| 4459 | kind: guaranteed |
| 4460 | fragment: |
| 4461 | start: 11 |
| 4462 | end: 58 |
| 4463 | src2: |
| 4464 | reason: Query will only return series where these labels are present. |
| 4465 | kind: guaranteed |
| 4466 | fragment: |
| 4467 | start: 11 |
| 4468 | end: 58 |
| 4469 | src3: |
| 4470 | reason: Query will only return series where these labels are present. |
| 4471 | kind: guaranteed |
| 4472 | fragment: |
| 4473 | start: 11 |
| 4474 | end: 58 |
| 4475 | returns: vector |
| 4476 | operations: |
| 4477 | - node: '[*parser.VectorSelector] up{job="api-server",src1="a",src2="b",src3="c"}' |
| 4478 | op: "" |
| 4479 | - args: |
| 4480 | - '"foo"' |
| 4481 | - '","' |
| 4482 | - '"src1"' |
| 4483 | - '"src2"' |
| 4484 | - '"src3"' |
| 4485 | node: '[*parser.Call] label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")' |
| 4486 | op: label_join |
| 4487 | indirect: |
| 4488 | - src: |
| 4489 | labels: |
| 4490 | "": |
| 4491 | reason: This query returns a string value with no labels. |
| 4492 | kind: excluded |
| 4493 | fragment: |
| 4494 | start: 60 |
| 4495 | end: 65 |
| 4496 | returns: string |
| 4497 | returnInfo: |
| 4498 | logicalexpr: "" |
| 4499 | valueposition: |
| 4500 | start: 0 |
| 4501 | end: 0 |
| 4502 | returnednumber: 0 |
| 4503 | alwaysreturns: true |
| 4504 | knownreturn: false |
| 4505 | isreturnbool: false |
| 4506 | position: |
| 4507 | start: 60 |
| 4508 | end: 65 |
| 4509 | type: string |
| 4510 | fixedLabels: true |
| 4511 | op: 0 |
| 4512 | side: 0 |
| 4513 | - src: |
| 4514 | labels: |
| 4515 | "": |
| 4516 | reason: This query returns a string value with no labels. |
| 4517 | kind: excluded |
| 4518 | fragment: |
| 4519 | start: 67 |
| 4520 | end: 70 |
| 4521 | returns: string |
| 4522 | returnInfo: |
| 4523 | logicalexpr: "" |
| 4524 | valueposition: |
| 4525 | start: 0 |
| 4526 | end: 0 |
| 4527 | returnednumber: 0 |
| 4528 | alwaysreturns: true |
| 4529 | knownreturn: false |
| 4530 | isreturnbool: false |
| 4531 | position: |
| 4532 | start: 67 |
| 4533 | end: 70 |
| 4534 | type: string |
| 4535 | fixedLabels: true |
| 4536 | op: 0 |
| 4537 | side: 0 |
| 4538 | - src: |
| 4539 | labels: |
| 4540 | "": |
| 4541 | reason: This query returns a string value with no labels. |
| 4542 | kind: excluded |
| 4543 | fragment: |
| 4544 | start: 72 |
| 4545 | end: 78 |
| 4546 | returns: string |
| 4547 | returnInfo: |
| 4548 | logicalexpr: "" |
| 4549 | valueposition: |
| 4550 | start: 0 |
| 4551 | end: 0 |
| 4552 | returnednumber: 0 |
| 4553 | alwaysreturns: true |
| 4554 | knownreturn: false |
| 4555 | isreturnbool: false |
| 4556 | position: |
| 4557 | start: 72 |
| 4558 | end: 78 |
| 4559 | type: string |
| 4560 | fixedLabels: true |
| 4561 | op: 0 |
| 4562 | side: 0 |
| 4563 | - src: |
| 4564 | labels: |
| 4565 | "": |
| 4566 | reason: This query returns a string value with no labels. |
| 4567 | kind: excluded |
| 4568 | fragment: |
| 4569 | start: 80 |
| 4570 | end: 86 |
| 4571 | returns: string |
| 4572 | returnInfo: |
| 4573 | logicalexpr: "" |
| 4574 | valueposition: |
| 4575 | start: 0 |
| 4576 | end: 0 |
| 4577 | returnednumber: 0 |
| 4578 | alwaysreturns: true |
| 4579 | knownreturn: false |
| 4580 | isreturnbool: false |
| 4581 | position: |
| 4582 | start: 80 |
| 4583 | end: 86 |
| 4584 | type: string |
| 4585 | fixedLabels: true |
| 4586 | op: 0 |
| 4587 | side: 0 |
| 4588 | - src: |
| 4589 | labels: |
| 4590 | "": |
| 4591 | reason: This query returns a string value with no labels. |
| 4592 | kind: excluded |
| 4593 | fragment: |
| 4594 | start: 88 |
| 4595 | end: 94 |
| 4596 | returns: string |
| 4597 | returnInfo: |
| 4598 | logicalexpr: "" |
| 4599 | valueposition: |
| 4600 | start: 0 |
| 4601 | end: 0 |
| 4602 | returnednumber: 0 |
| 4603 | alwaysreturns: true |
| 4604 | knownreturn: false |
| 4605 | isreturnbool: false |
| 4606 | position: |
| 4607 | start: 88 |
| 4608 | end: 94 |
| 4609 | type: string |
| 4610 | fixedLabels: true |
| 4611 | op: 0 |
| 4612 | side: 0 |
| 4613 | usedLabels: |
| 4614 | - src1 |
| 4615 | - src2 |
| 4616 | - src3 |
| 4617 | position: |
| 4618 | start: 11 |
| 4619 | end: 58 |
| 4620 | type: function |
| 4621 | |
| 4622 | --- |
| 4623 | |
| 4624 | [TestLabelsSource/89 - 1] |
| 4625 | expr: |4- |
| 4626 | |
| 4627 | ( |
| 4628 | sum(foo:sum > 0) without(notify) |
| 4629 | * on(job) group_left(notify) |
| 4630 | job:notify |
| 4631 | ) |
| 4632 | and on(job) |
| 4633 | sum(foo:count) by(job) > 20 |
| 4634 | output: |
| 4635 | - labels: |
| 4636 | __name__: |
| 4637 | reason: Binary operation between two vectors removes metric names. |
| 4638 | kind: excluded |
| 4639 | fragment: |
| 4640 | start: 4 |
| 4641 | end: 78 |
| 4642 | job: |
| 4643 | 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. |
| 4644 | kind: included |
| 4645 | fragment: |
| 4646 | start: 111 |
| 4647 | end: 114 |
| 4648 | notify: |
| 4649 | 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. |
| 4650 | kind: included |
| 4651 | fragment: |
| 4652 | start: 59 |
| 4653 | end: 65 |
| 4654 | returns: vector |
| 4655 | operations: |
| 4656 | - node: '[*parser.VectorSelector] foo:sum' |
| 4657 | op: "" |
| 4658 | - node: '[*parser.AggregateExpr] sum without (notify) (foo:sum > 0)' |
| 4659 | op: sum |
| 4660 | joins: |
| 4661 | - addedlabels: |
| 4662 | - notify |
| 4663 | depth: 0 |
| 4664 | ison: true |
| 4665 | matchinglabels: |
| 4666 | - job |
| 4667 | op: '*' |
| 4668 | src: |
| 4669 | returns: vector |
| 4670 | operations: |
| 4671 | - node: '[*parser.VectorSelector] job:notify' |
| 4672 | op: "" |
| 4673 | position: |
| 4674 | start: 68 |
| 4675 | end: 78 |
| 4676 | type: selector |
| 4677 | - addedlabels: [] |
| 4678 | depth: 0 |
| 4679 | ison: true |
| 4680 | matchinglabels: |
| 4681 | - job |
| 4682 | op: and |
| 4683 | src: |
| 4684 | labels: |
| 4685 | "": |
| 4686 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 4687 | kind: excluded |
| 4688 | fragment: |
| 4689 | start: 108 |
| 4690 | end: 110 |
| 4691 | __name__: |
| 4692 | reason: Aggregation removes metric name. |
| 4693 | kind: excluded |
| 4694 | fragment: |
| 4695 | start: 93 |
| 4696 | end: 115 |
| 4697 | job: |
| 4698 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 4699 | kind: included |
| 4700 | fragment: |
| 4701 | start: 111 |
| 4702 | end: 114 |
| 4703 | returns: vector |
| 4704 | operations: |
| 4705 | - node: '[*parser.VectorSelector] foo:count' |
| 4706 | op: "" |
| 4707 | - node: '[*parser.AggregateExpr] sum by (job) (foo:count)' |
| 4708 | op: sum |
| 4709 | indirect: |
| 4710 | - src: |
| 4711 | labels: |
| 4712 | "": |
| 4713 | reason: This query returns a number value with no labels. |
| 4714 | kind: excluded |
| 4715 | fragment: |
| 4716 | start: 118 |
| 4717 | end: 120 |
| 4718 | returns: scalar |
| 4719 | returnInfo: |
| 4720 | logicalexpr: "" |
| 4721 | valueposition: |
| 4722 | start: 118 |
| 4723 | end: 120 |
| 4724 | returnednumber: 20 |
| 4725 | alwaysreturns: true |
| 4726 | knownreturn: true |
| 4727 | isreturnbool: false |
| 4728 | position: |
| 4729 | start: 118 |
| 4730 | end: 120 |
| 4731 | type: number |
| 4732 | fixedLabels: true |
| 4733 | op: 57388 |
| 4734 | side: 1 |
| 4735 | usedLabels: |
| 4736 | - job |
| 4737 | condition: |
| 4738 | op: 57388 |
| 4739 | value: 20 |
| 4740 | present: true |
| 4741 | knownValue: true |
| 4742 | position: |
| 4743 | start: 97 |
| 4744 | end: 106 |
| 4745 | type: aggregation |
| 4746 | fixedLabels: true |
| 4747 | indirect: |
| 4748 | - src: |
| 4749 | labels: |
| 4750 | "": |
| 4751 | reason: This query returns a number value with no labels. |
| 4752 | kind: excluded |
| 4753 | fragment: |
| 4754 | start: 18 |
| 4755 | end: 19 |
| 4756 | returns: scalar |
| 4757 | returnInfo: |
| 4758 | logicalexpr: "" |
| 4759 | valueposition: |
| 4760 | start: 18 |
| 4761 | end: 19 |
| 4762 | returnednumber: 0 |
| 4763 | alwaysreturns: true |
| 4764 | knownreturn: true |
| 4765 | isreturnbool: false |
| 4766 | position: |
| 4767 | start: 18 |
| 4768 | end: 19 |
| 4769 | type: number |
| 4770 | fixedLabels: true |
| 4771 | op: 57388 |
| 4772 | side: 1 |
| 4773 | usedLabels: |
| 4774 | - job |
| 4775 | condition: |
| 4776 | op: 57391 |
| 4777 | present: true |
| 4778 | position: |
| 4779 | start: 8 |
| 4780 | end: 15 |
| 4781 | type: aggregation |
| 4782 | |
| 4783 | --- |
| 4784 | |
| 4785 | [TestLabelsSource/90 - 1] |
| 4786 | expr: container_file_descriptors / on (instance, app_name) container_ulimits_soft{ulimit="max_open_files"} |
| 4787 | output: |
| 4788 | - labels: |
| 4789 | "": |
| 4790 | 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. |
| 4791 | kind: excluded |
| 4792 | fragment: |
| 4793 | start: 29 |
| 4794 | end: 52 |
| 4795 | __name__: |
| 4796 | reason: Binary operation between two vectors removes metric names. |
| 4797 | kind: excluded |
| 4798 | fragment: |
| 4799 | start: 0 |
| 4800 | end: 100 |
| 4801 | app_name: |
| 4802 | 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. |
| 4803 | kind: included |
| 4804 | fragment: |
| 4805 | start: 43 |
| 4806 | end: 51 |
| 4807 | instance: |
| 4808 | 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. |
| 4809 | kind: included |
| 4810 | fragment: |
| 4811 | start: 33 |
| 4812 | end: 41 |
| 4813 | returns: vector |
| 4814 | operations: |
| 4815 | - node: '[*parser.VectorSelector] container_file_descriptors' |
| 4816 | op: "" |
| 4817 | joins: |
| 4818 | - addedlabels: [] |
| 4819 | depth: 0 |
| 4820 | ison: true |
| 4821 | matchinglabels: |
| 4822 | - instance |
| 4823 | - app_name |
| 4824 | op: / |
| 4825 | src: |
| 4826 | labels: |
| 4827 | ulimit: |
| 4828 | reason: Query will only return series where these labels are present. |
| 4829 | kind: guaranteed |
| 4830 | fragment: |
| 4831 | start: 53 |
| 4832 | end: 100 |
| 4833 | returns: vector |
| 4834 | operations: |
| 4835 | - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}' |
| 4836 | op: "" |
| 4837 | position: |
| 4838 | start: 53 |
| 4839 | end: 100 |
| 4840 | type: selector |
| 4841 | usedLabels: |
| 4842 | - instance |
| 4843 | - app_name |
| 4844 | position: |
| 4845 | start: 0 |
| 4846 | end: 26 |
| 4847 | type: selector |
| 4848 | fixedLabels: true |
| 4849 | |
| 4850 | --- |
| 4851 | |
| 4852 | [TestLabelsSource/91 - 1] |
| 4853 | expr: container_file_descriptors / on (instance, app_name) group_left() container_ulimits_soft{ulimit="max_open_files"} |
| 4854 | output: |
| 4855 | - labels: |
| 4856 | __name__: |
| 4857 | reason: Binary operation between two vectors removes metric names. |
| 4858 | kind: excluded |
| 4859 | fragment: |
| 4860 | start: 0 |
| 4861 | end: 113 |
| 4862 | app_name: |
| 4863 | reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results. |
| 4864 | kind: included |
| 4865 | fragment: |
| 4866 | start: 43 |
| 4867 | end: 51 |
| 4868 | instance: |
| 4869 | reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results. |
| 4870 | kind: included |
| 4871 | fragment: |
| 4872 | start: 33 |
| 4873 | end: 41 |
| 4874 | returns: vector |
| 4875 | operations: |
| 4876 | - node: '[*parser.VectorSelector] container_file_descriptors' |
| 4877 | op: "" |
| 4878 | joins: |
| 4879 | - addedlabels: [] |
| 4880 | depth: 0 |
| 4881 | ison: true |
| 4882 | matchinglabels: |
| 4883 | - instance |
| 4884 | - app_name |
| 4885 | op: / |
| 4886 | src: |
| 4887 | labels: |
| 4888 | ulimit: |
| 4889 | reason: Query will only return series where these labels are present. |
| 4890 | kind: guaranteed |
| 4891 | fragment: |
| 4892 | start: 66 |
| 4893 | end: 113 |
| 4894 | returns: vector |
| 4895 | operations: |
| 4896 | - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}' |
| 4897 | op: "" |
| 4898 | position: |
| 4899 | start: 66 |
| 4900 | end: 113 |
| 4901 | type: selector |
| 4902 | usedLabels: |
| 4903 | - instance |
| 4904 | - app_name |
| 4905 | position: |
| 4906 | start: 0 |
| 4907 | end: 26 |
| 4908 | type: selector |
| 4909 | |
| 4910 | --- |
| 4911 | |
| 4912 | [TestLabelsSource/92 - 1] |
| 4913 | expr: absent(foo{job="bar"}) |
| 4914 | output: |
| 4915 | - labels: |
| 4916 | "": |
| 4917 | reason: |- |
| 4918 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 4919 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 4920 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 4921 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 4922 | 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. |
| 4923 | kind: excluded |
| 4924 | fragment: |
| 4925 | start: 0 |
| 4926 | end: 6 |
| 4927 | job: |
| 4928 | reason: All labels passed to a absent() call will be present on the results if the query doesn't match anything. |
| 4929 | kind: guaranteed |
| 4930 | fragment: |
| 4931 | start: 0 |
| 4932 | end: 22 |
| 4933 | returns: vector |
| 4934 | operations: |
| 4935 | - node: '[*parser.VectorSelector] foo{job="bar"}' |
| 4936 | op: "" |
| 4937 | - node: '[*parser.Call] absent(foo{job="bar"})' |
| 4938 | op: absent |
| 4939 | usedLabels: |
| 4940 | - job |
| 4941 | position: |
| 4942 | start: 7 |
| 4943 | end: 21 |
| 4944 | type: function |
| 4945 | fixedLabels: true |
| 4946 | |
| 4947 | --- |
| 4948 | |
| 4949 | [TestLabelsSource/93 - 1] |
| 4950 | expr: absent(foo{job="bar", cluster!="dev", instance=~".+", env="prod"}) |
| 4951 | output: |
| 4952 | - labels: |
| 4953 | "": |
| 4954 | reason: |- |
| 4955 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 4956 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 4957 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 4958 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 4959 | 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. |
| 4960 | kind: excluded |
| 4961 | fragment: |
| 4962 | start: 0 |
| 4963 | end: 6 |
| 4964 | env: |
| 4965 | reason: All labels passed to a absent() call will be present on the results if the query doesn't match anything. |
| 4966 | kind: guaranteed |
| 4967 | fragment: |
| 4968 | start: 0 |
| 4969 | end: 66 |
| 4970 | instance: |
| 4971 | reason: |- |
| 4972 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 4973 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 4974 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 4975 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 4976 | 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. |
| 4977 | kind: excluded |
| 4978 | fragment: |
| 4979 | start: 0 |
| 4980 | end: 6 |
| 4981 | job: |
| 4982 | reason: All labels passed to a absent() call will be present on the results if the query doesn't match anything. |
| 4983 | kind: guaranteed |
| 4984 | fragment: |
| 4985 | start: 0 |
| 4986 | end: 66 |
| 4987 | returns: vector |
| 4988 | operations: |
| 4989 | - node: '[*parser.VectorSelector] foo{cluster!="dev",env="prod",instance=~".+",job="bar"}' |
| 4990 | op: "" |
| 4991 | - node: '[*parser.Call] absent(foo{cluster!="dev",env="prod",instance=~".+",job="bar"})' |
| 4992 | op: absent |
| 4993 | usedLabels: |
| 4994 | - job |
| 4995 | - env |
| 4996 | position: |
| 4997 | start: 7 |
| 4998 | end: 65 |
| 4999 | type: function |
| 5000 | fixedLabels: true |
| 5001 | |
| 5002 | --- |
| 5003 | |
| 5004 | [TestLabelsSource/94 - 1] |
| 5005 | expr: absent(sum(foo) by(job, instance)) |
| 5006 | output: |
| 5007 | - labels: |
| 5008 | "": |
| 5009 | reason: |- |
| 5010 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5011 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5012 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5013 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5014 | 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. |
| 5015 | kind: excluded |
| 5016 | fragment: |
| 5017 | start: 0 |
| 5018 | end: 6 |
| 5019 | __name__: |
| 5020 | reason: Aggregation removes metric name. |
| 5021 | kind: excluded |
| 5022 | fragment: |
| 5023 | start: 7 |
| 5024 | end: 33 |
| 5025 | instance: |
| 5026 | reason: |- |
| 5027 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5028 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5029 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5030 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5031 | 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. |
| 5032 | kind: excluded |
| 5033 | fragment: |
| 5034 | start: 0 |
| 5035 | end: 6 |
| 5036 | job: |
| 5037 | reason: |- |
| 5038 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5039 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5040 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5041 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5042 | 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. |
| 5043 | kind: excluded |
| 5044 | fragment: |
| 5045 | start: 0 |
| 5046 | end: 6 |
| 5047 | returns: vector |
| 5048 | operations: |
| 5049 | - node: '[*parser.VectorSelector] foo' |
| 5050 | op: "" |
| 5051 | - node: '[*parser.AggregateExpr] sum by (job, instance) (foo)' |
| 5052 | op: sum |
| 5053 | - node: '[*parser.Call] absent(sum by (job, instance) (foo))' |
| 5054 | op: absent |
| 5055 | position: |
| 5056 | start: 7 |
| 5057 | end: 33 |
| 5058 | type: function |
| 5059 | fixedLabels: true |
| 5060 | |
| 5061 | --- |
| 5062 | |
| 5063 | [TestLabelsSource/95 - 1] |
| 5064 | expr: absent(foo{job="prometheus", xxx="1"}) AND on(job) prometheus_build_info |
| 5065 | output: |
| 5066 | - labels: |
| 5067 | "": |
| 5068 | reason: |- |
| 5069 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5070 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5071 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5072 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5073 | 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. |
| 5074 | kind: excluded |
| 5075 | fragment: |
| 5076 | start: 0 |
| 5077 | end: 6 |
| 5078 | job: |
| 5079 | reason: All labels passed to a absent() call will be present on the results if the query doesn't match anything. |
| 5080 | kind: guaranteed |
| 5081 | fragment: |
| 5082 | start: 0 |
| 5083 | end: 38 |
| 5084 | xxx: |
| 5085 | reason: All labels passed to a absent() call will be present on the results if the query doesn't match anything. |
| 5086 | kind: guaranteed |
| 5087 | fragment: |
| 5088 | start: 0 |
| 5089 | end: 38 |
| 5090 | returns: vector |
| 5091 | operations: |
| 5092 | - node: '[*parser.VectorSelector] foo{job="prometheus",xxx="1"}' |
| 5093 | op: "" |
| 5094 | - node: '[*parser.Call] absent(foo{job="prometheus",xxx="1"})' |
| 5095 | op: absent |
| 5096 | joins: |
| 5097 | - addedlabels: [] |
| 5098 | depth: 0 |
| 5099 | ison: true |
| 5100 | matchinglabels: |
| 5101 | - job |
| 5102 | op: and |
| 5103 | src: |
| 5104 | returns: vector |
| 5105 | operations: |
| 5106 | - node: '[*parser.VectorSelector] prometheus_build_info' |
| 5107 | op: "" |
| 5108 | position: |
| 5109 | start: 51 |
| 5110 | end: 72 |
| 5111 | type: selector |
| 5112 | usedLabels: |
| 5113 | - job |
| 5114 | - xxx |
| 5115 | position: |
| 5116 | start: 7 |
| 5117 | end: 37 |
| 5118 | type: function |
| 5119 | fixedLabels: true |
| 5120 | |
| 5121 | --- |
| 5122 | |
| 5123 | [TestLabelsSource/96 - 1] |
| 5124 | expr: 1 + sum(foo) by(notjob) |
| 5125 | output: |
| 5126 | - labels: |
| 5127 | "": |
| 5128 | reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results. |
| 5129 | kind: excluded |
| 5130 | fragment: |
| 5131 | start: 13 |
| 5132 | end: 15 |
| 5133 | __name__: |
| 5134 | reason: Aggregation removes metric name. |
| 5135 | kind: excluded |
| 5136 | fragment: |
| 5137 | start: 4 |
| 5138 | end: 23 |
| 5139 | notjob: |
| 5140 | reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results. |
| 5141 | kind: included |
| 5142 | fragment: |
| 5143 | start: 16 |
| 5144 | end: 22 |
| 5145 | returns: vector |
| 5146 | operations: |
| 5147 | - node: '[*parser.VectorSelector] foo' |
| 5148 | op: "" |
| 5149 | - node: '[*parser.AggregateExpr] sum by (notjob) (foo)' |
| 5150 | op: sum |
| 5151 | indirect: |
| 5152 | - src: |
| 5153 | labels: |
| 5154 | "": |
| 5155 | reason: This query returns a number value with no labels. |
| 5156 | kind: excluded |
| 5157 | fragment: |
| 5158 | start: 0 |
| 5159 | end: 1 |
| 5160 | returns: scalar |
| 5161 | returnInfo: |
| 5162 | logicalexpr: "" |
| 5163 | valueposition: |
| 5164 | start: 0 |
| 5165 | end: 1 |
| 5166 | returnednumber: 1 |
| 5167 | alwaysreturns: true |
| 5168 | knownreturn: true |
| 5169 | isreturnbool: false |
| 5170 | position: |
| 5171 | start: 0 |
| 5172 | end: 1 |
| 5173 | type: number |
| 5174 | fixedLabels: true |
| 5175 | op: 57383 |
| 5176 | side: 0 |
| 5177 | usedLabels: |
| 5178 | - notjob |
| 5179 | position: |
| 5180 | start: 8 |
| 5181 | end: 11 |
| 5182 | type: aggregation |
| 5183 | fixedLabels: true |
| 5184 | |
| 5185 | --- |
| 5186 | |
| 5187 | [TestLabelsSource/97 - 1] |
| 5188 | expr: count(node_exporter_build_info) by (instance, version) != ignoring(package,version) group_left(foo) count(deb_package_version) by (instance, version, package) |
| 5189 | output: |
| 5190 | - labels: |
| 5191 | "": |
| 5192 | reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results. |
| 5193 | kind: excluded |
| 5194 | fragment: |
| 5195 | start: 32 |
| 5196 | end: 34 |
| 5197 | __name__: |
| 5198 | reason: Binary operation between two vectors removes metric names. |
| 5199 | kind: excluded |
| 5200 | fragment: |
| 5201 | start: 0 |
| 5202 | end: 158 |
| 5203 | foo: |
| 5204 | 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. |
| 5205 | kind: included |
| 5206 | fragment: |
| 5207 | start: 95 |
| 5208 | end: 98 |
| 5209 | instance: |
| 5210 | reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results. |
| 5211 | kind: included |
| 5212 | fragment: |
| 5213 | start: 36 |
| 5214 | end: 44 |
| 5215 | version: |
| 5216 | reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results. |
| 5217 | kind: included |
| 5218 | fragment: |
| 5219 | start: 46 |
| 5220 | end: 53 |
| 5221 | returns: vector |
| 5222 | operations: |
| 5223 | - node: '[*parser.VectorSelector] node_exporter_build_info' |
| 5224 | op: "" |
| 5225 | - node: '[*parser.AggregateExpr] count by (instance, version) (node_exporter_build_info)' |
| 5226 | op: count |
| 5227 | joins: |
| 5228 | - addedlabels: |
| 5229 | - foo |
| 5230 | deadlabels: |
| 5231 | - name: foo |
| 5232 | reason: You can't use `foo` because this label is not possible here. |
| 5233 | labelreason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 5234 | usagefragment: |
| 5235 | start: 95 |
| 5236 | end: 98 |
| 5237 | labelfragment: |
| 5238 | start: 127 |
| 5239 | end: 129 |
| 5240 | kind: 0 |
| 5241 | depth: 0 |
| 5242 | ison: false |
| 5243 | matchinglabels: |
| 5244 | - package |
| 5245 | - version |
| 5246 | op: '!=' |
| 5247 | src: |
| 5248 | labels: |
| 5249 | "": |
| 5250 | reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 5251 | kind: excluded |
| 5252 | fragment: |
| 5253 | start: 127 |
| 5254 | end: 129 |
| 5255 | __name__: |
| 5256 | reason: Aggregation removes metric name. |
| 5257 | kind: excluded |
| 5258 | fragment: |
| 5259 | start: 100 |
| 5260 | end: 158 |
| 5261 | instance: |
| 5262 | reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 5263 | kind: included |
| 5264 | fragment: |
| 5265 | start: 131 |
| 5266 | end: 139 |
| 5267 | package: |
| 5268 | reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 5269 | kind: included |
| 5270 | fragment: |
| 5271 | start: 150 |
| 5272 | end: 157 |
| 5273 | version: |
| 5274 | reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results. |
| 5275 | kind: included |
| 5276 | fragment: |
| 5277 | start: 141 |
| 5278 | end: 148 |
| 5279 | returns: vector |
| 5280 | operations: |
| 5281 | - node: '[*parser.VectorSelector] deb_package_version' |
| 5282 | op: "" |
| 5283 | - node: '[*parser.AggregateExpr] count by (instance, version, package) (deb_package_version)' |
| 5284 | op: count |
| 5285 | usedLabels: |
| 5286 | - instance |
| 5287 | - version |
| 5288 | - package |
| 5289 | position: |
| 5290 | start: 106 |
| 5291 | end: 125 |
| 5292 | type: aggregation |
| 5293 | fixedLabels: true |
| 5294 | usedLabels: |
| 5295 | - instance |
| 5296 | - version |
| 5297 | - foo |
| 5298 | condition: |
| 5299 | op: 57398 |
| 5300 | present: true |
| 5301 | position: |
| 5302 | start: 6 |
| 5303 | end: 30 |
| 5304 | type: aggregation |
| 5305 | fixedLabels: true |
| 5306 | |
| 5307 | --- |
| 5308 | |
| 5309 | [TestLabelsSource/98 - 1] |
| 5310 | expr: absent(foo) or absent(bar) |
| 5311 | output: |
| 5312 | - labels: |
| 5313 | "": |
| 5314 | reason: |- |
| 5315 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5316 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5317 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5318 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5319 | 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. |
| 5320 | kind: excluded |
| 5321 | fragment: |
| 5322 | start: 0 |
| 5323 | end: 6 |
| 5324 | returns: vector |
| 5325 | operations: |
| 5326 | - node: '[*parser.VectorSelector] foo' |
| 5327 | op: "" |
| 5328 | - node: '[*parser.Call] absent(foo)' |
| 5329 | op: absent |
| 5330 | position: |
| 5331 | start: 7 |
| 5332 | end: 10 |
| 5333 | type: function |
| 5334 | fixedLabels: true |
| 5335 | - labels: |
| 5336 | "": |
| 5337 | reason: |- |
| 5338 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5339 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5340 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5341 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5342 | 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. |
| 5343 | kind: excluded |
| 5344 | fragment: |
| 5345 | start: 15 |
| 5346 | end: 21 |
| 5347 | returns: vector |
| 5348 | operations: |
| 5349 | - node: '[*parser.VectorSelector] bar' |
| 5350 | op: "" |
| 5351 | - node: '[*parser.Call] absent(bar)' |
| 5352 | op: absent |
| 5353 | position: |
| 5354 | start: 22 |
| 5355 | end: 25 |
| 5356 | type: function |
| 5357 | fixedLabels: true |
| 5358 | |
| 5359 | --- |
| 5360 | |
| 5361 | [TestLabelsSource/99 - 1] |
| 5362 | expr: absent(vector(1)) |
| 5363 | output: |
| 5364 | - labels: |
| 5365 | "": |
| 5366 | reason: |- |
| 5367 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5368 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5369 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5370 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5371 | 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. |
| 5372 | kind: excluded |
| 5373 | fragment: |
| 5374 | start: 0 |
| 5375 | end: 6 |
| 5376 | returns: vector |
| 5377 | operations: |
| 5378 | - args: |
| 5379 | - "1" |
| 5380 | node: '[*parser.Call] vector(1)' |
| 5381 | op: vector |
| 5382 | - node: '[*parser.Call] absent(vector(1))' |
| 5383 | op: absent |
| 5384 | indirect: |
| 5385 | - src: |
| 5386 | labels: |
| 5387 | "": |
| 5388 | reason: This query returns a number value with no labels. |
| 5389 | kind: excluded |
| 5390 | fragment: |
| 5391 | start: 14 |
| 5392 | end: 15 |
| 5393 | returns: scalar |
| 5394 | returnInfo: |
| 5395 | logicalexpr: "" |
| 5396 | valueposition: |
| 5397 | start: 14 |
| 5398 | end: 15 |
| 5399 | returnednumber: 1 |
| 5400 | alwaysreturns: true |
| 5401 | knownreturn: true |
| 5402 | isreturnbool: false |
| 5403 | position: |
| 5404 | start: 14 |
| 5405 | end: 15 |
| 5406 | type: number |
| 5407 | fixedLabels: true |
| 5408 | op: 0 |
| 5409 | side: 0 |
| 5410 | returnInfo: |
| 5411 | logicalexpr: "" |
| 5412 | valueposition: |
| 5413 | start: 7 |
| 5414 | end: 16 |
| 5415 | returnednumber: 1 |
| 5416 | alwaysreturns: true |
| 5417 | knownreturn: true |
| 5418 | isreturnbool: false |
| 5419 | position: |
| 5420 | start: 7 |
| 5421 | end: 16 |
| 5422 | type: function |
| 5423 | fixedLabels: true |
| 5424 | |
| 5425 | --- |
| 5426 | |
| 5427 | [TestLabelsSource/100 - 1] |
| 5428 | expr: absent_over_time(foo[5m]) or absent(bar) |
| 5429 | output: |
| 5430 | - labels: |
| 5431 | "": |
| 5432 | reason: |- |
| 5433 | The [absent_over_time()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent_over_time) function is used to check if the provided query doesn't match any time series. |
| 5434 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5435 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5436 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5437 | 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. |
| 5438 | kind: excluded |
| 5439 | fragment: |
| 5440 | start: 0 |
| 5441 | end: 16 |
| 5442 | returns: vector |
| 5443 | operations: |
| 5444 | - node: '[*parser.MatrixSelector] foo[5m]' |
| 5445 | op: "" |
| 5446 | - node: '[*parser.VectorSelector] foo' |
| 5447 | op: "" |
| 5448 | - node: '[*parser.Call] absent_over_time(foo[5m])' |
| 5449 | op: absent_over_time |
| 5450 | position: |
| 5451 | start: 17 |
| 5452 | end: 24 |
| 5453 | type: function |
| 5454 | fixedLabels: true |
| 5455 | - labels: |
| 5456 | "": |
| 5457 | reason: |- |
| 5458 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5459 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5460 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5461 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5462 | 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. |
| 5463 | kind: excluded |
| 5464 | fragment: |
| 5465 | start: 29 |
| 5466 | end: 35 |
| 5467 | returns: vector |
| 5468 | operations: |
| 5469 | - node: '[*parser.VectorSelector] bar' |
| 5470 | op: "" |
| 5471 | - node: '[*parser.Call] absent(bar)' |
| 5472 | op: absent |
| 5473 | position: |
| 5474 | start: 36 |
| 5475 | end: 39 |
| 5476 | type: function |
| 5477 | fixedLabels: true |
| 5478 | |
| 5479 | --- |
| 5480 | |
| 5481 | [TestLabelsSource/101 - 1] |
| 5482 | expr: bar * on() group_right(cluster, env) absent(foo{job="xxx"}) |
| 5483 | output: |
| 5484 | - labels: |
| 5485 | "": |
| 5486 | reason: |- |
| 5487 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5488 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5489 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5490 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5491 | 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. |
| 5492 | kind: excluded |
| 5493 | fragment: |
| 5494 | start: 37 |
| 5495 | end: 43 |
| 5496 | __name__: |
| 5497 | reason: Binary operation between two vectors removes metric names. |
| 5498 | kind: excluded |
| 5499 | fragment: |
| 5500 | start: 0 |
| 5501 | end: 59 |
| 5502 | cluster: |
| 5503 | 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. |
| 5504 | kind: included |
| 5505 | fragment: |
| 5506 | start: 23 |
| 5507 | end: 30 |
| 5508 | env: |
| 5509 | 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. |
| 5510 | kind: included |
| 5511 | fragment: |
| 5512 | start: 32 |
| 5513 | end: 35 |
| 5514 | job: |
| 5515 | reason: All labels passed to a absent() call will be present on the results if the query doesn't match anything. |
| 5516 | kind: guaranteed |
| 5517 | fragment: |
| 5518 | start: 37 |
| 5519 | end: 59 |
| 5520 | returns: vector |
| 5521 | operations: |
| 5522 | - node: '[*parser.VectorSelector] foo{job="xxx"}' |
| 5523 | op: "" |
| 5524 | - node: '[*parser.Call] absent(foo{job="xxx"})' |
| 5525 | op: absent |
| 5526 | joins: |
| 5527 | - addedlabels: |
| 5528 | - cluster |
| 5529 | - env |
| 5530 | depth: 0 |
| 5531 | ison: true |
| 5532 | matchinglabels: [] |
| 5533 | op: '*' |
| 5534 | src: |
| 5535 | returns: vector |
| 5536 | operations: |
| 5537 | - node: '[*parser.VectorSelector] bar' |
| 5538 | op: "" |
| 5539 | position: |
| 5540 | start: 0 |
| 5541 | end: 3 |
| 5542 | type: selector |
| 5543 | usedLabels: |
| 5544 | - job |
| 5545 | position: |
| 5546 | start: 44 |
| 5547 | end: 58 |
| 5548 | type: function |
| 5549 | fixedLabels: true |
| 5550 | |
| 5551 | --- |
| 5552 | |
| 5553 | [TestLabelsSource/102 - 1] |
| 5554 | expr: bar * on() group_right() absent(foo{job="xxx"}) |
| 5555 | output: |
| 5556 | - labels: |
| 5557 | "": |
| 5558 | reason: |- |
| 5559 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 5560 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 5561 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 5562 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 5563 | 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. |
| 5564 | kind: excluded |
| 5565 | fragment: |
| 5566 | start: 25 |
| 5567 | end: 31 |
| 5568 | __name__: |
| 5569 | reason: Binary operation between two vectors removes metric names. |
| 5570 | kind: excluded |
| 5571 | fragment: |
| 5572 | start: 0 |
| 5573 | end: 47 |
| 5574 | job: |
| 5575 | reason: All labels passed to a absent() call will be present on the results if the query doesn't match anything. |
| 5576 | kind: guaranteed |
| 5577 | fragment: |
| 5578 | start: 25 |
| 5579 | end: 47 |
| 5580 | returns: vector |
| 5581 | operations: |
| 5582 | - node: '[*parser.VectorSelector] foo{job="xxx"}' |
| 5583 | op: "" |
| 5584 | - node: '[*parser.Call] absent(foo{job="xxx"})' |
| 5585 | op: absent |
| 5586 | joins: |
| 5587 | - addedlabels: [] |
| 5588 | depth: 0 |
| 5589 | ison: true |
| 5590 | matchinglabels: [] |
| 5591 | op: '*' |
| 5592 | src: |
| 5593 | returns: vector |
| 5594 | operations: |
| 5595 | - node: '[*parser.VectorSelector] bar' |
| 5596 | op: "" |
| 5597 | position: |
| 5598 | start: 0 |
| 5599 | end: 3 |
| 5600 | type: selector |
| 5601 | usedLabels: |
| 5602 | - job |
| 5603 | position: |
| 5604 | start: 32 |
| 5605 | end: 46 |
| 5606 | type: function |
| 5607 | fixedLabels: true |
| 5608 | |
| 5609 | --- |
| 5610 | |
| 5611 | [TestLabelsSource/103 - 1] |
| 5612 | expr: vector(1) |
| 5613 | output: |
| 5614 | - labels: |
| 5615 | "": |
| 5616 | reason: Calling `vector()` will return a vector value with no labels. |
| 5617 | kind: excluded |
| 5618 | fragment: |
| 5619 | start: 0 |
| 5620 | end: 6 |
| 5621 | returns: vector |
| 5622 | operations: |
| 5623 | - args: |
| 5624 | - "1" |
| 5625 | node: '[*parser.Call] vector(1)' |
| 5626 | op: vector |
| 5627 | indirect: |
| 5628 | - src: |
| 5629 | labels: |
| 5630 | "": |
| 5631 | reason: This query returns a number value with no labels. |
| 5632 | kind: excluded |
| 5633 | fragment: |
| 5634 | start: 7 |
| 5635 | end: 8 |
| 5636 | returns: scalar |
| 5637 | returnInfo: |
| 5638 | logicalexpr: "" |
| 5639 | valueposition: |
| 5640 | start: 7 |
| 5641 | end: 8 |
| 5642 | returnednumber: 1 |
| 5643 | alwaysreturns: true |
| 5644 | knownreturn: true |
| 5645 | isreturnbool: false |
| 5646 | position: |
| 5647 | start: 7 |
| 5648 | end: 8 |
| 5649 | type: number |
| 5650 | fixedLabels: true |
| 5651 | op: 0 |
| 5652 | side: 0 |
| 5653 | returnInfo: |
| 5654 | logicalexpr: "" |
| 5655 | valueposition: |
| 5656 | start: 0 |
| 5657 | end: 9 |
| 5658 | returnednumber: 1 |
| 5659 | alwaysreturns: true |
| 5660 | knownreturn: true |
| 5661 | isreturnbool: false |
| 5662 | position: |
| 5663 | start: 0 |
| 5664 | end: 9 |
| 5665 | type: function |
| 5666 | fixedLabels: true |
| 5667 | |
| 5668 | --- |
| 5669 | |
| 5670 | [TestLabelsSource/104 - 1] |
| 5671 | expr: vector(scalar(foo)) |
| 5672 | output: |
| 5673 | - labels: |
| 5674 | "": |
| 5675 | reason: Calling `vector()` will return a vector value with no labels. |
| 5676 | kind: excluded |
| 5677 | fragment: |
| 5678 | start: 0 |
| 5679 | end: 6 |
| 5680 | returns: vector |
| 5681 | operations: |
| 5682 | - args: |
| 5683 | - scalar(foo) |
| 5684 | node: '[*parser.Call] vector(scalar(foo))' |
| 5685 | op: vector |
| 5686 | indirect: |
| 5687 | - src: |
| 5688 | labels: |
| 5689 | "": |
| 5690 | reason: Calling `scalar()` will return a scalar value with no labels. |
| 5691 | kind: excluded |
| 5692 | fragment: |
| 5693 | start: 7 |
| 5694 | end: 18 |
| 5695 | returns: scalar |
| 5696 | operations: |
| 5697 | - node: '[*parser.VectorSelector] foo' |
| 5698 | op: "" |
| 5699 | - node: '[*parser.Call] scalar(foo)' |
| 5700 | op: scalar |
| 5701 | returnInfo: |
| 5702 | logicalexpr: "" |
| 5703 | valueposition: |
| 5704 | start: 0 |
| 5705 | end: 0 |
| 5706 | returnednumber: 0 |
| 5707 | alwaysreturns: true |
| 5708 | knownreturn: false |
| 5709 | isreturnbool: false |
| 5710 | position: |
| 5711 | start: 14 |
| 5712 | end: 17 |
| 5713 | type: function |
| 5714 | fixedLabels: true |
| 5715 | op: 0 |
| 5716 | side: 0 |
| 5717 | returnInfo: |
| 5718 | logicalexpr: "" |
| 5719 | valueposition: |
| 5720 | start: 0 |
| 5721 | end: 19 |
| 5722 | returnednumber: 0 |
| 5723 | alwaysreturns: true |
| 5724 | knownreturn: false |
| 5725 | isreturnbool: false |
| 5726 | position: |
| 5727 | start: 0 |
| 5728 | end: 19 |
| 5729 | type: function |
| 5730 | fixedLabels: true |
| 5731 | |
| 5732 | --- |
| 5733 | |
| 5734 | [TestLabelsSource/105 - 1] |
| 5735 | expr: vector(0.0 >= bool 0.5) == 1 |
| 5736 | output: |
| 5737 | - labels: |
| 5738 | "": |
| 5739 | reason: Calling `vector()` will return a vector value with no labels. |
| 5740 | kind: excluded |
| 5741 | fragment: |
| 5742 | start: 0 |
| 5743 | end: 6 |
| 5744 | deadInfo: |
| 5745 | reason: '`vector(0.0 >= bool 0.5) == 1` always evaluates to `0 == 1` which is not possible, so it will never return anything.' |
| 5746 | fragment: |
| 5747 | start: 0 |
| 5748 | end: 24 |
| 5749 | returns: vector |
| 5750 | operations: |
| 5751 | - args: |
| 5752 | - 0 >= bool 0.5 |
| 5753 | node: '[*parser.Call] vector(0 >= bool 0.5)' |
| 5754 | op: vector |
| 5755 | indirect: |
| 5756 | - src: |
| 5757 | labels: |
| 5758 | "": |
| 5759 | reason: This query returns a number value with no labels. |
| 5760 | kind: excluded |
| 5761 | fragment: |
| 5762 | start: 7 |
| 5763 | end: 10 |
| 5764 | deadInfo: |
| 5765 | reason: '`0.0 >= 0.5` always evaluates to `0 >= 0.5` and uses the `bool` modifier which means it will always return 0' |
| 5766 | fragment: |
| 5767 | start: 7 |
| 5768 | end: 10 |
| 5769 | returns: scalar |
| 5770 | indirect: |
| 5771 | - src: |
| 5772 | labels: |
| 5773 | "": |
| 5774 | reason: This query returns a number value with no labels. |
| 5775 | kind: excluded |
| 5776 | fragment: |
| 5777 | start: 20 |
| 5778 | end: 23 |
| 5779 | returns: scalar |
| 5780 | returnInfo: |
| 5781 | logicalexpr: "" |
| 5782 | valueposition: |
| 5783 | start: 20 |
| 5784 | end: 23 |
| 5785 | returnednumber: 0.5 |
| 5786 | alwaysreturns: true |
| 5787 | knownreturn: true |
| 5788 | isreturnbool: false |
| 5789 | position: |
| 5790 | start: 20 |
| 5791 | end: 23 |
| 5792 | type: number |
| 5793 | fixedLabels: true |
| 5794 | op: 57387 |
| 5795 | side: 1 |
| 5796 | returnInfo: |
| 5797 | logicalexpr: "" |
| 5798 | valueposition: |
| 5799 | start: 7 |
| 5800 | end: 10 |
| 5801 | returnednumber: 0 |
| 5802 | alwaysreturns: true |
| 5803 | knownreturn: true |
| 5804 | isreturnbool: false |
| 5805 | condition: |
| 5806 | op: 57387 |
| 5807 | value: 0.5 |
| 5808 | present: true |
| 5809 | knownValue: true |
| 5810 | position: |
| 5811 | start: 7 |
| 5812 | end: 10 |
| 5813 | type: number |
| 5814 | fixedLabels: true |
| 5815 | op: 0 |
| 5816 | side: 0 |
| 5817 | - src: |
| 5818 | labels: |
| 5819 | "": |
| 5820 | reason: This query returns a number value with no labels. |
| 5821 | kind: excluded |
| 5822 | fragment: |
| 5823 | start: 28 |
| 5824 | end: 29 |
| 5825 | returns: scalar |
| 5826 | returnInfo: |
| 5827 | logicalexpr: "" |
| 5828 | valueposition: |
| 5829 | start: 28 |
| 5830 | end: 29 |
| 5831 | returnednumber: 1 |
| 5832 | alwaysreturns: true |
| 5833 | knownreturn: true |
| 5834 | isreturnbool: false |
| 5835 | position: |
| 5836 | start: 28 |
| 5837 | end: 29 |
| 5838 | type: number |
| 5839 | fixedLabels: true |
| 5840 | op: 57385 |
| 5841 | side: 1 |
| 5842 | returnInfo: |
| 5843 | logicalexpr: "" |
| 5844 | valueposition: |
| 5845 | start: 0 |
| 5846 | end: 24 |
| 5847 | returnednumber: 0 |
| 5848 | alwaysreturns: true |
| 5849 | knownreturn: true |
| 5850 | isreturnbool: false |
| 5851 | condition: |
| 5852 | op: 57385 |
| 5853 | value: 1 |
| 5854 | present: true |
| 5855 | knownValue: true |
| 5856 | position: |
| 5857 | start: 0 |
| 5858 | end: 24 |
| 5859 | type: function |
| 5860 | fixedLabels: true |
| 5861 | |
| 5862 | --- |
| 5863 | |
| 5864 | [TestLabelsSource/106 - 1] |
| 5865 | expr: sum_over_time(foo{job="myjob"}[5m]) |
| 5866 | output: |
| 5867 | - labels: |
| 5868 | job: |
| 5869 | reason: Query will only return series where these labels are present. |
| 5870 | kind: guaranteed |
| 5871 | fragment: |
| 5872 | start: 14 |
| 5873 | end: 30 |
| 5874 | returns: vector |
| 5875 | operations: |
| 5876 | - node: '[*parser.MatrixSelector] foo{job="myjob"}[5m]' |
| 5877 | op: "" |
| 5878 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 5879 | op: "" |
| 5880 | - node: '[*parser.Call] sum_over_time(foo{job="myjob"}[5m])' |
| 5881 | op: sum_over_time |
| 5882 | position: |
| 5883 | start: 14 |
| 5884 | end: 34 |
| 5885 | type: function |
| 5886 | |
| 5887 | --- |
| 5888 | |
| 5889 | [TestLabelsSource/107 - 1] |
| 5890 | expr: days_in_month() |
| 5891 | output: |
| 5892 | - labels: |
| 5893 | "": |
| 5894 | reason: Calling `days_in_month()` with no arguments will return an empty time series with no labels. |
| 5895 | kind: excluded |
| 5896 | fragment: |
| 5897 | start: 0 |
| 5898 | end: 15 |
| 5899 | returns: vector |
| 5900 | operations: |
| 5901 | - node: '[*parser.Call] days_in_month()' |
| 5902 | op: days_in_month |
| 5903 | returnInfo: |
| 5904 | logicalexpr: "" |
| 5905 | valueposition: |
| 5906 | start: 0 |
| 5907 | end: 0 |
| 5908 | returnednumber: 0 |
| 5909 | alwaysreturns: true |
| 5910 | knownreturn: false |
| 5911 | isreturnbool: false |
| 5912 | position: |
| 5913 | start: 0 |
| 5914 | end: 15 |
| 5915 | type: function |
| 5916 | fixedLabels: true |
| 5917 | |
| 5918 | --- |
| 5919 | |
| 5920 | [TestLabelsSource/108 - 1] |
| 5921 | expr: days_in_month(foo{job="foo"}) |
| 5922 | output: |
| 5923 | - labels: |
| 5924 | job: |
| 5925 | reason: Query will only return series where these labels are present. |
| 5926 | kind: guaranteed |
| 5927 | fragment: |
| 5928 | start: 14 |
| 5929 | end: 28 |
| 5930 | returns: vector |
| 5931 | operations: |
| 5932 | - node: '[*parser.VectorSelector] foo{job="foo"}' |
| 5933 | op: "" |
| 5934 | - node: '[*parser.Call] days_in_month(foo{job="foo"})' |
| 5935 | op: days_in_month |
| 5936 | position: |
| 5937 | start: 14 |
| 5938 | end: 28 |
| 5939 | type: function |
| 5940 | |
| 5941 | --- |
| 5942 | |
| 5943 | [TestLabelsSource/109 - 1] |
| 5944 | expr: label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*") |
| 5945 | output: |
| 5946 | - labels: |
| 5947 | foo: |
| 5948 | reason: This label will be added to the result by a label_replace() call. |
| 5949 | kind: guaranteed |
| 5950 | fragment: |
| 5951 | start: 0 |
| 5952 | end: 84 |
| 5953 | job: |
| 5954 | reason: Query will only return series where these labels are present. |
| 5955 | kind: guaranteed |
| 5956 | fragment: |
| 5957 | start: 14 |
| 5958 | end: 48 |
| 5959 | service: |
| 5960 | reason: Query will only return series where these labels are present. |
| 5961 | kind: guaranteed |
| 5962 | fragment: |
| 5963 | start: 14 |
| 5964 | end: 48 |
| 5965 | returns: vector |
| 5966 | operations: |
| 5967 | - node: '[*parser.VectorSelector] up{job="api-server",service="a:c"}' |
| 5968 | op: "" |
| 5969 | - args: |
| 5970 | - '"foo"' |
| 5971 | - '"$1"' |
| 5972 | - '"service"' |
| 5973 | - '"(.*):.*"' |
| 5974 | node: '[*parser.Call] label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*")' |
| 5975 | op: label_replace |
| 5976 | indirect: |
| 5977 | - src: |
| 5978 | labels: |
| 5979 | "": |
| 5980 | reason: This query returns a string value with no labels. |
| 5981 | kind: excluded |
| 5982 | fragment: |
| 5983 | start: 50 |
| 5984 | end: 55 |
| 5985 | returns: string |
| 5986 | returnInfo: |
| 5987 | logicalexpr: "" |
| 5988 | valueposition: |
| 5989 | start: 0 |
| 5990 | end: 0 |
| 5991 | returnednumber: 0 |
| 5992 | alwaysreturns: true |
| 5993 | knownreturn: false |
| 5994 | isreturnbool: false |
| 5995 | position: |
| 5996 | start: 50 |
| 5997 | end: 55 |
| 5998 | type: string |
| 5999 | fixedLabels: true |
| 6000 | op: 0 |
| 6001 | side: 0 |
| 6002 | - src: |
| 6003 | labels: |
| 6004 | "": |
| 6005 | reason: This query returns a string value with no labels. |
| 6006 | kind: excluded |
| 6007 | fragment: |
| 6008 | start: 57 |
| 6009 | end: 61 |
| 6010 | returns: string |
| 6011 | returnInfo: |
| 6012 | logicalexpr: "" |
| 6013 | valueposition: |
| 6014 | start: 0 |
| 6015 | end: 0 |
| 6016 | returnednumber: 0 |
| 6017 | alwaysreturns: true |
| 6018 | knownreturn: false |
| 6019 | isreturnbool: false |
| 6020 | position: |
| 6021 | start: 57 |
| 6022 | end: 61 |
| 6023 | type: string |
| 6024 | fixedLabels: true |
| 6025 | op: 0 |
| 6026 | side: 0 |
| 6027 | - src: |
| 6028 | labels: |
| 6029 | "": |
| 6030 | reason: This query returns a string value with no labels. |
| 6031 | kind: excluded |
| 6032 | fragment: |
| 6033 | start: 63 |
| 6034 | end: 72 |
| 6035 | returns: string |
| 6036 | returnInfo: |
| 6037 | logicalexpr: "" |
| 6038 | valueposition: |
| 6039 | start: 0 |
| 6040 | end: 0 |
| 6041 | returnednumber: 0 |
| 6042 | alwaysreturns: true |
| 6043 | knownreturn: false |
| 6044 | isreturnbool: false |
| 6045 | position: |
| 6046 | start: 63 |
| 6047 | end: 72 |
| 6048 | type: string |
| 6049 | fixedLabels: true |
| 6050 | op: 0 |
| 6051 | side: 0 |
| 6052 | - src: |
| 6053 | labels: |
| 6054 | "": |
| 6055 | reason: This query returns a string value with no labels. |
| 6056 | kind: excluded |
| 6057 | fragment: |
| 6058 | start: 74 |
| 6059 | end: 83 |
| 6060 | returns: string |
| 6061 | returnInfo: |
| 6062 | logicalexpr: "" |
| 6063 | valueposition: |
| 6064 | start: 0 |
| 6065 | end: 0 |
| 6066 | returnednumber: 0 |
| 6067 | alwaysreturns: true |
| 6068 | knownreturn: false |
| 6069 | isreturnbool: false |
| 6070 | position: |
| 6071 | start: 74 |
| 6072 | end: 83 |
| 6073 | type: string |
| 6074 | fixedLabels: true |
| 6075 | op: 0 |
| 6076 | side: 0 |
| 6077 | usedLabels: |
| 6078 | - service |
| 6079 | position: |
| 6080 | start: 14 |
| 6081 | end: 48 |
| 6082 | type: function |
| 6083 | |
| 6084 | --- |
| 6085 | |
| 6086 | [TestLabelsSource/110 - 1] |
| 6087 | expr: label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)") |
| 6088 | output: |
| 6089 | - labels: |
| 6090 | "": |
| 6091 | reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results. |
| 6092 | kind: excluded |
| 6093 | fragment: |
| 6094 | start: 18 |
| 6095 | end: 20 |
| 6096 | __name__: |
| 6097 | reason: Aggregation removes metric name. |
| 6098 | kind: excluded |
| 6099 | fragment: |
| 6100 | start: 14 |
| 6101 | end: 39 |
| 6102 | cluster: |
| 6103 | reason: This label will be added to the result by a label_replace() call. |
| 6104 | kind: guaranteed |
| 6105 | fragment: |
| 6106 | start: 0 |
| 6107 | end: 76 |
| 6108 | pod: |
| 6109 | reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results. |
| 6110 | kind: included |
| 6111 | fragment: |
| 6112 | start: 22 |
| 6113 | end: 25 |
| 6114 | returns: vector |
| 6115 | operations: |
| 6116 | - node: '[*parser.VectorSelector] pod_status' |
| 6117 | op: "" |
| 6118 | - node: '[*parser.AggregateExpr] sum by (pod) (pod_status)' |
| 6119 | op: sum |
| 6120 | - args: |
| 6121 | - '"cluster"' |
| 6122 | - '"$1"' |
| 6123 | - '"pod"' |
| 6124 | - '"(.*)"' |
| 6125 | node: '[*parser.Call] label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)")' |
| 6126 | op: label_replace |
| 6127 | indirect: |
| 6128 | - src: |
| 6129 | labels: |
| 6130 | "": |
| 6131 | reason: This query returns a number value with no labels. |
| 6132 | kind: excluded |
| 6133 | fragment: |
| 6134 | start: 42 |
| 6135 | end: 43 |
| 6136 | returns: scalar |
| 6137 | returnInfo: |
| 6138 | logicalexpr: "" |
| 6139 | valueposition: |
| 6140 | start: 42 |
| 6141 | end: 43 |
| 6142 | returnednumber: 0 |
| 6143 | alwaysreturns: true |
| 6144 | knownreturn: true |
| 6145 | isreturnbool: false |
| 6146 | position: |
| 6147 | start: 42 |
| 6148 | end: 43 |
| 6149 | type: number |
| 6150 | fixedLabels: true |
| 6151 | op: 57388 |
| 6152 | side: 1 |
| 6153 | - src: |
| 6154 | labels: |
| 6155 | "": |
| 6156 | reason: This query returns a string value with no labels. |
| 6157 | kind: excluded |
| 6158 | fragment: |
| 6159 | start: 45 |
| 6160 | end: 54 |
| 6161 | returns: string |
| 6162 | returnInfo: |
| 6163 | logicalexpr: "" |
| 6164 | valueposition: |
| 6165 | start: 0 |
| 6166 | end: 0 |
| 6167 | returnednumber: 0 |
| 6168 | alwaysreturns: true |
| 6169 | knownreturn: false |
| 6170 | isreturnbool: false |
| 6171 | position: |
| 6172 | start: 45 |
| 6173 | end: 54 |
| 6174 | type: string |
| 6175 | fixedLabels: true |
| 6176 | op: 0 |
| 6177 | side: 0 |
| 6178 | - src: |
| 6179 | labels: |
| 6180 | "": |
| 6181 | reason: This query returns a string value with no labels. |
| 6182 | kind: excluded |
| 6183 | fragment: |
| 6184 | start: 56 |
| 6185 | end: 60 |
| 6186 | returns: string |
| 6187 | returnInfo: |
| 6188 | logicalexpr: "" |
| 6189 | valueposition: |
| 6190 | start: 0 |
| 6191 | end: 0 |
| 6192 | returnednumber: 0 |
| 6193 | alwaysreturns: true |
| 6194 | knownreturn: false |
| 6195 | isreturnbool: false |
| 6196 | position: |
| 6197 | start: 56 |
| 6198 | end: 60 |
| 6199 | type: string |
| 6200 | fixedLabels: true |
| 6201 | op: 0 |
| 6202 | side: 0 |
| 6203 | - src: |
| 6204 | labels: |
| 6205 | "": |
| 6206 | reason: This query returns a string value with no labels. |
| 6207 | kind: excluded |
| 6208 | fragment: |
| 6209 | start: 62 |
| 6210 | end: 67 |
| 6211 | returns: string |
| 6212 | returnInfo: |
| 6213 | logicalexpr: "" |
| 6214 | valueposition: |
| 6215 | start: 0 |
| 6216 | end: 0 |
| 6217 | returnednumber: 0 |
| 6218 | alwaysreturns: true |
| 6219 | knownreturn: false |
| 6220 | isreturnbool: false |
| 6221 | position: |
| 6222 | start: 62 |
| 6223 | end: 67 |
| 6224 | type: string |
| 6225 | fixedLabels: true |
| 6226 | op: 0 |
| 6227 | side: 0 |
| 6228 | - src: |
| 6229 | labels: |
| 6230 | "": |
| 6231 | reason: This query returns a string value with no labels. |
| 6232 | kind: excluded |
| 6233 | fragment: |
| 6234 | start: 69 |
| 6235 | end: 75 |
| 6236 | returns: string |
| 6237 | returnInfo: |
| 6238 | logicalexpr: "" |
| 6239 | valueposition: |
| 6240 | start: 0 |
| 6241 | end: 0 |
| 6242 | returnednumber: 0 |
| 6243 | alwaysreturns: true |
| 6244 | knownreturn: false |
| 6245 | isreturnbool: false |
| 6246 | position: |
| 6247 | start: 69 |
| 6248 | end: 75 |
| 6249 | type: string |
| 6250 | fixedLabels: true |
| 6251 | op: 0 |
| 6252 | side: 0 |
| 6253 | usedLabels: |
| 6254 | - pod |
| 6255 | condition: |
| 6256 | op: 57388 |
| 6257 | present: true |
| 6258 | knownValue: true |
| 6259 | position: |
| 6260 | start: 14 |
| 6261 | end: 43 |
| 6262 | type: function |
| 6263 | fixedLabels: true |
| 6264 | |
| 6265 | --- |
| 6266 | |
| 6267 | [TestLabelsSource/111 - 1] |
| 6268 | expr: (time() - my_metric) > 5*3600 |
| 6269 | output: |
| 6270 | - returns: vector |
| 6271 | operations: |
| 6272 | - node: '[*parser.VectorSelector] my_metric' |
| 6273 | op: "" |
| 6274 | indirect: |
| 6275 | - src: |
| 6276 | labels: |
| 6277 | "": |
| 6278 | reason: Calling `time()` will return a scalar value with no labels. |
| 6279 | kind: excluded |
| 6280 | fragment: |
| 6281 | start: 1 |
| 6282 | end: 7 |
| 6283 | returns: scalar |
| 6284 | operations: |
| 6285 | - node: '[*parser.Call] time()' |
| 6286 | op: time |
| 6287 | returnInfo: |
| 6288 | logicalexpr: "" |
| 6289 | valueposition: |
| 6290 | start: 1 |
| 6291 | end: 7 |
| 6292 | returnednumber: 0 |
| 6293 | alwaysreturns: true |
| 6294 | knownreturn: false |
| 6295 | isreturnbool: false |
| 6296 | position: |
| 6297 | start: 1 |
| 6298 | end: 7 |
| 6299 | type: function |
| 6300 | fixedLabels: true |
| 6301 | op: 57401 |
| 6302 | side: 0 |
| 6303 | - src: |
| 6304 | labels: |
| 6305 | "": |
| 6306 | reason: This query returns a number value with no labels. |
| 6307 | kind: excluded |
| 6308 | fragment: |
| 6309 | start: 23 |
| 6310 | end: 24 |
| 6311 | returns: scalar |
| 6312 | indirect: |
| 6313 | - src: |
| 6314 | labels: |
| 6315 | "": |
| 6316 | reason: This query returns a number value with no labels. |
| 6317 | kind: excluded |
| 6318 | fragment: |
| 6319 | start: 25 |
| 6320 | end: 29 |
| 6321 | returns: scalar |
| 6322 | returnInfo: |
| 6323 | logicalexpr: "" |
| 6324 | valueposition: |
| 6325 | start: 25 |
| 6326 | end: 29 |
| 6327 | returnednumber: 3600 |
| 6328 | alwaysreturns: true |
| 6329 | knownreturn: true |
| 6330 | isreturnbool: false |
| 6331 | position: |
| 6332 | start: 25 |
| 6333 | end: 29 |
| 6334 | type: number |
| 6335 | fixedLabels: true |
| 6336 | op: 57397 |
| 6337 | side: 1 |
| 6338 | returnInfo: |
| 6339 | logicalexpr: 5 * 3600 |
| 6340 | valueposition: |
| 6341 | start: 23 |
| 6342 | end: 24 |
| 6343 | returnednumber: 18000 |
| 6344 | alwaysreturns: true |
| 6345 | knownreturn: true |
| 6346 | isreturnbool: false |
| 6347 | position: |
| 6348 | start: 23 |
| 6349 | end: 24 |
| 6350 | type: number |
| 6351 | fixedLabels: true |
| 6352 | op: 57388 |
| 6353 | side: 1 |
| 6354 | condition: |
| 6355 | op: 57388 |
| 6356 | value: 18000 |
| 6357 | present: true |
| 6358 | knownValue: true |
| 6359 | position: |
| 6360 | start: 10 |
| 6361 | end: 19 |
| 6362 | type: selector |
| 6363 | |
| 6364 | --- |
| 6365 | |
| 6366 | [TestLabelsSource/112 - 1] |
| 6367 | expr: up{instance="a", job="prometheus"} * ignoring(job) up{instance="a", job="pint"} |
| 6368 | output: |
| 6369 | - labels: |
| 6370 | __name__: |
| 6371 | reason: Binary operation between two vectors removes metric names. |
| 6372 | kind: excluded |
| 6373 | fragment: |
| 6374 | start: 0 |
| 6375 | end: 79 |
| 6376 | instance: |
| 6377 | reason: Query will only return series where these labels are present. |
| 6378 | kind: guaranteed |
| 6379 | fragment: |
| 6380 | start: 0 |
| 6381 | end: 34 |
| 6382 | job: |
| 6383 | reason: Query is using one-to-one vector matching with `ignoring(job)`, all labels included inside `ignoring(...)` will be removed on the results. |
| 6384 | kind: excluded |
| 6385 | fragment: |
| 6386 | start: 46 |
| 6387 | end: 49 |
| 6388 | returns: vector |
| 6389 | operations: |
| 6390 | - node: '[*parser.VectorSelector] up{instance="a",job="prometheus"}' |
| 6391 | op: "" |
| 6392 | joins: |
| 6393 | - addedlabels: [] |
| 6394 | depth: 0 |
| 6395 | ison: false |
| 6396 | matchinglabels: |
| 6397 | - job |
| 6398 | op: '*' |
| 6399 | src: |
| 6400 | labels: |
| 6401 | instance: |
| 6402 | reason: Query will only return series where these labels are present. |
| 6403 | kind: guaranteed |
| 6404 | fragment: |
| 6405 | start: 51 |
| 6406 | end: 79 |
| 6407 | job: |
| 6408 | reason: Query will only return series where these labels are present. |
| 6409 | kind: guaranteed |
| 6410 | fragment: |
| 6411 | start: 51 |
| 6412 | end: 79 |
| 6413 | returns: vector |
| 6414 | operations: |
| 6415 | - node: '[*parser.VectorSelector] up{instance="a",job="pint"}' |
| 6416 | op: "" |
| 6417 | position: |
| 6418 | start: 51 |
| 6419 | end: 79 |
| 6420 | type: selector |
| 6421 | usedLabels: |
| 6422 | - instance |
| 6423 | position: |
| 6424 | start: 0 |
| 6425 | end: 34 |
| 6426 | type: selector |
| 6427 | |
| 6428 | --- |
| 6429 | |
| 6430 | [TestLabelsSource/113 - 1] |
| 6431 | expr: |4 |
| 6432 | |
| 6433 | avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"}) |
| 6434 | < 0.5 > 0 |
| 6435 | or sum without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"}) |
| 6436 | < on() count(colo_router_tier:disabled_pops:max{tier="1",router=~"edge.*"}) * 0.4 > 0 |
| 6437 | or avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"}) |
| 6438 | < 0.1 > 0 |
| 6439 | output: |
| 6440 | - labels: |
| 6441 | __name__: |
| 6442 | reason: Aggregation removes metric name. |
| 6443 | kind: excluded |
| 6444 | fragment: |
| 6445 | start: 1 |
| 6446 | end: 101 |
| 6447 | colo_id: |
| 6448 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6449 | kind: excluded |
| 6450 | fragment: |
| 6451 | start: 21 |
| 6452 | end: 28 |
| 6453 | instance: |
| 6454 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6455 | kind: excluded |
| 6456 | fragment: |
| 6457 | start: 30 |
| 6458 | end: 38 |
| 6459 | router: |
| 6460 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6461 | kind: excluded |
| 6462 | fragment: |
| 6463 | start: 13 |
| 6464 | end: 19 |
| 6465 | returns: vector |
| 6466 | operations: |
| 6467 | - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"}' |
| 6468 | op: "" |
| 6469 | - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"})' |
| 6470 | op: avg |
| 6471 | indirect: |
| 6472 | - src: |
| 6473 | labels: |
| 6474 | "": |
| 6475 | reason: This query returns a number value with no labels. |
| 6476 | kind: excluded |
| 6477 | fragment: |
| 6478 | start: 104 |
| 6479 | end: 107 |
| 6480 | returns: scalar |
| 6481 | returnInfo: |
| 6482 | logicalexpr: "" |
| 6483 | valueposition: |
| 6484 | start: 104 |
| 6485 | end: 107 |
| 6486 | returnednumber: 0.5 |
| 6487 | alwaysreturns: true |
| 6488 | knownreturn: true |
| 6489 | isreturnbool: false |
| 6490 | position: |
| 6491 | start: 104 |
| 6492 | end: 107 |
| 6493 | type: number |
| 6494 | fixedLabels: true |
| 6495 | op: 57393 |
| 6496 | side: 1 |
| 6497 | - src: |
| 6498 | labels: |
| 6499 | "": |
| 6500 | reason: This query returns a number value with no labels. |
| 6501 | kind: excluded |
| 6502 | fragment: |
| 6503 | start: 110 |
| 6504 | end: 111 |
| 6505 | returns: scalar |
| 6506 | returnInfo: |
| 6507 | logicalexpr: "" |
| 6508 | valueposition: |
| 6509 | start: 110 |
| 6510 | end: 111 |
| 6511 | returnednumber: 0 |
| 6512 | alwaysreturns: true |
| 6513 | knownreturn: true |
| 6514 | isreturnbool: false |
| 6515 | position: |
| 6516 | start: 110 |
| 6517 | end: 111 |
| 6518 | type: number |
| 6519 | fixedLabels: true |
| 6520 | op: 57388 |
| 6521 | side: 1 |
| 6522 | condition: |
| 6523 | op: 57393 |
| 6524 | value: 0.5 |
| 6525 | present: true |
| 6526 | knownValue: true |
| 6527 | position: |
| 6528 | start: 41 |
| 6529 | end: 100 |
| 6530 | type: aggregation |
| 6531 | - labels: |
| 6532 | "": |
| 6533 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 6534 | kind: excluded |
| 6535 | fragment: |
| 6536 | start: 216 |
| 6537 | end: 220 |
| 6538 | __name__: |
| 6539 | reason: Binary operation between two vectors removes metric names. |
| 6540 | kind: excluded |
| 6541 | fragment: |
| 6542 | start: 115 |
| 6543 | end: 295 |
| 6544 | cidr_use_case: |
| 6545 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 6546 | kind: excluded |
| 6547 | fragment: |
| 6548 | start: 216 |
| 6549 | end: 220 |
| 6550 | colo_id: |
| 6551 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6552 | kind: excluded |
| 6553 | fragment: |
| 6554 | start: 135 |
| 6555 | end: 142 |
| 6556 | instance: |
| 6557 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6558 | kind: excluded |
| 6559 | fragment: |
| 6560 | start: 144 |
| 6561 | end: 152 |
| 6562 | router: |
| 6563 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6564 | kind: excluded |
| 6565 | fragment: |
| 6566 | start: 127 |
| 6567 | end: 133 |
| 6568 | returns: vector |
| 6569 | operations: |
| 6570 | - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"}' |
| 6571 | op: "" |
| 6572 | - node: '[*parser.AggregateExpr] sum without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"})' |
| 6573 | op: sum |
| 6574 | joins: |
| 6575 | - addedlabels: [] |
| 6576 | depth: 0 |
| 6577 | ison: true |
| 6578 | matchinglabels: [] |
| 6579 | op: < |
| 6580 | src: |
| 6581 | labels: |
| 6582 | "": |
| 6583 | reason: Query is using aggregation that removes all labels. |
| 6584 | kind: excluded |
| 6585 | fragment: |
| 6586 | start: 221 |
| 6587 | end: 226 |
| 6588 | __name__: |
| 6589 | reason: Aggregation removes metric name. |
| 6590 | kind: excluded |
| 6591 | fragment: |
| 6592 | start: 221 |
| 6593 | end: 289 |
| 6594 | router: |
| 6595 | reason: Query is using aggregation that removes all labels. |
| 6596 | kind: excluded |
| 6597 | fragment: |
| 6598 | start: 221 |
| 6599 | end: 226 |
| 6600 | tier: |
| 6601 | reason: Query is using aggregation that removes all labels. |
| 6602 | kind: excluded |
| 6603 | fragment: |
| 6604 | start: 221 |
| 6605 | end: 226 |
| 6606 | returns: vector |
| 6607 | operations: |
| 6608 | - node: '[*parser.VectorSelector] colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"}' |
| 6609 | op: "" |
| 6610 | - node: '[*parser.AggregateExpr] count(colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"})' |
| 6611 | op: count |
| 6612 | indirect: |
| 6613 | - src: |
| 6614 | labels: |
| 6615 | "": |
| 6616 | reason: This query returns a number value with no labels. |
| 6617 | kind: excluded |
| 6618 | fragment: |
| 6619 | start: 292 |
| 6620 | end: 295 |
| 6621 | returns: scalar |
| 6622 | returnInfo: |
| 6623 | logicalexpr: "" |
| 6624 | valueposition: |
| 6625 | start: 292 |
| 6626 | end: 295 |
| 6627 | returnednumber: 0.4 |
| 6628 | alwaysreturns: true |
| 6629 | knownreturn: true |
| 6630 | isreturnbool: false |
| 6631 | position: |
| 6632 | start: 292 |
| 6633 | end: 295 |
| 6634 | type: number |
| 6635 | fixedLabels: true |
| 6636 | op: 57397 |
| 6637 | side: 1 |
| 6638 | position: |
| 6639 | start: 227 |
| 6640 | end: 288 |
| 6641 | type: aggregation |
| 6642 | fixedLabels: true |
| 6643 | indirect: |
| 6644 | - src: |
| 6645 | labels: |
| 6646 | "": |
| 6647 | reason: This query returns a number value with no labels. |
| 6648 | kind: excluded |
| 6649 | fragment: |
| 6650 | start: 298 |
| 6651 | end: 299 |
| 6652 | returns: scalar |
| 6653 | returnInfo: |
| 6654 | logicalexpr: "" |
| 6655 | valueposition: |
| 6656 | start: 298 |
| 6657 | end: 299 |
| 6658 | returnednumber: 0 |
| 6659 | alwaysreturns: true |
| 6660 | knownreturn: true |
| 6661 | isreturnbool: false |
| 6662 | position: |
| 6663 | start: 298 |
| 6664 | end: 299 |
| 6665 | type: number |
| 6666 | fixedLabels: true |
| 6667 | op: 57388 |
| 6668 | side: 1 |
| 6669 | condition: |
| 6670 | op: 57393 |
| 6671 | present: true |
| 6672 | position: |
| 6673 | start: 155 |
| 6674 | end: 212 |
| 6675 | type: aggregation |
| 6676 | fixedLabels: true |
| 6677 | - labels: |
| 6678 | __name__: |
| 6679 | reason: Aggregation removes metric name. |
| 6680 | kind: excluded |
| 6681 | fragment: |
| 6682 | start: 303 |
| 6683 | end: 404 |
| 6684 | cidr_use_case: |
| 6685 | reason: Query will only return series where these labels are present. |
| 6686 | kind: guaranteed |
| 6687 | fragment: |
| 6688 | start: 343 |
| 6689 | end: 403 |
| 6690 | colo_id: |
| 6691 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6692 | kind: excluded |
| 6693 | fragment: |
| 6694 | start: 323 |
| 6695 | end: 330 |
| 6696 | instance: |
| 6697 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6698 | kind: excluded |
| 6699 | fragment: |
| 6700 | start: 332 |
| 6701 | end: 340 |
| 6702 | router: |
| 6703 | reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results. |
| 6704 | kind: excluded |
| 6705 | fragment: |
| 6706 | start: 315 |
| 6707 | end: 321 |
| 6708 | returns: vector |
| 6709 | operations: |
| 6710 | - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"}' |
| 6711 | op: "" |
| 6712 | - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"})' |
| 6713 | op: avg |
| 6714 | indirect: |
| 6715 | - src: |
| 6716 | labels: |
| 6717 | "": |
| 6718 | reason: This query returns a number value with no labels. |
| 6719 | kind: excluded |
| 6720 | fragment: |
| 6721 | start: 407 |
| 6722 | end: 410 |
| 6723 | returns: scalar |
| 6724 | returnInfo: |
| 6725 | logicalexpr: "" |
| 6726 | valueposition: |
| 6727 | start: 407 |
| 6728 | end: 410 |
| 6729 | returnednumber: 0.1 |
| 6730 | alwaysreturns: true |
| 6731 | knownreturn: true |
| 6732 | isreturnbool: false |
| 6733 | position: |
| 6734 | start: 407 |
| 6735 | end: 410 |
| 6736 | type: number |
| 6737 | fixedLabels: true |
| 6738 | op: 57393 |
| 6739 | side: 1 |
| 6740 | - src: |
| 6741 | labels: |
| 6742 | "": |
| 6743 | reason: This query returns a number value with no labels. |
| 6744 | kind: excluded |
| 6745 | fragment: |
| 6746 | start: 413 |
| 6747 | end: 414 |
| 6748 | returns: scalar |
| 6749 | returnInfo: |
| 6750 | logicalexpr: "" |
| 6751 | valueposition: |
| 6752 | start: 413 |
| 6753 | end: 414 |
| 6754 | returnednumber: 0 |
| 6755 | alwaysreturns: true |
| 6756 | knownreturn: true |
| 6757 | isreturnbool: false |
| 6758 | position: |
| 6759 | start: 413 |
| 6760 | end: 414 |
| 6761 | type: number |
| 6762 | fixedLabels: true |
| 6763 | op: 57388 |
| 6764 | side: 1 |
| 6765 | condition: |
| 6766 | op: 57393 |
| 6767 | value: 0.1 |
| 6768 | present: true |
| 6769 | knownValue: true |
| 6770 | position: |
| 6771 | start: 343 |
| 6772 | end: 403 |
| 6773 | type: aggregation |
| 6774 | |
| 6775 | --- |
| 6776 | |
| 6777 | [TestLabelsSource/114 - 1] |
| 6778 | expr: label_replace(sum(foo) without(instance), "instance", "none", "", "") |
| 6779 | output: |
| 6780 | - labels: |
| 6781 | __name__: |
| 6782 | reason: Aggregation removes metric name. |
| 6783 | kind: excluded |
| 6784 | fragment: |
| 6785 | start: 14 |
| 6786 | end: 40 |
| 6787 | instance: |
| 6788 | reason: This label will be added to the result by a label_replace() call. |
| 6789 | kind: guaranteed |
| 6790 | fragment: |
| 6791 | start: 0 |
| 6792 | end: 69 |
| 6793 | returns: vector |
| 6794 | operations: |
| 6795 | - node: '[*parser.VectorSelector] foo' |
| 6796 | op: "" |
| 6797 | - node: '[*parser.AggregateExpr] sum without (instance) (foo)' |
| 6798 | op: sum |
| 6799 | - args: |
| 6800 | - '"instance"' |
| 6801 | - '"none"' |
| 6802 | - '""' |
| 6803 | - '""' |
| 6804 | node: '[*parser.Call] label_replace(sum without (instance) (foo), "instance", "none", "", "")' |
| 6805 | op: label_replace |
| 6806 | indirect: |
| 6807 | - src: |
| 6808 | labels: |
| 6809 | "": |
| 6810 | reason: This query returns a string value with no labels. |
| 6811 | kind: excluded |
| 6812 | fragment: |
| 6813 | start: 42 |
| 6814 | end: 52 |
| 6815 | returns: string |
| 6816 | returnInfo: |
| 6817 | logicalexpr: "" |
| 6818 | valueposition: |
| 6819 | start: 0 |
| 6820 | end: 0 |
| 6821 | returnednumber: 0 |
| 6822 | alwaysreturns: true |
| 6823 | knownreturn: false |
| 6824 | isreturnbool: false |
| 6825 | position: |
| 6826 | start: 42 |
| 6827 | end: 52 |
| 6828 | type: string |
| 6829 | fixedLabels: true |
| 6830 | op: 0 |
| 6831 | side: 0 |
| 6832 | - src: |
| 6833 | labels: |
| 6834 | "": |
| 6835 | reason: This query returns a string value with no labels. |
| 6836 | kind: excluded |
| 6837 | fragment: |
| 6838 | start: 54 |
| 6839 | end: 60 |
| 6840 | returns: string |
| 6841 | returnInfo: |
| 6842 | logicalexpr: "" |
| 6843 | valueposition: |
| 6844 | start: 0 |
| 6845 | end: 0 |
| 6846 | returnednumber: 0 |
| 6847 | alwaysreturns: true |
| 6848 | knownreturn: false |
| 6849 | isreturnbool: false |
| 6850 | position: |
| 6851 | start: 54 |
| 6852 | end: 60 |
| 6853 | type: string |
| 6854 | fixedLabels: true |
| 6855 | op: 0 |
| 6856 | side: 0 |
| 6857 | - src: |
| 6858 | labels: |
| 6859 | "": |
| 6860 | reason: This query returns a string value with no labels. |
| 6861 | kind: excluded |
| 6862 | fragment: |
| 6863 | start: 62 |
| 6864 | end: 64 |
| 6865 | returns: string |
| 6866 | returnInfo: |
| 6867 | logicalexpr: "" |
| 6868 | valueposition: |
| 6869 | start: 0 |
| 6870 | end: 0 |
| 6871 | returnednumber: 0 |
| 6872 | alwaysreturns: true |
| 6873 | knownreturn: false |
| 6874 | isreturnbool: false |
| 6875 | position: |
| 6876 | start: 62 |
| 6877 | end: 64 |
| 6878 | type: string |
| 6879 | fixedLabels: true |
| 6880 | op: 0 |
| 6881 | side: 0 |
| 6882 | - src: |
| 6883 | labels: |
| 6884 | "": |
| 6885 | reason: This query returns a string value with no labels. |
| 6886 | kind: excluded |
| 6887 | fragment: |
| 6888 | start: 66 |
| 6889 | end: 68 |
| 6890 | returns: string |
| 6891 | returnInfo: |
| 6892 | logicalexpr: "" |
| 6893 | valueposition: |
| 6894 | start: 0 |
| 6895 | end: 0 |
| 6896 | returnednumber: 0 |
| 6897 | alwaysreturns: true |
| 6898 | knownreturn: false |
| 6899 | isreturnbool: false |
| 6900 | position: |
| 6901 | start: 66 |
| 6902 | end: 68 |
| 6903 | type: string |
| 6904 | fixedLabels: true |
| 6905 | op: 0 |
| 6906 | side: 0 |
| 6907 | usedLabels: |
| 6908 | - "" |
| 6909 | position: |
| 6910 | start: 14 |
| 6911 | end: 40 |
| 6912 | type: function |
| 6913 | |
| 6914 | --- |
| 6915 | |
| 6916 | [TestLabelsSource/115 - 1] |
| 6917 | expr: |4- |
| 6918 | |
| 6919 | sum by (region, target, colo_name) ( |
| 6920 | sum_over_time(probe_success{job="abc"}[5m]) |
| 6921 | or |
| 6922 | vector(1) |
| 6923 | ) == 0 |
| 6924 | output: |
| 6925 | - labels: |
| 6926 | "": |
| 6927 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 6928 | kind: excluded |
| 6929 | fragment: |
| 6930 | start: 5 |
| 6931 | end: 7 |
| 6932 | __name__: |
| 6933 | reason: Aggregation removes metric name. |
| 6934 | kind: excluded |
| 6935 | fragment: |
| 6936 | start: 1 |
| 6937 | end: 102 |
| 6938 | colo_name: |
| 6939 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 6940 | kind: included |
| 6941 | fragment: |
| 6942 | start: 25 |
| 6943 | end: 34 |
| 6944 | job: |
| 6945 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 6946 | kind: excluded |
| 6947 | fragment: |
| 6948 | start: 5 |
| 6949 | end: 35 |
| 6950 | region: |
| 6951 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 6952 | kind: included |
| 6953 | fragment: |
| 6954 | start: 9 |
| 6955 | end: 15 |
| 6956 | target: |
| 6957 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 6958 | kind: included |
| 6959 | fragment: |
| 6960 | start: 17 |
| 6961 | end: 23 |
| 6962 | returns: vector |
| 6963 | operations: |
| 6964 | - node: '[*parser.MatrixSelector] probe_success{job="abc"}[5m]' |
| 6965 | op: "" |
| 6966 | - node: '[*parser.VectorSelector] probe_success{job="abc"}' |
| 6967 | op: "" |
| 6968 | - node: '[*parser.Call] sum_over_time(probe_success{job="abc"}[5m])' |
| 6969 | op: sum_over_time |
| 6970 | - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))' |
| 6971 | op: sum |
| 6972 | indirect: |
| 6973 | - src: |
| 6974 | labels: |
| 6975 | "": |
| 6976 | reason: This query returns a number value with no labels. |
| 6977 | kind: excluded |
| 6978 | fragment: |
| 6979 | start: 106 |
| 6980 | end: 107 |
| 6981 | returns: scalar |
| 6982 | returnInfo: |
| 6983 | logicalexpr: "" |
| 6984 | valueposition: |
| 6985 | start: 106 |
| 6986 | end: 107 |
| 6987 | returnednumber: 0 |
| 6988 | alwaysreturns: true |
| 6989 | knownreturn: true |
| 6990 | isreturnbool: false |
| 6991 | position: |
| 6992 | start: 106 |
| 6993 | end: 107 |
| 6994 | type: number |
| 6995 | fixedLabels: true |
| 6996 | op: 57385 |
| 6997 | side: 1 |
| 6998 | usedLabels: |
| 6999 | - region |
| 7000 | - target |
| 7001 | - colo_name |
| 7002 | condition: |
| 7003 | op: 57385 |
| 7004 | present: true |
| 7005 | knownValue: true |
| 7006 | position: |
| 7007 | start: 56 |
| 7008 | end: 84 |
| 7009 | type: aggregation |
| 7010 | fixedLabels: true |
| 7011 | - labels: |
| 7012 | "": |
| 7013 | reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 7014 | kind: excluded |
| 7015 | fragment: |
| 7016 | start: 5 |
| 7017 | end: 7 |
| 7018 | __name__: |
| 7019 | reason: Aggregation removes metric name. |
| 7020 | kind: excluded |
| 7021 | fragment: |
| 7022 | start: 1 |
| 7023 | end: 102 |
| 7024 | colo_name: |
| 7025 | reason: Calling `vector()` will return a vector value with no labels. |
| 7026 | kind: excluded |
| 7027 | fragment: |
| 7028 | start: 91 |
| 7029 | end: 97 |
| 7030 | region: |
| 7031 | reason: Calling `vector()` will return a vector value with no labels. |
| 7032 | kind: excluded |
| 7033 | fragment: |
| 7034 | start: 91 |
| 7035 | end: 97 |
| 7036 | target: |
| 7037 | reason: Calling `vector()` will return a vector value with no labels. |
| 7038 | kind: excluded |
| 7039 | fragment: |
| 7040 | start: 91 |
| 7041 | end: 97 |
| 7042 | deadInfo: |
| 7043 | reason: '`vector(1) == 0` always evaluates to `1 == 0` which is not possible, so it will never return anything.' |
| 7044 | fragment: |
| 7045 | start: 91 |
| 7046 | end: 100 |
| 7047 | returns: vector |
| 7048 | deadLabels: |
| 7049 | - name: region |
| 7050 | reason: You can't use `region` because this label is not possible here. |
| 7051 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 7052 | usagefragment: |
| 7053 | start: 9 |
| 7054 | end: 15 |
| 7055 | labelfragment: |
| 7056 | start: 91 |
| 7057 | end: 97 |
| 7058 | kind: 0 |
| 7059 | - name: target |
| 7060 | reason: You can't use `target` because this label is not possible here. |
| 7061 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 7062 | usagefragment: |
| 7063 | start: 17 |
| 7064 | end: 23 |
| 7065 | labelfragment: |
| 7066 | start: 91 |
| 7067 | end: 97 |
| 7068 | kind: 0 |
| 7069 | - name: colo_name |
| 7070 | reason: You can't use `colo_name` because this label is not possible here. |
| 7071 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 7072 | usagefragment: |
| 7073 | start: 25 |
| 7074 | end: 34 |
| 7075 | labelfragment: |
| 7076 | start: 91 |
| 7077 | end: 97 |
| 7078 | kind: 0 |
| 7079 | operations: |
| 7080 | - args: |
| 7081 | - "1" |
| 7082 | node: '[*parser.Call] vector(1)' |
| 7083 | op: vector |
| 7084 | - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))' |
| 7085 | op: sum |
| 7086 | indirect: |
| 7087 | - src: |
| 7088 | labels: |
| 7089 | "": |
| 7090 | reason: This query returns a number value with no labels. |
| 7091 | kind: excluded |
| 7092 | fragment: |
| 7093 | start: 98 |
| 7094 | end: 99 |
| 7095 | returns: scalar |
| 7096 | returnInfo: |
| 7097 | logicalexpr: "" |
| 7098 | valueposition: |
| 7099 | start: 98 |
| 7100 | end: 99 |
| 7101 | returnednumber: 1 |
| 7102 | alwaysreturns: true |
| 7103 | knownreturn: true |
| 7104 | isreturnbool: false |
| 7105 | position: |
| 7106 | start: 98 |
| 7107 | end: 99 |
| 7108 | type: number |
| 7109 | fixedLabels: true |
| 7110 | op: 0 |
| 7111 | side: 0 |
| 7112 | - src: |
| 7113 | labels: |
| 7114 | "": |
| 7115 | reason: This query returns a number value with no labels. |
| 7116 | kind: excluded |
| 7117 | fragment: |
| 7118 | start: 106 |
| 7119 | end: 107 |
| 7120 | returns: scalar |
| 7121 | returnInfo: |
| 7122 | logicalexpr: "" |
| 7123 | valueposition: |
| 7124 | start: 106 |
| 7125 | end: 107 |
| 7126 | returnednumber: 0 |
| 7127 | alwaysreturns: true |
| 7128 | knownreturn: true |
| 7129 | isreturnbool: false |
| 7130 | position: |
| 7131 | start: 106 |
| 7132 | end: 107 |
| 7133 | type: number |
| 7134 | fixedLabels: true |
| 7135 | op: 57385 |
| 7136 | side: 1 |
| 7137 | usedLabels: |
| 7138 | - region |
| 7139 | - target |
| 7140 | - colo_name |
| 7141 | returnInfo: |
| 7142 | logicalexpr: "" |
| 7143 | valueposition: |
| 7144 | start: 91 |
| 7145 | end: 100 |
| 7146 | returnednumber: 1 |
| 7147 | alwaysreturns: true |
| 7148 | knownreturn: true |
| 7149 | isreturnbool: false |
| 7150 | condition: |
| 7151 | op: 57385 |
| 7152 | present: true |
| 7153 | knownValue: true |
| 7154 | position: |
| 7155 | start: 91 |
| 7156 | end: 100 |
| 7157 | type: aggregation |
| 7158 | fixedLabels: true |
| 7159 | |
| 7160 | --- |
| 7161 | |
| 7162 | [TestLabelsSource/116 - 1] |
| 7163 | expr: vector(1) or foo |
| 7164 | output: |
| 7165 | - labels: |
| 7166 | "": |
| 7167 | reason: Calling `vector()` will return a vector value with no labels. |
| 7168 | kind: excluded |
| 7169 | fragment: |
| 7170 | start: 0 |
| 7171 | end: 6 |
| 7172 | returns: vector |
| 7173 | operations: |
| 7174 | - args: |
| 7175 | - "1" |
| 7176 | node: '[*parser.Call] vector(1)' |
| 7177 | op: vector |
| 7178 | indirect: |
| 7179 | - src: |
| 7180 | labels: |
| 7181 | "": |
| 7182 | reason: This query returns a number value with no labels. |
| 7183 | kind: excluded |
| 7184 | fragment: |
| 7185 | start: 7 |
| 7186 | end: 8 |
| 7187 | returns: scalar |
| 7188 | returnInfo: |
| 7189 | logicalexpr: "" |
| 7190 | valueposition: |
| 7191 | start: 7 |
| 7192 | end: 8 |
| 7193 | returnednumber: 1 |
| 7194 | alwaysreturns: true |
| 7195 | knownreturn: true |
| 7196 | isreturnbool: false |
| 7197 | position: |
| 7198 | start: 7 |
| 7199 | end: 8 |
| 7200 | type: number |
| 7201 | fixedLabels: true |
| 7202 | op: 0 |
| 7203 | side: 0 |
| 7204 | returnInfo: |
| 7205 | logicalexpr: "" |
| 7206 | valueposition: |
| 7207 | start: 0 |
| 7208 | end: 9 |
| 7209 | returnednumber: 1 |
| 7210 | alwaysreturns: true |
| 7211 | knownreturn: true |
| 7212 | isreturnbool: false |
| 7213 | position: |
| 7214 | start: 0 |
| 7215 | end: 9 |
| 7216 | type: function |
| 7217 | fixedLabels: true |
| 7218 | - deadInfo: |
| 7219 | reason: The left hand side always returns something and so the right hand side is never used. |
| 7220 | fragment: |
| 7221 | start: 13 |
| 7222 | end: 16 |
| 7223 | returns: vector |
| 7224 | operations: |
| 7225 | - node: '[*parser.VectorSelector] foo' |
| 7226 | op: "" |
| 7227 | position: |
| 7228 | start: 13 |
| 7229 | end: 16 |
| 7230 | type: selector |
| 7231 | |
| 7232 | --- |
| 7233 | |
| 7234 | [TestLabelsSource/117 - 1] |
| 7235 | expr: vector(0) > 0 |
| 7236 | output: |
| 7237 | - labels: |
| 7238 | "": |
| 7239 | reason: Calling `vector()` will return a vector value with no labels. |
| 7240 | kind: excluded |
| 7241 | fragment: |
| 7242 | start: 0 |
| 7243 | end: 6 |
| 7244 | deadInfo: |
| 7245 | reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.' |
| 7246 | fragment: |
| 7247 | start: 0 |
| 7248 | end: 9 |
| 7249 | returns: vector |
| 7250 | operations: |
| 7251 | - args: |
| 7252 | - "0" |
| 7253 | node: '[*parser.Call] vector(0)' |
| 7254 | op: vector |
| 7255 | indirect: |
| 7256 | - src: |
| 7257 | labels: |
| 7258 | "": |
| 7259 | reason: This query returns a number value with no labels. |
| 7260 | kind: excluded |
| 7261 | fragment: |
| 7262 | start: 7 |
| 7263 | end: 8 |
| 7264 | returns: scalar |
| 7265 | returnInfo: |
| 7266 | logicalexpr: "" |
| 7267 | valueposition: |
| 7268 | start: 7 |
| 7269 | end: 8 |
| 7270 | returnednumber: 0 |
| 7271 | alwaysreturns: true |
| 7272 | knownreturn: true |
| 7273 | isreturnbool: false |
| 7274 | position: |
| 7275 | start: 7 |
| 7276 | end: 8 |
| 7277 | type: number |
| 7278 | fixedLabels: true |
| 7279 | op: 0 |
| 7280 | side: 0 |
| 7281 | - src: |
| 7282 | labels: |
| 7283 | "": |
| 7284 | reason: This query returns a number value with no labels. |
| 7285 | kind: excluded |
| 7286 | fragment: |
| 7287 | start: 12 |
| 7288 | end: 13 |
| 7289 | returns: scalar |
| 7290 | returnInfo: |
| 7291 | logicalexpr: "" |
| 7292 | valueposition: |
| 7293 | start: 12 |
| 7294 | end: 13 |
| 7295 | returnednumber: 0 |
| 7296 | alwaysreturns: true |
| 7297 | knownreturn: true |
| 7298 | isreturnbool: false |
| 7299 | position: |
| 7300 | start: 12 |
| 7301 | end: 13 |
| 7302 | type: number |
| 7303 | fixedLabels: true |
| 7304 | op: 57388 |
| 7305 | side: 1 |
| 7306 | returnInfo: |
| 7307 | logicalexpr: "" |
| 7308 | valueposition: |
| 7309 | start: 0 |
| 7310 | end: 9 |
| 7311 | returnednumber: 0 |
| 7312 | alwaysreturns: true |
| 7313 | knownreturn: true |
| 7314 | isreturnbool: false |
| 7315 | condition: |
| 7316 | op: 57388 |
| 7317 | present: true |
| 7318 | knownValue: true |
| 7319 | position: |
| 7320 | start: 0 |
| 7321 | end: 9 |
| 7322 | type: function |
| 7323 | fixedLabels: true |
| 7324 | |
| 7325 | --- |
| 7326 | |
| 7327 | [TestLabelsSource/118 - 1] |
| 7328 | expr: vector(0) > vector(1) |
| 7329 | output: |
| 7330 | - labels: |
| 7331 | "": |
| 7332 | reason: Calling `vector()` will return a vector value with no labels. |
| 7333 | kind: excluded |
| 7334 | fragment: |
| 7335 | start: 0 |
| 7336 | end: 6 |
| 7337 | __name__: |
| 7338 | reason: Binary operation between two vectors removes metric names. |
| 7339 | kind: excluded |
| 7340 | fragment: |
| 7341 | start: 0 |
| 7342 | end: 21 |
| 7343 | deadInfo: |
| 7344 | reason: '`vector(0) > vector(1)` always evaluates to `0 > 1` which is not possible, so it will never return anything.' |
| 7345 | fragment: |
| 7346 | start: 0 |
| 7347 | end: 9 |
| 7348 | returns: vector |
| 7349 | operations: |
| 7350 | - args: |
| 7351 | - "0" |
| 7352 | node: '[*parser.Call] vector(0)' |
| 7353 | op: vector |
| 7354 | joins: |
| 7355 | - addedlabels: [] |
| 7356 | depth: 0 |
| 7357 | ison: false |
| 7358 | matchinglabels: [] |
| 7359 | op: '>' |
| 7360 | src: |
| 7361 | labels: |
| 7362 | "": |
| 7363 | reason: Calling `vector()` will return a vector value with no labels. |
| 7364 | kind: excluded |
| 7365 | fragment: |
| 7366 | start: 12 |
| 7367 | end: 18 |
| 7368 | returns: vector |
| 7369 | operations: |
| 7370 | - args: |
| 7371 | - "1" |
| 7372 | node: '[*parser.Call] vector(1)' |
| 7373 | op: vector |
| 7374 | indirect: |
| 7375 | - src: |
| 7376 | labels: |
| 7377 | "": |
| 7378 | reason: This query returns a number value with no labels. |
| 7379 | kind: excluded |
| 7380 | fragment: |
| 7381 | start: 19 |
| 7382 | end: 20 |
| 7383 | returns: scalar |
| 7384 | returnInfo: |
| 7385 | logicalexpr: "" |
| 7386 | valueposition: |
| 7387 | start: 19 |
| 7388 | end: 20 |
| 7389 | returnednumber: 1 |
| 7390 | alwaysreturns: true |
| 7391 | knownreturn: true |
| 7392 | isreturnbool: false |
| 7393 | position: |
| 7394 | start: 19 |
| 7395 | end: 20 |
| 7396 | type: number |
| 7397 | fixedLabels: true |
| 7398 | op: 0 |
| 7399 | side: 0 |
| 7400 | returnInfo: |
| 7401 | logicalexpr: "" |
| 7402 | valueposition: |
| 7403 | start: 12 |
| 7404 | end: 21 |
| 7405 | returnednumber: 1 |
| 7406 | alwaysreturns: true |
| 7407 | knownreturn: true |
| 7408 | isreturnbool: false |
| 7409 | position: |
| 7410 | start: 12 |
| 7411 | end: 21 |
| 7412 | type: function |
| 7413 | fixedLabels: true |
| 7414 | indirect: |
| 7415 | - src: |
| 7416 | labels: |
| 7417 | "": |
| 7418 | reason: This query returns a number value with no labels. |
| 7419 | kind: excluded |
| 7420 | fragment: |
| 7421 | start: 7 |
| 7422 | end: 8 |
| 7423 | returns: scalar |
| 7424 | returnInfo: |
| 7425 | logicalexpr: "" |
| 7426 | valueposition: |
| 7427 | start: 7 |
| 7428 | end: 8 |
| 7429 | returnednumber: 0 |
| 7430 | alwaysreturns: true |
| 7431 | knownreturn: true |
| 7432 | isreturnbool: false |
| 7433 | position: |
| 7434 | start: 7 |
| 7435 | end: 8 |
| 7436 | type: number |
| 7437 | fixedLabels: true |
| 7438 | op: 0 |
| 7439 | side: 0 |
| 7440 | returnInfo: |
| 7441 | logicalexpr: "" |
| 7442 | valueposition: |
| 7443 | start: 0 |
| 7444 | end: 9 |
| 7445 | returnednumber: 0 |
| 7446 | alwaysreturns: true |
| 7447 | knownreturn: true |
| 7448 | isreturnbool: false |
| 7449 | condition: |
| 7450 | op: 57388 |
| 7451 | value: 1 |
| 7452 | present: true |
| 7453 | knownValue: true |
| 7454 | position: |
| 7455 | start: 0 |
| 7456 | end: 9 |
| 7457 | type: function |
| 7458 | fixedLabels: true |
| 7459 | |
| 7460 | --- |
| 7461 | |
| 7462 | [TestLabelsSource/119 - 1] |
| 7463 | expr: sum(foo or vector(0)) > 0 |
| 7464 | output: |
| 7465 | - labels: |
| 7466 | "": |
| 7467 | reason: Query is using aggregation that removes all labels. |
| 7468 | kind: excluded |
| 7469 | fragment: |
| 7470 | start: 0 |
| 7471 | end: 3 |
| 7472 | __name__: |
| 7473 | reason: Aggregation removes metric name. |
| 7474 | kind: excluded |
| 7475 | fragment: |
| 7476 | start: 0 |
| 7477 | end: 21 |
| 7478 | returns: vector |
| 7479 | operations: |
| 7480 | - node: '[*parser.VectorSelector] foo' |
| 7481 | op: "" |
| 7482 | - node: '[*parser.AggregateExpr] sum(foo or vector(0))' |
| 7483 | op: sum |
| 7484 | indirect: |
| 7485 | - src: |
| 7486 | labels: |
| 7487 | "": |
| 7488 | reason: This query returns a number value with no labels. |
| 7489 | kind: excluded |
| 7490 | fragment: |
| 7491 | start: 24 |
| 7492 | end: 25 |
| 7493 | returns: scalar |
| 7494 | returnInfo: |
| 7495 | logicalexpr: "" |
| 7496 | valueposition: |
| 7497 | start: 24 |
| 7498 | end: 25 |
| 7499 | returnednumber: 0 |
| 7500 | alwaysreturns: true |
| 7501 | knownreturn: true |
| 7502 | isreturnbool: false |
| 7503 | position: |
| 7504 | start: 24 |
| 7505 | end: 25 |
| 7506 | type: number |
| 7507 | fixedLabels: true |
| 7508 | op: 57388 |
| 7509 | side: 1 |
| 7510 | condition: |
| 7511 | op: 57388 |
| 7512 | present: true |
| 7513 | knownValue: true |
| 7514 | position: |
| 7515 | start: 4 |
| 7516 | end: 7 |
| 7517 | type: aggregation |
| 7518 | fixedLabels: true |
| 7519 | - labels: |
| 7520 | "": |
| 7521 | reason: Query is using aggregation that removes all labels. |
| 7522 | kind: excluded |
| 7523 | fragment: |
| 7524 | start: 0 |
| 7525 | end: 3 |
| 7526 | __name__: |
| 7527 | reason: Aggregation removes metric name. |
| 7528 | kind: excluded |
| 7529 | fragment: |
| 7530 | start: 0 |
| 7531 | end: 21 |
| 7532 | deadInfo: |
| 7533 | reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.' |
| 7534 | fragment: |
| 7535 | start: 11 |
| 7536 | end: 20 |
| 7537 | returns: vector |
| 7538 | operations: |
| 7539 | - args: |
| 7540 | - "0" |
| 7541 | node: '[*parser.Call] vector(0)' |
| 7542 | op: vector |
| 7543 | - node: '[*parser.AggregateExpr] sum(foo or vector(0))' |
| 7544 | op: sum |
| 7545 | indirect: |
| 7546 | - src: |
| 7547 | labels: |
| 7548 | "": |
| 7549 | reason: This query returns a number value with no labels. |
| 7550 | kind: excluded |
| 7551 | fragment: |
| 7552 | start: 18 |
| 7553 | end: 19 |
| 7554 | returns: scalar |
| 7555 | returnInfo: |
| 7556 | logicalexpr: "" |
| 7557 | valueposition: |
| 7558 | start: 18 |
| 7559 | end: 19 |
| 7560 | returnednumber: 0 |
| 7561 | alwaysreturns: true |
| 7562 | knownreturn: true |
| 7563 | isreturnbool: false |
| 7564 | position: |
| 7565 | start: 18 |
| 7566 | end: 19 |
| 7567 | type: number |
| 7568 | fixedLabels: true |
| 7569 | op: 0 |
| 7570 | side: 0 |
| 7571 | - src: |
| 7572 | labels: |
| 7573 | "": |
| 7574 | reason: This query returns a number value with no labels. |
| 7575 | kind: excluded |
| 7576 | fragment: |
| 7577 | start: 24 |
| 7578 | end: 25 |
| 7579 | returns: scalar |
| 7580 | returnInfo: |
| 7581 | logicalexpr: "" |
| 7582 | valueposition: |
| 7583 | start: 24 |
| 7584 | end: 25 |
| 7585 | returnednumber: 0 |
| 7586 | alwaysreturns: true |
| 7587 | knownreturn: true |
| 7588 | isreturnbool: false |
| 7589 | position: |
| 7590 | start: 24 |
| 7591 | end: 25 |
| 7592 | type: number |
| 7593 | fixedLabels: true |
| 7594 | op: 57388 |
| 7595 | side: 1 |
| 7596 | returnInfo: |
| 7597 | logicalexpr: "" |
| 7598 | valueposition: |
| 7599 | start: 11 |
| 7600 | end: 20 |
| 7601 | returnednumber: 0 |
| 7602 | alwaysreturns: true |
| 7603 | knownreturn: true |
| 7604 | isreturnbool: false |
| 7605 | condition: |
| 7606 | op: 57388 |
| 7607 | present: true |
| 7608 | knownValue: true |
| 7609 | position: |
| 7610 | start: 11 |
| 7611 | end: 20 |
| 7612 | type: aggregation |
| 7613 | fixedLabels: true |
| 7614 | |
| 7615 | --- |
| 7616 | |
| 7617 | [TestLabelsSource/120 - 1] |
| 7618 | expr: (sum(foo or vector(1)) > 0) == 2 |
| 7619 | output: |
| 7620 | - labels: |
| 7621 | "": |
| 7622 | reason: Query is using aggregation that removes all labels. |
| 7623 | kind: excluded |
| 7624 | fragment: |
| 7625 | start: 1 |
| 7626 | end: 4 |
| 7627 | __name__: |
| 7628 | reason: Aggregation removes metric name. |
| 7629 | kind: excluded |
| 7630 | fragment: |
| 7631 | start: 1 |
| 7632 | end: 22 |
| 7633 | returns: vector |
| 7634 | operations: |
| 7635 | - node: '[*parser.VectorSelector] foo' |
| 7636 | op: "" |
| 7637 | - node: '[*parser.AggregateExpr] sum(foo or vector(1))' |
| 7638 | op: sum |
| 7639 | indirect: |
| 7640 | - src: |
| 7641 | labels: |
| 7642 | "": |
| 7643 | reason: This query returns a number value with no labels. |
| 7644 | kind: excluded |
| 7645 | fragment: |
| 7646 | start: 25 |
| 7647 | end: 26 |
| 7648 | returns: scalar |
| 7649 | returnInfo: |
| 7650 | logicalexpr: "" |
| 7651 | valueposition: |
| 7652 | start: 25 |
| 7653 | end: 26 |
| 7654 | returnednumber: 0 |
| 7655 | alwaysreturns: true |
| 7656 | knownreturn: true |
| 7657 | isreturnbool: false |
| 7658 | position: |
| 7659 | start: 25 |
| 7660 | end: 26 |
| 7661 | type: number |
| 7662 | fixedLabels: true |
| 7663 | op: 57388 |
| 7664 | side: 1 |
| 7665 | - src: |
| 7666 | labels: |
| 7667 | "": |
| 7668 | reason: This query returns a number value with no labels. |
| 7669 | kind: excluded |
| 7670 | fragment: |
| 7671 | start: 31 |
| 7672 | end: 32 |
| 7673 | returns: scalar |
| 7674 | returnInfo: |
| 7675 | logicalexpr: "" |
| 7676 | valueposition: |
| 7677 | start: 31 |
| 7678 | end: 32 |
| 7679 | returnednumber: 2 |
| 7680 | alwaysreturns: true |
| 7681 | knownreturn: true |
| 7682 | isreturnbool: false |
| 7683 | position: |
| 7684 | start: 31 |
| 7685 | end: 32 |
| 7686 | type: number |
| 7687 | fixedLabels: true |
| 7688 | op: 57385 |
| 7689 | side: 1 |
| 7690 | condition: |
| 7691 | op: 57388 |
| 7692 | present: true |
| 7693 | knownValue: true |
| 7694 | position: |
| 7695 | start: 5 |
| 7696 | end: 8 |
| 7697 | type: aggregation |
| 7698 | fixedLabels: true |
| 7699 | - labels: |
| 7700 | "": |
| 7701 | reason: Query is using aggregation that removes all labels. |
| 7702 | kind: excluded |
| 7703 | fragment: |
| 7704 | start: 1 |
| 7705 | end: 4 |
| 7706 | __name__: |
| 7707 | reason: Aggregation removes metric name. |
| 7708 | kind: excluded |
| 7709 | fragment: |
| 7710 | start: 1 |
| 7711 | end: 22 |
| 7712 | deadInfo: |
| 7713 | reason: '`vector(1) == 2` always evaluates to `1 == 2` which is not possible, so it will never return anything.' |
| 7714 | fragment: |
| 7715 | start: 12 |
| 7716 | end: 21 |
| 7717 | returns: vector |
| 7718 | operations: |
| 7719 | - args: |
| 7720 | - "1" |
| 7721 | node: '[*parser.Call] vector(1)' |
| 7722 | op: vector |
| 7723 | - node: '[*parser.AggregateExpr] sum(foo or vector(1))' |
| 7724 | op: sum |
| 7725 | indirect: |
| 7726 | - src: |
| 7727 | labels: |
| 7728 | "": |
| 7729 | reason: This query returns a number value with no labels. |
| 7730 | kind: excluded |
| 7731 | fragment: |
| 7732 | start: 19 |
| 7733 | end: 20 |
| 7734 | returns: scalar |
| 7735 | returnInfo: |
| 7736 | logicalexpr: "" |
| 7737 | valueposition: |
| 7738 | start: 19 |
| 7739 | end: 20 |
| 7740 | returnednumber: 1 |
| 7741 | alwaysreturns: true |
| 7742 | knownreturn: true |
| 7743 | isreturnbool: false |
| 7744 | position: |
| 7745 | start: 19 |
| 7746 | end: 20 |
| 7747 | type: number |
| 7748 | fixedLabels: true |
| 7749 | op: 0 |
| 7750 | side: 0 |
| 7751 | - src: |
| 7752 | labels: |
| 7753 | "": |
| 7754 | reason: This query returns a number value with no labels. |
| 7755 | kind: excluded |
| 7756 | fragment: |
| 7757 | start: 25 |
| 7758 | end: 26 |
| 7759 | returns: scalar |
| 7760 | returnInfo: |
| 7761 | logicalexpr: "" |
| 7762 | valueposition: |
| 7763 | start: 25 |
| 7764 | end: 26 |
| 7765 | returnednumber: 0 |
| 7766 | alwaysreturns: true |
| 7767 | knownreturn: true |
| 7768 | isreturnbool: false |
| 7769 | position: |
| 7770 | start: 25 |
| 7771 | end: 26 |
| 7772 | type: number |
| 7773 | fixedLabels: true |
| 7774 | op: 57388 |
| 7775 | side: 1 |
| 7776 | - src: |
| 7777 | labels: |
| 7778 | "": |
| 7779 | reason: This query returns a number value with no labels. |
| 7780 | kind: excluded |
| 7781 | fragment: |
| 7782 | start: 31 |
| 7783 | end: 32 |
| 7784 | returns: scalar |
| 7785 | returnInfo: |
| 7786 | logicalexpr: "" |
| 7787 | valueposition: |
| 7788 | start: 31 |
| 7789 | end: 32 |
| 7790 | returnednumber: 2 |
| 7791 | alwaysreturns: true |
| 7792 | knownreturn: true |
| 7793 | isreturnbool: false |
| 7794 | position: |
| 7795 | start: 31 |
| 7796 | end: 32 |
| 7797 | type: number |
| 7798 | fixedLabels: true |
| 7799 | op: 57385 |
| 7800 | side: 1 |
| 7801 | returnInfo: |
| 7802 | logicalexpr: "" |
| 7803 | valueposition: |
| 7804 | start: 12 |
| 7805 | end: 21 |
| 7806 | returnednumber: 1 |
| 7807 | alwaysreturns: true |
| 7808 | knownreturn: true |
| 7809 | isreturnbool: false |
| 7810 | condition: |
| 7811 | op: 57388 |
| 7812 | present: true |
| 7813 | knownValue: true |
| 7814 | position: |
| 7815 | start: 12 |
| 7816 | end: 21 |
| 7817 | type: aggregation |
| 7818 | fixedLabels: true |
| 7819 | |
| 7820 | --- |
| 7821 | |
| 7822 | [TestLabelsSource/121 - 1] |
| 7823 | expr: (sum(foo or vector(1)) > 0) != 2 |
| 7824 | output: |
| 7825 | - labels: |
| 7826 | "": |
| 7827 | reason: Query is using aggregation that removes all labels. |
| 7828 | kind: excluded |
| 7829 | fragment: |
| 7830 | start: 1 |
| 7831 | end: 4 |
| 7832 | __name__: |
| 7833 | reason: Aggregation removes metric name. |
| 7834 | kind: excluded |
| 7835 | fragment: |
| 7836 | start: 1 |
| 7837 | end: 22 |
| 7838 | returns: vector |
| 7839 | operations: |
| 7840 | - node: '[*parser.VectorSelector] foo' |
| 7841 | op: "" |
| 7842 | - node: '[*parser.AggregateExpr] sum(foo or vector(1))' |
| 7843 | op: sum |
| 7844 | indirect: |
| 7845 | - src: |
| 7846 | labels: |
| 7847 | "": |
| 7848 | reason: This query returns a number value with no labels. |
| 7849 | kind: excluded |
| 7850 | fragment: |
| 7851 | start: 25 |
| 7852 | end: 26 |
| 7853 | returns: scalar |
| 7854 | returnInfo: |
| 7855 | logicalexpr: "" |
| 7856 | valueposition: |
| 7857 | start: 25 |
| 7858 | end: 26 |
| 7859 | returnednumber: 0 |
| 7860 | alwaysreturns: true |
| 7861 | knownreturn: true |
| 7862 | isreturnbool: false |
| 7863 | position: |
| 7864 | start: 25 |
| 7865 | end: 26 |
| 7866 | type: number |
| 7867 | fixedLabels: true |
| 7868 | op: 57388 |
| 7869 | side: 1 |
| 7870 | - src: |
| 7871 | labels: |
| 7872 | "": |
| 7873 | reason: This query returns a number value with no labels. |
| 7874 | kind: excluded |
| 7875 | fragment: |
| 7876 | start: 31 |
| 7877 | end: 32 |
| 7878 | returns: scalar |
| 7879 | returnInfo: |
| 7880 | logicalexpr: "" |
| 7881 | valueposition: |
| 7882 | start: 31 |
| 7883 | end: 32 |
| 7884 | returnednumber: 2 |
| 7885 | alwaysreturns: true |
| 7886 | knownreturn: true |
| 7887 | isreturnbool: false |
| 7888 | position: |
| 7889 | start: 31 |
| 7890 | end: 32 |
| 7891 | type: number |
| 7892 | fixedLabels: true |
| 7893 | op: 57398 |
| 7894 | side: 1 |
| 7895 | condition: |
| 7896 | op: 57388 |
| 7897 | present: true |
| 7898 | knownValue: true |
| 7899 | position: |
| 7900 | start: 5 |
| 7901 | end: 8 |
| 7902 | type: aggregation |
| 7903 | fixedLabels: true |
| 7904 | - labels: |
| 7905 | "": |
| 7906 | reason: Query is using aggregation that removes all labels. |
| 7907 | kind: excluded |
| 7908 | fragment: |
| 7909 | start: 1 |
| 7910 | end: 4 |
| 7911 | __name__: |
| 7912 | reason: Aggregation removes metric name. |
| 7913 | kind: excluded |
| 7914 | fragment: |
| 7915 | start: 1 |
| 7916 | end: 22 |
| 7917 | returns: vector |
| 7918 | operations: |
| 7919 | - args: |
| 7920 | - "1" |
| 7921 | node: '[*parser.Call] vector(1)' |
| 7922 | op: vector |
| 7923 | - node: '[*parser.AggregateExpr] sum(foo or vector(1))' |
| 7924 | op: sum |
| 7925 | indirect: |
| 7926 | - src: |
| 7927 | labels: |
| 7928 | "": |
| 7929 | reason: This query returns a number value with no labels. |
| 7930 | kind: excluded |
| 7931 | fragment: |
| 7932 | start: 19 |
| 7933 | end: 20 |
| 7934 | returns: scalar |
| 7935 | returnInfo: |
| 7936 | logicalexpr: "" |
| 7937 | valueposition: |
| 7938 | start: 19 |
| 7939 | end: 20 |
| 7940 | returnednumber: 1 |
| 7941 | alwaysreturns: true |
| 7942 | knownreturn: true |
| 7943 | isreturnbool: false |
| 7944 | position: |
| 7945 | start: 19 |
| 7946 | end: 20 |
| 7947 | type: number |
| 7948 | fixedLabels: true |
| 7949 | op: 0 |
| 7950 | side: 0 |
| 7951 | - src: |
| 7952 | labels: |
| 7953 | "": |
| 7954 | reason: This query returns a number value with no labels. |
| 7955 | kind: excluded |
| 7956 | fragment: |
| 7957 | start: 25 |
| 7958 | end: 26 |
| 7959 | returns: scalar |
| 7960 | returnInfo: |
| 7961 | logicalexpr: "" |
| 7962 | valueposition: |
| 7963 | start: 25 |
| 7964 | end: 26 |
| 7965 | returnednumber: 0 |
| 7966 | alwaysreturns: true |
| 7967 | knownreturn: true |
| 7968 | isreturnbool: false |
| 7969 | position: |
| 7970 | start: 25 |
| 7971 | end: 26 |
| 7972 | type: number |
| 7973 | fixedLabels: true |
| 7974 | op: 57388 |
| 7975 | side: 1 |
| 7976 | - src: |
| 7977 | labels: |
| 7978 | "": |
| 7979 | reason: This query returns a number value with no labels. |
| 7980 | kind: excluded |
| 7981 | fragment: |
| 7982 | start: 31 |
| 7983 | end: 32 |
| 7984 | returns: scalar |
| 7985 | returnInfo: |
| 7986 | logicalexpr: "" |
| 7987 | valueposition: |
| 7988 | start: 31 |
| 7989 | end: 32 |
| 7990 | returnednumber: 2 |
| 7991 | alwaysreturns: true |
| 7992 | knownreturn: true |
| 7993 | isreturnbool: false |
| 7994 | position: |
| 7995 | start: 31 |
| 7996 | end: 32 |
| 7997 | type: number |
| 7998 | fixedLabels: true |
| 7999 | op: 57398 |
| 8000 | side: 1 |
| 8001 | returnInfo: |
| 8002 | logicalexpr: "" |
| 8003 | valueposition: |
| 8004 | start: 12 |
| 8005 | end: 21 |
| 8006 | returnednumber: 1 |
| 8007 | alwaysreturns: true |
| 8008 | knownreturn: true |
| 8009 | isreturnbool: false |
| 8010 | condition: |
| 8011 | op: 57388 |
| 8012 | present: true |
| 8013 | knownValue: true |
| 8014 | position: |
| 8015 | start: 12 |
| 8016 | end: 21 |
| 8017 | type: aggregation |
| 8018 | fixedLabels: true |
| 8019 | |
| 8020 | --- |
| 8021 | |
| 8022 | [TestLabelsSource/122 - 1] |
| 8023 | expr: (sum(foo or vector(2)) > 0) != 2 |
| 8024 | output: |
| 8025 | - labels: |
| 8026 | "": |
| 8027 | reason: Query is using aggregation that removes all labels. |
| 8028 | kind: excluded |
| 8029 | fragment: |
| 8030 | start: 1 |
| 8031 | end: 4 |
| 8032 | __name__: |
| 8033 | reason: Aggregation removes metric name. |
| 8034 | kind: excluded |
| 8035 | fragment: |
| 8036 | start: 1 |
| 8037 | end: 22 |
| 8038 | returns: vector |
| 8039 | operations: |
| 8040 | - node: '[*parser.VectorSelector] foo' |
| 8041 | op: "" |
| 8042 | - node: '[*parser.AggregateExpr] sum(foo or vector(2))' |
| 8043 | op: sum |
| 8044 | indirect: |
| 8045 | - src: |
| 8046 | labels: |
| 8047 | "": |
| 8048 | reason: This query returns a number value with no labels. |
| 8049 | kind: excluded |
| 8050 | fragment: |
| 8051 | start: 25 |
| 8052 | end: 26 |
| 8053 | returns: scalar |
| 8054 | returnInfo: |
| 8055 | logicalexpr: "" |
| 8056 | valueposition: |
| 8057 | start: 25 |
| 8058 | end: 26 |
| 8059 | returnednumber: 0 |
| 8060 | alwaysreturns: true |
| 8061 | knownreturn: true |
| 8062 | isreturnbool: false |
| 8063 | position: |
| 8064 | start: 25 |
| 8065 | end: 26 |
| 8066 | type: number |
| 8067 | fixedLabels: true |
| 8068 | op: 57388 |
| 8069 | side: 1 |
| 8070 | - src: |
| 8071 | labels: |
| 8072 | "": |
| 8073 | reason: This query returns a number value with no labels. |
| 8074 | kind: excluded |
| 8075 | fragment: |
| 8076 | start: 31 |
| 8077 | end: 32 |
| 8078 | returns: scalar |
| 8079 | returnInfo: |
| 8080 | logicalexpr: "" |
| 8081 | valueposition: |
| 8082 | start: 31 |
| 8083 | end: 32 |
| 8084 | returnednumber: 2 |
| 8085 | alwaysreturns: true |
| 8086 | knownreturn: true |
| 8087 | isreturnbool: false |
| 8088 | position: |
| 8089 | start: 31 |
| 8090 | end: 32 |
| 8091 | type: number |
| 8092 | fixedLabels: true |
| 8093 | op: 57398 |
| 8094 | side: 1 |
| 8095 | condition: |
| 8096 | op: 57388 |
| 8097 | present: true |
| 8098 | knownValue: true |
| 8099 | position: |
| 8100 | start: 5 |
| 8101 | end: 8 |
| 8102 | type: aggregation |
| 8103 | fixedLabels: true |
| 8104 | - labels: |
| 8105 | "": |
| 8106 | reason: Query is using aggregation that removes all labels. |
| 8107 | kind: excluded |
| 8108 | fragment: |
| 8109 | start: 1 |
| 8110 | end: 4 |
| 8111 | __name__: |
| 8112 | reason: Aggregation removes metric name. |
| 8113 | kind: excluded |
| 8114 | fragment: |
| 8115 | start: 1 |
| 8116 | end: 22 |
| 8117 | deadInfo: |
| 8118 | reason: '`vector(2) != 2` always evaluates to `2 != 2` which is not possible, so it will never return anything.' |
| 8119 | fragment: |
| 8120 | start: 12 |
| 8121 | end: 21 |
| 8122 | returns: vector |
| 8123 | operations: |
| 8124 | - args: |
| 8125 | - "2" |
| 8126 | node: '[*parser.Call] vector(2)' |
| 8127 | op: vector |
| 8128 | - node: '[*parser.AggregateExpr] sum(foo or vector(2))' |
| 8129 | op: sum |
| 8130 | indirect: |
| 8131 | - src: |
| 8132 | labels: |
| 8133 | "": |
| 8134 | reason: This query returns a number value with no labels. |
| 8135 | kind: excluded |
| 8136 | fragment: |
| 8137 | start: 19 |
| 8138 | end: 20 |
| 8139 | returns: scalar |
| 8140 | returnInfo: |
| 8141 | logicalexpr: "" |
| 8142 | valueposition: |
| 8143 | start: 19 |
| 8144 | end: 20 |
| 8145 | returnednumber: 2 |
| 8146 | alwaysreturns: true |
| 8147 | knownreturn: true |
| 8148 | isreturnbool: false |
| 8149 | position: |
| 8150 | start: 19 |
| 8151 | end: 20 |
| 8152 | type: number |
| 8153 | fixedLabels: true |
| 8154 | op: 0 |
| 8155 | side: 0 |
| 8156 | - src: |
| 8157 | labels: |
| 8158 | "": |
| 8159 | reason: This query returns a number value with no labels. |
| 8160 | kind: excluded |
| 8161 | fragment: |
| 8162 | start: 25 |
| 8163 | end: 26 |
| 8164 | returns: scalar |
| 8165 | returnInfo: |
| 8166 | logicalexpr: "" |
| 8167 | valueposition: |
| 8168 | start: 25 |
| 8169 | end: 26 |
| 8170 | returnednumber: 0 |
| 8171 | alwaysreturns: true |
| 8172 | knownreturn: true |
| 8173 | isreturnbool: false |
| 8174 | position: |
| 8175 | start: 25 |
| 8176 | end: 26 |
| 8177 | type: number |
| 8178 | fixedLabels: true |
| 8179 | op: 57388 |
| 8180 | side: 1 |
| 8181 | - src: |
| 8182 | labels: |
| 8183 | "": |
| 8184 | reason: This query returns a number value with no labels. |
| 8185 | kind: excluded |
| 8186 | fragment: |
| 8187 | start: 31 |
| 8188 | end: 32 |
| 8189 | returns: scalar |
| 8190 | returnInfo: |
| 8191 | logicalexpr: "" |
| 8192 | valueposition: |
| 8193 | start: 31 |
| 8194 | end: 32 |
| 8195 | returnednumber: 2 |
| 8196 | alwaysreturns: true |
| 8197 | knownreturn: true |
| 8198 | isreturnbool: false |
| 8199 | position: |
| 8200 | start: 31 |
| 8201 | end: 32 |
| 8202 | type: number |
| 8203 | fixedLabels: true |
| 8204 | op: 57398 |
| 8205 | side: 1 |
| 8206 | returnInfo: |
| 8207 | logicalexpr: "" |
| 8208 | valueposition: |
| 8209 | start: 12 |
| 8210 | end: 21 |
| 8211 | returnednumber: 2 |
| 8212 | alwaysreturns: true |
| 8213 | knownreturn: true |
| 8214 | isreturnbool: false |
| 8215 | condition: |
| 8216 | op: 57388 |
| 8217 | present: true |
| 8218 | knownValue: true |
| 8219 | position: |
| 8220 | start: 12 |
| 8221 | end: 21 |
| 8222 | type: aggregation |
| 8223 | fixedLabels: true |
| 8224 | |
| 8225 | --- |
| 8226 | |
| 8227 | [TestLabelsSource/123 - 1] |
| 8228 | expr: |- |
| 8229 | (sum(sometimes{foo!="bar"} or vector(0))) |
| 8230 | or |
| 8231 | ((bob > 10) or sum(foo) or vector(1)) |
| 8232 | output: |
| 8233 | - labels: |
| 8234 | "": |
| 8235 | reason: Query is using aggregation that removes all labels. |
| 8236 | kind: excluded |
| 8237 | fragment: |
| 8238 | start: 1 |
| 8239 | end: 4 |
| 8240 | __name__: |
| 8241 | reason: Aggregation removes metric name. |
| 8242 | kind: excluded |
| 8243 | fragment: |
| 8244 | start: 1 |
| 8245 | end: 40 |
| 8246 | returns: vector |
| 8247 | operations: |
| 8248 | - node: '[*parser.VectorSelector] sometimes{foo!="bar"}' |
| 8249 | op: "" |
| 8250 | - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))' |
| 8251 | op: sum |
| 8252 | position: |
| 8253 | start: 5 |
| 8254 | end: 26 |
| 8255 | type: aggregation |
| 8256 | fixedLabels: true |
| 8257 | - labels: |
| 8258 | "": |
| 8259 | reason: Query is using aggregation that removes all labels. |
| 8260 | kind: excluded |
| 8261 | fragment: |
| 8262 | start: 1 |
| 8263 | end: 4 |
| 8264 | __name__: |
| 8265 | reason: Aggregation removes metric name. |
| 8266 | kind: excluded |
| 8267 | fragment: |
| 8268 | start: 1 |
| 8269 | end: 40 |
| 8270 | returns: vector |
| 8271 | operations: |
| 8272 | - args: |
| 8273 | - "0" |
| 8274 | node: '[*parser.Call] vector(0)' |
| 8275 | op: vector |
| 8276 | - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))' |
| 8277 | op: sum |
| 8278 | indirect: |
| 8279 | - src: |
| 8280 | labels: |
| 8281 | "": |
| 8282 | reason: This query returns a number value with no labels. |
| 8283 | kind: excluded |
| 8284 | fragment: |
| 8285 | start: 37 |
| 8286 | end: 38 |
| 8287 | returns: scalar |
| 8288 | returnInfo: |
| 8289 | logicalexpr: "" |
| 8290 | valueposition: |
| 8291 | start: 37 |
| 8292 | end: 38 |
| 8293 | returnednumber: 0 |
| 8294 | alwaysreturns: true |
| 8295 | knownreturn: true |
| 8296 | isreturnbool: false |
| 8297 | position: |
| 8298 | start: 37 |
| 8299 | end: 38 |
| 8300 | type: number |
| 8301 | fixedLabels: true |
| 8302 | op: 0 |
| 8303 | side: 0 |
| 8304 | returnInfo: |
| 8305 | logicalexpr: "" |
| 8306 | valueposition: |
| 8307 | start: 30 |
| 8308 | end: 39 |
| 8309 | returnednumber: 0 |
| 8310 | alwaysreturns: true |
| 8311 | knownreturn: true |
| 8312 | isreturnbool: false |
| 8313 | position: |
| 8314 | start: 30 |
| 8315 | end: 39 |
| 8316 | type: aggregation |
| 8317 | fixedLabels: true |
| 8318 | - returns: vector |
| 8319 | operations: |
| 8320 | - node: '[*parser.VectorSelector] bob' |
| 8321 | op: "" |
| 8322 | indirect: |
| 8323 | - src: |
| 8324 | labels: |
| 8325 | "": |
| 8326 | reason: This query returns a number value with no labels. |
| 8327 | kind: excluded |
| 8328 | fragment: |
| 8329 | start: 53 |
| 8330 | end: 55 |
| 8331 | returns: scalar |
| 8332 | returnInfo: |
| 8333 | logicalexpr: "" |
| 8334 | valueposition: |
| 8335 | start: 53 |
| 8336 | end: 55 |
| 8337 | returnednumber: 10 |
| 8338 | alwaysreturns: true |
| 8339 | knownreturn: true |
| 8340 | isreturnbool: false |
| 8341 | position: |
| 8342 | start: 53 |
| 8343 | end: 55 |
| 8344 | type: number |
| 8345 | fixedLabels: true |
| 8346 | op: 57388 |
| 8347 | side: 1 |
| 8348 | condition: |
| 8349 | op: 57388 |
| 8350 | value: 10 |
| 8351 | present: true |
| 8352 | knownValue: true |
| 8353 | position: |
| 8354 | start: 47 |
| 8355 | end: 50 |
| 8356 | type: selector |
| 8357 | - labels: |
| 8358 | "": |
| 8359 | reason: Query is using aggregation that removes all labels. |
| 8360 | kind: excluded |
| 8361 | fragment: |
| 8362 | start: 60 |
| 8363 | end: 63 |
| 8364 | __name__: |
| 8365 | reason: Aggregation removes metric name. |
| 8366 | kind: excluded |
| 8367 | fragment: |
| 8368 | start: 60 |
| 8369 | end: 68 |
| 8370 | returns: vector |
| 8371 | operations: |
| 8372 | - node: '[*parser.VectorSelector] foo' |
| 8373 | op: "" |
| 8374 | - node: '[*parser.AggregateExpr] sum(foo)' |
| 8375 | op: sum |
| 8376 | position: |
| 8377 | start: 64 |
| 8378 | end: 67 |
| 8379 | type: aggregation |
| 8380 | fixedLabels: true |
| 8381 | - labels: |
| 8382 | "": |
| 8383 | reason: Calling `vector()` will return a vector value with no labels. |
| 8384 | kind: excluded |
| 8385 | fragment: |
| 8386 | start: 72 |
| 8387 | end: 78 |
| 8388 | returns: vector |
| 8389 | operations: |
| 8390 | - args: |
| 8391 | - "1" |
| 8392 | node: '[*parser.Call] vector(1)' |
| 8393 | op: vector |
| 8394 | indirect: |
| 8395 | - src: |
| 8396 | labels: |
| 8397 | "": |
| 8398 | reason: This query returns a number value with no labels. |
| 8399 | kind: excluded |
| 8400 | fragment: |
| 8401 | start: 79 |
| 8402 | end: 80 |
| 8403 | returns: scalar |
| 8404 | returnInfo: |
| 8405 | logicalexpr: "" |
| 8406 | valueposition: |
| 8407 | start: 79 |
| 8408 | end: 80 |
| 8409 | returnednumber: 1 |
| 8410 | alwaysreturns: true |
| 8411 | knownreturn: true |
| 8412 | isreturnbool: false |
| 8413 | position: |
| 8414 | start: 79 |
| 8415 | end: 80 |
| 8416 | type: number |
| 8417 | fixedLabels: true |
| 8418 | op: 0 |
| 8419 | side: 0 |
| 8420 | returnInfo: |
| 8421 | logicalexpr: "" |
| 8422 | valueposition: |
| 8423 | start: 72 |
| 8424 | end: 81 |
| 8425 | returnednumber: 1 |
| 8426 | alwaysreturns: true |
| 8427 | knownreturn: true |
| 8428 | isreturnbool: false |
| 8429 | position: |
| 8430 | start: 72 |
| 8431 | end: 81 |
| 8432 | type: function |
| 8433 | fixedLabels: true |
| 8434 | |
| 8435 | --- |
| 8436 | |
| 8437 | [TestLabelsSource/124 - 1] |
| 8438 | expr: |4- |
| 8439 | |
| 8440 | ( |
| 8441 | sum(sometimes{foo!="bar"}) |
| 8442 | or |
| 8443 | vector(1) |
| 8444 | ) and ( |
| 8445 | ((bob > 10) or sum(bar)) |
| 8446 | or |
| 8447 | notfound > 0 |
| 8448 | ) |
| 8449 | output: |
| 8450 | - labels: |
| 8451 | "": |
| 8452 | reason: Query is using aggregation that removes all labels. |
| 8453 | kind: excluded |
| 8454 | fragment: |
| 8455 | start: 4 |
| 8456 | end: 7 |
| 8457 | __name__: |
| 8458 | reason: Aggregation removes metric name. |
| 8459 | kind: excluded |
| 8460 | fragment: |
| 8461 | start: 4 |
| 8462 | end: 30 |
| 8463 | returns: vector |
| 8464 | operations: |
| 8465 | - node: '[*parser.VectorSelector] sometimes{foo!="bar"}' |
| 8466 | op: "" |
| 8467 | - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"})' |
| 8468 | op: sum |
| 8469 | joins: |
| 8470 | - addedlabels: [] |
| 8471 | depth: 0 |
| 8472 | ison: false |
| 8473 | matchinglabels: [] |
| 8474 | op: and |
| 8475 | src: |
| 8476 | returns: vector |
| 8477 | operations: |
| 8478 | - node: '[*parser.VectorSelector] bob' |
| 8479 | op: "" |
| 8480 | indirect: |
| 8481 | - src: |
| 8482 | labels: |
| 8483 | "": |
| 8484 | reason: This query returns a number value with no labels. |
| 8485 | kind: excluded |
| 8486 | fragment: |
| 8487 | start: 63 |
| 8488 | end: 65 |
| 8489 | returns: scalar |
| 8490 | returnInfo: |
| 8491 | logicalexpr: "" |
| 8492 | valueposition: |
| 8493 | start: 63 |
| 8494 | end: 65 |
| 8495 | returnednumber: 10 |
| 8496 | alwaysreturns: true |
| 8497 | knownreturn: true |
| 8498 | isreturnbool: false |
| 8499 | position: |
| 8500 | start: 63 |
| 8501 | end: 65 |
| 8502 | type: number |
| 8503 | fixedLabels: true |
| 8504 | op: 57388 |
| 8505 | side: 1 |
| 8506 | condition: |
| 8507 | op: 57388 |
| 8508 | value: 10 |
| 8509 | present: true |
| 8510 | knownValue: true |
| 8511 | position: |
| 8512 | start: 57 |
| 8513 | end: 60 |
| 8514 | type: selector |
| 8515 | - addedlabels: [] |
| 8516 | depth: 0 |
| 8517 | ison: false |
| 8518 | matchinglabels: [] |
| 8519 | op: and |
| 8520 | src: |
| 8521 | labels: |
| 8522 | "": |
| 8523 | reason: Query is using aggregation that removes all labels. |
| 8524 | kind: excluded |
| 8525 | fragment: |
| 8526 | start: 70 |
| 8527 | end: 73 |
| 8528 | __name__: |
| 8529 | reason: Aggregation removes metric name. |
| 8530 | kind: excluded |
| 8531 | fragment: |
| 8532 | start: 70 |
| 8533 | end: 78 |
| 8534 | returns: vector |
| 8535 | operations: |
| 8536 | - node: '[*parser.VectorSelector] bar' |
| 8537 | op: "" |
| 8538 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 8539 | op: sum |
| 8540 | position: |
| 8541 | start: 74 |
| 8542 | end: 77 |
| 8543 | type: aggregation |
| 8544 | fixedLabels: true |
| 8545 | - addedlabels: [] |
| 8546 | depth: 0 |
| 8547 | ison: false |
| 8548 | matchinglabels: [] |
| 8549 | op: and |
| 8550 | src: |
| 8551 | returns: vector |
| 8552 | operations: |
| 8553 | - node: '[*parser.VectorSelector] notfound' |
| 8554 | op: "" |
| 8555 | indirect: |
| 8556 | - src: |
| 8557 | labels: |
| 8558 | "": |
| 8559 | reason: This query returns a number value with no labels. |
| 8560 | kind: excluded |
| 8561 | fragment: |
| 8562 | start: 96 |
| 8563 | end: 97 |
| 8564 | returns: scalar |
| 8565 | returnInfo: |
| 8566 | logicalexpr: "" |
| 8567 | valueposition: |
| 8568 | start: 96 |
| 8569 | end: 97 |
| 8570 | returnednumber: 0 |
| 8571 | alwaysreturns: true |
| 8572 | knownreturn: true |
| 8573 | isreturnbool: false |
| 8574 | position: |
| 8575 | start: 96 |
| 8576 | end: 97 |
| 8577 | type: number |
| 8578 | fixedLabels: true |
| 8579 | op: 57388 |
| 8580 | side: 1 |
| 8581 | condition: |
| 8582 | op: 57388 |
| 8583 | present: true |
| 8584 | knownValue: true |
| 8585 | position: |
| 8586 | start: 85 |
| 8587 | end: 93 |
| 8588 | type: selector |
| 8589 | condition: |
| 8590 | op: 57391 |
| 8591 | present: true |
| 8592 | position: |
| 8593 | start: 8 |
| 8594 | end: 29 |
| 8595 | type: aggregation |
| 8596 | fixedLabels: true |
| 8597 | - labels: |
| 8598 | "": |
| 8599 | reason: Calling `vector()` will return a vector value with no labels. |
| 8600 | kind: excluded |
| 8601 | fragment: |
| 8602 | start: 36 |
| 8603 | end: 42 |
| 8604 | returns: vector |
| 8605 | operations: |
| 8606 | - args: |
| 8607 | - "1" |
| 8608 | node: '[*parser.Call] vector(1)' |
| 8609 | op: vector |
| 8610 | joins: |
| 8611 | - addedlabels: [] |
| 8612 | depth: 0 |
| 8613 | ison: false |
| 8614 | matchinglabels: [] |
| 8615 | op: and |
| 8616 | src: |
| 8617 | returns: vector |
| 8618 | operations: |
| 8619 | - node: '[*parser.VectorSelector] bob' |
| 8620 | op: "" |
| 8621 | indirect: |
| 8622 | - src: |
| 8623 | labels: |
| 8624 | "": |
| 8625 | reason: This query returns a number value with no labels. |
| 8626 | kind: excluded |
| 8627 | fragment: |
| 8628 | start: 63 |
| 8629 | end: 65 |
| 8630 | returns: scalar |
| 8631 | returnInfo: |
| 8632 | logicalexpr: "" |
| 8633 | valueposition: |
| 8634 | start: 63 |
| 8635 | end: 65 |
| 8636 | returnednumber: 10 |
| 8637 | alwaysreturns: true |
| 8638 | knownreturn: true |
| 8639 | isreturnbool: false |
| 8640 | position: |
| 8641 | start: 63 |
| 8642 | end: 65 |
| 8643 | type: number |
| 8644 | fixedLabels: true |
| 8645 | op: 57388 |
| 8646 | side: 1 |
| 8647 | condition: |
| 8648 | op: 57388 |
| 8649 | value: 10 |
| 8650 | present: true |
| 8651 | knownValue: true |
| 8652 | position: |
| 8653 | start: 57 |
| 8654 | end: 60 |
| 8655 | type: selector |
| 8656 | - addedlabels: [] |
| 8657 | depth: 0 |
| 8658 | ison: false |
| 8659 | matchinglabels: [] |
| 8660 | op: and |
| 8661 | src: |
| 8662 | labels: |
| 8663 | "": |
| 8664 | reason: Query is using aggregation that removes all labels. |
| 8665 | kind: excluded |
| 8666 | fragment: |
| 8667 | start: 70 |
| 8668 | end: 73 |
| 8669 | __name__: |
| 8670 | reason: Aggregation removes metric name. |
| 8671 | kind: excluded |
| 8672 | fragment: |
| 8673 | start: 70 |
| 8674 | end: 78 |
| 8675 | returns: vector |
| 8676 | operations: |
| 8677 | - node: '[*parser.VectorSelector] bar' |
| 8678 | op: "" |
| 8679 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 8680 | op: sum |
| 8681 | position: |
| 8682 | start: 74 |
| 8683 | end: 77 |
| 8684 | type: aggregation |
| 8685 | fixedLabels: true |
| 8686 | - addedlabels: [] |
| 8687 | depth: 0 |
| 8688 | ison: false |
| 8689 | matchinglabels: [] |
| 8690 | op: and |
| 8691 | src: |
| 8692 | returns: vector |
| 8693 | operations: |
| 8694 | - node: '[*parser.VectorSelector] notfound' |
| 8695 | op: "" |
| 8696 | indirect: |
| 8697 | - src: |
| 8698 | labels: |
| 8699 | "": |
| 8700 | reason: This query returns a number value with no labels. |
| 8701 | kind: excluded |
| 8702 | fragment: |
| 8703 | start: 96 |
| 8704 | end: 97 |
| 8705 | returns: scalar |
| 8706 | returnInfo: |
| 8707 | logicalexpr: "" |
| 8708 | valueposition: |
| 8709 | start: 96 |
| 8710 | end: 97 |
| 8711 | returnednumber: 0 |
| 8712 | alwaysreturns: true |
| 8713 | knownreturn: true |
| 8714 | isreturnbool: false |
| 8715 | position: |
| 8716 | start: 96 |
| 8717 | end: 97 |
| 8718 | type: number |
| 8719 | fixedLabels: true |
| 8720 | op: 57388 |
| 8721 | side: 1 |
| 8722 | condition: |
| 8723 | op: 57388 |
| 8724 | present: true |
| 8725 | knownValue: true |
| 8726 | position: |
| 8727 | start: 85 |
| 8728 | end: 93 |
| 8729 | type: selector |
| 8730 | indirect: |
| 8731 | - src: |
| 8732 | labels: |
| 8733 | "": |
| 8734 | reason: This query returns a number value with no labels. |
| 8735 | kind: excluded |
| 8736 | fragment: |
| 8737 | start: 43 |
| 8738 | end: 44 |
| 8739 | returns: scalar |
| 8740 | returnInfo: |
| 8741 | logicalexpr: "" |
| 8742 | valueposition: |
| 8743 | start: 43 |
| 8744 | end: 44 |
| 8745 | returnednumber: 1 |
| 8746 | alwaysreturns: true |
| 8747 | knownreturn: true |
| 8748 | isreturnbool: false |
| 8749 | position: |
| 8750 | start: 43 |
| 8751 | end: 44 |
| 8752 | type: number |
| 8753 | fixedLabels: true |
| 8754 | op: 0 |
| 8755 | side: 0 |
| 8756 | returnInfo: |
| 8757 | logicalexpr: "" |
| 8758 | valueposition: |
| 8759 | start: 36 |
| 8760 | end: 45 |
| 8761 | returnednumber: 1 |
| 8762 | alwaysreturns: true |
| 8763 | knownreturn: true |
| 8764 | isreturnbool: false |
| 8765 | condition: |
| 8766 | op: 57391 |
| 8767 | present: true |
| 8768 | position: |
| 8769 | start: 36 |
| 8770 | end: 45 |
| 8771 | type: function |
| 8772 | fixedLabels: true |
| 8773 | |
| 8774 | --- |
| 8775 | |
| 8776 | [TestLabelsSource/125 - 1] |
| 8777 | expr: foo offset 5m > 5 |
| 8778 | output: |
| 8779 | - returns: vector |
| 8780 | operations: |
| 8781 | - node: '[*parser.VectorSelector] foo offset 5m' |
| 8782 | op: "" |
| 8783 | indirect: |
| 8784 | - src: |
| 8785 | labels: |
| 8786 | "": |
| 8787 | reason: This query returns a number value with no labels. |
| 8788 | kind: excluded |
| 8789 | fragment: |
| 8790 | start: 16 |
| 8791 | end: 17 |
| 8792 | returns: scalar |
| 8793 | returnInfo: |
| 8794 | logicalexpr: "" |
| 8795 | valueposition: |
| 8796 | start: 16 |
| 8797 | end: 17 |
| 8798 | returnednumber: 5 |
| 8799 | alwaysreturns: true |
| 8800 | knownreturn: true |
| 8801 | isreturnbool: false |
| 8802 | position: |
| 8803 | start: 16 |
| 8804 | end: 17 |
| 8805 | type: number |
| 8806 | fixedLabels: true |
| 8807 | op: 57388 |
| 8808 | side: 1 |
| 8809 | condition: |
| 8810 | op: 57388 |
| 8811 | value: 5 |
| 8812 | present: true |
| 8813 | knownValue: true |
| 8814 | position: |
| 8815 | start: 0 |
| 8816 | end: 13 |
| 8817 | type: selector |
| 8818 | |
| 8819 | --- |
| 8820 | |
| 8821 | [TestLabelsSource/126 - 1] |
| 8822 | expr: |4 |
| 8823 | |
| 8824 | (rate(metric2[5m]) or vector(0)) + |
| 8825 | (rate(metric1[5m]) or vector(1)) + |
| 8826 | (rate(metric3{log_name="samplerd"}[5m]) or vector(2)) > 0 |
| 8827 | output: |
| 8828 | - labels: |
| 8829 | __name__: |
| 8830 | reason: Binary operation between two vectors removes metric names. |
| 8831 | kind: excluded |
| 8832 | fragment: |
| 8833 | start: 1 |
| 8834 | end: 124 |
| 8835 | returns: vector |
| 8836 | operations: |
| 8837 | - node: '[*parser.MatrixSelector] metric2[5m]' |
| 8838 | op: "" |
| 8839 | - node: '[*parser.VectorSelector] metric2' |
| 8840 | op: "" |
| 8841 | - node: '[*parser.Call] rate(metric2[5m])' |
| 8842 | op: rate |
| 8843 | joins: |
| 8844 | - addedlabels: [] |
| 8845 | depth: 0 |
| 8846 | ison: false |
| 8847 | matchinglabels: [] |
| 8848 | op: + |
| 8849 | src: |
| 8850 | returns: vector |
| 8851 | operations: |
| 8852 | - node: '[*parser.MatrixSelector] metric1[5m]' |
| 8853 | op: "" |
| 8854 | - node: '[*parser.VectorSelector] metric1' |
| 8855 | op: "" |
| 8856 | - node: '[*parser.Call] rate(metric1[5m])' |
| 8857 | op: rate |
| 8858 | position: |
| 8859 | start: 42 |
| 8860 | end: 53 |
| 8861 | type: function |
| 8862 | - addedlabels: [] |
| 8863 | depth: 0 |
| 8864 | ison: false |
| 8865 | matchinglabels: [] |
| 8866 | op: + |
| 8867 | src: |
| 8868 | labels: |
| 8869 | "": |
| 8870 | reason: Calling `vector()` will return a vector value with no labels. |
| 8871 | kind: excluded |
| 8872 | fragment: |
| 8873 | start: 58 |
| 8874 | end: 64 |
| 8875 | returns: vector |
| 8876 | operations: |
| 8877 | - args: |
| 8878 | - "1" |
| 8879 | node: '[*parser.Call] vector(1)' |
| 8880 | op: vector |
| 8881 | indirect: |
| 8882 | - src: |
| 8883 | labels: |
| 8884 | "": |
| 8885 | reason: This query returns a number value with no labels. |
| 8886 | kind: excluded |
| 8887 | fragment: |
| 8888 | start: 65 |
| 8889 | end: 66 |
| 8890 | returns: scalar |
| 8891 | returnInfo: |
| 8892 | logicalexpr: "" |
| 8893 | valueposition: |
| 8894 | start: 65 |
| 8895 | end: 66 |
| 8896 | returnednumber: 1 |
| 8897 | alwaysreturns: true |
| 8898 | knownreturn: true |
| 8899 | isreturnbool: false |
| 8900 | position: |
| 8901 | start: 65 |
| 8902 | end: 66 |
| 8903 | type: number |
| 8904 | fixedLabels: true |
| 8905 | op: 0 |
| 8906 | side: 0 |
| 8907 | returnInfo: |
| 8908 | logicalexpr: "" |
| 8909 | valueposition: |
| 8910 | start: 58 |
| 8911 | end: 67 |
| 8912 | returnednumber: 1 |
| 8913 | alwaysreturns: true |
| 8914 | knownreturn: true |
| 8915 | isreturnbool: false |
| 8916 | position: |
| 8917 | start: 58 |
| 8918 | end: 67 |
| 8919 | type: function |
| 8920 | fixedLabels: true |
| 8921 | - addedlabels: [] |
| 8922 | depth: 0 |
| 8923 | ison: false |
| 8924 | matchinglabels: [] |
| 8925 | op: + |
| 8926 | src: |
| 8927 | labels: |
| 8928 | log_name: |
| 8929 | reason: Query will only return series where these labels are present. |
| 8930 | kind: guaranteed |
| 8931 | fragment: |
| 8932 | start: 77 |
| 8933 | end: 105 |
| 8934 | returns: vector |
| 8935 | operations: |
| 8936 | - node: '[*parser.MatrixSelector] metric3{log_name="samplerd"}[5m]' |
| 8937 | op: "" |
| 8938 | - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}' |
| 8939 | op: "" |
| 8940 | - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])' |
| 8941 | op: rate |
| 8942 | usedLabels: |
| 8943 | - log_name |
| 8944 | position: |
| 8945 | start: 77 |
| 8946 | end: 109 |
| 8947 | type: function |
| 8948 | - addedlabels: [] |
| 8949 | depth: 0 |
| 8950 | ison: false |
| 8951 | matchinglabels: [] |
| 8952 | op: + |
| 8953 | src: |
| 8954 | labels: |
| 8955 | "": |
| 8956 | reason: Calling `vector()` will return a vector value with no labels. |
| 8957 | kind: excluded |
| 8958 | fragment: |
| 8959 | start: 114 |
| 8960 | end: 120 |
| 8961 | returns: vector |
| 8962 | operations: |
| 8963 | - args: |
| 8964 | - "2" |
| 8965 | node: '[*parser.Call] vector(2)' |
| 8966 | op: vector |
| 8967 | indirect: |
| 8968 | - src: |
| 8969 | labels: |
| 8970 | "": |
| 8971 | reason: This query returns a number value with no labels. |
| 8972 | kind: excluded |
| 8973 | fragment: |
| 8974 | start: 121 |
| 8975 | end: 122 |
| 8976 | returns: scalar |
| 8977 | returnInfo: |
| 8978 | logicalexpr: "" |
| 8979 | valueposition: |
| 8980 | start: 121 |
| 8981 | end: 122 |
| 8982 | returnednumber: 2 |
| 8983 | alwaysreturns: true |
| 8984 | knownreturn: true |
| 8985 | isreturnbool: false |
| 8986 | position: |
| 8987 | start: 121 |
| 8988 | end: 122 |
| 8989 | type: number |
| 8990 | fixedLabels: true |
| 8991 | op: 0 |
| 8992 | side: 0 |
| 8993 | returnInfo: |
| 8994 | logicalexpr: "" |
| 8995 | valueposition: |
| 8996 | start: 114 |
| 8997 | end: 123 |
| 8998 | returnednumber: 2 |
| 8999 | alwaysreturns: true |
| 9000 | knownreturn: true |
| 9001 | isreturnbool: false |
| 9002 | position: |
| 9003 | start: 114 |
| 9004 | end: 123 |
| 9005 | type: function |
| 9006 | fixedLabels: true |
| 9007 | indirect: |
| 9008 | - src: |
| 9009 | labels: |
| 9010 | "": |
| 9011 | reason: This query returns a number value with no labels. |
| 9012 | kind: excluded |
| 9013 | fragment: |
| 9014 | start: 127 |
| 9015 | end: 128 |
| 9016 | returns: scalar |
| 9017 | returnInfo: |
| 9018 | logicalexpr: "" |
| 9019 | valueposition: |
| 9020 | start: 127 |
| 9021 | end: 128 |
| 9022 | returnednumber: 0 |
| 9023 | alwaysreturns: true |
| 9024 | knownreturn: true |
| 9025 | isreturnbool: false |
| 9026 | position: |
| 9027 | start: 127 |
| 9028 | end: 128 |
| 9029 | type: number |
| 9030 | fixedLabels: true |
| 9031 | op: 57388 |
| 9032 | side: 1 |
| 9033 | condition: |
| 9034 | op: 57388 |
| 9035 | present: true |
| 9036 | knownValue: true |
| 9037 | position: |
| 9038 | start: 7 |
| 9039 | end: 18 |
| 9040 | type: function |
| 9041 | - labels: |
| 9042 | "": |
| 9043 | reason: Calling `vector()` will return a vector value with no labels. |
| 9044 | kind: excluded |
| 9045 | fragment: |
| 9046 | start: 23 |
| 9047 | end: 29 |
| 9048 | __name__: |
| 9049 | reason: Binary operation between two vectors removes metric names. |
| 9050 | kind: excluded |
| 9051 | fragment: |
| 9052 | start: 1 |
| 9053 | end: 124 |
| 9054 | returns: vector |
| 9055 | operations: |
| 9056 | - args: |
| 9057 | - "0" |
| 9058 | node: '[*parser.Call] vector(0)' |
| 9059 | op: vector |
| 9060 | joins: |
| 9061 | - addedlabels: [] |
| 9062 | depth: 0 |
| 9063 | ison: false |
| 9064 | matchinglabels: [] |
| 9065 | op: + |
| 9066 | src: |
| 9067 | returns: vector |
| 9068 | operations: |
| 9069 | - node: '[*parser.MatrixSelector] metric1[5m]' |
| 9070 | op: "" |
| 9071 | - node: '[*parser.VectorSelector] metric1' |
| 9072 | op: "" |
| 9073 | - node: '[*parser.Call] rate(metric1[5m])' |
| 9074 | op: rate |
| 9075 | position: |
| 9076 | start: 42 |
| 9077 | end: 53 |
| 9078 | type: function |
| 9079 | - addedlabels: [] |
| 9080 | depth: 0 |
| 9081 | ison: false |
| 9082 | matchinglabels: [] |
| 9083 | op: + |
| 9084 | src: |
| 9085 | labels: |
| 9086 | "": |
| 9087 | reason: Calling `vector()` will return a vector value with no labels. |
| 9088 | kind: excluded |
| 9089 | fragment: |
| 9090 | start: 58 |
| 9091 | end: 64 |
| 9092 | returns: vector |
| 9093 | operations: |
| 9094 | - args: |
| 9095 | - "1" |
| 9096 | node: '[*parser.Call] vector(1)' |
| 9097 | op: vector |
| 9098 | indirect: |
| 9099 | - src: |
| 9100 | labels: |
| 9101 | "": |
| 9102 | reason: This query returns a number value with no labels. |
| 9103 | kind: excluded |
| 9104 | fragment: |
| 9105 | start: 65 |
| 9106 | end: 66 |
| 9107 | returns: scalar |
| 9108 | returnInfo: |
| 9109 | logicalexpr: "" |
| 9110 | valueposition: |
| 9111 | start: 65 |
| 9112 | end: 66 |
| 9113 | returnednumber: 1 |
| 9114 | alwaysreturns: true |
| 9115 | knownreturn: true |
| 9116 | isreturnbool: false |
| 9117 | position: |
| 9118 | start: 65 |
| 9119 | end: 66 |
| 9120 | type: number |
| 9121 | fixedLabels: true |
| 9122 | op: 0 |
| 9123 | side: 0 |
| 9124 | returnInfo: |
| 9125 | logicalexpr: "" |
| 9126 | valueposition: |
| 9127 | start: 58 |
| 9128 | end: 67 |
| 9129 | returnednumber: 1 |
| 9130 | alwaysreturns: true |
| 9131 | knownreturn: true |
| 9132 | isreturnbool: false |
| 9133 | position: |
| 9134 | start: 58 |
| 9135 | end: 67 |
| 9136 | type: function |
| 9137 | fixedLabels: true |
| 9138 | - addedlabels: [] |
| 9139 | depth: 0 |
| 9140 | ison: false |
| 9141 | matchinglabels: [] |
| 9142 | op: + |
| 9143 | src: |
| 9144 | labels: |
| 9145 | log_name: |
| 9146 | reason: Query will only return series where these labels are present. |
| 9147 | kind: guaranteed |
| 9148 | fragment: |
| 9149 | start: 77 |
| 9150 | end: 105 |
| 9151 | returns: vector |
| 9152 | operations: |
| 9153 | - node: '[*parser.MatrixSelector] metric3{log_name="samplerd"}[5m]' |
| 9154 | op: "" |
| 9155 | - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}' |
| 9156 | op: "" |
| 9157 | - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])' |
| 9158 | op: rate |
| 9159 | usedLabels: |
| 9160 | - log_name |
| 9161 | position: |
| 9162 | start: 77 |
| 9163 | end: 109 |
| 9164 | type: function |
| 9165 | - addedlabels: [] |
| 9166 | depth: 0 |
| 9167 | ison: false |
| 9168 | matchinglabels: [] |
| 9169 | op: + |
| 9170 | src: |
| 9171 | labels: |
| 9172 | "": |
| 9173 | reason: Calling `vector()` will return a vector value with no labels. |
| 9174 | kind: excluded |
| 9175 | fragment: |
| 9176 | start: 114 |
| 9177 | end: 120 |
| 9178 | returns: vector |
| 9179 | operations: |
| 9180 | - args: |
| 9181 | - "2" |
| 9182 | node: '[*parser.Call] vector(2)' |
| 9183 | op: vector |
| 9184 | indirect: |
| 9185 | - src: |
| 9186 | labels: |
| 9187 | "": |
| 9188 | reason: This query returns a number value with no labels. |
| 9189 | kind: excluded |
| 9190 | fragment: |
| 9191 | start: 121 |
| 9192 | end: 122 |
| 9193 | returns: scalar |
| 9194 | returnInfo: |
| 9195 | logicalexpr: "" |
| 9196 | valueposition: |
| 9197 | start: 121 |
| 9198 | end: 122 |
| 9199 | returnednumber: 2 |
| 9200 | alwaysreturns: true |
| 9201 | knownreturn: true |
| 9202 | isreturnbool: false |
| 9203 | position: |
| 9204 | start: 121 |
| 9205 | end: 122 |
| 9206 | type: number |
| 9207 | fixedLabels: true |
| 9208 | op: 0 |
| 9209 | side: 0 |
| 9210 | returnInfo: |
| 9211 | logicalexpr: "" |
| 9212 | valueposition: |
| 9213 | start: 114 |
| 9214 | end: 123 |
| 9215 | returnednumber: 2 |
| 9216 | alwaysreturns: true |
| 9217 | knownreturn: true |
| 9218 | isreturnbool: false |
| 9219 | position: |
| 9220 | start: 114 |
| 9221 | end: 123 |
| 9222 | type: function |
| 9223 | fixedLabels: true |
| 9224 | indirect: |
| 9225 | - src: |
| 9226 | labels: |
| 9227 | "": |
| 9228 | reason: This query returns a number value with no labels. |
| 9229 | kind: excluded |
| 9230 | fragment: |
| 9231 | start: 30 |
| 9232 | end: 31 |
| 9233 | returns: scalar |
| 9234 | returnInfo: |
| 9235 | logicalexpr: "" |
| 9236 | valueposition: |
| 9237 | start: 30 |
| 9238 | end: 31 |
| 9239 | returnednumber: 0 |
| 9240 | alwaysreturns: true |
| 9241 | knownreturn: true |
| 9242 | isreturnbool: false |
| 9243 | position: |
| 9244 | start: 30 |
| 9245 | end: 31 |
| 9246 | type: number |
| 9247 | fixedLabels: true |
| 9248 | op: 0 |
| 9249 | side: 0 |
| 9250 | - src: |
| 9251 | labels: |
| 9252 | "": |
| 9253 | reason: This query returns a number value with no labels. |
| 9254 | kind: excluded |
| 9255 | fragment: |
| 9256 | start: 127 |
| 9257 | end: 128 |
| 9258 | returns: scalar |
| 9259 | returnInfo: |
| 9260 | logicalexpr: "" |
| 9261 | valueposition: |
| 9262 | start: 127 |
| 9263 | end: 128 |
| 9264 | returnednumber: 0 |
| 9265 | alwaysreturns: true |
| 9266 | knownreturn: true |
| 9267 | isreturnbool: false |
| 9268 | position: |
| 9269 | start: 127 |
| 9270 | end: 128 |
| 9271 | type: number |
| 9272 | fixedLabels: true |
| 9273 | op: 57388 |
| 9274 | side: 1 |
| 9275 | returnInfo: |
| 9276 | logicalexpr: vector(0) + vector(1) + vector(2) |
| 9277 | valueposition: |
| 9278 | start: 23 |
| 9279 | end: 32 |
| 9280 | returnednumber: 3 |
| 9281 | alwaysreturns: true |
| 9282 | knownreturn: true |
| 9283 | isreturnbool: false |
| 9284 | condition: |
| 9285 | op: 57388 |
| 9286 | present: true |
| 9287 | knownValue: true |
| 9288 | position: |
| 9289 | start: 23 |
| 9290 | end: 32 |
| 9291 | type: function |
| 9292 | fixedLabels: true |
| 9293 | |
| 9294 | --- |
| 9295 | |
| 9296 | [TestLabelsSource/127 - 1] |
| 9297 | expr: label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)") |
| 9298 | output: |
| 9299 | - labels: |
| 9300 | "": |
| 9301 | reason: Calling `vector()` will return a vector value with no labels. |
| 9302 | kind: excluded |
| 9303 | fragment: |
| 9304 | start: 14 |
| 9305 | end: 20 |
| 9306 | nexthop_tag: |
| 9307 | reason: This label will be added to the result by a label_replace() call. |
| 9308 | kind: guaranteed |
| 9309 | fragment: |
| 9310 | start: 0 |
| 9311 | end: 64 |
| 9312 | returns: vector |
| 9313 | operations: |
| 9314 | - args: |
| 9315 | - "1" |
| 9316 | node: '[*parser.Call] vector(1)' |
| 9317 | op: vector |
| 9318 | - args: |
| 9319 | - '"nexthop_tag"' |
| 9320 | - '"$1"' |
| 9321 | - '"nexthop"' |
| 9322 | - '"(.+)"' |
| 9323 | node: '[*parser.Call] label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)")' |
| 9324 | op: label_replace |
| 9325 | indirect: |
| 9326 | - src: |
| 9327 | labels: |
| 9328 | "": |
| 9329 | reason: This query returns a number value with no labels. |
| 9330 | kind: excluded |
| 9331 | fragment: |
| 9332 | start: 21 |
| 9333 | end: 22 |
| 9334 | returns: scalar |
| 9335 | returnInfo: |
| 9336 | logicalexpr: "" |
| 9337 | valueposition: |
| 9338 | start: 21 |
| 9339 | end: 22 |
| 9340 | returnednumber: 1 |
| 9341 | alwaysreturns: true |
| 9342 | knownreturn: true |
| 9343 | isreturnbool: false |
| 9344 | position: |
| 9345 | start: 21 |
| 9346 | end: 22 |
| 9347 | type: number |
| 9348 | fixedLabels: true |
| 9349 | op: 0 |
| 9350 | side: 0 |
| 9351 | - src: |
| 9352 | labels: |
| 9353 | "": |
| 9354 | reason: This query returns a string value with no labels. |
| 9355 | kind: excluded |
| 9356 | fragment: |
| 9357 | start: 25 |
| 9358 | end: 38 |
| 9359 | returns: string |
| 9360 | returnInfo: |
| 9361 | logicalexpr: "" |
| 9362 | valueposition: |
| 9363 | start: 0 |
| 9364 | end: 0 |
| 9365 | returnednumber: 0 |
| 9366 | alwaysreturns: true |
| 9367 | knownreturn: false |
| 9368 | isreturnbool: false |
| 9369 | position: |
| 9370 | start: 25 |
| 9371 | end: 38 |
| 9372 | type: string |
| 9373 | fixedLabels: true |
| 9374 | op: 0 |
| 9375 | side: 0 |
| 9376 | - src: |
| 9377 | labels: |
| 9378 | "": |
| 9379 | reason: This query returns a string value with no labels. |
| 9380 | kind: excluded |
| 9381 | fragment: |
| 9382 | start: 40 |
| 9383 | end: 44 |
| 9384 | returns: string |
| 9385 | returnInfo: |
| 9386 | logicalexpr: "" |
| 9387 | valueposition: |
| 9388 | start: 0 |
| 9389 | end: 0 |
| 9390 | returnednumber: 0 |
| 9391 | alwaysreturns: true |
| 9392 | knownreturn: false |
| 9393 | isreturnbool: false |
| 9394 | position: |
| 9395 | start: 40 |
| 9396 | end: 44 |
| 9397 | type: string |
| 9398 | fixedLabels: true |
| 9399 | op: 0 |
| 9400 | side: 0 |
| 9401 | - src: |
| 9402 | labels: |
| 9403 | "": |
| 9404 | reason: This query returns a string value with no labels. |
| 9405 | kind: excluded |
| 9406 | fragment: |
| 9407 | start: 46 |
| 9408 | end: 55 |
| 9409 | returns: string |
| 9410 | returnInfo: |
| 9411 | logicalexpr: "" |
| 9412 | valueposition: |
| 9413 | start: 0 |
| 9414 | end: 0 |
| 9415 | returnednumber: 0 |
| 9416 | alwaysreturns: true |
| 9417 | knownreturn: false |
| 9418 | isreturnbool: false |
| 9419 | position: |
| 9420 | start: 46 |
| 9421 | end: 55 |
| 9422 | type: string |
| 9423 | fixedLabels: true |
| 9424 | op: 0 |
| 9425 | side: 0 |
| 9426 | - src: |
| 9427 | labels: |
| 9428 | "": |
| 9429 | reason: This query returns a string value with no labels. |
| 9430 | kind: excluded |
| 9431 | fragment: |
| 9432 | start: 57 |
| 9433 | end: 63 |
| 9434 | returns: string |
| 9435 | returnInfo: |
| 9436 | logicalexpr: "" |
| 9437 | valueposition: |
| 9438 | start: 0 |
| 9439 | end: 0 |
| 9440 | returnednumber: 0 |
| 9441 | alwaysreturns: true |
| 9442 | knownreturn: false |
| 9443 | isreturnbool: false |
| 9444 | position: |
| 9445 | start: 57 |
| 9446 | end: 63 |
| 9447 | type: string |
| 9448 | fixedLabels: true |
| 9449 | op: 0 |
| 9450 | side: 0 |
| 9451 | usedLabels: |
| 9452 | - nexthop |
| 9453 | returnInfo: |
| 9454 | logicalexpr: "" |
| 9455 | valueposition: |
| 9456 | start: 14 |
| 9457 | end: 23 |
| 9458 | returnednumber: 1 |
| 9459 | alwaysreturns: true |
| 9460 | knownreturn: true |
| 9461 | isreturnbool: false |
| 9462 | position: |
| 9463 | start: 14 |
| 9464 | end: 23 |
| 9465 | type: function |
| 9466 | fixedLabels: true |
| 9467 | |
| 9468 | --- |
| 9469 | |
| 9470 | [TestLabelsSource/128 - 1] |
| 9471 | expr: (sum(foo{job="myjob"})) |
| 9472 | output: |
| 9473 | - labels: |
| 9474 | "": |
| 9475 | reason: Query is using aggregation that removes all labels. |
| 9476 | kind: excluded |
| 9477 | fragment: |
| 9478 | start: 1 |
| 9479 | end: 4 |
| 9480 | __name__: |
| 9481 | reason: Aggregation removes metric name. |
| 9482 | kind: excluded |
| 9483 | fragment: |
| 9484 | start: 1 |
| 9485 | end: 22 |
| 9486 | job: |
| 9487 | reason: Query is using aggregation that removes all labels. |
| 9488 | kind: excluded |
| 9489 | fragment: |
| 9490 | start: 1 |
| 9491 | end: 4 |
| 9492 | returns: vector |
| 9493 | operations: |
| 9494 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 9495 | op: "" |
| 9496 | - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})' |
| 9497 | op: sum |
| 9498 | position: |
| 9499 | start: 5 |
| 9500 | end: 21 |
| 9501 | type: aggregation |
| 9502 | fixedLabels: true |
| 9503 | |
| 9504 | --- |
| 9505 | |
| 9506 | [TestLabelsSource/129 - 1] |
| 9507 | expr: (-foo{job="myjob"}) |
| 9508 | output: |
| 9509 | - labels: |
| 9510 | job: |
| 9511 | reason: Query will only return series where these labels are present. |
| 9512 | kind: guaranteed |
| 9513 | fragment: |
| 9514 | start: 2 |
| 9515 | end: 18 |
| 9516 | returns: vector |
| 9517 | operations: |
| 9518 | - node: '[*parser.VectorSelector] foo{job="myjob"}' |
| 9519 | op: "" |
| 9520 | position: |
| 9521 | start: 2 |
| 9522 | end: 18 |
| 9523 | type: selector |
| 9524 | |
| 9525 | --- |
| 9526 | |
| 9527 | [TestLabelsSource/130 - 1] |
| 9528 | expr: |4- |
| 9529 | |
| 9530 | ((( group(vector(0)) ))) > 0 |
| 9531 | output: |
| 9532 | - labels: |
| 9533 | "": |
| 9534 | reason: Query is using aggregation that removes all labels. |
| 9535 | kind: excluded |
| 9536 | fragment: |
| 9537 | start: 5 |
| 9538 | end: 10 |
| 9539 | __name__: |
| 9540 | reason: Aggregation removes metric name. |
| 9541 | kind: excluded |
| 9542 | fragment: |
| 9543 | start: 5 |
| 9544 | end: 21 |
| 9545 | deadInfo: |
| 9546 | reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.' |
| 9547 | fragment: |
| 9548 | start: 11 |
| 9549 | end: 20 |
| 9550 | returns: vector |
| 9551 | operations: |
| 9552 | - args: |
| 9553 | - "0" |
| 9554 | node: '[*parser.Call] vector(0)' |
| 9555 | op: vector |
| 9556 | - node: '[*parser.AggregateExpr] group(vector(0))' |
| 9557 | op: group |
| 9558 | indirect: |
| 9559 | - src: |
| 9560 | labels: |
| 9561 | "": |
| 9562 | reason: This query returns a number value with no labels. |
| 9563 | kind: excluded |
| 9564 | fragment: |
| 9565 | start: 18 |
| 9566 | end: 19 |
| 9567 | returns: scalar |
| 9568 | returnInfo: |
| 9569 | logicalexpr: "" |
| 9570 | valueposition: |
| 9571 | start: 18 |
| 9572 | end: 19 |
| 9573 | returnednumber: 0 |
| 9574 | alwaysreturns: true |
| 9575 | knownreturn: true |
| 9576 | isreturnbool: false |
| 9577 | position: |
| 9578 | start: 18 |
| 9579 | end: 19 |
| 9580 | type: number |
| 9581 | fixedLabels: true |
| 9582 | op: 0 |
| 9583 | side: 0 |
| 9584 | - src: |
| 9585 | labels: |
| 9586 | "": |
| 9587 | reason: This query returns a number value with no labels. |
| 9588 | kind: excluded |
| 9589 | fragment: |
| 9590 | start: 28 |
| 9591 | end: 29 |
| 9592 | returns: scalar |
| 9593 | returnInfo: |
| 9594 | logicalexpr: "" |
| 9595 | valueposition: |
| 9596 | start: 28 |
| 9597 | end: 29 |
| 9598 | returnednumber: 0 |
| 9599 | alwaysreturns: true |
| 9600 | knownreturn: true |
| 9601 | isreturnbool: false |
| 9602 | position: |
| 9603 | start: 28 |
| 9604 | end: 29 |
| 9605 | type: number |
| 9606 | fixedLabels: true |
| 9607 | op: 57388 |
| 9608 | side: 1 |
| 9609 | returnInfo: |
| 9610 | logicalexpr: "" |
| 9611 | valueposition: |
| 9612 | start: 11 |
| 9613 | end: 20 |
| 9614 | returnednumber: 0 |
| 9615 | alwaysreturns: true |
| 9616 | knownreturn: true |
| 9617 | isreturnbool: false |
| 9618 | condition: |
| 9619 | op: 57388 |
| 9620 | present: true |
| 9621 | knownValue: true |
| 9622 | position: |
| 9623 | start: 11 |
| 9624 | end: 20 |
| 9625 | type: aggregation |
| 9626 | fixedLabels: true |
| 9627 | |
| 9628 | --- |
| 9629 | |
| 9630 | [TestLabelsSource/131 - 1] |
| 9631 | expr: 1 > bool 5 |
| 9632 | output: |
| 9633 | - labels: |
| 9634 | "": |
| 9635 | reason: This query returns a number value with no labels. |
| 9636 | kind: excluded |
| 9637 | fragment: |
| 9638 | start: 0 |
| 9639 | end: 1 |
| 9640 | deadInfo: |
| 9641 | reason: '`1 > 5` always evaluates to `1 > 5` and uses the `bool` modifier which means it will always return 0' |
| 9642 | fragment: |
| 9643 | start: 0 |
| 9644 | end: 1 |
| 9645 | returns: scalar |
| 9646 | indirect: |
| 9647 | - src: |
| 9648 | labels: |
| 9649 | "": |
| 9650 | reason: This query returns a number value with no labels. |
| 9651 | kind: excluded |
| 9652 | fragment: |
| 9653 | start: 9 |
| 9654 | end: 10 |
| 9655 | returns: scalar |
| 9656 | returnInfo: |
| 9657 | logicalexpr: "" |
| 9658 | valueposition: |
| 9659 | start: 9 |
| 9660 | end: 10 |
| 9661 | returnednumber: 5 |
| 9662 | alwaysreturns: true |
| 9663 | knownreturn: true |
| 9664 | isreturnbool: false |
| 9665 | position: |
| 9666 | start: 9 |
| 9667 | end: 10 |
| 9668 | type: number |
| 9669 | fixedLabels: true |
| 9670 | op: 57388 |
| 9671 | side: 1 |
| 9672 | returnInfo: |
| 9673 | logicalexpr: "" |
| 9674 | valueposition: |
| 9675 | start: 0 |
| 9676 | end: 1 |
| 9677 | returnednumber: 1 |
| 9678 | alwaysreturns: true |
| 9679 | knownreturn: true |
| 9680 | isreturnbool: false |
| 9681 | condition: |
| 9682 | op: 57388 |
| 9683 | value: 5 |
| 9684 | present: true |
| 9685 | knownValue: true |
| 9686 | position: |
| 9687 | start: 0 |
| 9688 | end: 1 |
| 9689 | type: number |
| 9690 | fixedLabels: true |
| 9691 | |
| 9692 | --- |
| 9693 | |
| 9694 | [TestLabelsSource/132 - 1] |
| 9695 | expr: prometheus_ready{job="prometheus"} unless vector(0) |
| 9696 | output: |
| 9697 | - labels: |
| 9698 | job: |
| 9699 | reason: Query will only return series where these labels are present. |
| 9700 | kind: guaranteed |
| 9701 | fragment: |
| 9702 | start: 0 |
| 9703 | end: 34 |
| 9704 | returns: vector |
| 9705 | operations: |
| 9706 | - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}' |
| 9707 | op: "" |
| 9708 | unless: |
| 9709 | - deadinfo: |
| 9710 | 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. |
| 9711 | fragment: |
| 9712 | start: 42 |
| 9713 | end: 48 |
| 9714 | ison: false |
| 9715 | matchinglabels: [] |
| 9716 | src: |
| 9717 | labels: |
| 9718 | "": |
| 9719 | reason: Calling `vector()` will return a vector value with no labels. |
| 9720 | kind: excluded |
| 9721 | fragment: |
| 9722 | start: 42 |
| 9723 | end: 48 |
| 9724 | returns: vector |
| 9725 | operations: |
| 9726 | - args: |
| 9727 | - "0" |
| 9728 | node: '[*parser.Call] vector(0)' |
| 9729 | op: vector |
| 9730 | indirect: |
| 9731 | - src: |
| 9732 | labels: |
| 9733 | "": |
| 9734 | reason: This query returns a number value with no labels. |
| 9735 | kind: excluded |
| 9736 | fragment: |
| 9737 | start: 49 |
| 9738 | end: 50 |
| 9739 | returns: scalar |
| 9740 | returnInfo: |
| 9741 | logicalexpr: "" |
| 9742 | valueposition: |
| 9743 | start: 49 |
| 9744 | end: 50 |
| 9745 | returnednumber: 0 |
| 9746 | alwaysreturns: true |
| 9747 | knownreturn: true |
| 9748 | isreturnbool: false |
| 9749 | position: |
| 9750 | start: 49 |
| 9751 | end: 50 |
| 9752 | type: number |
| 9753 | fixedLabels: true |
| 9754 | op: 0 |
| 9755 | side: 0 |
| 9756 | returnInfo: |
| 9757 | logicalexpr: "" |
| 9758 | valueposition: |
| 9759 | start: 42 |
| 9760 | end: 51 |
| 9761 | returnednumber: 0 |
| 9762 | alwaysreturns: true |
| 9763 | knownreturn: true |
| 9764 | isreturnbool: false |
| 9765 | position: |
| 9766 | start: 42 |
| 9767 | end: 51 |
| 9768 | type: function |
| 9769 | fixedLabels: true |
| 9770 | usedLabels: |
| 9771 | - job |
| 9772 | position: |
| 9773 | start: 0 |
| 9774 | end: 34 |
| 9775 | type: selector |
| 9776 | |
| 9777 | --- |
| 9778 | |
| 9779 | [TestLabelsSource/133 - 1] |
| 9780 | expr: prometheus_ready{job="prometheus"} unless on() vector(0) |
| 9781 | output: |
| 9782 | - labels: |
| 9783 | job: |
| 9784 | reason: Query will only return series where these labels are present. |
| 9785 | kind: guaranteed |
| 9786 | fragment: |
| 9787 | start: 0 |
| 9788 | end: 34 |
| 9789 | deadInfo: |
| 9790 | reason: This query will never return anything because the `unless` query always returns something. |
| 9791 | fragment: |
| 9792 | start: 47 |
| 9793 | end: 56 |
| 9794 | returns: vector |
| 9795 | operations: |
| 9796 | - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}' |
| 9797 | op: "" |
| 9798 | unless: |
| 9799 | - ison: true |
| 9800 | matchinglabels: [] |
| 9801 | src: |
| 9802 | labels: |
| 9803 | "": |
| 9804 | reason: Calling `vector()` will return a vector value with no labels. |
| 9805 | kind: excluded |
| 9806 | fragment: |
| 9807 | start: 47 |
| 9808 | end: 53 |
| 9809 | returns: vector |
| 9810 | operations: |
| 9811 | - args: |
| 9812 | - "0" |
| 9813 | node: '[*parser.Call] vector(0)' |
| 9814 | op: vector |
| 9815 | indirect: |
| 9816 | - src: |
| 9817 | labels: |
| 9818 | "": |
| 9819 | reason: This query returns a number value with no labels. |
| 9820 | kind: excluded |
| 9821 | fragment: |
| 9822 | start: 54 |
| 9823 | end: 55 |
| 9824 | returns: scalar |
| 9825 | returnInfo: |
| 9826 | logicalexpr: "" |
| 9827 | valueposition: |
| 9828 | start: 54 |
| 9829 | end: 55 |
| 9830 | returnednumber: 0 |
| 9831 | alwaysreturns: true |
| 9832 | knownreturn: true |
| 9833 | isreturnbool: false |
| 9834 | position: |
| 9835 | start: 54 |
| 9836 | end: 55 |
| 9837 | type: number |
| 9838 | fixedLabels: true |
| 9839 | op: 0 |
| 9840 | side: 0 |
| 9841 | returnInfo: |
| 9842 | logicalexpr: "" |
| 9843 | valueposition: |
| 9844 | start: 47 |
| 9845 | end: 56 |
| 9846 | returnednumber: 0 |
| 9847 | alwaysreturns: true |
| 9848 | knownreturn: true |
| 9849 | isreturnbool: false |
| 9850 | position: |
| 9851 | start: 47 |
| 9852 | end: 56 |
| 9853 | type: function |
| 9854 | fixedLabels: true |
| 9855 | position: |
| 9856 | start: 0 |
| 9857 | end: 34 |
| 9858 | type: selector |
| 9859 | |
| 9860 | --- |
| 9861 | |
| 9862 | [TestLabelsSource/134 - 1] |
| 9863 | expr: prometheus_ready{job="prometheus"} unless on(job) vector(0) |
| 9864 | output: |
| 9865 | - labels: |
| 9866 | job: |
| 9867 | reason: Query will only return series where these labels are present. |
| 9868 | kind: guaranteed |
| 9869 | fragment: |
| 9870 | start: 0 |
| 9871 | end: 34 |
| 9872 | returns: vector |
| 9873 | operations: |
| 9874 | - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}' |
| 9875 | op: "" |
| 9876 | unless: |
| 9877 | - deadinfo: |
| 9878 | 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. |
| 9879 | fragment: |
| 9880 | start: 50 |
| 9881 | end: 56 |
| 9882 | ison: true |
| 9883 | matchinglabels: |
| 9884 | - job |
| 9885 | src: |
| 9886 | labels: |
| 9887 | "": |
| 9888 | reason: Calling `vector()` will return a vector value with no labels. |
| 9889 | kind: excluded |
| 9890 | fragment: |
| 9891 | start: 50 |
| 9892 | end: 56 |
| 9893 | returns: vector |
| 9894 | operations: |
| 9895 | - args: |
| 9896 | - "0" |
| 9897 | node: '[*parser.Call] vector(0)' |
| 9898 | op: vector |
| 9899 | indirect: |
| 9900 | - src: |
| 9901 | labels: |
| 9902 | "": |
| 9903 | reason: This query returns a number value with no labels. |
| 9904 | kind: excluded |
| 9905 | fragment: |
| 9906 | start: 57 |
| 9907 | end: 58 |
| 9908 | returns: scalar |
| 9909 | returnInfo: |
| 9910 | logicalexpr: "" |
| 9911 | valueposition: |
| 9912 | start: 57 |
| 9913 | end: 58 |
| 9914 | returnednumber: 0 |
| 9915 | alwaysreturns: true |
| 9916 | knownreturn: true |
| 9917 | isreturnbool: false |
| 9918 | position: |
| 9919 | start: 57 |
| 9920 | end: 58 |
| 9921 | type: number |
| 9922 | fixedLabels: true |
| 9923 | op: 0 |
| 9924 | side: 0 |
| 9925 | returnInfo: |
| 9926 | logicalexpr: "" |
| 9927 | valueposition: |
| 9928 | start: 50 |
| 9929 | end: 59 |
| 9930 | returnednumber: 0 |
| 9931 | alwaysreturns: true |
| 9932 | knownreturn: true |
| 9933 | isreturnbool: false |
| 9934 | position: |
| 9935 | start: 50 |
| 9936 | end: 59 |
| 9937 | type: function |
| 9938 | fixedLabels: true |
| 9939 | usedLabels: |
| 9940 | - job |
| 9941 | position: |
| 9942 | start: 0 |
| 9943 | end: 34 |
| 9944 | type: selector |
| 9945 | |
| 9946 | --- |
| 9947 | |
| 9948 | [TestLabelsSource/135 - 1] |
| 9949 | expr: |4 |
| 9950 | |
| 9951 | max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"}) |
| 9952 | unless |
| 9953 | sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"}) |
| 9954 | * on (instance) group_left (cluster) |
| 9955 | cf_node_role{kubernetes_role="master",role="kubernetes"} |
| 9956 | output: |
| 9957 | - labels: |
| 9958 | "": |
| 9959 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9960 | kind: excluded |
| 9961 | fragment: |
| 9962 | start: 5 |
| 9963 | end: 7 |
| 9964 | __name__: |
| 9965 | reason: Aggregation removes metric name. |
| 9966 | kind: excluded |
| 9967 | fragment: |
| 9968 | start: 1 |
| 9969 | end: 86 |
| 9970 | cluster: |
| 9971 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9972 | kind: included |
| 9973 | fragment: |
| 9974 | start: 19 |
| 9975 | end: 26 |
| 9976 | instance: |
| 9977 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9978 | kind: included |
| 9979 | fragment: |
| 9980 | start: 9 |
| 9981 | end: 17 |
| 9982 | kubernetes_role: |
| 9983 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9984 | kind: excluded |
| 9985 | fragment: |
| 9986 | start: 5 |
| 9987 | end: 27 |
| 9988 | role: |
| 9989 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 9990 | kind: excluded |
| 9991 | fragment: |
| 9992 | start: 5 |
| 9993 | end: 27 |
| 9994 | returns: vector |
| 9995 | operations: |
| 9996 | - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}' |
| 9997 | op: "" |
| 9998 | - node: '[*parser.AggregateExpr] max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"})' |
| 9999 | op: max |
| 10000 | unless: |
| 10001 | - ison: false |
| 10002 | matchinglabels: [] |
| 10003 | src: |
| 10004 | labels: |
| 10005 | "": |
| 10006 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 10007 | kind: excluded |
| 10008 | fragment: |
| 10009 | start: 99 |
| 10010 | end: 101 |
| 10011 | __name__: |
| 10012 | reason: Binary operation between two vectors removes metric names. |
| 10013 | kind: excluded |
| 10014 | fragment: |
| 10015 | start: 95 |
| 10016 | end: 303 |
| 10017 | cluster: |
| 10018 | 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. |
| 10019 | kind: included |
| 10020 | fragment: |
| 10021 | start: 234 |
| 10022 | end: 241 |
| 10023 | instance: |
| 10024 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10025 | kind: included |
| 10026 | fragment: |
| 10027 | start: 212 |
| 10028 | end: 220 |
| 10029 | name: |
| 10030 | reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 10031 | kind: excluded |
| 10032 | fragment: |
| 10033 | start: 99 |
| 10034 | end: 121 |
| 10035 | returns: vector |
| 10036 | operations: |
| 10037 | - node: '[*parser.VectorSelector] node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"}' |
| 10038 | op: "" |
| 10039 | - node: '[*parser.AggregateExpr] sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"})' |
| 10040 | op: sum |
| 10041 | joins: |
| 10042 | - addedlabels: |
| 10043 | - cluster |
| 10044 | depth: 0 |
| 10045 | ison: true |
| 10046 | matchinglabels: |
| 10047 | - instance |
| 10048 | op: '*' |
| 10049 | src: |
| 10050 | labels: |
| 10051 | kubernetes_role: |
| 10052 | reason: Query will only return series where these labels are present. |
| 10053 | kind: guaranteed |
| 10054 | fragment: |
| 10055 | start: 247 |
| 10056 | end: 303 |
| 10057 | role: |
| 10058 | reason: Query will only return series where these labels are present. |
| 10059 | kind: guaranteed |
| 10060 | fragment: |
| 10061 | start: 247 |
| 10062 | end: 303 |
| 10063 | returns: vector |
| 10064 | operations: |
| 10065 | - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}' |
| 10066 | op: "" |
| 10067 | position: |
| 10068 | start: 247 |
| 10069 | end: 303 |
| 10070 | type: selector |
| 10071 | indirect: |
| 10072 | - src: |
| 10073 | labels: |
| 10074 | "": |
| 10075 | reason: Calling `time()` will return a scalar value with no labels. |
| 10076 | kind: excluded |
| 10077 | fragment: |
| 10078 | start: 123 |
| 10079 | end: 129 |
| 10080 | returns: scalar |
| 10081 | operations: |
| 10082 | - node: '[*parser.Call] time()' |
| 10083 | op: time |
| 10084 | returnInfo: |
| 10085 | logicalexpr: "" |
| 10086 | valueposition: |
| 10087 | start: 123 |
| 10088 | end: 129 |
| 10089 | returnednumber: 0 |
| 10090 | alwaysreturns: true |
| 10091 | knownreturn: false |
| 10092 | isreturnbool: false |
| 10093 | position: |
| 10094 | start: 123 |
| 10095 | end: 129 |
| 10096 | type: function |
| 10097 | fixedLabels: true |
| 10098 | op: 57401 |
| 10099 | side: 0 |
| 10100 | usedLabels: |
| 10101 | - instance |
| 10102 | - cluster |
| 10103 | position: |
| 10104 | start: 132 |
| 10105 | end: 201 |
| 10106 | type: aggregation |
| 10107 | fixedLabels: true |
| 10108 | usedLabels: |
| 10109 | - instance |
| 10110 | - cluster |
| 10111 | position: |
| 10112 | start: 29 |
| 10113 | end: 85 |
| 10114 | type: aggregation |
| 10115 | fixedLabels: true |
| 10116 | |
| 10117 | --- |
| 10118 | |
| 10119 | [TestLabelsSource/136 - 1] |
| 10120 | expr: foo{a="1"} * on() bar{b="2"} |
| 10121 | output: |
| 10122 | - labels: |
| 10123 | "": |
| 10124 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 10125 | kind: excluded |
| 10126 | fragment: |
| 10127 | start: 13 |
| 10128 | end: 17 |
| 10129 | __name__: |
| 10130 | reason: Binary operation between two vectors removes metric names. |
| 10131 | kind: excluded |
| 10132 | fragment: |
| 10133 | start: 0 |
| 10134 | end: 28 |
| 10135 | a: |
| 10136 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 10137 | kind: excluded |
| 10138 | fragment: |
| 10139 | start: 13 |
| 10140 | end: 17 |
| 10141 | returns: vector |
| 10142 | operations: |
| 10143 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 10144 | op: "" |
| 10145 | joins: |
| 10146 | - addedlabels: [] |
| 10147 | depth: 0 |
| 10148 | ison: true |
| 10149 | matchinglabels: [] |
| 10150 | op: '*' |
| 10151 | src: |
| 10152 | labels: |
| 10153 | b: |
| 10154 | reason: Query will only return series where these labels are present. |
| 10155 | kind: guaranteed |
| 10156 | fragment: |
| 10157 | start: 18 |
| 10158 | end: 28 |
| 10159 | returns: vector |
| 10160 | operations: |
| 10161 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 10162 | op: "" |
| 10163 | position: |
| 10164 | start: 18 |
| 10165 | end: 28 |
| 10166 | type: selector |
| 10167 | position: |
| 10168 | start: 0 |
| 10169 | end: 10 |
| 10170 | type: selector |
| 10171 | fixedLabels: true |
| 10172 | |
| 10173 | --- |
| 10174 | |
| 10175 | [TestLabelsSource/137 - 1] |
| 10176 | expr: foo{a="1"} * on(instance) group_left(c,d) bar{b="2"} |
| 10177 | output: |
| 10178 | - labels: |
| 10179 | __name__: |
| 10180 | reason: Binary operation between two vectors removes metric names. |
| 10181 | kind: excluded |
| 10182 | fragment: |
| 10183 | start: 0 |
| 10184 | end: 52 |
| 10185 | a: |
| 10186 | reason: Query will only return series where these labels are present. |
| 10187 | kind: guaranteed |
| 10188 | fragment: |
| 10189 | start: 0 |
| 10190 | end: 10 |
| 10191 | c: |
| 10192 | 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. |
| 10193 | kind: included |
| 10194 | fragment: |
| 10195 | start: 37 |
| 10196 | end: 38 |
| 10197 | d: |
| 10198 | 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. |
| 10199 | kind: included |
| 10200 | fragment: |
| 10201 | start: 39 |
| 10202 | end: 40 |
| 10203 | instance: |
| 10204 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10205 | kind: included |
| 10206 | fragment: |
| 10207 | start: 16 |
| 10208 | end: 24 |
| 10209 | returns: vector |
| 10210 | operations: |
| 10211 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 10212 | op: "" |
| 10213 | joins: |
| 10214 | - addedlabels: |
| 10215 | - c |
| 10216 | - d |
| 10217 | depth: 0 |
| 10218 | ison: true |
| 10219 | matchinglabels: |
| 10220 | - instance |
| 10221 | op: '*' |
| 10222 | src: |
| 10223 | labels: |
| 10224 | b: |
| 10225 | reason: Query will only return series where these labels are present. |
| 10226 | kind: guaranteed |
| 10227 | fragment: |
| 10228 | start: 42 |
| 10229 | end: 52 |
| 10230 | returns: vector |
| 10231 | operations: |
| 10232 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 10233 | op: "" |
| 10234 | position: |
| 10235 | start: 42 |
| 10236 | end: 52 |
| 10237 | type: selector |
| 10238 | usedLabels: |
| 10239 | - instance |
| 10240 | position: |
| 10241 | start: 0 |
| 10242 | end: 10 |
| 10243 | type: selector |
| 10244 | |
| 10245 | --- |
| 10246 | |
| 10247 | [TestLabelsSource/138 - 1] |
| 10248 | expr: foo{a="1"} * on(instance) group_right(c,d) bar{b="2"} |
| 10249 | output: |
| 10250 | - labels: |
| 10251 | __name__: |
| 10252 | reason: Binary operation between two vectors removes metric names. |
| 10253 | kind: excluded |
| 10254 | fragment: |
| 10255 | start: 0 |
| 10256 | end: 53 |
| 10257 | b: |
| 10258 | reason: Query will only return series where these labels are present. |
| 10259 | kind: guaranteed |
| 10260 | fragment: |
| 10261 | start: 43 |
| 10262 | end: 53 |
| 10263 | c: |
| 10264 | 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. |
| 10265 | kind: included |
| 10266 | fragment: |
| 10267 | start: 38 |
| 10268 | end: 39 |
| 10269 | d: |
| 10270 | 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. |
| 10271 | kind: included |
| 10272 | fragment: |
| 10273 | start: 40 |
| 10274 | end: 41 |
| 10275 | instance: |
| 10276 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10277 | kind: included |
| 10278 | fragment: |
| 10279 | start: 16 |
| 10280 | end: 24 |
| 10281 | returns: vector |
| 10282 | operations: |
| 10283 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 10284 | op: "" |
| 10285 | joins: |
| 10286 | - addedlabels: |
| 10287 | - c |
| 10288 | - d |
| 10289 | depth: 0 |
| 10290 | ison: true |
| 10291 | matchinglabels: |
| 10292 | - instance |
| 10293 | op: '*' |
| 10294 | src: |
| 10295 | labels: |
| 10296 | a: |
| 10297 | reason: Query will only return series where these labels are present. |
| 10298 | kind: guaranteed |
| 10299 | fragment: |
| 10300 | start: 0 |
| 10301 | end: 10 |
| 10302 | returns: vector |
| 10303 | operations: |
| 10304 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 10305 | op: "" |
| 10306 | position: |
| 10307 | start: 0 |
| 10308 | end: 10 |
| 10309 | type: selector |
| 10310 | usedLabels: |
| 10311 | - instance |
| 10312 | position: |
| 10313 | start: 43 |
| 10314 | end: 53 |
| 10315 | type: selector |
| 10316 | |
| 10317 | --- |
| 10318 | |
| 10319 | [TestLabelsSource/139 - 1] |
| 10320 | expr: foo{a="1"} * on(instance) sum(bar{b="2"}) |
| 10321 | output: |
| 10322 | - labels: |
| 10323 | "": |
| 10324 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 10325 | kind: excluded |
| 10326 | fragment: |
| 10327 | start: 13 |
| 10328 | end: 25 |
| 10329 | __name__: |
| 10330 | reason: Binary operation between two vectors removes metric names. |
| 10331 | kind: excluded |
| 10332 | fragment: |
| 10333 | start: 0 |
| 10334 | end: 41 |
| 10335 | a: |
| 10336 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 10337 | kind: excluded |
| 10338 | fragment: |
| 10339 | start: 13 |
| 10340 | end: 25 |
| 10341 | instance: |
| 10342 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 10343 | kind: included |
| 10344 | fragment: |
| 10345 | start: 16 |
| 10346 | end: 24 |
| 10347 | returns: vector |
| 10348 | operations: |
| 10349 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 10350 | op: "" |
| 10351 | joins: |
| 10352 | - addedlabels: [] |
| 10353 | deadinfo: |
| 10354 | 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. |
| 10355 | fragment: |
| 10356 | start: 26 |
| 10357 | end: 29 |
| 10358 | depth: 0 |
| 10359 | ison: true |
| 10360 | matchinglabels: |
| 10361 | - instance |
| 10362 | op: '*' |
| 10363 | src: |
| 10364 | labels: |
| 10365 | "": |
| 10366 | reason: Query is using aggregation that removes all labels. |
| 10367 | kind: excluded |
| 10368 | fragment: |
| 10369 | start: 26 |
| 10370 | end: 29 |
| 10371 | __name__: |
| 10372 | reason: Aggregation removes metric name. |
| 10373 | kind: excluded |
| 10374 | fragment: |
| 10375 | start: 26 |
| 10376 | end: 41 |
| 10377 | b: |
| 10378 | reason: Query is using aggregation that removes all labels. |
| 10379 | kind: excluded |
| 10380 | fragment: |
| 10381 | start: 26 |
| 10382 | end: 29 |
| 10383 | returns: vector |
| 10384 | operations: |
| 10385 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 10386 | op: "" |
| 10387 | - node: '[*parser.AggregateExpr] sum(bar{b="2"})' |
| 10388 | op: sum |
| 10389 | position: |
| 10390 | start: 30 |
| 10391 | end: 40 |
| 10392 | type: aggregation |
| 10393 | fixedLabels: true |
| 10394 | usedLabels: |
| 10395 | - instance |
| 10396 | position: |
| 10397 | start: 0 |
| 10398 | end: 10 |
| 10399 | type: selector |
| 10400 | fixedLabels: true |
| 10401 | |
| 10402 | --- |
| 10403 | |
| 10404 | [TestLabelsSource/140 - 1] |
| 10405 | expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"}) |
| 10406 | output: |
| 10407 | - labels: |
| 10408 | __name__: |
| 10409 | reason: Binary operation between two vectors removes metric names. |
| 10410 | kind: excluded |
| 10411 | fragment: |
| 10412 | start: 0 |
| 10413 | end: 57 |
| 10414 | a: |
| 10415 | reason: Query will only return series where these labels are present. |
| 10416 | kind: guaranteed |
| 10417 | fragment: |
| 10418 | start: 0 |
| 10419 | end: 10 |
| 10420 | c: |
| 10421 | 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. |
| 10422 | kind: included |
| 10423 | fragment: |
| 10424 | start: 37 |
| 10425 | end: 38 |
| 10426 | d: |
| 10427 | 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. |
| 10428 | kind: included |
| 10429 | fragment: |
| 10430 | start: 39 |
| 10431 | end: 40 |
| 10432 | instance: |
| 10433 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10434 | kind: included |
| 10435 | fragment: |
| 10436 | start: 16 |
| 10437 | end: 24 |
| 10438 | returns: vector |
| 10439 | operations: |
| 10440 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 10441 | op: "" |
| 10442 | joins: |
| 10443 | - addedlabels: |
| 10444 | - c |
| 10445 | - d |
| 10446 | deadinfo: |
| 10447 | 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. |
| 10448 | fragment: |
| 10449 | start: 42 |
| 10450 | end: 45 |
| 10451 | deadlabels: |
| 10452 | - name: c |
| 10453 | reason: You can't use `c` because this label is not possible here. |
| 10454 | labelreason: Query is using aggregation that removes all labels. |
| 10455 | usagefragment: |
| 10456 | start: 37 |
| 10457 | end: 38 |
| 10458 | labelfragment: |
| 10459 | start: 42 |
| 10460 | end: 45 |
| 10461 | kind: 0 |
| 10462 | - name: d |
| 10463 | reason: You can't use `d` because this label is not possible here. |
| 10464 | labelreason: Query is using aggregation that removes all labels. |
| 10465 | usagefragment: |
| 10466 | start: 39 |
| 10467 | end: 40 |
| 10468 | labelfragment: |
| 10469 | start: 42 |
| 10470 | end: 45 |
| 10471 | kind: 0 |
| 10472 | depth: 0 |
| 10473 | ison: true |
| 10474 | matchinglabels: |
| 10475 | - instance |
| 10476 | op: '*' |
| 10477 | src: |
| 10478 | labels: |
| 10479 | "": |
| 10480 | reason: Query is using aggregation that removes all labels. |
| 10481 | kind: excluded |
| 10482 | fragment: |
| 10483 | start: 42 |
| 10484 | end: 45 |
| 10485 | __name__: |
| 10486 | reason: Aggregation removes metric name. |
| 10487 | kind: excluded |
| 10488 | fragment: |
| 10489 | start: 42 |
| 10490 | end: 57 |
| 10491 | b: |
| 10492 | reason: Query is using aggregation that removes all labels. |
| 10493 | kind: excluded |
| 10494 | fragment: |
| 10495 | start: 42 |
| 10496 | end: 45 |
| 10497 | returns: vector |
| 10498 | operations: |
| 10499 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 10500 | op: "" |
| 10501 | - node: '[*parser.AggregateExpr] sum(bar{b="2"})' |
| 10502 | op: sum |
| 10503 | position: |
| 10504 | start: 46 |
| 10505 | end: 56 |
| 10506 | type: aggregation |
| 10507 | fixedLabels: true |
| 10508 | usedLabels: |
| 10509 | - instance |
| 10510 | position: |
| 10511 | start: 0 |
| 10512 | end: 10 |
| 10513 | type: selector |
| 10514 | |
| 10515 | --- |
| 10516 | |
| 10517 | [TestLabelsSource/141 - 1] |
| 10518 | expr: sum(foo{a="1"}) * on(instance) group_right(c,d) bar{b="2"} |
| 10519 | output: |
| 10520 | - labels: |
| 10521 | __name__: |
| 10522 | reason: Binary operation between two vectors removes metric names. |
| 10523 | kind: excluded |
| 10524 | fragment: |
| 10525 | start: 0 |
| 10526 | end: 58 |
| 10527 | b: |
| 10528 | reason: Query will only return series where these labels are present. |
| 10529 | kind: guaranteed |
| 10530 | fragment: |
| 10531 | start: 48 |
| 10532 | end: 58 |
| 10533 | c: |
| 10534 | 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. |
| 10535 | kind: included |
| 10536 | fragment: |
| 10537 | start: 43 |
| 10538 | end: 44 |
| 10539 | d: |
| 10540 | 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. |
| 10541 | kind: included |
| 10542 | fragment: |
| 10543 | start: 45 |
| 10544 | end: 46 |
| 10545 | instance: |
| 10546 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10547 | kind: included |
| 10548 | fragment: |
| 10549 | start: 21 |
| 10550 | end: 29 |
| 10551 | returns: vector |
| 10552 | operations: |
| 10553 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 10554 | op: "" |
| 10555 | joins: |
| 10556 | - addedlabels: |
| 10557 | - c |
| 10558 | - d |
| 10559 | deadinfo: |
| 10560 | 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. |
| 10561 | fragment: |
| 10562 | start: 0 |
| 10563 | end: 3 |
| 10564 | deadlabels: |
| 10565 | - name: c |
| 10566 | reason: You can't use `c` because this label is not possible here. |
| 10567 | labelreason: Query is using aggregation that removes all labels. |
| 10568 | usagefragment: |
| 10569 | start: 43 |
| 10570 | end: 44 |
| 10571 | labelfragment: |
| 10572 | start: 0 |
| 10573 | end: 3 |
| 10574 | kind: 0 |
| 10575 | - name: d |
| 10576 | reason: You can't use `d` because this label is not possible here. |
| 10577 | labelreason: Query is using aggregation that removes all labels. |
| 10578 | usagefragment: |
| 10579 | start: 45 |
| 10580 | end: 46 |
| 10581 | labelfragment: |
| 10582 | start: 0 |
| 10583 | end: 3 |
| 10584 | kind: 0 |
| 10585 | depth: 0 |
| 10586 | ison: true |
| 10587 | matchinglabels: |
| 10588 | - instance |
| 10589 | op: '*' |
| 10590 | src: |
| 10591 | labels: |
| 10592 | "": |
| 10593 | reason: Query is using aggregation that removes all labels. |
| 10594 | kind: excluded |
| 10595 | fragment: |
| 10596 | start: 0 |
| 10597 | end: 3 |
| 10598 | __name__: |
| 10599 | reason: Aggregation removes metric name. |
| 10600 | kind: excluded |
| 10601 | fragment: |
| 10602 | start: 0 |
| 10603 | end: 15 |
| 10604 | a: |
| 10605 | reason: Query is using aggregation that removes all labels. |
| 10606 | kind: excluded |
| 10607 | fragment: |
| 10608 | start: 0 |
| 10609 | end: 3 |
| 10610 | returns: vector |
| 10611 | operations: |
| 10612 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 10613 | op: "" |
| 10614 | - node: '[*parser.AggregateExpr] sum(foo{a="1"})' |
| 10615 | op: sum |
| 10616 | position: |
| 10617 | start: 4 |
| 10618 | end: 14 |
| 10619 | type: aggregation |
| 10620 | fixedLabels: true |
| 10621 | usedLabels: |
| 10622 | - instance |
| 10623 | position: |
| 10624 | start: 48 |
| 10625 | end: 58 |
| 10626 | type: selector |
| 10627 | |
| 10628 | --- |
| 10629 | |
| 10630 | [TestLabelsSource/142 - 1] |
| 10631 | expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"}) without(instance) |
| 10632 | output: |
| 10633 | - labels: |
| 10634 | __name__: |
| 10635 | reason: Binary operation between two vectors removes metric names. |
| 10636 | kind: excluded |
| 10637 | fragment: |
| 10638 | start: 0 |
| 10639 | end: 75 |
| 10640 | a: |
| 10641 | reason: Query will only return series where these labels are present. |
| 10642 | kind: guaranteed |
| 10643 | fragment: |
| 10644 | start: 0 |
| 10645 | end: 10 |
| 10646 | c: |
| 10647 | 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. |
| 10648 | kind: included |
| 10649 | fragment: |
| 10650 | start: 37 |
| 10651 | end: 38 |
| 10652 | d: |
| 10653 | 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. |
| 10654 | kind: included |
| 10655 | fragment: |
| 10656 | start: 39 |
| 10657 | end: 40 |
| 10658 | instance: |
| 10659 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10660 | kind: included |
| 10661 | fragment: |
| 10662 | start: 16 |
| 10663 | end: 24 |
| 10664 | returns: vector |
| 10665 | operations: |
| 10666 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 10667 | op: "" |
| 10668 | joins: |
| 10669 | - addedlabels: |
| 10670 | - c |
| 10671 | - d |
| 10672 | deadinfo: |
| 10673 | 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. |
| 10674 | fragment: |
| 10675 | start: 66 |
| 10676 | end: 74 |
| 10677 | depth: 0 |
| 10678 | ison: true |
| 10679 | matchinglabels: |
| 10680 | - instance |
| 10681 | op: '*' |
| 10682 | src: |
| 10683 | labels: |
| 10684 | __name__: |
| 10685 | reason: Aggregation removes metric name. |
| 10686 | kind: excluded |
| 10687 | fragment: |
| 10688 | start: 42 |
| 10689 | end: 75 |
| 10690 | b: |
| 10691 | reason: Query will only return series where these labels are present. |
| 10692 | kind: guaranteed |
| 10693 | fragment: |
| 10694 | start: 46 |
| 10695 | end: 56 |
| 10696 | instance: |
| 10697 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 10698 | kind: excluded |
| 10699 | fragment: |
| 10700 | start: 66 |
| 10701 | end: 74 |
| 10702 | returns: vector |
| 10703 | operations: |
| 10704 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 10705 | op: "" |
| 10706 | - node: '[*parser.AggregateExpr] sum without (instance) (bar{b="2"})' |
| 10707 | op: sum |
| 10708 | position: |
| 10709 | start: 46 |
| 10710 | end: 56 |
| 10711 | type: aggregation |
| 10712 | usedLabels: |
| 10713 | - instance |
| 10714 | position: |
| 10715 | start: 0 |
| 10716 | end: 10 |
| 10717 | type: selector |
| 10718 | |
| 10719 | --- |
| 10720 | |
| 10721 | [TestLabelsSource/143 - 1] |
| 10722 | expr: sum(foo{a="1"}) without(instance) * on(instance) group_right(c,d) bar{b="2"} |
| 10723 | output: |
| 10724 | - labels: |
| 10725 | __name__: |
| 10726 | reason: Binary operation between two vectors removes metric names. |
| 10727 | kind: excluded |
| 10728 | fragment: |
| 10729 | start: 0 |
| 10730 | end: 76 |
| 10731 | b: |
| 10732 | reason: Query will only return series where these labels are present. |
| 10733 | kind: guaranteed |
| 10734 | fragment: |
| 10735 | start: 66 |
| 10736 | end: 76 |
| 10737 | c: |
| 10738 | 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. |
| 10739 | kind: included |
| 10740 | fragment: |
| 10741 | start: 61 |
| 10742 | end: 62 |
| 10743 | d: |
| 10744 | 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. |
| 10745 | kind: included |
| 10746 | fragment: |
| 10747 | start: 63 |
| 10748 | end: 64 |
| 10749 | instance: |
| 10750 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10751 | kind: included |
| 10752 | fragment: |
| 10753 | start: 39 |
| 10754 | end: 47 |
| 10755 | returns: vector |
| 10756 | operations: |
| 10757 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 10758 | op: "" |
| 10759 | joins: |
| 10760 | - addedlabels: |
| 10761 | - c |
| 10762 | - d |
| 10763 | deadinfo: |
| 10764 | 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. |
| 10765 | fragment: |
| 10766 | start: 24 |
| 10767 | end: 32 |
| 10768 | depth: 0 |
| 10769 | ison: true |
| 10770 | matchinglabels: |
| 10771 | - instance |
| 10772 | op: '*' |
| 10773 | src: |
| 10774 | labels: |
| 10775 | __name__: |
| 10776 | reason: Aggregation removes metric name. |
| 10777 | kind: excluded |
| 10778 | fragment: |
| 10779 | start: 0 |
| 10780 | end: 33 |
| 10781 | a: |
| 10782 | reason: Query will only return series where these labels are present. |
| 10783 | kind: guaranteed |
| 10784 | fragment: |
| 10785 | start: 4 |
| 10786 | end: 14 |
| 10787 | instance: |
| 10788 | reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results. |
| 10789 | kind: excluded |
| 10790 | fragment: |
| 10791 | start: 24 |
| 10792 | end: 32 |
| 10793 | returns: vector |
| 10794 | operations: |
| 10795 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 10796 | op: "" |
| 10797 | - node: '[*parser.AggregateExpr] sum without (instance) (foo{a="1"})' |
| 10798 | op: sum |
| 10799 | position: |
| 10800 | start: 4 |
| 10801 | end: 14 |
| 10802 | type: aggregation |
| 10803 | usedLabels: |
| 10804 | - instance |
| 10805 | position: |
| 10806 | start: 66 |
| 10807 | end: 76 |
| 10808 | type: selector |
| 10809 | |
| 10810 | --- |
| 10811 | |
| 10812 | [TestLabelsSource/144 - 1] |
| 10813 | expr: |4 |
| 10814 | |
| 10815 | max without (source_instance) ( |
| 10816 | increase(kernel_device_io_errors_total{device!~"loop.+"}[120m]) > 3 unless on(instance, device) ( |
| 10817 | increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[125m])*2 > increase(kernel_device_io_errors_total[120m]) |
| 10818 | ) |
| 10819 | and on(device, instance) absent(node_disk_info) |
| 10820 | ) * on(instance) group_left(group) label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)") |
| 10821 | output: |
| 10822 | - labels: |
| 10823 | __name__: |
| 10824 | reason: Binary operation between two vectors removes metric names. |
| 10825 | kind: excluded |
| 10826 | fragment: |
| 10827 | start: 2 |
| 10828 | end: 442 |
| 10829 | device: |
| 10830 | 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. |
| 10831 | kind: included |
| 10832 | fragment: |
| 10833 | start: 274 |
| 10834 | end: 280 |
| 10835 | group: |
| 10836 | 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. |
| 10837 | kind: included |
| 10838 | fragment: |
| 10839 | start: 344 |
| 10840 | end: 349 |
| 10841 | instance: |
| 10842 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 10843 | kind: included |
| 10844 | fragment: |
| 10845 | start: 323 |
| 10846 | end: 331 |
| 10847 | source_instance: |
| 10848 | reason: Query is using aggregation with `without(source_instance)`, all labels included inside `without(...)` will be removed from the results. |
| 10849 | kind: excluded |
| 10850 | fragment: |
| 10851 | start: 15 |
| 10852 | end: 30 |
| 10853 | returns: vector |
| 10854 | operations: |
| 10855 | - node: '[*parser.MatrixSelector] kernel_device_io_errors_total{device!~"loop.+"}[2h]' |
| 10856 | op: "" |
| 10857 | - node: '[*parser.VectorSelector] kernel_device_io_errors_total{device!~"loop.+"}' |
| 10858 | op: "" |
| 10859 | - node: '[*parser.Call] increase(kernel_device_io_errors_total{device!~"loop.+"}[2h])' |
| 10860 | op: increase |
| 10861 | - 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))' |
| 10862 | op: max |
| 10863 | joins: |
| 10864 | - addedlabels: [] |
| 10865 | deadinfo: |
| 10866 | reason: |- |
| 10867 | 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 the provided query doesn't match any time series. |
| 10868 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 10869 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 10870 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 10871 | 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. |
| 10872 | fragment: |
| 10873 | start: 292 |
| 10874 | end: 298 |
| 10875 | depth: 1 |
| 10876 | ison: true |
| 10877 | matchinglabels: |
| 10878 | - device |
| 10879 | - instance |
| 10880 | op: and |
| 10881 | src: |
| 10882 | labels: |
| 10883 | "": |
| 10884 | reason: |- |
| 10885 | The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if the provided query doesn't match any time series. |
| 10886 | You will only get any results back if the metric selector you pass doesn't match anything. |
| 10887 | Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels. |
| 10888 | This means that the only labels you can get back from absent call are the ones you pass to it. |
| 10889 | 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. |
| 10890 | kind: excluded |
| 10891 | fragment: |
| 10892 | start: 292 |
| 10893 | end: 298 |
| 10894 | returns: vector |
| 10895 | operations: |
| 10896 | - node: '[*parser.VectorSelector] node_disk_info' |
| 10897 | op: "" |
| 10898 | - node: '[*parser.Call] absent(node_disk_info)' |
| 10899 | op: absent |
| 10900 | position: |
| 10901 | start: 299 |
| 10902 | end: 313 |
| 10903 | type: function |
| 10904 | fixedLabels: true |
| 10905 | - addedlabels: |
| 10906 | - group |
| 10907 | depth: 0 |
| 10908 | ison: true |
| 10909 | matchinglabels: |
| 10910 | - instance |
| 10911 | op: '*' |
| 10912 | src: |
| 10913 | labels: |
| 10914 | instance: |
| 10915 | reason: This label will be added to the result by a label_replace() call. |
| 10916 | kind: guaranteed |
| 10917 | fragment: |
| 10918 | start: 351 |
| 10919 | end: 442 |
| 10920 | returns: vector |
| 10921 | operations: |
| 10922 | - node: '[*parser.VectorSelector] salt_highstate_runner_configured_minions' |
| 10923 | op: "" |
| 10924 | - args: |
| 10925 | - '"instance"' |
| 10926 | - '"$1"' |
| 10927 | - '"minion"' |
| 10928 | - '"(.+)"' |
| 10929 | node: '[*parser.Call] label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)")' |
| 10930 | op: label_replace |
| 10931 | indirect: |
| 10932 | - src: |
| 10933 | labels: |
| 10934 | "": |
| 10935 | reason: This query returns a string value with no labels. |
| 10936 | kind: excluded |
| 10937 | fragment: |
| 10938 | start: 407 |
| 10939 | end: 417 |
| 10940 | returns: string |
| 10941 | returnInfo: |
| 10942 | logicalexpr: "" |
| 10943 | valueposition: |
| 10944 | start: 0 |
| 10945 | end: 0 |
| 10946 | returnednumber: 0 |
| 10947 | alwaysreturns: true |
| 10948 | knownreturn: false |
| 10949 | isreturnbool: false |
| 10950 | position: |
| 10951 | start: 407 |
| 10952 | end: 417 |
| 10953 | type: string |
| 10954 | fixedLabels: true |
| 10955 | op: 0 |
| 10956 | side: 0 |
| 10957 | - src: |
| 10958 | labels: |
| 10959 | "": |
| 10960 | reason: This query returns a string value with no labels. |
| 10961 | kind: excluded |
| 10962 | fragment: |
| 10963 | start: 419 |
| 10964 | end: 423 |
| 10965 | returns: string |
| 10966 | returnInfo: |
| 10967 | logicalexpr: "" |
| 10968 | valueposition: |
| 10969 | start: 0 |
| 10970 | end: 0 |
| 10971 | returnednumber: 0 |
| 10972 | alwaysreturns: true |
| 10973 | knownreturn: false |
| 10974 | isreturnbool: false |
| 10975 | position: |
| 10976 | start: 419 |
| 10977 | end: 423 |
| 10978 | type: string |
| 10979 | fixedLabels: true |
| 10980 | op: 0 |
| 10981 | side: 0 |
| 10982 | - src: |
| 10983 | labels: |
| 10984 | "": |
| 10985 | reason: This query returns a string value with no labels. |
| 10986 | kind: excluded |
| 10987 | fragment: |
| 10988 | start: 425 |
| 10989 | end: 433 |
| 10990 | returns: string |
| 10991 | returnInfo: |
| 10992 | logicalexpr: "" |
| 10993 | valueposition: |
| 10994 | start: 0 |
| 10995 | end: 0 |
| 10996 | returnednumber: 0 |
| 10997 | alwaysreturns: true |
| 10998 | knownreturn: false |
| 10999 | isreturnbool: false |
| 11000 | position: |
| 11001 | start: 425 |
| 11002 | end: 433 |
| 11003 | type: string |
| 11004 | fixedLabels: true |
| 11005 | op: 0 |
| 11006 | side: 0 |
| 11007 | - src: |
| 11008 | labels: |
| 11009 | "": |
| 11010 | reason: This query returns a string value with no labels. |
| 11011 | kind: excluded |
| 11012 | fragment: |
| 11013 | start: 435 |
| 11014 | end: 441 |
| 11015 | returns: string |
| 11016 | returnInfo: |
| 11017 | logicalexpr: "" |
| 11018 | valueposition: |
| 11019 | start: 0 |
| 11020 | end: 0 |
| 11021 | returnednumber: 0 |
| 11022 | alwaysreturns: true |
| 11023 | knownreturn: false |
| 11024 | isreturnbool: false |
| 11025 | position: |
| 11026 | start: 435 |
| 11027 | end: 441 |
| 11028 | type: string |
| 11029 | fixedLabels: true |
| 11030 | op: 0 |
| 11031 | side: 0 |
| 11032 | usedLabels: |
| 11033 | - minion |
| 11034 | position: |
| 11035 | start: 365 |
| 11036 | end: 405 |
| 11037 | type: function |
| 11038 | unless: |
| 11039 | - ison: true |
| 11040 | matchinglabels: |
| 11041 | - instance |
| 11042 | - device |
| 11043 | src: |
| 11044 | labels: |
| 11045 | __name__: |
| 11046 | reason: Binary operation between two vectors removes metric names. |
| 11047 | kind: excluded |
| 11048 | fragment: |
| 11049 | start: 140 |
| 11050 | end: 258 |
| 11051 | returns: vector |
| 11052 | operations: |
| 11053 | - node: '[*parser.MatrixSelector] kernel_device_io_soft_errors_total{device!~"loop.+"}[2h5m]' |
| 11054 | op: "" |
| 11055 | - node: '[*parser.VectorSelector] kernel_device_io_soft_errors_total{device!~"loop.+"}' |
| 11056 | op: "" |
| 11057 | - node: '[*parser.Call] increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[2h5m])' |
| 11058 | op: increase |
| 11059 | joins: |
| 11060 | - addedlabels: [] |
| 11061 | depth: 0 |
| 11062 | ison: false |
| 11063 | matchinglabels: [] |
| 11064 | op: '>' |
| 11065 | src: |
| 11066 | returns: vector |
| 11067 | operations: |
| 11068 | - node: '[*parser.MatrixSelector] kernel_device_io_errors_total[2h]' |
| 11069 | op: "" |
| 11070 | - node: '[*parser.VectorSelector] kernel_device_io_errors_total' |
| 11071 | op: "" |
| 11072 | - node: '[*parser.Call] increase(kernel_device_io_errors_total[2h])' |
| 11073 | op: increase |
| 11074 | position: |
| 11075 | start: 222 |
| 11076 | end: 257 |
| 11077 | type: function |
| 11078 | indirect: |
| 11079 | - src: |
| 11080 | labels: |
| 11081 | "": |
| 11082 | reason: This query returns a number value with no labels. |
| 11083 | kind: excluded |
| 11084 | fragment: |
| 11085 | start: 209 |
| 11086 | end: 210 |
| 11087 | returns: scalar |
| 11088 | returnInfo: |
| 11089 | logicalexpr: "" |
| 11090 | valueposition: |
| 11091 | start: 209 |
| 11092 | end: 210 |
| 11093 | returnednumber: 2 |
| 11094 | alwaysreturns: true |
| 11095 | knownreturn: true |
| 11096 | isreturnbool: false |
| 11097 | position: |
| 11098 | start: 209 |
| 11099 | end: 210 |
| 11100 | type: number |
| 11101 | fixedLabels: true |
| 11102 | op: 57397 |
| 11103 | side: 1 |
| 11104 | condition: |
| 11105 | op: 57388 |
| 11106 | present: true |
| 11107 | position: |
| 11108 | start: 149 |
| 11109 | end: 207 |
| 11110 | type: function |
| 11111 | indirect: |
| 11112 | - src: |
| 11113 | labels: |
| 11114 | "": |
| 11115 | reason: This query returns a number value with no labels. |
| 11116 | kind: excluded |
| 11117 | fragment: |
| 11118 | start: 103 |
| 11119 | end: 104 |
| 11120 | returns: scalar |
| 11121 | returnInfo: |
| 11122 | logicalexpr: "" |
| 11123 | valueposition: |
| 11124 | start: 103 |
| 11125 | end: 104 |
| 11126 | returnednumber: 3 |
| 11127 | alwaysreturns: true |
| 11128 | knownreturn: true |
| 11129 | isreturnbool: false |
| 11130 | position: |
| 11131 | start: 103 |
| 11132 | end: 104 |
| 11133 | type: number |
| 11134 | fixedLabels: true |
| 11135 | op: 57388 |
| 11136 | side: 1 |
| 11137 | usedLabels: |
| 11138 | - instance |
| 11139 | - device |
| 11140 | condition: |
| 11141 | op: 57388 |
| 11142 | value: 3 |
| 11143 | present: true |
| 11144 | knownValue: true |
| 11145 | position: |
| 11146 | start: 46 |
| 11147 | end: 99 |
| 11148 | type: aggregation |
| 11149 | |
| 11150 | --- |
| 11151 | |
| 11152 | [TestLabelsSource/145 - 1] |
| 11153 | expr: sum(foo{a="1"}) by(job) * on() bar{b="2"} |
| 11154 | output: |
| 11155 | - labels: |
| 11156 | "": |
| 11157 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 11158 | kind: excluded |
| 11159 | fragment: |
| 11160 | start: 26 |
| 11161 | end: 30 |
| 11162 | __name__: |
| 11163 | reason: Binary operation between two vectors removes metric names. |
| 11164 | kind: excluded |
| 11165 | fragment: |
| 11166 | start: 0 |
| 11167 | end: 41 |
| 11168 | a: |
| 11169 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 11170 | kind: excluded |
| 11171 | fragment: |
| 11172 | start: 16 |
| 11173 | end: 23 |
| 11174 | job: |
| 11175 | reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results. |
| 11176 | kind: excluded |
| 11177 | fragment: |
| 11178 | start: 26 |
| 11179 | end: 30 |
| 11180 | returns: vector |
| 11181 | operations: |
| 11182 | - node: '[*parser.VectorSelector] foo{a="1"}' |
| 11183 | op: "" |
| 11184 | - node: '[*parser.AggregateExpr] sum by (job) (foo{a="1"})' |
| 11185 | op: sum |
| 11186 | joins: |
| 11187 | - addedlabels: [] |
| 11188 | depth: 0 |
| 11189 | ison: true |
| 11190 | matchinglabels: [] |
| 11191 | op: '*' |
| 11192 | src: |
| 11193 | labels: |
| 11194 | b: |
| 11195 | reason: Query will only return series where these labels are present. |
| 11196 | kind: guaranteed |
| 11197 | fragment: |
| 11198 | start: 31 |
| 11199 | end: 41 |
| 11200 | returns: vector |
| 11201 | operations: |
| 11202 | - node: '[*parser.VectorSelector] bar{b="2"}' |
| 11203 | op: "" |
| 11204 | position: |
| 11205 | start: 31 |
| 11206 | end: 41 |
| 11207 | type: selector |
| 11208 | position: |
| 11209 | start: 4 |
| 11210 | end: 14 |
| 11211 | type: aggregation |
| 11212 | fixedLabels: true |
| 11213 | |
| 11214 | --- |
| 11215 | |
| 11216 | [TestLabelsSource/146 - 1] |
| 11217 | expr: sum(sum(foo) without(job)) by(job) |
| 11218 | output: |
| 11219 | - labels: |
| 11220 | "": |
| 11221 | reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results. |
| 11222 | kind: excluded |
| 11223 | fragment: |
| 11224 | start: 27 |
| 11225 | end: 29 |
| 11226 | __name__: |
| 11227 | reason: Aggregation removes metric name. |
| 11228 | kind: excluded |
| 11229 | fragment: |
| 11230 | start: 0 |
| 11231 | end: 34 |
| 11232 | job: |
| 11233 | reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 11234 | kind: excluded |
| 11235 | fragment: |
| 11236 | start: 21 |
| 11237 | end: 24 |
| 11238 | returns: vector |
| 11239 | deadLabels: |
| 11240 | - name: job |
| 11241 | reason: You can't use `job` because this label is not possible here. |
| 11242 | labelreason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results. |
| 11243 | usagefragment: |
| 11244 | start: 30 |
| 11245 | end: 33 |
| 11246 | labelfragment: |
| 11247 | start: 21 |
| 11248 | end: 24 |
| 11249 | kind: 0 |
| 11250 | operations: |
| 11251 | - node: '[*parser.VectorSelector] foo' |
| 11252 | op: "" |
| 11253 | - node: '[*parser.AggregateExpr] sum without (job) (foo)' |
| 11254 | op: sum |
| 11255 | - node: '[*parser.AggregateExpr] sum by (job) (sum without (job) (foo))' |
| 11256 | op: sum |
| 11257 | usedLabels: |
| 11258 | - job |
| 11259 | position: |
| 11260 | start: 8 |
| 11261 | end: 11 |
| 11262 | type: aggregation |
| 11263 | fixedLabels: true |
| 11264 | |
| 11265 | --- |
| 11266 | |
| 11267 | [TestLabelsSource/147 - 1] |
| 11268 | expr: |4 |
| 11269 | |
| 11270 | prometheus:scrape_series_added:since_gc:sum |
| 11271 | * on(prometheus) group_left() |
| 11272 | label_replace( |
| 11273 | max(max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])) by(instance) |
| 11274 | / |
| 11275 | max(max_over_time(prometheus_tsdb_head_series[2h])) by(instance), |
| 11276 | "prometheus", "$1", |
| 11277 | "instance", "(.+)" |
| 11278 | ) |
| 11279 | output: |
| 11280 | - labels: |
| 11281 | __name__: |
| 11282 | reason: Binary operation between two vectors removes metric names. |
| 11283 | kind: excluded |
| 11284 | fragment: |
| 11285 | start: 1 |
| 11286 | end: 287 |
| 11287 | prometheus: |
| 11288 | reason: Query is using many-to-one vector matching with `on(prometheus)`, labels included inside `on(...)` will be present on the results. |
| 11289 | kind: included |
| 11290 | fragment: |
| 11291 | start: 50 |
| 11292 | end: 60 |
| 11293 | returns: vector |
| 11294 | operations: |
| 11295 | - node: '[*parser.VectorSelector] prometheus:scrape_series_added:since_gc:sum' |
| 11296 | op: "" |
| 11297 | joins: |
| 11298 | - addedlabels: [] |
| 11299 | depth: 0 |
| 11300 | ison: true |
| 11301 | matchinglabels: |
| 11302 | - prometheus |
| 11303 | op: '*' |
| 11304 | src: |
| 11305 | labels: |
| 11306 | "": |
| 11307 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 11308 | kind: excluded |
| 11309 | fragment: |
| 11310 | start: 158 |
| 11311 | end: 160 |
| 11312 | __name__: |
| 11313 | reason: Binary operation between two vectors removes metric names. |
| 11314 | kind: excluded |
| 11315 | fragment: |
| 11316 | start: 92 |
| 11317 | end: 241 |
| 11318 | instance: |
| 11319 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 11320 | kind: included |
| 11321 | fragment: |
| 11322 | start: 161 |
| 11323 | end: 169 |
| 11324 | job: |
| 11325 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 11326 | kind: excluded |
| 11327 | fragment: |
| 11328 | start: 158 |
| 11329 | end: 170 |
| 11330 | prometheus: |
| 11331 | reason: This label will be added to the result by a label_replace() call. |
| 11332 | kind: guaranteed |
| 11333 | fragment: |
| 11334 | start: 75 |
| 11335 | end: 287 |
| 11336 | returns: vector |
| 11337 | operations: |
| 11338 | - node: '[*parser.MatrixSelector] go_memstats_alloc_bytes{job="prometheus"}[2h]' |
| 11339 | op: "" |
| 11340 | - node: '[*parser.VectorSelector] go_memstats_alloc_bytes{job="prometheus"}' |
| 11341 | op: "" |
| 11342 | - node: '[*parser.Call] max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])' |
| 11343 | op: max_over_time |
| 11344 | - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h]))' |
| 11345 | op: max |
| 11346 | - args: |
| 11347 | - '"prometheus"' |
| 11348 | - '"$1"' |
| 11349 | - '"instance"' |
| 11350 | - '"(.+)"' |
| 11351 | 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", "(.+)")' |
| 11352 | op: label_replace |
| 11353 | joins: |
| 11354 | - addedlabels: [] |
| 11355 | depth: 0 |
| 11356 | ison: false |
| 11357 | matchinglabels: [] |
| 11358 | op: / |
| 11359 | src: |
| 11360 | labels: |
| 11361 | "": |
| 11362 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 11363 | kind: excluded |
| 11364 | fragment: |
| 11365 | start: 229 |
| 11366 | end: 231 |
| 11367 | __name__: |
| 11368 | reason: Aggregation removes metric name. |
| 11369 | kind: excluded |
| 11370 | fragment: |
| 11371 | start: 177 |
| 11372 | end: 241 |
| 11373 | instance: |
| 11374 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 11375 | kind: included |
| 11376 | fragment: |
| 11377 | start: 232 |
| 11378 | end: 240 |
| 11379 | returns: vector |
| 11380 | operations: |
| 11381 | - node: '[*parser.MatrixSelector] prometheus_tsdb_head_series[2h]' |
| 11382 | op: "" |
| 11383 | - node: '[*parser.VectorSelector] prometheus_tsdb_head_series' |
| 11384 | op: "" |
| 11385 | - node: '[*parser.Call] max_over_time(prometheus_tsdb_head_series[2h])' |
| 11386 | op: max_over_time |
| 11387 | - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(prometheus_tsdb_head_series[2h]))' |
| 11388 | op: max |
| 11389 | usedLabels: |
| 11390 | - instance |
| 11391 | position: |
| 11392 | start: 195 |
| 11393 | end: 226 |
| 11394 | type: aggregation |
| 11395 | fixedLabels: true |
| 11396 | indirect: |
| 11397 | - src: |
| 11398 | labels: |
| 11399 | "": |
| 11400 | reason: This query returns a string value with no labels. |
| 11401 | kind: excluded |
| 11402 | fragment: |
| 11403 | start: 245 |
| 11404 | end: 257 |
| 11405 | returns: string |
| 11406 | returnInfo: |
| 11407 | logicalexpr: "" |
| 11408 | valueposition: |
| 11409 | start: 0 |
| 11410 | end: 0 |
| 11411 | returnednumber: 0 |
| 11412 | alwaysreturns: true |
| 11413 | knownreturn: false |
| 11414 | isreturnbool: false |
| 11415 | position: |
| 11416 | start: 245 |
| 11417 | end: 257 |
| 11418 | type: string |
| 11419 | fixedLabels: true |
| 11420 | op: 0 |
| 11421 | side: 0 |
| 11422 | - src: |
| 11423 | labels: |
| 11424 | "": |
| 11425 | reason: This query returns a string value with no labels. |
| 11426 | kind: excluded |
| 11427 | fragment: |
| 11428 | start: 259 |
| 11429 | end: 263 |
| 11430 | returns: string |
| 11431 | returnInfo: |
| 11432 | logicalexpr: "" |
| 11433 | valueposition: |
| 11434 | start: 0 |
| 11435 | end: 0 |
| 11436 | returnednumber: 0 |
| 11437 | alwaysreturns: true |
| 11438 | knownreturn: false |
| 11439 | isreturnbool: false |
| 11440 | position: |
| 11441 | start: 259 |
| 11442 | end: 263 |
| 11443 | type: string |
| 11444 | fixedLabels: true |
| 11445 | op: 0 |
| 11446 | side: 0 |
| 11447 | - src: |
| 11448 | labels: |
| 11449 | "": |
| 11450 | reason: This query returns a string value with no labels. |
| 11451 | kind: excluded |
| 11452 | fragment: |
| 11453 | start: 267 |
| 11454 | end: 277 |
| 11455 | returns: string |
| 11456 | returnInfo: |
| 11457 | logicalexpr: "" |
| 11458 | valueposition: |
| 11459 | start: 0 |
| 11460 | end: 0 |
| 11461 | returnednumber: 0 |
| 11462 | alwaysreturns: true |
| 11463 | knownreturn: false |
| 11464 | isreturnbool: false |
| 11465 | position: |
| 11466 | start: 267 |
| 11467 | end: 277 |
| 11468 | type: string |
| 11469 | fixedLabels: true |
| 11470 | op: 0 |
| 11471 | side: 0 |
| 11472 | - src: |
| 11473 | labels: |
| 11474 | "": |
| 11475 | reason: This query returns a string value with no labels. |
| 11476 | kind: excluded |
| 11477 | fragment: |
| 11478 | start: 279 |
| 11479 | end: 285 |
| 11480 | returns: string |
| 11481 | returnInfo: |
| 11482 | logicalexpr: "" |
| 11483 | valueposition: |
| 11484 | start: 0 |
| 11485 | end: 0 |
| 11486 | returnednumber: 0 |
| 11487 | alwaysreturns: true |
| 11488 | knownreturn: false |
| 11489 | isreturnbool: false |
| 11490 | position: |
| 11491 | start: 279 |
| 11492 | end: 285 |
| 11493 | type: string |
| 11494 | fixedLabels: true |
| 11495 | op: 0 |
| 11496 | side: 0 |
| 11497 | usedLabels: |
| 11498 | - instance |
| 11499 | position: |
| 11500 | start: 92 |
| 11501 | end: 241 |
| 11502 | type: function |
| 11503 | fixedLabels: true |
| 11504 | usedLabels: |
| 11505 | - prometheus |
| 11506 | position: |
| 11507 | start: 1 |
| 11508 | end: 44 |
| 11509 | type: selector |
| 11510 | |
| 11511 | --- |
| 11512 | |
| 11513 | [TestLabelsSource/148 - 1] |
| 11514 | expr: (day_of_week() == 6 and hour() < 1) or vector(1) |
| 11515 | output: |
| 11516 | - labels: |
| 11517 | "": |
| 11518 | reason: Calling `day_of_week()` with no arguments will return an empty time series with no labels. |
| 11519 | kind: excluded |
| 11520 | fragment: |
| 11521 | start: 1 |
| 11522 | end: 14 |
| 11523 | returns: vector |
| 11524 | operations: |
| 11525 | - node: '[*parser.Call] day_of_week()' |
| 11526 | op: day_of_week |
| 11527 | joins: |
| 11528 | - addedlabels: [] |
| 11529 | depth: 0 |
| 11530 | ison: false |
| 11531 | matchinglabels: [] |
| 11532 | op: and |
| 11533 | src: |
| 11534 | labels: |
| 11535 | "": |
| 11536 | reason: Calling `hour()` with no arguments will return an empty time series with no labels. |
| 11537 | kind: excluded |
| 11538 | fragment: |
| 11539 | start: 24 |
| 11540 | end: 30 |
| 11541 | returns: vector |
| 11542 | operations: |
| 11543 | - node: '[*parser.Call] hour()' |
| 11544 | op: hour |
| 11545 | indirect: |
| 11546 | - src: |
| 11547 | labels: |
| 11548 | "": |
| 11549 | reason: This query returns a number value with no labels. |
| 11550 | kind: excluded |
| 11551 | fragment: |
| 11552 | start: 33 |
| 11553 | end: 34 |
| 11554 | returns: scalar |
| 11555 | returnInfo: |
| 11556 | logicalexpr: "" |
| 11557 | valueposition: |
| 11558 | start: 33 |
| 11559 | end: 34 |
| 11560 | returnednumber: 1 |
| 11561 | alwaysreturns: true |
| 11562 | knownreturn: true |
| 11563 | isreturnbool: false |
| 11564 | position: |
| 11565 | start: 33 |
| 11566 | end: 34 |
| 11567 | type: number |
| 11568 | fixedLabels: true |
| 11569 | op: 57393 |
| 11570 | side: 1 |
| 11571 | returnInfo: |
| 11572 | logicalexpr: "" |
| 11573 | valueposition: |
| 11574 | start: 0 |
| 11575 | end: 0 |
| 11576 | returnednumber: 0 |
| 11577 | alwaysreturns: true |
| 11578 | knownreturn: false |
| 11579 | isreturnbool: false |
| 11580 | condition: |
| 11581 | op: 57393 |
| 11582 | value: 1 |
| 11583 | present: true |
| 11584 | knownValue: true |
| 11585 | position: |
| 11586 | start: 24 |
| 11587 | end: 30 |
| 11588 | type: function |
| 11589 | fixedLabels: true |
| 11590 | indirect: |
| 11591 | - src: |
| 11592 | labels: |
| 11593 | "": |
| 11594 | reason: This query returns a number value with no labels. |
| 11595 | kind: excluded |
| 11596 | fragment: |
| 11597 | start: 18 |
| 11598 | end: 19 |
| 11599 | returns: scalar |
| 11600 | returnInfo: |
| 11601 | logicalexpr: "" |
| 11602 | valueposition: |
| 11603 | start: 18 |
| 11604 | end: 19 |
| 11605 | returnednumber: 6 |
| 11606 | alwaysreturns: true |
| 11607 | knownreturn: true |
| 11608 | isreturnbool: false |
| 11609 | position: |
| 11610 | start: 18 |
| 11611 | end: 19 |
| 11612 | type: number |
| 11613 | fixedLabels: true |
| 11614 | op: 57385 |
| 11615 | side: 1 |
| 11616 | returnInfo: |
| 11617 | logicalexpr: "" |
| 11618 | valueposition: |
| 11619 | start: 0 |
| 11620 | end: 0 |
| 11621 | returnednumber: 0 |
| 11622 | alwaysreturns: true |
| 11623 | knownreturn: false |
| 11624 | isreturnbool: false |
| 11625 | condition: |
| 11626 | op: 57391 |
| 11627 | present: true |
| 11628 | position: |
| 11629 | start: 1 |
| 11630 | end: 14 |
| 11631 | type: function |
| 11632 | fixedLabels: true |
| 11633 | - labels: |
| 11634 | "": |
| 11635 | reason: Calling `vector()` will return a vector value with no labels. |
| 11636 | kind: excluded |
| 11637 | fragment: |
| 11638 | start: 39 |
| 11639 | end: 45 |
| 11640 | returns: vector |
| 11641 | operations: |
| 11642 | - args: |
| 11643 | - "1" |
| 11644 | node: '[*parser.Call] vector(1)' |
| 11645 | op: vector |
| 11646 | indirect: |
| 11647 | - src: |
| 11648 | labels: |
| 11649 | "": |
| 11650 | reason: This query returns a number value with no labels. |
| 11651 | kind: excluded |
| 11652 | fragment: |
| 11653 | start: 46 |
| 11654 | end: 47 |
| 11655 | returns: scalar |
| 11656 | returnInfo: |
| 11657 | logicalexpr: "" |
| 11658 | valueposition: |
| 11659 | start: 46 |
| 11660 | end: 47 |
| 11661 | returnednumber: 1 |
| 11662 | alwaysreturns: true |
| 11663 | knownreturn: true |
| 11664 | isreturnbool: false |
| 11665 | position: |
| 11666 | start: 46 |
| 11667 | end: 47 |
| 11668 | type: number |
| 11669 | fixedLabels: true |
| 11670 | op: 0 |
| 11671 | side: 0 |
| 11672 | returnInfo: |
| 11673 | logicalexpr: "" |
| 11674 | valueposition: |
| 11675 | start: 39 |
| 11676 | end: 48 |
| 11677 | returnednumber: 1 |
| 11678 | alwaysreturns: true |
| 11679 | knownreturn: true |
| 11680 | isreturnbool: false |
| 11681 | position: |
| 11682 | start: 39 |
| 11683 | end: 48 |
| 11684 | type: function |
| 11685 | fixedLabels: true |
| 11686 | |
| 11687 | --- |
| 11688 | |
| 11689 | [TestLabelsSource/149 - 1] |
| 11690 | expr: |4- |
| 11691 | |
| 11692 | sum by (foo, bar) ( |
| 11693 | rate(errors_total[5m]) |
| 11694 | * on (instance) group_left (bob, alice) |
| 11695 | server_errors_total |
| 11696 | ) |
| 11697 | output: |
| 11698 | - labels: |
| 11699 | "": |
| 11700 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 11701 | kind: excluded |
| 11702 | fragment: |
| 11703 | start: 5 |
| 11704 | end: 7 |
| 11705 | __name__: |
| 11706 | reason: Aggregation removes metric name. |
| 11707 | kind: excluded |
| 11708 | fragment: |
| 11709 | start: 1 |
| 11710 | end: 115 |
| 11711 | alice: |
| 11712 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 11713 | kind: excluded |
| 11714 | fragment: |
| 11715 | start: 5 |
| 11716 | end: 18 |
| 11717 | bar: |
| 11718 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 11719 | kind: included |
| 11720 | fragment: |
| 11721 | start: 14 |
| 11722 | end: 17 |
| 11723 | bob: |
| 11724 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 11725 | kind: excluded |
| 11726 | fragment: |
| 11727 | start: 5 |
| 11728 | end: 18 |
| 11729 | foo: |
| 11730 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 11731 | kind: included |
| 11732 | fragment: |
| 11733 | start: 9 |
| 11734 | end: 12 |
| 11735 | instance: |
| 11736 | reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results. |
| 11737 | kind: excluded |
| 11738 | fragment: |
| 11739 | start: 5 |
| 11740 | end: 18 |
| 11741 | returns: vector |
| 11742 | deadLabels: |
| 11743 | - name: bob |
| 11744 | reason: Previously joined label `bob` is being removed from the results. |
| 11745 | 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. |
| 11746 | usagefragment: |
| 11747 | start: 5 |
| 11748 | end: 18 |
| 11749 | labelfragment: |
| 11750 | start: 78 |
| 11751 | end: 81 |
| 11752 | kind: 3 |
| 11753 | - name: alice |
| 11754 | reason: Previously joined label `alice` is being removed from the results. |
| 11755 | 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. |
| 11756 | usagefragment: |
| 11757 | start: 5 |
| 11758 | end: 18 |
| 11759 | labelfragment: |
| 11760 | start: 83 |
| 11761 | end: 88 |
| 11762 | kind: 3 |
| 11763 | operations: |
| 11764 | - node: '[*parser.MatrixSelector] errors_total[5m]' |
| 11765 | op: "" |
| 11766 | - node: '[*parser.VectorSelector] errors_total' |
| 11767 | op: "" |
| 11768 | - node: '[*parser.Call] rate(errors_total[5m])' |
| 11769 | op: rate |
| 11770 | - node: '[*parser.AggregateExpr] sum by (foo, bar) (rate(errors_total[5m]) * on (instance) group_left (bob, alice) server_errors_total)' |
| 11771 | op: sum |
| 11772 | joins: |
| 11773 | - addedlabels: |
| 11774 | - bob |
| 11775 | - alice |
| 11776 | depth: 1 |
| 11777 | ison: true |
| 11778 | matchinglabels: |
| 11779 | - instance |
| 11780 | op: '*' |
| 11781 | src: |
| 11782 | returns: vector |
| 11783 | operations: |
| 11784 | - node: '[*parser.VectorSelector] server_errors_total' |
| 11785 | op: "" |
| 11786 | position: |
| 11787 | start: 94 |
| 11788 | end: 113 |
| 11789 | type: selector |
| 11790 | usedLabels: |
| 11791 | - foo |
| 11792 | - bar |
| 11793 | position: |
| 11794 | start: 30 |
| 11795 | end: 46 |
| 11796 | type: aggregation |
| 11797 | fixedLabels: true |
| 11798 | |
| 11799 | --- |
| 11800 | |
| 11801 | [TestLabelsSource/150 - 1] |
| 11802 | expr: 1 - (foo or vector(0)) < 0.999 |
| 11803 | output: |
| 11804 | - returns: vector |
| 11805 | operations: |
| 11806 | - node: '[*parser.VectorSelector] foo' |
| 11807 | op: "" |
| 11808 | indirect: |
| 11809 | - src: |
| 11810 | labels: |
| 11811 | "": |
| 11812 | reason: This query returns a number value with no labels. |
| 11813 | kind: excluded |
| 11814 | fragment: |
| 11815 | start: 0 |
| 11816 | end: 1 |
| 11817 | returns: scalar |
| 11818 | returnInfo: |
| 11819 | logicalexpr: "" |
| 11820 | valueposition: |
| 11821 | start: 0 |
| 11822 | end: 1 |
| 11823 | returnednumber: 1 |
| 11824 | alwaysreturns: true |
| 11825 | knownreturn: true |
| 11826 | isreturnbool: false |
| 11827 | position: |
| 11828 | start: 0 |
| 11829 | end: 1 |
| 11830 | type: number |
| 11831 | fixedLabels: true |
| 11832 | op: 57401 |
| 11833 | side: 0 |
| 11834 | - src: |
| 11835 | labels: |
| 11836 | "": |
| 11837 | reason: This query returns a number value with no labels. |
| 11838 | kind: excluded |
| 11839 | fragment: |
| 11840 | start: 25 |
| 11841 | end: 30 |
| 11842 | returns: scalar |
| 11843 | returnInfo: |
| 11844 | logicalexpr: "" |
| 11845 | valueposition: |
| 11846 | start: 25 |
| 11847 | end: 30 |
| 11848 | returnednumber: 0.999 |
| 11849 | alwaysreturns: true |
| 11850 | knownreturn: true |
| 11851 | isreturnbool: false |
| 11852 | position: |
| 11853 | start: 25 |
| 11854 | end: 30 |
| 11855 | type: number |
| 11856 | fixedLabels: true |
| 11857 | op: 57393 |
| 11858 | side: 1 |
| 11859 | condition: |
| 11860 | op: 57393 |
| 11861 | value: 0.999 |
| 11862 | present: true |
| 11863 | knownValue: true |
| 11864 | position: |
| 11865 | start: 5 |
| 11866 | end: 8 |
| 11867 | type: selector |
| 11868 | - labels: |
| 11869 | "": |
| 11870 | reason: Calling `vector()` will return a vector value with no labels. |
| 11871 | kind: excluded |
| 11872 | fragment: |
| 11873 | start: 12 |
| 11874 | end: 18 |
| 11875 | deadInfo: |
| 11876 | reason: '`1 - vector(0) < 0.999` always evaluates to `1 < 0.999` which is not possible, so it will never return anything.' |
| 11877 | fragment: |
| 11878 | start: 12 |
| 11879 | end: 21 |
| 11880 | returns: vector |
| 11881 | operations: |
| 11882 | - args: |
| 11883 | - "0" |
| 11884 | node: '[*parser.Call] vector(0)' |
| 11885 | op: vector |
| 11886 | indirect: |
| 11887 | - src: |
| 11888 | labels: |
| 11889 | "": |
| 11890 | reason: This query returns a number value with no labels. |
| 11891 | kind: excluded |
| 11892 | fragment: |
| 11893 | start: 19 |
| 11894 | end: 20 |
| 11895 | returns: scalar |
| 11896 | returnInfo: |
| 11897 | logicalexpr: "" |
| 11898 | valueposition: |
| 11899 | start: 19 |
| 11900 | end: 20 |
| 11901 | returnednumber: 0 |
| 11902 | alwaysreturns: true |
| 11903 | knownreturn: true |
| 11904 | isreturnbool: false |
| 11905 | position: |
| 11906 | start: 19 |
| 11907 | end: 20 |
| 11908 | type: number |
| 11909 | fixedLabels: true |
| 11910 | op: 0 |
| 11911 | side: 0 |
| 11912 | - src: |
| 11913 | labels: |
| 11914 | "": |
| 11915 | reason: This query returns a number value with no labels. |
| 11916 | kind: excluded |
| 11917 | fragment: |
| 11918 | start: 0 |
| 11919 | end: 1 |
| 11920 | returns: scalar |
| 11921 | returnInfo: |
| 11922 | logicalexpr: "" |
| 11923 | valueposition: |
| 11924 | start: 0 |
| 11925 | end: 1 |
| 11926 | returnednumber: 1 |
| 11927 | alwaysreturns: true |
| 11928 | knownreturn: true |
| 11929 | isreturnbool: false |
| 11930 | position: |
| 11931 | start: 0 |
| 11932 | end: 1 |
| 11933 | type: number |
| 11934 | fixedLabels: true |
| 11935 | op: 57401 |
| 11936 | side: 0 |
| 11937 | - src: |
| 11938 | labels: |
| 11939 | "": |
| 11940 | reason: This query returns a number value with no labels. |
| 11941 | kind: excluded |
| 11942 | fragment: |
| 11943 | start: 25 |
| 11944 | end: 30 |
| 11945 | returns: scalar |
| 11946 | returnInfo: |
| 11947 | logicalexpr: "" |
| 11948 | valueposition: |
| 11949 | start: 25 |
| 11950 | end: 30 |
| 11951 | returnednumber: 0.999 |
| 11952 | alwaysreturns: true |
| 11953 | knownreturn: true |
| 11954 | isreturnbool: false |
| 11955 | position: |
| 11956 | start: 25 |
| 11957 | end: 30 |
| 11958 | type: number |
| 11959 | fixedLabels: true |
| 11960 | op: 57393 |
| 11961 | side: 1 |
| 11962 | returnInfo: |
| 11963 | logicalexpr: 1 - vector(0) |
| 11964 | valueposition: |
| 11965 | start: 0 |
| 11966 | end: 1 |
| 11967 | returnednumber: 1 |
| 11968 | alwaysreturns: true |
| 11969 | knownreturn: true |
| 11970 | isreturnbool: false |
| 11971 | condition: |
| 11972 | op: 57393 |
| 11973 | value: 0.999 |
| 11974 | present: true |
| 11975 | knownValue: true |
| 11976 | position: |
| 11977 | start: 12 |
| 11978 | end: 21 |
| 11979 | type: function |
| 11980 | fixedLabels: true |
| 11981 | |
| 11982 | --- |
| 11983 | |
| 11984 | [TestLabelsSource/151 - 1] |
| 11985 | expr: |4 |
| 11986 | |
| 11987 | ( |
| 11988 | vector(1) and month() == 2 |
| 11989 | ) or vector(0) |
| 11990 | output: |
| 11991 | - labels: |
| 11992 | "": |
| 11993 | reason: Calling `vector()` will return a vector value with no labels. |
| 11994 | kind: excluded |
| 11995 | fragment: |
| 11996 | start: 5 |
| 11997 | end: 11 |
| 11998 | returns: vector |
| 11999 | operations: |
| 12000 | - args: |
| 12001 | - "1" |
| 12002 | node: '[*parser.Call] vector(1)' |
| 12003 | op: vector |
| 12004 | joins: |
| 12005 | - addedlabels: [] |
| 12006 | depth: 0 |
| 12007 | ison: false |
| 12008 | matchinglabels: [] |
| 12009 | op: and |
| 12010 | src: |
| 12011 | labels: |
| 12012 | "": |
| 12013 | reason: Calling `month()` with no arguments will return an empty time series with no labels. |
| 12014 | kind: excluded |
| 12015 | fragment: |
| 12016 | start: 19 |
| 12017 | end: 26 |
| 12018 | returns: vector |
| 12019 | operations: |
| 12020 | - node: '[*parser.Call] month()' |
| 12021 | op: month |
| 12022 | indirect: |
| 12023 | - src: |
| 12024 | labels: |
| 12025 | "": |
| 12026 | reason: This query returns a number value with no labels. |
| 12027 | kind: excluded |
| 12028 | fragment: |
| 12029 | start: 30 |
| 12030 | end: 31 |
| 12031 | returns: scalar |
| 12032 | returnInfo: |
| 12033 | logicalexpr: "" |
| 12034 | valueposition: |
| 12035 | start: 30 |
| 12036 | end: 31 |
| 12037 | returnednumber: 2 |
| 12038 | alwaysreturns: true |
| 12039 | knownreturn: true |
| 12040 | isreturnbool: false |
| 12041 | position: |
| 12042 | start: 30 |
| 12043 | end: 31 |
| 12044 | type: number |
| 12045 | fixedLabels: true |
| 12046 | op: 57385 |
| 12047 | side: 1 |
| 12048 | returnInfo: |
| 12049 | logicalexpr: "" |
| 12050 | valueposition: |
| 12051 | start: 0 |
| 12052 | end: 0 |
| 12053 | returnednumber: 0 |
| 12054 | alwaysreturns: true |
| 12055 | knownreturn: false |
| 12056 | isreturnbool: false |
| 12057 | condition: |
| 12058 | op: 57385 |
| 12059 | value: 2 |
| 12060 | present: true |
| 12061 | knownValue: true |
| 12062 | position: |
| 12063 | start: 19 |
| 12064 | end: 26 |
| 12065 | type: function |
| 12066 | fixedLabels: true |
| 12067 | indirect: |
| 12068 | - src: |
| 12069 | labels: |
| 12070 | "": |
| 12071 | reason: This query returns a number value with no labels. |
| 12072 | kind: excluded |
| 12073 | fragment: |
| 12074 | start: 12 |
| 12075 | end: 13 |
| 12076 | returns: scalar |
| 12077 | returnInfo: |
| 12078 | logicalexpr: "" |
| 12079 | valueposition: |
| 12080 | start: 12 |
| 12081 | end: 13 |
| 12082 | returnednumber: 1 |
| 12083 | alwaysreturns: true |
| 12084 | knownreturn: true |
| 12085 | isreturnbool: false |
| 12086 | position: |
| 12087 | start: 12 |
| 12088 | end: 13 |
| 12089 | type: number |
| 12090 | fixedLabels: true |
| 12091 | op: 0 |
| 12092 | side: 0 |
| 12093 | returnInfo: |
| 12094 | logicalexpr: "" |
| 12095 | valueposition: |
| 12096 | start: 5 |
| 12097 | end: 14 |
| 12098 | returnednumber: 1 |
| 12099 | alwaysreturns: true |
| 12100 | knownreturn: true |
| 12101 | isreturnbool: false |
| 12102 | condition: |
| 12103 | op: 57391 |
| 12104 | present: true |
| 12105 | position: |
| 12106 | start: 5 |
| 12107 | end: 14 |
| 12108 | type: function |
| 12109 | fixedLabels: true |
| 12110 | - labels: |
| 12111 | "": |
| 12112 | reason: Calling `vector()` will return a vector value with no labels. |
| 12113 | kind: excluded |
| 12114 | fragment: |
| 12115 | start: 37 |
| 12116 | end: 43 |
| 12117 | returns: vector |
| 12118 | operations: |
| 12119 | - args: |
| 12120 | - "0" |
| 12121 | node: '[*parser.Call] vector(0)' |
| 12122 | op: vector |
| 12123 | indirect: |
| 12124 | - src: |
| 12125 | labels: |
| 12126 | "": |
| 12127 | reason: This query returns a number value with no labels. |
| 12128 | kind: excluded |
| 12129 | fragment: |
| 12130 | start: 44 |
| 12131 | end: 45 |
| 12132 | returns: scalar |
| 12133 | returnInfo: |
| 12134 | logicalexpr: "" |
| 12135 | valueposition: |
| 12136 | start: 44 |
| 12137 | end: 45 |
| 12138 | returnednumber: 0 |
| 12139 | alwaysreturns: true |
| 12140 | knownreturn: true |
| 12141 | isreturnbool: false |
| 12142 | position: |
| 12143 | start: 44 |
| 12144 | end: 45 |
| 12145 | type: number |
| 12146 | fixedLabels: true |
| 12147 | op: 0 |
| 12148 | side: 0 |
| 12149 | returnInfo: |
| 12150 | logicalexpr: "" |
| 12151 | valueposition: |
| 12152 | start: 37 |
| 12153 | end: 46 |
| 12154 | returnednumber: 0 |
| 12155 | alwaysreturns: true |
| 12156 | knownreturn: true |
| 12157 | isreturnbool: false |
| 12158 | position: |
| 12159 | start: 37 |
| 12160 | end: 46 |
| 12161 | type: function |
| 12162 | fixedLabels: true |
| 12163 | |
| 12164 | --- |
| 12165 | |
| 12166 | [TestLabelsSource/152 - 1] |
| 12167 | expr: count by (region) (stddev by (colo_name, region) (error_total)) |
| 12168 | output: |
| 12169 | - labels: |
| 12170 | "": |
| 12171 | reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results. |
| 12172 | kind: excluded |
| 12173 | fragment: |
| 12174 | start: 6 |
| 12175 | end: 8 |
| 12176 | __name__: |
| 12177 | reason: Aggregation removes metric name. |
| 12178 | kind: excluded |
| 12179 | fragment: |
| 12180 | start: 0 |
| 12181 | end: 63 |
| 12182 | colo_name: |
| 12183 | reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results. |
| 12184 | kind: excluded |
| 12185 | fragment: |
| 12186 | start: 6 |
| 12187 | end: 17 |
| 12188 | region: |
| 12189 | reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results. |
| 12190 | kind: included |
| 12191 | fragment: |
| 12192 | start: 10 |
| 12193 | end: 16 |
| 12194 | returns: vector |
| 12195 | operations: |
| 12196 | - node: '[*parser.VectorSelector] error_total' |
| 12197 | op: "" |
| 12198 | - node: '[*parser.AggregateExpr] stddev by (colo_name, region) (error_total)' |
| 12199 | op: stddev |
| 12200 | - node: '[*parser.AggregateExpr] count by (region) (stddev by (colo_name, region) (error_total))' |
| 12201 | op: count |
| 12202 | usedLabels: |
| 12203 | - region |
| 12204 | position: |
| 12205 | start: 50 |
| 12206 | end: 61 |
| 12207 | type: aggregation |
| 12208 | fixedLabels: true |
| 12209 | |
| 12210 | --- |
| 12211 | |
| 12212 | [TestLabelsSource/153 - 1] |
| 12213 | expr: |4 |
| 12214 | |
| 12215 | ( |
| 12216 | avg( |
| 12217 | rate(foo_rejections[6h]) |
| 12218 | or |
| 12219 | vector(0) |
| 12220 | ) by (colo_name) |
| 12221 | / |
| 12222 | ( |
| 12223 | avg( |
| 12224 | rate(foo_total[6h]) |
| 12225 | or |
| 12226 | vector(1) |
| 12227 | ) by (colo_name) |
| 12228 | ) |
| 12229 | ) > 5 |
| 12230 | * |
| 12231 | ( |
| 12232 | avg( |
| 12233 | rate(foo_rejections[6h] offset 1d) |
| 12234 | or |
| 12235 | vector(0) |
| 12236 | ) by (colo_name) |
| 12237 | / |
| 12238 | avg( |
| 12239 | rate(foo_total[6h] offset 1d) |
| 12240 | or |
| 12241 | vector(1) |
| 12242 | ) by (colo_name) |
| 12243 | ) and on (colo_name) (colo_job:foo_total:rate2m or vector(0)) > 80 |
| 12244 | and on (colo_name) (colo_job:foo_total:rate2m offset 1d or vector(0)) > 80 |
| 12245 | output: |
| 12246 | - labels: |
| 12247 | "": |
| 12248 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12249 | kind: excluded |
| 12250 | fragment: |
| 12251 | start: 64 |
| 12252 | end: 66 |
| 12253 | __name__: |
| 12254 | reason: Binary operation between two vectors removes metric names. |
| 12255 | kind: excluded |
| 12256 | fragment: |
| 12257 | start: 1 |
| 12258 | end: 336 |
| 12259 | colo_name: |
| 12260 | 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. |
| 12261 | kind: included |
| 12262 | fragment: |
| 12263 | start: 412 |
| 12264 | end: 421 |
| 12265 | returns: vector |
| 12266 | operations: |
| 12267 | - node: '[*parser.MatrixSelector] foo_rejections[6h]' |
| 12268 | op: "" |
| 12269 | - node: '[*parser.VectorSelector] foo_rejections' |
| 12270 | op: "" |
| 12271 | - node: '[*parser.Call] rate(foo_rejections[6h])' |
| 12272 | op: rate |
| 12273 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))' |
| 12274 | op: avg |
| 12275 | joins: |
| 12276 | - addedlabels: [] |
| 12277 | depth: 0 |
| 12278 | ison: false |
| 12279 | matchinglabels: [] |
| 12280 | op: / |
| 12281 | src: |
| 12282 | labels: |
| 12283 | "": |
| 12284 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12285 | kind: excluded |
| 12286 | fragment: |
| 12287 | start: 147 |
| 12288 | end: 149 |
| 12289 | __name__: |
| 12290 | reason: Aggregation removes metric name. |
| 12291 | kind: excluded |
| 12292 | fragment: |
| 12293 | start: 91 |
| 12294 | end: 161 |
| 12295 | colo_name: |
| 12296 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12297 | kind: included |
| 12298 | fragment: |
| 12299 | start: 151 |
| 12300 | end: 160 |
| 12301 | returns: vector |
| 12302 | operations: |
| 12303 | - node: '[*parser.MatrixSelector] foo_total[6h]' |
| 12304 | op: "" |
| 12305 | - node: '[*parser.VectorSelector] foo_total' |
| 12306 | op: "" |
| 12307 | - node: '[*parser.Call] rate(foo_total[6h])' |
| 12308 | op: rate |
| 12309 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))' |
| 12310 | op: avg |
| 12311 | usedLabels: |
| 12312 | - colo_name |
| 12313 | position: |
| 12314 | start: 107 |
| 12315 | end: 120 |
| 12316 | type: aggregation |
| 12317 | fixedLabels: true |
| 12318 | - addedlabels: [] |
| 12319 | depth: 0 |
| 12320 | ison: false |
| 12321 | matchinglabels: [] |
| 12322 | op: / |
| 12323 | src: |
| 12324 | labels: |
| 12325 | "": |
| 12326 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12327 | kind: excluded |
| 12328 | fragment: |
| 12329 | start: 147 |
| 12330 | end: 149 |
| 12331 | __name__: |
| 12332 | reason: Aggregation removes metric name. |
| 12333 | kind: excluded |
| 12334 | fragment: |
| 12335 | start: 91 |
| 12336 | end: 161 |
| 12337 | colo_name: |
| 12338 | reason: Calling `vector()` will return a vector value with no labels. |
| 12339 | kind: excluded |
| 12340 | fragment: |
| 12341 | start: 131 |
| 12342 | end: 137 |
| 12343 | returns: vector |
| 12344 | deadLabels: |
| 12345 | - name: colo_name |
| 12346 | reason: You can't use `colo_name` because this label is not possible here. |
| 12347 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 12348 | usagefragment: |
| 12349 | start: 151 |
| 12350 | end: 160 |
| 12351 | labelfragment: |
| 12352 | start: 131 |
| 12353 | end: 137 |
| 12354 | kind: 0 |
| 12355 | operations: |
| 12356 | - args: |
| 12357 | - "1" |
| 12358 | node: '[*parser.Call] vector(1)' |
| 12359 | op: vector |
| 12360 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))' |
| 12361 | op: avg |
| 12362 | indirect: |
| 12363 | - src: |
| 12364 | labels: |
| 12365 | "": |
| 12366 | reason: This query returns a number value with no labels. |
| 12367 | kind: excluded |
| 12368 | fragment: |
| 12369 | start: 138 |
| 12370 | end: 139 |
| 12371 | returns: scalar |
| 12372 | returnInfo: |
| 12373 | logicalexpr: "" |
| 12374 | valueposition: |
| 12375 | start: 138 |
| 12376 | end: 139 |
| 12377 | returnednumber: 1 |
| 12378 | alwaysreturns: true |
| 12379 | knownreturn: true |
| 12380 | isreturnbool: false |
| 12381 | position: |
| 12382 | start: 138 |
| 12383 | end: 139 |
| 12384 | type: number |
| 12385 | fixedLabels: true |
| 12386 | op: 0 |
| 12387 | side: 0 |
| 12388 | usedLabels: |
| 12389 | - colo_name |
| 12390 | returnInfo: |
| 12391 | logicalexpr: "" |
| 12392 | valueposition: |
| 12393 | start: 131 |
| 12394 | end: 140 |
| 12395 | returnednumber: 1 |
| 12396 | alwaysreturns: true |
| 12397 | knownreturn: true |
| 12398 | isreturnbool: false |
| 12399 | position: |
| 12400 | start: 131 |
| 12401 | end: 140 |
| 12402 | type: aggregation |
| 12403 | fixedLabels: true |
| 12404 | - addedlabels: [] |
| 12405 | depth: 0 |
| 12406 | ison: false |
| 12407 | matchinglabels: [] |
| 12408 | op: '>' |
| 12409 | src: |
| 12410 | labels: |
| 12411 | "": |
| 12412 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12413 | kind: excluded |
| 12414 | fragment: |
| 12415 | start: 241 |
| 12416 | end: 243 |
| 12417 | __name__: |
| 12418 | reason: Binary operation between two vectors removes metric names. |
| 12419 | kind: excluded |
| 12420 | fragment: |
| 12421 | start: 178 |
| 12422 | end: 334 |
| 12423 | colo_name: |
| 12424 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12425 | kind: included |
| 12426 | fragment: |
| 12427 | start: 245 |
| 12428 | end: 254 |
| 12429 | returns: vector |
| 12430 | operations: |
| 12431 | - node: '[*parser.MatrixSelector] foo_rejections[6h] offset 1d' |
| 12432 | op: "" |
| 12433 | - node: '[*parser.VectorSelector] foo_rejections offset 1d' |
| 12434 | op: "" |
| 12435 | - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)' |
| 12436 | op: rate |
| 12437 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))' |
| 12438 | op: avg |
| 12439 | joins: |
| 12440 | - addedlabels: [] |
| 12441 | depth: 0 |
| 12442 | ison: false |
| 12443 | matchinglabels: [] |
| 12444 | op: / |
| 12445 | src: |
| 12446 | labels: |
| 12447 | "": |
| 12448 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12449 | kind: excluded |
| 12450 | fragment: |
| 12451 | start: 320 |
| 12452 | end: 322 |
| 12453 | __name__: |
| 12454 | reason: Aggregation removes metric name. |
| 12455 | kind: excluded |
| 12456 | fragment: |
| 12457 | start: 262 |
| 12458 | end: 334 |
| 12459 | colo_name: |
| 12460 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12461 | kind: included |
| 12462 | fragment: |
| 12463 | start: 324 |
| 12464 | end: 333 |
| 12465 | returns: vector |
| 12466 | operations: |
| 12467 | - node: '[*parser.MatrixSelector] foo_total[6h] offset 1d' |
| 12468 | op: "" |
| 12469 | - node: '[*parser.VectorSelector] foo_total offset 1d' |
| 12470 | op: "" |
| 12471 | - node: '[*parser.Call] rate(foo_total[6h] offset 1d)' |
| 12472 | op: rate |
| 12473 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 12474 | op: avg |
| 12475 | usedLabels: |
| 12476 | - colo_name |
| 12477 | position: |
| 12478 | start: 276 |
| 12479 | end: 299 |
| 12480 | type: aggregation |
| 12481 | fixedLabels: true |
| 12482 | - addedlabels: [] |
| 12483 | depth: 0 |
| 12484 | ison: false |
| 12485 | matchinglabels: [] |
| 12486 | op: / |
| 12487 | src: |
| 12488 | labels: |
| 12489 | "": |
| 12490 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12491 | kind: excluded |
| 12492 | fragment: |
| 12493 | start: 320 |
| 12494 | end: 322 |
| 12495 | __name__: |
| 12496 | reason: Aggregation removes metric name. |
| 12497 | kind: excluded |
| 12498 | fragment: |
| 12499 | start: 262 |
| 12500 | end: 334 |
| 12501 | colo_name: |
| 12502 | reason: Calling `vector()` will return a vector value with no labels. |
| 12503 | kind: excluded |
| 12504 | fragment: |
| 12505 | start: 306 |
| 12506 | end: 312 |
| 12507 | returns: vector |
| 12508 | deadLabels: |
| 12509 | - name: colo_name |
| 12510 | reason: You can't use `colo_name` because this label is not possible here. |
| 12511 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 12512 | usagefragment: |
| 12513 | start: 324 |
| 12514 | end: 333 |
| 12515 | labelfragment: |
| 12516 | start: 306 |
| 12517 | end: 312 |
| 12518 | kind: 0 |
| 12519 | operations: |
| 12520 | - args: |
| 12521 | - "1" |
| 12522 | node: '[*parser.Call] vector(1)' |
| 12523 | op: vector |
| 12524 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 12525 | op: avg |
| 12526 | indirect: |
| 12527 | - src: |
| 12528 | labels: |
| 12529 | "": |
| 12530 | reason: This query returns a number value with no labels. |
| 12531 | kind: excluded |
| 12532 | fragment: |
| 12533 | start: 313 |
| 12534 | end: 314 |
| 12535 | returns: scalar |
| 12536 | returnInfo: |
| 12537 | logicalexpr: "" |
| 12538 | valueposition: |
| 12539 | start: 313 |
| 12540 | end: 314 |
| 12541 | returnednumber: 1 |
| 12542 | alwaysreturns: true |
| 12543 | knownreturn: true |
| 12544 | isreturnbool: false |
| 12545 | position: |
| 12546 | start: 313 |
| 12547 | end: 314 |
| 12548 | type: number |
| 12549 | fixedLabels: true |
| 12550 | op: 0 |
| 12551 | side: 0 |
| 12552 | usedLabels: |
| 12553 | - colo_name |
| 12554 | returnInfo: |
| 12555 | logicalexpr: "" |
| 12556 | valueposition: |
| 12557 | start: 306 |
| 12558 | end: 315 |
| 12559 | returnednumber: 1 |
| 12560 | alwaysreturns: true |
| 12561 | knownreturn: true |
| 12562 | isreturnbool: false |
| 12563 | position: |
| 12564 | start: 306 |
| 12565 | end: 315 |
| 12566 | type: aggregation |
| 12567 | fixedLabels: true |
| 12568 | indirect: |
| 12569 | - src: |
| 12570 | labels: |
| 12571 | "": |
| 12572 | reason: This query returns a number value with no labels. |
| 12573 | kind: excluded |
| 12574 | fragment: |
| 12575 | start: 170 |
| 12576 | end: 171 |
| 12577 | returns: scalar |
| 12578 | returnInfo: |
| 12579 | logicalexpr: "" |
| 12580 | valueposition: |
| 12581 | start: 170 |
| 12582 | end: 171 |
| 12583 | returnednumber: 5 |
| 12584 | alwaysreturns: true |
| 12585 | knownreturn: true |
| 12586 | isreturnbool: false |
| 12587 | position: |
| 12588 | start: 170 |
| 12589 | end: 171 |
| 12590 | type: number |
| 12591 | fixedLabels: true |
| 12592 | op: 57397 |
| 12593 | side: 0 |
| 12594 | usedLabels: |
| 12595 | - colo_name |
| 12596 | position: |
| 12597 | start: 192 |
| 12598 | end: 220 |
| 12599 | type: aggregation |
| 12600 | fixedLabels: true |
| 12601 | - addedlabels: [] |
| 12602 | depth: 0 |
| 12603 | ison: false |
| 12604 | matchinglabels: [] |
| 12605 | op: '>' |
| 12606 | src: |
| 12607 | labels: |
| 12608 | "": |
| 12609 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12610 | kind: excluded |
| 12611 | fragment: |
| 12612 | start: 241 |
| 12613 | end: 243 |
| 12614 | __name__: |
| 12615 | reason: Binary operation between two vectors removes metric names. |
| 12616 | kind: excluded |
| 12617 | fragment: |
| 12618 | start: 178 |
| 12619 | end: 334 |
| 12620 | colo_name: |
| 12621 | reason: Calling `vector()` will return a vector value with no labels. |
| 12622 | kind: excluded |
| 12623 | fragment: |
| 12624 | start: 227 |
| 12625 | end: 233 |
| 12626 | returns: vector |
| 12627 | deadLabels: |
| 12628 | - name: colo_name |
| 12629 | reason: You can't use `colo_name` because this label is not possible here. |
| 12630 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 12631 | usagefragment: |
| 12632 | start: 245 |
| 12633 | end: 254 |
| 12634 | labelfragment: |
| 12635 | start: 227 |
| 12636 | end: 233 |
| 12637 | kind: 0 |
| 12638 | operations: |
| 12639 | - args: |
| 12640 | - "0" |
| 12641 | node: '[*parser.Call] vector(0)' |
| 12642 | op: vector |
| 12643 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))' |
| 12644 | op: avg |
| 12645 | joins: |
| 12646 | - addedlabels: [] |
| 12647 | depth: 0 |
| 12648 | ison: false |
| 12649 | matchinglabels: [] |
| 12650 | op: / |
| 12651 | src: |
| 12652 | labels: |
| 12653 | "": |
| 12654 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12655 | kind: excluded |
| 12656 | fragment: |
| 12657 | start: 320 |
| 12658 | end: 322 |
| 12659 | __name__: |
| 12660 | reason: Aggregation removes metric name. |
| 12661 | kind: excluded |
| 12662 | fragment: |
| 12663 | start: 262 |
| 12664 | end: 334 |
| 12665 | colo_name: |
| 12666 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12667 | kind: included |
| 12668 | fragment: |
| 12669 | start: 324 |
| 12670 | end: 333 |
| 12671 | returns: vector |
| 12672 | operations: |
| 12673 | - node: '[*parser.MatrixSelector] foo_total[6h] offset 1d' |
| 12674 | op: "" |
| 12675 | - node: '[*parser.VectorSelector] foo_total offset 1d' |
| 12676 | op: "" |
| 12677 | - node: '[*parser.Call] rate(foo_total[6h] offset 1d)' |
| 12678 | op: rate |
| 12679 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 12680 | op: avg |
| 12681 | usedLabels: |
| 12682 | - colo_name |
| 12683 | position: |
| 12684 | start: 276 |
| 12685 | end: 299 |
| 12686 | type: aggregation |
| 12687 | fixedLabels: true |
| 12688 | - addedlabels: [] |
| 12689 | depth: 0 |
| 12690 | ison: false |
| 12691 | matchinglabels: [] |
| 12692 | op: / |
| 12693 | src: |
| 12694 | labels: |
| 12695 | "": |
| 12696 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 12697 | kind: excluded |
| 12698 | fragment: |
| 12699 | start: 320 |
| 12700 | end: 322 |
| 12701 | __name__: |
| 12702 | reason: Aggregation removes metric name. |
| 12703 | kind: excluded |
| 12704 | fragment: |
| 12705 | start: 262 |
| 12706 | end: 334 |
| 12707 | colo_name: |
| 12708 | reason: Calling `vector()` will return a vector value with no labels. |
| 12709 | kind: excluded |
| 12710 | fragment: |
| 12711 | start: 306 |
| 12712 | end: 312 |
| 12713 | returns: vector |
| 12714 | deadLabels: |
| 12715 | - name: colo_name |
| 12716 | reason: You can't use `colo_name` because this label is not possible here. |
| 12717 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 12718 | usagefragment: |
| 12719 | start: 324 |
| 12720 | end: 333 |
| 12721 | labelfragment: |
| 12722 | start: 306 |
| 12723 | end: 312 |
| 12724 | kind: 0 |
| 12725 | operations: |
| 12726 | - args: |
| 12727 | - "1" |
| 12728 | node: '[*parser.Call] vector(1)' |
| 12729 | op: vector |
| 12730 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 12731 | op: avg |
| 12732 | indirect: |
| 12733 | - src: |
| 12734 | labels: |
| 12735 | "": |
| 12736 | reason: This query returns a number value with no labels. |
| 12737 | kind: excluded |
| 12738 | fragment: |
| 12739 | start: 313 |
| 12740 | end: 314 |
| 12741 | returns: scalar |
| 12742 | returnInfo: |
| 12743 | logicalexpr: "" |
| 12744 | valueposition: |
| 12745 | start: 313 |
| 12746 | end: 314 |
| 12747 | returnednumber: 1 |
| 12748 | alwaysreturns: true |
| 12749 | knownreturn: true |
| 12750 | isreturnbool: false |
| 12751 | position: |
| 12752 | start: 313 |
| 12753 | end: 314 |
| 12754 | type: number |
| 12755 | fixedLabels: true |
| 12756 | op: 0 |
| 12757 | side: 0 |
| 12758 | usedLabels: |
| 12759 | - colo_name |
| 12760 | returnInfo: |
| 12761 | logicalexpr: "" |
| 12762 | valueposition: |
| 12763 | start: 306 |
| 12764 | end: 315 |
| 12765 | returnednumber: 1 |
| 12766 | alwaysreturns: true |
| 12767 | knownreturn: true |
| 12768 | isreturnbool: false |
| 12769 | position: |
| 12770 | start: 306 |
| 12771 | end: 315 |
| 12772 | type: aggregation |
| 12773 | fixedLabels: true |
| 12774 | indirect: |
| 12775 | - src: |
| 12776 | labels: |
| 12777 | "": |
| 12778 | reason: This query returns a number value with no labels. |
| 12779 | kind: excluded |
| 12780 | fragment: |
| 12781 | start: 234 |
| 12782 | end: 235 |
| 12783 | returns: scalar |
| 12784 | returnInfo: |
| 12785 | logicalexpr: "" |
| 12786 | valueposition: |
| 12787 | start: 234 |
| 12788 | end: 235 |
| 12789 | returnednumber: 0 |
| 12790 | alwaysreturns: true |
| 12791 | knownreturn: true |
| 12792 | isreturnbool: false |
| 12793 | position: |
| 12794 | start: 234 |
| 12795 | end: 235 |
| 12796 | type: number |
| 12797 | fixedLabels: true |
| 12798 | op: 0 |
| 12799 | side: 0 |
| 12800 | - src: |
| 12801 | labels: |
| 12802 | "": |
| 12803 | reason: This query returns a number value with no labels. |
| 12804 | kind: excluded |
| 12805 | fragment: |
| 12806 | start: 170 |
| 12807 | end: 171 |
| 12808 | returns: scalar |
| 12809 | returnInfo: |
| 12810 | logicalexpr: "" |
| 12811 | valueposition: |
| 12812 | start: 170 |
| 12813 | end: 171 |
| 12814 | returnednumber: 5 |
| 12815 | alwaysreturns: true |
| 12816 | knownreturn: true |
| 12817 | isreturnbool: false |
| 12818 | position: |
| 12819 | start: 170 |
| 12820 | end: 171 |
| 12821 | type: number |
| 12822 | fixedLabels: true |
| 12823 | op: 57397 |
| 12824 | side: 0 |
| 12825 | usedLabels: |
| 12826 | - colo_name |
| 12827 | returnInfo: |
| 12828 | logicalexpr: 5 * vector(0) / vector(1) |
| 12829 | valueposition: |
| 12830 | start: 170 |
| 12831 | end: 171 |
| 12832 | returnednumber: 0 |
| 12833 | alwaysreturns: true |
| 12834 | knownreturn: true |
| 12835 | isreturnbool: false |
| 12836 | position: |
| 12837 | start: 227 |
| 12838 | end: 236 |
| 12839 | type: aggregation |
| 12840 | fixedLabels: true |
| 12841 | - addedlabels: [] |
| 12842 | depth: 0 |
| 12843 | ison: true |
| 12844 | matchinglabels: |
| 12845 | - colo_name |
| 12846 | op: and |
| 12847 | src: |
| 12848 | returns: vector |
| 12849 | operations: |
| 12850 | - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m' |
| 12851 | op: "" |
| 12852 | indirect: |
| 12853 | - src: |
| 12854 | labels: |
| 12855 | "": |
| 12856 | reason: This query returns a number value with no labels. |
| 12857 | kind: excluded |
| 12858 | fragment: |
| 12859 | start: 399 |
| 12860 | end: 401 |
| 12861 | returns: scalar |
| 12862 | returnInfo: |
| 12863 | logicalexpr: "" |
| 12864 | valueposition: |
| 12865 | start: 399 |
| 12866 | end: 401 |
| 12867 | returnednumber: 80 |
| 12868 | alwaysreturns: true |
| 12869 | knownreturn: true |
| 12870 | isreturnbool: false |
| 12871 | position: |
| 12872 | start: 399 |
| 12873 | end: 401 |
| 12874 | type: number |
| 12875 | fixedLabels: true |
| 12876 | op: 57388 |
| 12877 | side: 1 |
| 12878 | condition: |
| 12879 | op: 57388 |
| 12880 | value: 80 |
| 12881 | present: true |
| 12882 | knownValue: true |
| 12883 | position: |
| 12884 | start: 357 |
| 12885 | end: 382 |
| 12886 | type: selector |
| 12887 | - addedlabels: [] |
| 12888 | deadinfo: |
| 12889 | 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. |
| 12890 | fragment: |
| 12891 | start: 386 |
| 12892 | end: 392 |
| 12893 | depth: 0 |
| 12894 | ison: true |
| 12895 | matchinglabels: |
| 12896 | - colo_name |
| 12897 | op: and |
| 12898 | src: |
| 12899 | labels: |
| 12900 | "": |
| 12901 | reason: Calling `vector()` will return a vector value with no labels. |
| 12902 | kind: excluded |
| 12903 | fragment: |
| 12904 | start: 386 |
| 12905 | end: 392 |
| 12906 | deadInfo: |
| 12907 | reason: '`vector(0) > 80` always evaluates to `0 > 80` which is not possible, so it will never return anything.' |
| 12908 | fragment: |
| 12909 | start: 386 |
| 12910 | end: 395 |
| 12911 | returns: vector |
| 12912 | operations: |
| 12913 | - args: |
| 12914 | - "0" |
| 12915 | node: '[*parser.Call] vector(0)' |
| 12916 | op: vector |
| 12917 | indirect: |
| 12918 | - src: |
| 12919 | labels: |
| 12920 | "": |
| 12921 | reason: This query returns a number value with no labels. |
| 12922 | kind: excluded |
| 12923 | fragment: |
| 12924 | start: 393 |
| 12925 | end: 394 |
| 12926 | returns: scalar |
| 12927 | returnInfo: |
| 12928 | logicalexpr: "" |
| 12929 | valueposition: |
| 12930 | start: 393 |
| 12931 | end: 394 |
| 12932 | returnednumber: 0 |
| 12933 | alwaysreturns: true |
| 12934 | knownreturn: true |
| 12935 | isreturnbool: false |
| 12936 | position: |
| 12937 | start: 393 |
| 12938 | end: 394 |
| 12939 | type: number |
| 12940 | fixedLabels: true |
| 12941 | op: 0 |
| 12942 | side: 0 |
| 12943 | - src: |
| 12944 | labels: |
| 12945 | "": |
| 12946 | reason: This query returns a number value with no labels. |
| 12947 | kind: excluded |
| 12948 | fragment: |
| 12949 | start: 399 |
| 12950 | end: 401 |
| 12951 | returns: scalar |
| 12952 | returnInfo: |
| 12953 | logicalexpr: "" |
| 12954 | valueposition: |
| 12955 | start: 399 |
| 12956 | end: 401 |
| 12957 | returnednumber: 80 |
| 12958 | alwaysreturns: true |
| 12959 | knownreturn: true |
| 12960 | isreturnbool: false |
| 12961 | position: |
| 12962 | start: 399 |
| 12963 | end: 401 |
| 12964 | type: number |
| 12965 | fixedLabels: true |
| 12966 | op: 57388 |
| 12967 | side: 1 |
| 12968 | returnInfo: |
| 12969 | logicalexpr: "" |
| 12970 | valueposition: |
| 12971 | start: 386 |
| 12972 | end: 395 |
| 12973 | returnednumber: 0 |
| 12974 | alwaysreturns: true |
| 12975 | knownreturn: true |
| 12976 | isreturnbool: false |
| 12977 | condition: |
| 12978 | op: 57388 |
| 12979 | value: 80 |
| 12980 | present: true |
| 12981 | knownValue: true |
| 12982 | position: |
| 12983 | start: 386 |
| 12984 | end: 395 |
| 12985 | type: function |
| 12986 | fixedLabels: true |
| 12987 | - addedlabels: [] |
| 12988 | depth: 0 |
| 12989 | ison: true |
| 12990 | matchinglabels: |
| 12991 | - colo_name |
| 12992 | op: and |
| 12993 | src: |
| 12994 | returns: vector |
| 12995 | operations: |
| 12996 | - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d' |
| 12997 | op: "" |
| 12998 | indirect: |
| 12999 | - src: |
| 13000 | labels: |
| 13001 | "": |
| 13002 | reason: This query returns a number value with no labels. |
| 13003 | kind: excluded |
| 13004 | fragment: |
| 13005 | start: 476 |
| 13006 | end: 478 |
| 13007 | returns: scalar |
| 13008 | returnInfo: |
| 13009 | logicalexpr: "" |
| 13010 | valueposition: |
| 13011 | start: 476 |
| 13012 | end: 478 |
| 13013 | returnednumber: 80 |
| 13014 | alwaysreturns: true |
| 13015 | knownreturn: true |
| 13016 | isreturnbool: false |
| 13017 | position: |
| 13018 | start: 476 |
| 13019 | end: 478 |
| 13020 | type: number |
| 13021 | fixedLabels: true |
| 13022 | op: 57388 |
| 13023 | side: 1 |
| 13024 | condition: |
| 13025 | op: 57388 |
| 13026 | value: 80 |
| 13027 | present: true |
| 13028 | knownValue: true |
| 13029 | position: |
| 13030 | start: 424 |
| 13031 | end: 459 |
| 13032 | type: selector |
| 13033 | - addedlabels: [] |
| 13034 | deadinfo: |
| 13035 | 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. |
| 13036 | fragment: |
| 13037 | start: 463 |
| 13038 | end: 469 |
| 13039 | depth: 0 |
| 13040 | ison: true |
| 13041 | matchinglabels: |
| 13042 | - colo_name |
| 13043 | op: and |
| 13044 | src: |
| 13045 | labels: |
| 13046 | "": |
| 13047 | reason: Calling `vector()` will return a vector value with no labels. |
| 13048 | kind: excluded |
| 13049 | fragment: |
| 13050 | start: 463 |
| 13051 | end: 469 |
| 13052 | deadInfo: |
| 13053 | reason: '`vector(0) > 80` always evaluates to `0 > 80` which is not possible, so it will never return anything.' |
| 13054 | fragment: |
| 13055 | start: 463 |
| 13056 | end: 472 |
| 13057 | returns: vector |
| 13058 | operations: |
| 13059 | - args: |
| 13060 | - "0" |
| 13061 | node: '[*parser.Call] vector(0)' |
| 13062 | op: vector |
| 13063 | indirect: |
| 13064 | - src: |
| 13065 | labels: |
| 13066 | "": |
| 13067 | reason: This query returns a number value with no labels. |
| 13068 | kind: excluded |
| 13069 | fragment: |
| 13070 | start: 470 |
| 13071 | end: 471 |
| 13072 | returns: scalar |
| 13073 | returnInfo: |
| 13074 | logicalexpr: "" |
| 13075 | valueposition: |
| 13076 | start: 470 |
| 13077 | end: 471 |
| 13078 | returnednumber: 0 |
| 13079 | alwaysreturns: true |
| 13080 | knownreturn: true |
| 13081 | isreturnbool: false |
| 13082 | position: |
| 13083 | start: 470 |
| 13084 | end: 471 |
| 13085 | type: number |
| 13086 | fixedLabels: true |
| 13087 | op: 0 |
| 13088 | side: 0 |
| 13089 | - src: |
| 13090 | labels: |
| 13091 | "": |
| 13092 | reason: This query returns a number value with no labels. |
| 13093 | kind: excluded |
| 13094 | fragment: |
| 13095 | start: 476 |
| 13096 | end: 478 |
| 13097 | returns: scalar |
| 13098 | returnInfo: |
| 13099 | logicalexpr: "" |
| 13100 | valueposition: |
| 13101 | start: 476 |
| 13102 | end: 478 |
| 13103 | returnednumber: 80 |
| 13104 | alwaysreturns: true |
| 13105 | knownreturn: true |
| 13106 | isreturnbool: false |
| 13107 | position: |
| 13108 | start: 476 |
| 13109 | end: 478 |
| 13110 | type: number |
| 13111 | fixedLabels: true |
| 13112 | op: 57388 |
| 13113 | side: 1 |
| 13114 | returnInfo: |
| 13115 | logicalexpr: "" |
| 13116 | valueposition: |
| 13117 | start: 463 |
| 13118 | end: 472 |
| 13119 | returnednumber: 0 |
| 13120 | alwaysreturns: true |
| 13121 | knownreturn: true |
| 13122 | isreturnbool: false |
| 13123 | condition: |
| 13124 | op: 57388 |
| 13125 | value: 80 |
| 13126 | present: true |
| 13127 | knownValue: true |
| 13128 | position: |
| 13129 | start: 463 |
| 13130 | end: 472 |
| 13131 | type: function |
| 13132 | fixedLabels: true |
| 13133 | usedLabels: |
| 13134 | - colo_name |
| 13135 | condition: |
| 13136 | op: 57391 |
| 13137 | present: true |
| 13138 | position: |
| 13139 | start: 19 |
| 13140 | end: 37 |
| 13141 | type: aggregation |
| 13142 | fixedLabels: true |
| 13143 | - labels: |
| 13144 | "": |
| 13145 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13146 | kind: excluded |
| 13147 | fragment: |
| 13148 | start: 64 |
| 13149 | end: 66 |
| 13150 | __name__: |
| 13151 | reason: Binary operation between two vectors removes metric names. |
| 13152 | kind: excluded |
| 13153 | fragment: |
| 13154 | start: 1 |
| 13155 | end: 336 |
| 13156 | colo_name: |
| 13157 | 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. |
| 13158 | kind: included |
| 13159 | fragment: |
| 13160 | start: 412 |
| 13161 | end: 421 |
| 13162 | deadInfo: |
| 13163 | 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.' |
| 13164 | fragment: |
| 13165 | start: 50 |
| 13166 | end: 59 |
| 13167 | returns: vector |
| 13168 | deadLabels: |
| 13169 | - name: colo_name |
| 13170 | reason: You can't use `colo_name` because this label is not possible here. |
| 13171 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 13172 | usagefragment: |
| 13173 | start: 68 |
| 13174 | end: 77 |
| 13175 | labelfragment: |
| 13176 | start: 50 |
| 13177 | end: 56 |
| 13178 | kind: 0 |
| 13179 | - name: colo_name |
| 13180 | reason: You can't use `colo_name` because this label is not possible here. |
| 13181 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 13182 | usagefragment: |
| 13183 | start: 345 |
| 13184 | end: 354 |
| 13185 | labelfragment: |
| 13186 | start: 50 |
| 13187 | end: 56 |
| 13188 | kind: 0 |
| 13189 | operations: |
| 13190 | - args: |
| 13191 | - "0" |
| 13192 | node: '[*parser.Call] vector(0)' |
| 13193 | op: vector |
| 13194 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))' |
| 13195 | op: avg |
| 13196 | joins: |
| 13197 | - addedlabels: [] |
| 13198 | depth: 0 |
| 13199 | ison: false |
| 13200 | matchinglabels: [] |
| 13201 | op: / |
| 13202 | src: |
| 13203 | labels: |
| 13204 | "": |
| 13205 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13206 | kind: excluded |
| 13207 | fragment: |
| 13208 | start: 147 |
| 13209 | end: 149 |
| 13210 | __name__: |
| 13211 | reason: Aggregation removes metric name. |
| 13212 | kind: excluded |
| 13213 | fragment: |
| 13214 | start: 91 |
| 13215 | end: 161 |
| 13216 | colo_name: |
| 13217 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13218 | kind: included |
| 13219 | fragment: |
| 13220 | start: 151 |
| 13221 | end: 160 |
| 13222 | returns: vector |
| 13223 | operations: |
| 13224 | - node: '[*parser.MatrixSelector] foo_total[6h]' |
| 13225 | op: "" |
| 13226 | - node: '[*parser.VectorSelector] foo_total' |
| 13227 | op: "" |
| 13228 | - node: '[*parser.Call] rate(foo_total[6h])' |
| 13229 | op: rate |
| 13230 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))' |
| 13231 | op: avg |
| 13232 | usedLabels: |
| 13233 | - colo_name |
| 13234 | position: |
| 13235 | start: 107 |
| 13236 | end: 120 |
| 13237 | type: aggregation |
| 13238 | fixedLabels: true |
| 13239 | - addedlabels: [] |
| 13240 | depth: 0 |
| 13241 | ison: false |
| 13242 | matchinglabels: [] |
| 13243 | op: / |
| 13244 | src: |
| 13245 | labels: |
| 13246 | "": |
| 13247 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13248 | kind: excluded |
| 13249 | fragment: |
| 13250 | start: 147 |
| 13251 | end: 149 |
| 13252 | __name__: |
| 13253 | reason: Aggregation removes metric name. |
| 13254 | kind: excluded |
| 13255 | fragment: |
| 13256 | start: 91 |
| 13257 | end: 161 |
| 13258 | colo_name: |
| 13259 | reason: Calling `vector()` will return a vector value with no labels. |
| 13260 | kind: excluded |
| 13261 | fragment: |
| 13262 | start: 131 |
| 13263 | end: 137 |
| 13264 | returns: vector |
| 13265 | deadLabels: |
| 13266 | - name: colo_name |
| 13267 | reason: You can't use `colo_name` because this label is not possible here. |
| 13268 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 13269 | usagefragment: |
| 13270 | start: 151 |
| 13271 | end: 160 |
| 13272 | labelfragment: |
| 13273 | start: 131 |
| 13274 | end: 137 |
| 13275 | kind: 0 |
| 13276 | operations: |
| 13277 | - args: |
| 13278 | - "1" |
| 13279 | node: '[*parser.Call] vector(1)' |
| 13280 | op: vector |
| 13281 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))' |
| 13282 | op: avg |
| 13283 | indirect: |
| 13284 | - src: |
| 13285 | labels: |
| 13286 | "": |
| 13287 | reason: This query returns a number value with no labels. |
| 13288 | kind: excluded |
| 13289 | fragment: |
| 13290 | start: 138 |
| 13291 | end: 139 |
| 13292 | returns: scalar |
| 13293 | returnInfo: |
| 13294 | logicalexpr: "" |
| 13295 | valueposition: |
| 13296 | start: 138 |
| 13297 | end: 139 |
| 13298 | returnednumber: 1 |
| 13299 | alwaysreturns: true |
| 13300 | knownreturn: true |
| 13301 | isreturnbool: false |
| 13302 | position: |
| 13303 | start: 138 |
| 13304 | end: 139 |
| 13305 | type: number |
| 13306 | fixedLabels: true |
| 13307 | op: 0 |
| 13308 | side: 0 |
| 13309 | usedLabels: |
| 13310 | - colo_name |
| 13311 | returnInfo: |
| 13312 | logicalexpr: "" |
| 13313 | valueposition: |
| 13314 | start: 131 |
| 13315 | end: 140 |
| 13316 | returnednumber: 1 |
| 13317 | alwaysreturns: true |
| 13318 | knownreturn: true |
| 13319 | isreturnbool: false |
| 13320 | position: |
| 13321 | start: 131 |
| 13322 | end: 140 |
| 13323 | type: aggregation |
| 13324 | fixedLabels: true |
| 13325 | - addedlabels: [] |
| 13326 | depth: 0 |
| 13327 | ison: false |
| 13328 | matchinglabels: [] |
| 13329 | op: '>' |
| 13330 | src: |
| 13331 | labels: |
| 13332 | "": |
| 13333 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13334 | kind: excluded |
| 13335 | fragment: |
| 13336 | start: 241 |
| 13337 | end: 243 |
| 13338 | __name__: |
| 13339 | reason: Binary operation between two vectors removes metric names. |
| 13340 | kind: excluded |
| 13341 | fragment: |
| 13342 | start: 178 |
| 13343 | end: 334 |
| 13344 | colo_name: |
| 13345 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13346 | kind: included |
| 13347 | fragment: |
| 13348 | start: 245 |
| 13349 | end: 254 |
| 13350 | returns: vector |
| 13351 | operations: |
| 13352 | - node: '[*parser.MatrixSelector] foo_rejections[6h] offset 1d' |
| 13353 | op: "" |
| 13354 | - node: '[*parser.VectorSelector] foo_rejections offset 1d' |
| 13355 | op: "" |
| 13356 | - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)' |
| 13357 | op: rate |
| 13358 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))' |
| 13359 | op: avg |
| 13360 | joins: |
| 13361 | - addedlabels: [] |
| 13362 | depth: 0 |
| 13363 | ison: false |
| 13364 | matchinglabels: [] |
| 13365 | op: / |
| 13366 | src: |
| 13367 | labels: |
| 13368 | "": |
| 13369 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13370 | kind: excluded |
| 13371 | fragment: |
| 13372 | start: 320 |
| 13373 | end: 322 |
| 13374 | __name__: |
| 13375 | reason: Aggregation removes metric name. |
| 13376 | kind: excluded |
| 13377 | fragment: |
| 13378 | start: 262 |
| 13379 | end: 334 |
| 13380 | colo_name: |
| 13381 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13382 | kind: included |
| 13383 | fragment: |
| 13384 | start: 324 |
| 13385 | end: 333 |
| 13386 | returns: vector |
| 13387 | operations: |
| 13388 | - node: '[*parser.MatrixSelector] foo_total[6h] offset 1d' |
| 13389 | op: "" |
| 13390 | - node: '[*parser.VectorSelector] foo_total offset 1d' |
| 13391 | op: "" |
| 13392 | - node: '[*parser.Call] rate(foo_total[6h] offset 1d)' |
| 13393 | op: rate |
| 13394 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 13395 | op: avg |
| 13396 | usedLabels: |
| 13397 | - colo_name |
| 13398 | position: |
| 13399 | start: 276 |
| 13400 | end: 299 |
| 13401 | type: aggregation |
| 13402 | fixedLabels: true |
| 13403 | - addedlabels: [] |
| 13404 | depth: 0 |
| 13405 | ison: false |
| 13406 | matchinglabels: [] |
| 13407 | op: / |
| 13408 | src: |
| 13409 | labels: |
| 13410 | "": |
| 13411 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13412 | kind: excluded |
| 13413 | fragment: |
| 13414 | start: 320 |
| 13415 | end: 322 |
| 13416 | __name__: |
| 13417 | reason: Aggregation removes metric name. |
| 13418 | kind: excluded |
| 13419 | fragment: |
| 13420 | start: 262 |
| 13421 | end: 334 |
| 13422 | colo_name: |
| 13423 | reason: Calling `vector()` will return a vector value with no labels. |
| 13424 | kind: excluded |
| 13425 | fragment: |
| 13426 | start: 306 |
| 13427 | end: 312 |
| 13428 | returns: vector |
| 13429 | deadLabels: |
| 13430 | - name: colo_name |
| 13431 | reason: You can't use `colo_name` because this label is not possible here. |
| 13432 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 13433 | usagefragment: |
| 13434 | start: 324 |
| 13435 | end: 333 |
| 13436 | labelfragment: |
| 13437 | start: 306 |
| 13438 | end: 312 |
| 13439 | kind: 0 |
| 13440 | operations: |
| 13441 | - args: |
| 13442 | - "1" |
| 13443 | node: '[*parser.Call] vector(1)' |
| 13444 | op: vector |
| 13445 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 13446 | op: avg |
| 13447 | indirect: |
| 13448 | - src: |
| 13449 | labels: |
| 13450 | "": |
| 13451 | reason: This query returns a number value with no labels. |
| 13452 | kind: excluded |
| 13453 | fragment: |
| 13454 | start: 313 |
| 13455 | end: 314 |
| 13456 | returns: scalar |
| 13457 | returnInfo: |
| 13458 | logicalexpr: "" |
| 13459 | valueposition: |
| 13460 | start: 313 |
| 13461 | end: 314 |
| 13462 | returnednumber: 1 |
| 13463 | alwaysreturns: true |
| 13464 | knownreturn: true |
| 13465 | isreturnbool: false |
| 13466 | position: |
| 13467 | start: 313 |
| 13468 | end: 314 |
| 13469 | type: number |
| 13470 | fixedLabels: true |
| 13471 | op: 0 |
| 13472 | side: 0 |
| 13473 | usedLabels: |
| 13474 | - colo_name |
| 13475 | returnInfo: |
| 13476 | logicalexpr: "" |
| 13477 | valueposition: |
| 13478 | start: 306 |
| 13479 | end: 315 |
| 13480 | returnednumber: 1 |
| 13481 | alwaysreturns: true |
| 13482 | knownreturn: true |
| 13483 | isreturnbool: false |
| 13484 | position: |
| 13485 | start: 306 |
| 13486 | end: 315 |
| 13487 | type: aggregation |
| 13488 | fixedLabels: true |
| 13489 | indirect: |
| 13490 | - src: |
| 13491 | labels: |
| 13492 | "": |
| 13493 | reason: This query returns a number value with no labels. |
| 13494 | kind: excluded |
| 13495 | fragment: |
| 13496 | start: 170 |
| 13497 | end: 171 |
| 13498 | returns: scalar |
| 13499 | returnInfo: |
| 13500 | logicalexpr: "" |
| 13501 | valueposition: |
| 13502 | start: 170 |
| 13503 | end: 171 |
| 13504 | returnednumber: 5 |
| 13505 | alwaysreturns: true |
| 13506 | knownreturn: true |
| 13507 | isreturnbool: false |
| 13508 | position: |
| 13509 | start: 170 |
| 13510 | end: 171 |
| 13511 | type: number |
| 13512 | fixedLabels: true |
| 13513 | op: 57397 |
| 13514 | side: 0 |
| 13515 | usedLabels: |
| 13516 | - colo_name |
| 13517 | position: |
| 13518 | start: 192 |
| 13519 | end: 220 |
| 13520 | type: aggregation |
| 13521 | fixedLabels: true |
| 13522 | - addedlabels: [] |
| 13523 | depth: 0 |
| 13524 | ison: false |
| 13525 | matchinglabels: [] |
| 13526 | op: '>' |
| 13527 | src: |
| 13528 | labels: |
| 13529 | "": |
| 13530 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13531 | kind: excluded |
| 13532 | fragment: |
| 13533 | start: 241 |
| 13534 | end: 243 |
| 13535 | __name__: |
| 13536 | reason: Binary operation between two vectors removes metric names. |
| 13537 | kind: excluded |
| 13538 | fragment: |
| 13539 | start: 178 |
| 13540 | end: 334 |
| 13541 | colo_name: |
| 13542 | reason: Calling `vector()` will return a vector value with no labels. |
| 13543 | kind: excluded |
| 13544 | fragment: |
| 13545 | start: 227 |
| 13546 | end: 233 |
| 13547 | returns: vector |
| 13548 | deadLabels: |
| 13549 | - name: colo_name |
| 13550 | reason: You can't use `colo_name` because this label is not possible here. |
| 13551 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 13552 | usagefragment: |
| 13553 | start: 245 |
| 13554 | end: 254 |
| 13555 | labelfragment: |
| 13556 | start: 227 |
| 13557 | end: 233 |
| 13558 | kind: 0 |
| 13559 | operations: |
| 13560 | - args: |
| 13561 | - "0" |
| 13562 | node: '[*parser.Call] vector(0)' |
| 13563 | op: vector |
| 13564 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))' |
| 13565 | op: avg |
| 13566 | joins: |
| 13567 | - addedlabels: [] |
| 13568 | depth: 0 |
| 13569 | ison: false |
| 13570 | matchinglabels: [] |
| 13571 | op: / |
| 13572 | src: |
| 13573 | labels: |
| 13574 | "": |
| 13575 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13576 | kind: excluded |
| 13577 | fragment: |
| 13578 | start: 320 |
| 13579 | end: 322 |
| 13580 | __name__: |
| 13581 | reason: Aggregation removes metric name. |
| 13582 | kind: excluded |
| 13583 | fragment: |
| 13584 | start: 262 |
| 13585 | end: 334 |
| 13586 | colo_name: |
| 13587 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13588 | kind: included |
| 13589 | fragment: |
| 13590 | start: 324 |
| 13591 | end: 333 |
| 13592 | returns: vector |
| 13593 | operations: |
| 13594 | - node: '[*parser.MatrixSelector] foo_total[6h] offset 1d' |
| 13595 | op: "" |
| 13596 | - node: '[*parser.VectorSelector] foo_total offset 1d' |
| 13597 | op: "" |
| 13598 | - node: '[*parser.Call] rate(foo_total[6h] offset 1d)' |
| 13599 | op: rate |
| 13600 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 13601 | op: avg |
| 13602 | usedLabels: |
| 13603 | - colo_name |
| 13604 | position: |
| 13605 | start: 276 |
| 13606 | end: 299 |
| 13607 | type: aggregation |
| 13608 | fixedLabels: true |
| 13609 | - addedlabels: [] |
| 13610 | depth: 0 |
| 13611 | ison: false |
| 13612 | matchinglabels: [] |
| 13613 | op: / |
| 13614 | src: |
| 13615 | labels: |
| 13616 | "": |
| 13617 | reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results. |
| 13618 | kind: excluded |
| 13619 | fragment: |
| 13620 | start: 320 |
| 13621 | end: 322 |
| 13622 | __name__: |
| 13623 | reason: Aggregation removes metric name. |
| 13624 | kind: excluded |
| 13625 | fragment: |
| 13626 | start: 262 |
| 13627 | end: 334 |
| 13628 | colo_name: |
| 13629 | reason: Calling `vector()` will return a vector value with no labels. |
| 13630 | kind: excluded |
| 13631 | fragment: |
| 13632 | start: 306 |
| 13633 | end: 312 |
| 13634 | returns: vector |
| 13635 | deadLabels: |
| 13636 | - name: colo_name |
| 13637 | reason: You can't use `colo_name` because this label is not possible here. |
| 13638 | labelreason: Calling `vector()` will return a vector value with no labels. |
| 13639 | usagefragment: |
| 13640 | start: 324 |
| 13641 | end: 333 |
| 13642 | labelfragment: |
| 13643 | start: 306 |
| 13644 | end: 312 |
| 13645 | kind: 0 |
| 13646 | operations: |
| 13647 | - args: |
| 13648 | - "1" |
| 13649 | node: '[*parser.Call] vector(1)' |
| 13650 | op: vector |
| 13651 | - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))' |
| 13652 | op: avg |
| 13653 | indirect: |
| 13654 | - src: |
| 13655 | labels: |
| 13656 | "": |
| 13657 | reason: This query returns a number value with no labels. |
| 13658 | kind: excluded |
| 13659 | fragment: |
| 13660 | start: 313 |
| 13661 | end: 314 |
| 13662 | returns: scalar |
| 13663 | returnInfo: |
| 13664 | logicalexpr: "" |
| 13665 | valueposition: |
| 13666 | start: 313 |
| 13667 | end: 314 |
| 13668 | returnednumber: 1 |
| 13669 | alwaysreturns: true |
| 13670 | knownreturn: true |
| 13671 | isreturnbool: false |
| 13672 | position: |
| 13673 | start: 313 |
| 13674 | end: 314 |
| 13675 | type: number |
| 13676 | fixedLabels: true |
| 13677 | op: 0 |
| 13678 | side: 0 |
| 13679 | usedLabels: |
| 13680 | - colo_name |
| 13681 | returnInfo: |
| 13682 | logicalexpr: "" |
| 13683 | valueposition: |
| 13684 | start: 306 |
| 13685 | end: 315 |
| 13686 | returnednumber: 1 |
| 13687 | alwaysreturns: true |
| 13688 | knownreturn: true |
| 13689 | isreturnbool: false |
| 13690 | position: |
| 13691 | start: 306 |
| 13692 | end: 315 |
| 13693 | type: aggregation |
| 13694 | fixedLabels: true |
| 13695 | indirect: |
| 13696 | - src: |
| 13697 | labels: |
| 13698 | "": |
| 13699 | reason: This query returns a number value with no labels. |
| 13700 | kind: excluded |
| 13701 | fragment: |
| 13702 | start: 234 |
| 13703 | end: 235 |
| 13704 | returns: scalar |
| 13705 | returnInfo: |
| 13706 | logicalexpr: "" |
| 13707 | valueposition: |
| 13708 | start: 234 |
| 13709 | end: 235 |
| 13710 | returnednumber: 0 |
| 13711 | alwaysreturns: true |
| 13712 | knownreturn: true |
| 13713 | isreturnbool: false |
| 13714 | position: |
| 13715 | start: 234 |
| 13716 | end: 235 |
| 13717 | type: number |
| 13718 | fixedLabels: true |
| 13719 | op: 0 |
| 13720 | side: 0 |
| 13721 | - src: |
| 13722 | labels: |
| 13723 | "": |
| 13724 | reason: This query returns a number value with no labels. |
| 13725 | kind: excluded |
| 13726 | fragment: |
| 13727 | start: 170 |
| 13728 | end: 171 |
| 13729 | returns: scalar |
| 13730 | returnInfo: |
| 13731 | logicalexpr: "" |
| 13732 | valueposition: |
| 13733 | start: 170 |
| 13734 | end: 171 |
| 13735 | returnednumber: 5 |
| 13736 | alwaysreturns: true |
| 13737 | knownreturn: true |
| 13738 | isreturnbool: false |
| 13739 | position: |
| 13740 | start: 170 |
| 13741 | end: 171 |
| 13742 | type: number |
| 13743 | fixedLabels: true |
| 13744 | op: 57397 |
| 13745 | side: 0 |
| 13746 | usedLabels: |
| 13747 | - colo_name |
| 13748 | returnInfo: |
| 13749 | logicalexpr: 5 * vector(0) / vector(1) |
| 13750 | valueposition: |
| 13751 | start: 170 |
| 13752 | end: 171 |
| 13753 | returnednumber: 0 |
| 13754 | alwaysreturns: true |
| 13755 | knownreturn: true |
| 13756 | isreturnbool: false |
| 13757 | position: |
| 13758 | start: 227 |
| 13759 | end: 236 |
| 13760 | type: aggregation |
| 13761 | fixedLabels: true |
| 13762 | - addedlabels: [] |
| 13763 | depth: 0 |
| 13764 | ison: true |
| 13765 | matchinglabels: |
| 13766 | - colo_name |
| 13767 | op: and |
| 13768 | src: |
| 13769 | returns: vector |
| 13770 | operations: |
| 13771 | - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m' |
| 13772 | op: "" |
| 13773 | indirect: |
| 13774 | - src: |
| 13775 | labels: |
| 13776 | "": |
| 13777 | reason: This query returns a number value with no labels. |
| 13778 | kind: excluded |
| 13779 | fragment: |
| 13780 | start: 399 |
| 13781 | end: 401 |
| 13782 | returns: scalar |
| 13783 | returnInfo: |
| 13784 | logicalexpr: "" |
| 13785 | valueposition: |
| 13786 | start: 399 |
| 13787 | end: 401 |
| 13788 | returnednumber: 80 |
| 13789 | alwaysreturns: true |
| 13790 | knownreturn: true |
| 13791 | isreturnbool: false |
| 13792 | position: |
| 13793 | start: 399 |
| 13794 | end: 401 |
| 13795 | type: number |
| 13796 | fixedLabels: true |
| 13797 | op: 57388 |
| 13798 | side: 1 |
| 13799 | condition: |
| 13800 | op: 57388 |
| 13801 | value: 80 |
| 13802 | present: true |
| 13803 | knownValue: true |
| 13804 | position: |
| 13805 | start: 357 |
| 13806 | end: 382 |
| 13807 | type: selector |
| 13808 | - addedlabels: [] |
| 13809 | deadinfo: |
| 13810 | 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. |
| 13811 | fragment: |
| 13812 | start: 386 |
| 13813 | end: 392 |
| 13814 | depth: 0 |
| 13815 | ison: true |
| 13816 | matchinglabels: |
| 13817 | - colo_name |
| 13818 | op: and |
| 13819 | src: |
| 13820 | labels: |
| 13821 | "": |
| 13822 | reason: Calling `vector()` will return a vector value with no labels. |
| 13823 | kind: excluded |
| 13824 | fragment: |
| 13825 | start: 386 |
| 13826 | end: 392 |
| 13827 | deadInfo: |
| 13828 | reason: '`vector(0) > 80` always evaluates to `0 > 80` which is not possible, so it will never return anything.' |
| 13829 | fragment: |
| 13830 | start: 386 |
| 13831 | end: 395 |
| 13832 | returns: vector |
| 13833 | operations: |
| 13834 | - args: |
| 13835 | - "0" |
| 13836 | node: '[*parser.Call] vector(0)' |
| 13837 | op: vector |
| 13838 | indirect: |
| 13839 | - src: |
| 13840 | labels: |
| 13841 | "": |
| 13842 | reason: This query returns a number value with no labels. |
| 13843 | kind: excluded |
| 13844 | fragment: |
| 13845 | start: 393 |
| 13846 | end: 394 |
| 13847 | returns: scalar |
| 13848 | returnInfo: |
| 13849 | logicalexpr: "" |
| 13850 | valueposition: |
| 13851 | start: 393 |
| 13852 | end: 394 |
| 13853 | returnednumber: 0 |
| 13854 | alwaysreturns: true |
| 13855 | knownreturn: true |
| 13856 | isreturnbool: false |
| 13857 | position: |
| 13858 | start: 393 |
| 13859 | end: 394 |
| 13860 | type: number |
| 13861 | fixedLabels: true |
| 13862 | op: 0 |
| 13863 | side: 0 |
| 13864 | - src: |
| 13865 | labels: |
| 13866 | "": |
| 13867 | reason: This query returns a number value with no labels. |
| 13868 | kind: excluded |
| 13869 | fragment: |
| 13870 | start: 399 |
| 13871 | end: 401 |
| 13872 | returns: scalar |
| 13873 | returnInfo: |
| 13874 | logicalexpr: "" |
| 13875 | valueposition: |
| 13876 | start: 399 |
| 13877 | end: 401 |
| 13878 | returnednumber: 80 |
| 13879 | alwaysreturns: true |
| 13880 | knownreturn: true |
| 13881 | isreturnbool: false |
| 13882 | position: |
| 13883 | start: 399 |
| 13884 | end: 401 |
| 13885 | type: number |
| 13886 | fixedLabels: true |
| 13887 | op: 57388 |
| 13888 | side: 1 |
| 13889 | returnInfo: |
| 13890 | logicalexpr: "" |
| 13891 | valueposition: |
| 13892 | start: 386 |
| 13893 | end: 395 |
| 13894 | returnednumber: 0 |
| 13895 | alwaysreturns: true |
| 13896 | knownreturn: true |
| 13897 | isreturnbool: false |
| 13898 | condition: |
| 13899 | op: 57388 |
| 13900 | value: 80 |
| 13901 | present: true |
| 13902 | knownValue: true |
| 13903 | position: |
| 13904 | start: 386 |
| 13905 | end: 395 |
| 13906 | type: function |
| 13907 | fixedLabels: true |
| 13908 | - addedlabels: [] |
| 13909 | depth: 0 |
| 13910 | ison: true |
| 13911 | matchinglabels: |
| 13912 | - colo_name |
| 13913 | op: and |
| 13914 | src: |
| 13915 | returns: vector |
| 13916 | operations: |
| 13917 | - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d' |
| 13918 | op: "" |
| 13919 | indirect: |
| 13920 | - src: |
| 13921 | labels: |
| 13922 | "": |
| 13923 | reason: This query returns a number value with no labels. |
| 13924 | kind: excluded |
| 13925 | fragment: |
| 13926 | start: 476 |
| 13927 | end: 478 |
| 13928 | returns: scalar |
| 13929 | returnInfo: |
| 13930 | logicalexpr: "" |
| 13931 | valueposition: |
| 13932 | start: 476 |
| 13933 | end: 478 |
| 13934 | returnednumber: 80 |
| 13935 | alwaysreturns: true |
| 13936 | knownreturn: true |
| 13937 | isreturnbool: false |
| 13938 | position: |
| 13939 | start: 476 |
| 13940 | end: 478 |
| 13941 | type: number |
| 13942 | fixedLabels: true |
| 13943 | op: 57388 |
| 13944 | side: 1 |
| 13945 | condition: |
| 13946 | op: 57388 |
| 13947 | value: 80 |
| 13948 | present: true |
| 13949 | knownValue: true |
| 13950 | position: |
| 13951 | start: 424 |
| 13952 | end: 459 |
| 13953 | type: selector |
| 13954 | - addedlabels: [] |
| 13955 | deadinfo: |
| 13956 | 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. |
| 13957 | fragment: |
| 13958 | start: 463 |
| 13959 | end: 469 |
| 13960 | depth: 0 |
| 13961 | ison: true |
| 13962 | matchinglabels: |
| 13963 | - colo_name |
| 13964 | op: and |
| 13965 | src: |
| 13966 | labels: |
| 13967 | "": |
| 13968 | reason: Calling `vector()` will return a vector value with no labels. |
| 13969 | kind: excluded |
| 13970 | fragment: |
| 13971 | start: 463 |
| 13972 | end: 469 |
| 13973 | deadInfo: |
| 13974 | reason: '`vector(0) > 80` always evaluates to `0 > 80` which is not possible, so it will never return anything.' |
| 13975 | fragment: |
| 13976 | start: 463 |
| 13977 | end: 472 |
| 13978 | returns: vector |
| 13979 | operations: |
| 13980 | - args: |
| 13981 | - "0" |
| 13982 | node: '[*parser.Call] vector(0)' |
| 13983 | op: vector |
| 13984 | indirect: |
| 13985 | - src: |
| 13986 | labels: |
| 13987 | "": |
| 13988 | reason: This query returns a number value with no labels. |
| 13989 | kind: excluded |
| 13990 | fragment: |
| 13991 | start: 470 |
| 13992 | end: 471 |
| 13993 | returns: scalar |
| 13994 | returnInfo: |
| 13995 | logicalexpr: "" |
| 13996 | valueposition: |
| 13997 | start: 470 |
| 13998 | end: 471 |
| 13999 | returnednumber: 0 |
| 14000 | alwaysreturns: true |
| 14001 | knownreturn: true |
| 14002 | isreturnbool: false |
| 14003 | position: |
| 14004 | start: 470 |
| 14005 | end: 471 |
| 14006 | type: number |
| 14007 | fixedLabels: true |
| 14008 | op: 0 |
| 14009 | side: 0 |
| 14010 | - src: |
| 14011 | labels: |
| 14012 | "": |
| 14013 | reason: This query returns a number value with no labels. |
| 14014 | kind: excluded |
| 14015 | fragment: |
| 14016 | start: 476 |
| 14017 | end: 478 |
| 14018 | returns: scalar |
| 14019 | returnInfo: |
| 14020 | logicalexpr: "" |
| 14021 | valueposition: |
| 14022 | start: 476 |
| 14023 | end: 478 |
| 14024 | returnednumber: 80 |
| 14025 | alwaysreturns: true |
| 14026 | knownreturn: true |
| 14027 | isreturnbool: false |
| 14028 | position: |
| 14029 | start: 476 |
| 14030 | end: 478 |
| 14031 | type: number |
| 14032 | fixedLabels: true |
| 14033 | op: 57388 |
| 14034 | side: 1 |
| 14035 | returnInfo: |
| 14036 | logicalexpr: "" |
| 14037 | valueposition: |
| 14038 | start: 463 |
| 14039 | end: 472 |
| 14040 | returnednumber: 0 |
| 14041 | alwaysreturns: true |
| 14042 | knownreturn: true |
| 14043 | isreturnbool: false |
| 14044 | condition: |
| 14045 | op: 57388 |
| 14046 | value: 80 |
| 14047 | present: true |
| 14048 | knownValue: true |
| 14049 | position: |
| 14050 | start: 463 |
| 14051 | end: 472 |
| 14052 | type: function |
| 14053 | fixedLabels: true |
| 14054 | indirect: |
| 14055 | - src: |
| 14056 | labels: |
| 14057 | "": |
| 14058 | reason: This query returns a number value with no labels. |
| 14059 | kind: excluded |
| 14060 | fragment: |
| 14061 | start: 57 |
| 14062 | end: 58 |
| 14063 | returns: scalar |
| 14064 | returnInfo: |
| 14065 | logicalexpr: "" |
| 14066 | valueposition: |
| 14067 | start: 57 |
| 14068 | end: 58 |
| 14069 | returnednumber: 0 |
| 14070 | alwaysreturns: true |
| 14071 | knownreturn: true |
| 14072 | isreturnbool: false |
| 14073 | position: |
| 14074 | start: 57 |
| 14075 | end: 58 |
| 14076 | type: number |
| 14077 | fixedLabels: true |
| 14078 | op: 0 |
| 14079 | side: 0 |
| 14080 | usedLabels: |
| 14081 | - colo_name |
| 14082 | returnInfo: |
| 14083 | logicalexpr: vector(0) / vector(1) |
| 14084 | valueposition: |
| 14085 | start: 50 |
| 14086 | end: 59 |
| 14087 | returnednumber: 0 |
| 14088 | alwaysreturns: true |
| 14089 | knownreturn: true |
| 14090 | isreturnbool: false |
| 14091 | condition: |
| 14092 | op: 57391 |
| 14093 | present: true |
| 14094 | position: |
| 14095 | start: 50 |
| 14096 | end: 59 |
| 14097 | type: aggregation |
| 14098 | fixedLabels: true |
| 14099 | |
| 14100 | --- |
| 14101 | |
| 14102 | [TestLabelsSource/154 - 1] |
| 14103 | expr: sum(selector) / sum(selector offset 30m) > 5 |
| 14104 | output: |
| 14105 | - labels: |
| 14106 | "": |
| 14107 | reason: Query is using aggregation that removes all labels. |
| 14108 | kind: excluded |
| 14109 | fragment: |
| 14110 | start: 0 |
| 14111 | end: 3 |
| 14112 | __name__: |
| 14113 | reason: Binary operation between two vectors removes metric names. |
| 14114 | kind: excluded |
| 14115 | fragment: |
| 14116 | start: 0 |
| 14117 | end: 40 |
| 14118 | returns: vector |
| 14119 | operations: |
| 14120 | - node: '[*parser.VectorSelector] selector' |
| 14121 | op: "" |
| 14122 | - node: '[*parser.AggregateExpr] sum(selector)' |
| 14123 | op: sum |
| 14124 | joins: |
| 14125 | - addedlabels: [] |
| 14126 | depth: 0 |
| 14127 | ison: false |
| 14128 | matchinglabels: [] |
| 14129 | op: / |
| 14130 | src: |
| 14131 | labels: |
| 14132 | "": |
| 14133 | reason: Query is using aggregation that removes all labels. |
| 14134 | kind: excluded |
| 14135 | fragment: |
| 14136 | start: 16 |
| 14137 | end: 19 |
| 14138 | __name__: |
| 14139 | reason: Aggregation removes metric name. |
| 14140 | kind: excluded |
| 14141 | fragment: |
| 14142 | start: 16 |
| 14143 | end: 40 |
| 14144 | returns: vector |
| 14145 | operations: |
| 14146 | - node: '[*parser.VectorSelector] selector offset 30m' |
| 14147 | op: "" |
| 14148 | - node: '[*parser.AggregateExpr] sum(selector offset 30m)' |
| 14149 | op: sum |
| 14150 | position: |
| 14151 | start: 20 |
| 14152 | end: 39 |
| 14153 | type: aggregation |
| 14154 | fixedLabels: true |
| 14155 | indirect: |
| 14156 | - src: |
| 14157 | labels: |
| 14158 | "": |
| 14159 | reason: This query returns a number value with no labels. |
| 14160 | kind: excluded |
| 14161 | fragment: |
| 14162 | start: 43 |
| 14163 | end: 44 |
| 14164 | returns: scalar |
| 14165 | returnInfo: |
| 14166 | logicalexpr: "" |
| 14167 | valueposition: |
| 14168 | start: 43 |
| 14169 | end: 44 |
| 14170 | returnednumber: 5 |
| 14171 | alwaysreturns: true |
| 14172 | knownreturn: true |
| 14173 | isreturnbool: false |
| 14174 | position: |
| 14175 | start: 43 |
| 14176 | end: 44 |
| 14177 | type: number |
| 14178 | fixedLabels: true |
| 14179 | op: 57388 |
| 14180 | side: 1 |
| 14181 | condition: |
| 14182 | op: 57388 |
| 14183 | value: 5 |
| 14184 | present: true |
| 14185 | knownValue: true |
| 14186 | position: |
| 14187 | start: 4 |
| 14188 | end: 12 |
| 14189 | type: aggregation |
| 14190 | fixedLabels: true |
| 14191 | |
| 14192 | --- |
| 14193 | |
| 14194 | [TestLabelsSource/155 - 1] |
| 14195 | expr: |4- |
| 14196 | |
| 14197 | count by (dc) ( |
| 14198 | max(0 < (token_expiration - time()) < (6*60*60)) by (instance) |
| 14199 | * on (instance) group_right label_replace( |
| 14200 | configured_minions, "instance", "$1", "minion", "(.+)") |
| 14201 | ) > 5 |
| 14202 | output: |
| 14203 | - labels: |
| 14204 | "": |
| 14205 | reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results. |
| 14206 | kind: excluded |
| 14207 | fragment: |
| 14208 | start: 7 |
| 14209 | end: 9 |
| 14210 | __name__: |
| 14211 | reason: Aggregation removes metric name. |
| 14212 | kind: excluded |
| 14213 | fragment: |
| 14214 | start: 1 |
| 14215 | end: 190 |
| 14216 | dc: |
| 14217 | reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results. |
| 14218 | kind: included |
| 14219 | fragment: |
| 14220 | start: 11 |
| 14221 | end: 13 |
| 14222 | instance: |
| 14223 | reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results. |
| 14224 | kind: excluded |
| 14225 | fragment: |
| 14226 | start: 7 |
| 14227 | end: 14 |
| 14228 | returns: vector |
| 14229 | operations: |
| 14230 | - node: '[*parser.VectorSelector] configured_minions' |
| 14231 | op: "" |
| 14232 | - args: |
| 14233 | - '"instance"' |
| 14234 | - '"$1"' |
| 14235 | - '"minion"' |
| 14236 | - '"(.+)"' |
| 14237 | node: '[*parser.Call] label_replace(configured_minions, "instance", "$1", "minion", "(.+)")' |
| 14238 | op: label_replace |
| 14239 | - 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", "(.+)"))' |
| 14240 | op: count |
| 14241 | joins: |
| 14242 | - addedlabels: [] |
| 14243 | depth: 1 |
| 14244 | ison: true |
| 14245 | matchinglabels: |
| 14246 | - instance |
| 14247 | op: '*' |
| 14248 | src: |
| 14249 | labels: |
| 14250 | "": |
| 14251 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 14252 | kind: excluded |
| 14253 | fragment: |
| 14254 | start: 68 |
| 14255 | end: 70 |
| 14256 | __name__: |
| 14257 | reason: Aggregation removes metric name. |
| 14258 | kind: excluded |
| 14259 | fragment: |
| 14260 | start: 19 |
| 14261 | end: 81 |
| 14262 | instance: |
| 14263 | reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results. |
| 14264 | kind: included |
| 14265 | fragment: |
| 14266 | start: 72 |
| 14267 | end: 80 |
| 14268 | returns: vector |
| 14269 | operations: |
| 14270 | - node: '[*parser.VectorSelector] token_expiration' |
| 14271 | op: "" |
| 14272 | - node: '[*parser.AggregateExpr] max by (instance) (0 < (token_expiration - time()) < (6 * 60 * 60))' |
| 14273 | op: max |
| 14274 | indirect: |
| 14275 | - src: |
| 14276 | labels: |
| 14277 | "": |
| 14278 | reason: Calling `time()` will return a scalar value with no labels. |
| 14279 | kind: excluded |
| 14280 | fragment: |
| 14281 | start: 47 |
| 14282 | end: 53 |
| 14283 | returns: scalar |
| 14284 | operations: |
| 14285 | - node: '[*parser.Call] time()' |
| 14286 | op: time |
| 14287 | returnInfo: |
| 14288 | logicalexpr: "" |
| 14289 | valueposition: |
| 14290 | start: 47 |
| 14291 | end: 53 |
| 14292 | returnednumber: 0 |
| 14293 | alwaysreturns: true |
| 14294 | knownreturn: false |
| 14295 | isreturnbool: false |
| 14296 | position: |
| 14297 | start: 47 |
| 14298 | end: 53 |
| 14299 | type: function |
| 14300 | fixedLabels: true |
| 14301 | op: 57401 |
| 14302 | side: 1 |
| 14303 | - src: |
| 14304 | labels: |
| 14305 | "": |
| 14306 | reason: This query returns a number value with no labels. |
| 14307 | kind: excluded |
| 14308 | fragment: |
| 14309 | start: 23 |
| 14310 | end: 24 |
| 14311 | returns: scalar |
| 14312 | returnInfo: |
| 14313 | logicalexpr: "" |
| 14314 | valueposition: |
| 14315 | start: 23 |
| 14316 | end: 24 |
| 14317 | returnednumber: 0 |
| 14318 | alwaysreturns: true |
| 14319 | knownreturn: true |
| 14320 | isreturnbool: false |
| 14321 | position: |
| 14322 | start: 23 |
| 14323 | end: 24 |
| 14324 | type: number |
| 14325 | fixedLabels: true |
| 14326 | op: 57393 |
| 14327 | side: 0 |
| 14328 | - src: |
| 14329 | labels: |
| 14330 | "": |
| 14331 | reason: This query returns a number value with no labels. |
| 14332 | kind: excluded |
| 14333 | fragment: |
| 14334 | start: 58 |
| 14335 | end: 59 |
| 14336 | returns: scalar |
| 14337 | indirect: |
| 14338 | - src: |
| 14339 | labels: |
| 14340 | "": |
| 14341 | reason: This query returns a number value with no labels. |
| 14342 | kind: excluded |
| 14343 | fragment: |
| 14344 | start: 60 |
| 14345 | end: 62 |
| 14346 | returns: scalar |
| 14347 | returnInfo: |
| 14348 | logicalexpr: "" |
| 14349 | valueposition: |
| 14350 | start: 60 |
| 14351 | end: 62 |
| 14352 | returnednumber: 60 |
| 14353 | alwaysreturns: true |
| 14354 | knownreturn: true |
| 14355 | isreturnbool: false |
| 14356 | position: |
| 14357 | start: 60 |
| 14358 | end: 62 |
| 14359 | type: number |
| 14360 | fixedLabels: true |
| 14361 | op: 57397 |
| 14362 | side: 1 |
| 14363 | - src: |
| 14364 | labels: |
| 14365 | "": |
| 14366 | reason: This query returns a number value with no labels. |
| 14367 | kind: excluded |
| 14368 | fragment: |
| 14369 | start: 63 |
| 14370 | end: 65 |
| 14371 | returns: scalar |
| 14372 | returnInfo: |
| 14373 | logicalexpr: "" |
| 14374 | valueposition: |
| 14375 | start: 63 |
| 14376 | end: 65 |
| 14377 | returnednumber: 60 |
| 14378 | alwaysreturns: true |
| 14379 | knownreturn: true |
| 14380 | isreturnbool: false |
| 14381 | position: |
| 14382 | start: 63 |
| 14383 | end: 65 |
| 14384 | type: number |
| 14385 | fixedLabels: true |
| 14386 | op: 57397 |
| 14387 | side: 1 |
| 14388 | returnInfo: |
| 14389 | logicalexpr: 6 * 60 * 60 |
| 14390 | valueposition: |
| 14391 | start: 58 |
| 14392 | end: 59 |
| 14393 | returnednumber: 21600 |
| 14394 | alwaysreturns: true |
| 14395 | knownreturn: true |
| 14396 | isreturnbool: false |
| 14397 | position: |
| 14398 | start: 58 |
| 14399 | end: 59 |
| 14400 | type: number |
| 14401 | fixedLabels: true |
| 14402 | op: 57393 |
| 14403 | side: 1 |
| 14404 | usedLabels: |
| 14405 | - instance |
| 14406 | condition: |
| 14407 | op: 57393 |
| 14408 | present: true |
| 14409 | knownValue: true |
| 14410 | position: |
| 14411 | start: 28 |
| 14412 | end: 44 |
| 14413 | type: aggregation |
| 14414 | fixedLabels: true |
| 14415 | indirect: |
| 14416 | - src: |
| 14417 | labels: |
| 14418 | "": |
| 14419 | reason: This query returns a string value with no labels. |
| 14420 | kind: excluded |
| 14421 | fragment: |
| 14422 | start: 151 |
| 14423 | end: 161 |
| 14424 | returns: string |
| 14425 | returnInfo: |
| 14426 | logicalexpr: "" |
| 14427 | valueposition: |
| 14428 | start: 0 |
| 14429 | end: 0 |
| 14430 | returnednumber: 0 |
| 14431 | alwaysreturns: true |
| 14432 | knownreturn: false |
| 14433 | isreturnbool: false |
| 14434 | position: |
| 14435 | start: 151 |
| 14436 | end: 161 |
| 14437 | type: string |
| 14438 | fixedLabels: true |
| 14439 | op: 0 |
| 14440 | side: 0 |
| 14441 | - src: |
| 14442 | labels: |
| 14443 | "": |
| 14444 | reason: This query returns a string value with no labels. |
| 14445 | kind: excluded |
| 14446 | fragment: |
| 14447 | start: 163 |
| 14448 | end: 167 |
| 14449 | returns: string |
| 14450 | returnInfo: |
| 14451 | logicalexpr: "" |
| 14452 | valueposition: |
| 14453 | start: 0 |
| 14454 | end: 0 |
| 14455 | returnednumber: 0 |
| 14456 | alwaysreturns: true |
| 14457 | knownreturn: false |
| 14458 | isreturnbool: false |
| 14459 | position: |
| 14460 | start: 163 |
| 14461 | end: 167 |
| 14462 | type: string |
| 14463 | fixedLabels: true |
| 14464 | op: 0 |
| 14465 | side: 0 |
| 14466 | - src: |
| 14467 | labels: |
| 14468 | "": |
| 14469 | reason: This query returns a string value with no labels. |
| 14470 | kind: excluded |
| 14471 | fragment: |
| 14472 | start: 169 |
| 14473 | end: 177 |
| 14474 | returns: string |
| 14475 | returnInfo: |
| 14476 | logicalexpr: "" |
| 14477 | valueposition: |
| 14478 | start: 0 |
| 14479 | end: 0 |
| 14480 | returnednumber: 0 |
| 14481 | alwaysreturns: true |
| 14482 | knownreturn: false |
| 14483 | isreturnbool: false |
| 14484 | position: |
| 14485 | start: 169 |
| 14486 | end: 177 |
| 14487 | type: string |
| 14488 | fixedLabels: true |
| 14489 | op: 0 |
| 14490 | side: 0 |
| 14491 | - src: |
| 14492 | labels: |
| 14493 | "": |
| 14494 | reason: This query returns a string value with no labels. |
| 14495 | kind: excluded |
| 14496 | fragment: |
| 14497 | start: 179 |
| 14498 | end: 185 |
| 14499 | returns: string |
| 14500 | returnInfo: |
| 14501 | logicalexpr: "" |
| 14502 | valueposition: |
| 14503 | start: 0 |
| 14504 | end: 0 |
| 14505 | returnednumber: 0 |
| 14506 | alwaysreturns: true |
| 14507 | knownreturn: false |
| 14508 | isreturnbool: false |
| 14509 | position: |
| 14510 | start: 179 |
| 14511 | end: 185 |
| 14512 | type: string |
| 14513 | fixedLabels: true |
| 14514 | op: 0 |
| 14515 | side: 0 |
| 14516 | - src: |
| 14517 | labels: |
| 14518 | "": |
| 14519 | reason: This query returns a number value with no labels. |
| 14520 | kind: excluded |
| 14521 | fragment: |
| 14522 | start: 193 |
| 14523 | end: 194 |
| 14524 | returns: scalar |
| 14525 | returnInfo: |
| 14526 | logicalexpr: "" |
| 14527 | valueposition: |
| 14528 | start: 193 |
| 14529 | end: 194 |
| 14530 | returnednumber: 5 |
| 14531 | alwaysreturns: true |
| 14532 | knownreturn: true |
| 14533 | isreturnbool: false |
| 14534 | position: |
| 14535 | start: 193 |
| 14536 | end: 194 |
| 14537 | type: number |
| 14538 | fixedLabels: true |
| 14539 | op: 57388 |
| 14540 | side: 1 |
| 14541 | usedLabels: |
| 14542 | - dc |
| 14543 | condition: |
| 14544 | op: 57388 |
| 14545 | value: 5 |
| 14546 | present: true |
| 14547 | knownValue: true |
| 14548 | position: |
| 14549 | start: 131 |
| 14550 | end: 149 |
| 14551 | type: aggregation |
| 14552 | fixedLabels: true |
| 14553 | |
| 14554 | --- |
| 14555 | |
| 14556 | [TestLabelsSource/156 - 1] |
| 14557 | expr: topk(10, prometheus_build_info*prometheus_ready) |
| 14558 | output: |
| 14559 | - labels: |
| 14560 | __name__: |
| 14561 | reason: Binary operation between two vectors removes metric names. |
| 14562 | kind: excluded |
| 14563 | fragment: |
| 14564 | start: 9 |
| 14565 | end: 47 |
| 14566 | returns: vector |
| 14567 | operations: |
| 14568 | - node: '[*parser.VectorSelector] prometheus_build_info' |
| 14569 | op: "" |
| 14570 | - args: |
| 14571 | - "10" |
| 14572 | node: '[*parser.AggregateExpr] topk(10, prometheus_build_info * prometheus_ready)' |
| 14573 | op: topk |
| 14574 | joins: |
| 14575 | - addedlabels: [] |
| 14576 | depth: 1 |
| 14577 | ison: false |
| 14578 | matchinglabels: [] |
| 14579 | op: '*' |
| 14580 | src: |
| 14581 | returns: vector |
| 14582 | operations: |
| 14583 | - node: '[*parser.VectorSelector] prometheus_ready' |
| 14584 | op: "" |
| 14585 | position: |
| 14586 | start: 31 |
| 14587 | end: 47 |
| 14588 | type: selector |
| 14589 | position: |
| 14590 | start: 9 |
| 14591 | end: 30 |
| 14592 | type: aggregation |
| 14593 | |
| 14594 | --- |
| 14595 | |
| 14596 | [TestLabelsSource/157 - 1] |
| 14597 | expr: bottomk(10, prometheus_build_info*prometheus_ready) |
| 14598 | output: |
| 14599 | - labels: |
| 14600 | __name__: |
| 14601 | reason: Binary operation between two vectors removes metric names. |
| 14602 | kind: excluded |
| 14603 | fragment: |
| 14604 | start: 12 |
| 14605 | end: 50 |
| 14606 | returns: vector |
| 14607 | operations: |
| 14608 | - node: '[*parser.VectorSelector] prometheus_build_info' |
| 14609 | op: "" |
| 14610 | - args: |
| 14611 | - "10" |
| 14612 | node: '[*parser.AggregateExpr] bottomk(10, prometheus_build_info * prometheus_ready)' |
| 14613 | op: bottomk |
| 14614 | joins: |
| 14615 | - addedlabels: [] |
| 14616 | depth: 1 |
| 14617 | ison: false |
| 14618 | matchinglabels: [] |
| 14619 | op: '*' |
| 14620 | src: |
| 14621 | returns: vector |
| 14622 | operations: |
| 14623 | - node: '[*parser.VectorSelector] prometheus_ready' |
| 14624 | op: "" |
| 14625 | position: |
| 14626 | start: 34 |
| 14627 | end: 50 |
| 14628 | type: selector |
| 14629 | position: |
| 14630 | start: 12 |
| 14631 | end: 33 |
| 14632 | type: aggregation |
| 14633 | |
| 14634 | --- |
| 14635 | |
| 14636 | [TestLabelsSource/158 - 1] |
| 14637 | expr: histogram_fraction(0, 0.1, metric) |
| 14638 | output: |
| 14639 | - returns: vector |
| 14640 | operations: |
| 14641 | - node: '[*parser.VectorSelector] metric' |
| 14642 | op: "" |
| 14643 | - args: |
| 14644 | - "0" |
| 14645 | - "0.1" |
| 14646 | node: '[*parser.Call] histogram_fraction(0, 0.1, metric)' |
| 14647 | op: histogram_fraction |
| 14648 | indirect: |
| 14649 | - src: |
| 14650 | labels: |
| 14651 | "": |
| 14652 | reason: This query returns a number value with no labels. |
| 14653 | kind: excluded |
| 14654 | fragment: |
| 14655 | start: 19 |
| 14656 | end: 20 |
| 14657 | returns: scalar |
| 14658 | returnInfo: |
| 14659 | logicalexpr: "" |
| 14660 | valueposition: |
| 14661 | start: 19 |
| 14662 | end: 20 |
| 14663 | returnednumber: 0 |
| 14664 | alwaysreturns: true |
| 14665 | knownreturn: true |
| 14666 | isreturnbool: false |
| 14667 | position: |
| 14668 | start: 19 |
| 14669 | end: 20 |
| 14670 | type: number |
| 14671 | fixedLabels: true |
| 14672 | op: 0 |
| 14673 | side: 0 |
| 14674 | - src: |
| 14675 | labels: |
| 14676 | "": |
| 14677 | reason: This query returns a number value with no labels. |
| 14678 | kind: excluded |
| 14679 | fragment: |
| 14680 | start: 22 |
| 14681 | end: 25 |
| 14682 | returns: scalar |
| 14683 | returnInfo: |
| 14684 | logicalexpr: "" |
| 14685 | valueposition: |
| 14686 | start: 22 |
| 14687 | end: 25 |
| 14688 | returnednumber: 0.1 |
| 14689 | alwaysreturns: true |
| 14690 | knownreturn: true |
| 14691 | isreturnbool: false |
| 14692 | position: |
| 14693 | start: 22 |
| 14694 | end: 25 |
| 14695 | type: number |
| 14696 | fixedLabels: true |
| 14697 | op: 0 |
| 14698 | side: 0 |
| 14699 | position: |
| 14700 | start: 27 |
| 14701 | end: 33 |
| 14702 | type: function |
| 14703 | |
| 14704 | --- |
| 14705 | |
| 14706 | [TestLabelsSource/159 - 1] |
| 14707 | expr: 'foo * foo ' |
| 14708 | output: |
| 14709 | - labels: |
| 14710 | __name__: |
| 14711 | reason: Binary operation between two vectors removes metric names. |
| 14712 | kind: excluded |
| 14713 | fragment: |
| 14714 | start: 0 |
| 14715 | end: 9 |
| 14716 | returns: vector |
| 14717 | operations: |
| 14718 | - node: '[*parser.VectorSelector] foo' |
| 14719 | op: "" |
| 14720 | joins: |
| 14721 | - addedlabels: [] |
| 14722 | depth: 0 |
| 14723 | ison: false |
| 14724 | matchinglabels: [] |
| 14725 | op: '*' |
| 14726 | src: |
| 14727 | returns: vector |
| 14728 | operations: |
| 14729 | - node: '[*parser.VectorSelector] foo' |
| 14730 | op: "" |
| 14731 | position: |
| 14732 | start: 6 |
| 14733 | end: 9 |
| 14734 | type: selector |
| 14735 | position: |
| 14736 | start: 0 |
| 14737 | end: 3 |
| 14738 | type: selector |
| 14739 | |
| 14740 | --- |
| 14741 | |
| 14742 | [TestLabelsSource/160 - 1] |
| 14743 | expr: 'foo + on(__name__, job) foo ' |
| 14744 | output: |
| 14745 | - labels: |
| 14746 | "": |
| 14747 | reason: Query is using one-to-one vector matching with `on(__name__, job)`, only labels included inside `on(...)` will be present on the results. |
| 14748 | kind: excluded |
| 14749 | fragment: |
| 14750 | start: 6 |
| 14751 | end: 23 |
| 14752 | __name__: |
| 14753 | reason: Binary operation between two vectors removes metric names. |
| 14754 | kind: excluded |
| 14755 | fragment: |
| 14756 | start: 0 |
| 14757 | end: 27 |
| 14758 | job: |
| 14759 | reason: Query is using one-to-one vector matching with `on(__name__, job)`, only labels included inside `on(...)` will be present on the results. |
| 14760 | kind: included |
| 14761 | fragment: |
| 14762 | start: 19 |
| 14763 | end: 22 |
| 14764 | returns: vector |
| 14765 | operations: |
| 14766 | - node: '[*parser.VectorSelector] foo' |
| 14767 | op: "" |
| 14768 | joins: |
| 14769 | - addedlabels: [] |
| 14770 | depth: 0 |
| 14771 | ison: true |
| 14772 | matchinglabels: |
| 14773 | - __name__ |
| 14774 | - job |
| 14775 | op: + |
| 14776 | src: |
| 14777 | returns: vector |
| 14778 | operations: |
| 14779 | - node: '[*parser.VectorSelector] foo' |
| 14780 | op: "" |
| 14781 | position: |
| 14782 | start: 24 |
| 14783 | end: 27 |
| 14784 | type: selector |
| 14785 | usedLabels: |
| 14786 | - job |
| 14787 | position: |
| 14788 | start: 0 |
| 14789 | end: 3 |
| 14790 | type: selector |
| 14791 | fixedLabels: true |
| 14792 | |
| 14793 | --- |
| 14794 | |
| 14795 | [TestLabelsSource/161 - 1] |
| 14796 | expr: 'foo + on(__name__, job) group_left foo ' |
| 14797 | output: |
| 14798 | - labels: |
| 14799 | __name__: |
| 14800 | reason: Binary operation between two vectors removes metric names. |
| 14801 | kind: excluded |
| 14802 | fragment: |
| 14803 | start: 0 |
| 14804 | end: 38 |
| 14805 | job: |
| 14806 | reason: Query is using many-to-one vector matching with `on(__name__, job)`, labels included inside `on(...)` will be present on the results. |
| 14807 | kind: included |
| 14808 | fragment: |
| 14809 | start: 19 |
| 14810 | end: 22 |
| 14811 | returns: vector |
| 14812 | operations: |
| 14813 | - node: '[*parser.VectorSelector] foo' |
| 14814 | op: "" |
| 14815 | joins: |
| 14816 | - addedlabels: [] |
| 14817 | depth: 0 |
| 14818 | ison: true |
| 14819 | matchinglabels: |
| 14820 | - __name__ |
| 14821 | - job |
| 14822 | op: + |
| 14823 | src: |
| 14824 | returns: vector |
| 14825 | operations: |
| 14826 | - node: '[*parser.VectorSelector] foo' |
| 14827 | op: "" |
| 14828 | position: |
| 14829 | start: 35 |
| 14830 | end: 38 |
| 14831 | type: selector |
| 14832 | usedLabels: |
| 14833 | - job |
| 14834 | position: |
| 14835 | start: 0 |
| 14836 | end: 3 |
| 14837 | type: selector |
| 14838 | |
| 14839 | --- |
| 14840 | |
| 14841 | [TestLabelsSource/162 - 1] |
| 14842 | expr: 'foo + on(__name__, job) group_right foo ' |
| 14843 | output: |
| 14844 | - labels: |
| 14845 | __name__: |
| 14846 | reason: Binary operation between two vectors removes metric names. |
| 14847 | kind: excluded |
| 14848 | fragment: |
| 14849 | start: 0 |
| 14850 | end: 39 |
| 14851 | job: |
| 14852 | reason: Query is using one-to-many vector matching with `on(__name__, job)`, labels included inside `on(...)` will be present on the results. |
| 14853 | kind: included |
| 14854 | fragment: |
| 14855 | start: 19 |
| 14856 | end: 22 |
| 14857 | returns: vector |
| 14858 | operations: |
| 14859 | - node: '[*parser.VectorSelector] foo' |
| 14860 | op: "" |
| 14861 | joins: |
| 14862 | - addedlabels: [] |
| 14863 | depth: 0 |
| 14864 | ison: true |
| 14865 | matchinglabels: |
| 14866 | - __name__ |
| 14867 | - job |
| 14868 | op: + |
| 14869 | src: |
| 14870 | returns: vector |
| 14871 | operations: |
| 14872 | - node: '[*parser.VectorSelector] foo' |
| 14873 | op: "" |
| 14874 | position: |
| 14875 | start: 0 |
| 14876 | end: 3 |
| 14877 | type: selector |
| 14878 | usedLabels: |
| 14879 | - job |
| 14880 | position: |
| 14881 | start: 36 |
| 14882 | end: 39 |
| 14883 | type: selector |
| 14884 | |
| 14885 | --- |
| 14886 | |
| 14887 | [TestLabelsSource/163 - 1] |
| 14888 | expr: |- |
| 14889 | group by (env, cluster) ( |
| 14890 | up{env="prod", job="foo"} and on (instance) (services_enabled == 999) |
| 14891 | ) |
| 14892 | output: |
| 14893 | - labels: |
| 14894 | "": |
| 14895 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 14896 | kind: excluded |
| 14897 | fragment: |
| 14898 | start: 6 |
| 14899 | end: 8 |
| 14900 | __name__: |
| 14901 | reason: Aggregation removes metric name. |
| 14902 | kind: excluded |
| 14903 | fragment: |
| 14904 | start: 0 |
| 14905 | end: 104 |
| 14906 | cluster: |
| 14907 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 14908 | kind: included |
| 14909 | fragment: |
| 14910 | start: 15 |
| 14911 | end: 22 |
| 14912 | env: |
| 14913 | reason: Query will only return series where these labels are present. |
| 14914 | kind: guaranteed |
| 14915 | fragment: |
| 14916 | start: 32 |
| 14917 | end: 57 |
| 14918 | instance: |
| 14919 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 14920 | kind: excluded |
| 14921 | fragment: |
| 14922 | start: 6 |
| 14923 | end: 23 |
| 14924 | job: |
| 14925 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 14926 | kind: excluded |
| 14927 | fragment: |
| 14928 | start: 6 |
| 14929 | end: 23 |
| 14930 | returns: vector |
| 14931 | operations: |
| 14932 | - node: '[*parser.VectorSelector] up{env="prod",job="foo"}' |
| 14933 | op: "" |
| 14934 | - node: '[*parser.AggregateExpr] group by (env, cluster) (up{env="prod",job="foo"} and on (instance) (services_enabled == 999))' |
| 14935 | op: group |
| 14936 | joins: |
| 14937 | - addedlabels: [] |
| 14938 | depth: 1 |
| 14939 | ison: true |
| 14940 | matchinglabels: |
| 14941 | - instance |
| 14942 | op: and |
| 14943 | src: |
| 14944 | returns: vector |
| 14945 | operations: |
| 14946 | - node: '[*parser.VectorSelector] services_enabled' |
| 14947 | op: "" |
| 14948 | indirect: |
| 14949 | - src: |
| 14950 | labels: |
| 14951 | "": |
| 14952 | reason: This query returns a number value with no labels. |
| 14953 | kind: excluded |
| 14954 | fragment: |
| 14955 | start: 97 |
| 14956 | end: 100 |
| 14957 | returns: scalar |
| 14958 | returnInfo: |
| 14959 | logicalexpr: "" |
| 14960 | valueposition: |
| 14961 | start: 97 |
| 14962 | end: 100 |
| 14963 | returnednumber: 999 |
| 14964 | alwaysreturns: true |
| 14965 | knownreturn: true |
| 14966 | isreturnbool: false |
| 14967 | position: |
| 14968 | start: 97 |
| 14969 | end: 100 |
| 14970 | type: number |
| 14971 | fixedLabels: true |
| 14972 | op: 57385 |
| 14973 | side: 1 |
| 14974 | condition: |
| 14975 | op: 57385 |
| 14976 | value: 999 |
| 14977 | present: true |
| 14978 | knownValue: true |
| 14979 | position: |
| 14980 | start: 77 |
| 14981 | end: 93 |
| 14982 | type: selector |
| 14983 | usedLabels: |
| 14984 | - env |
| 14985 | - cluster |
| 14986 | condition: |
| 14987 | op: 57391 |
| 14988 | present: true |
| 14989 | position: |
| 14990 | start: 32 |
| 14991 | end: 57 |
| 14992 | type: aggregation |
| 14993 | fixedLabels: true |
| 14994 | |
| 14995 | --- |
| 14996 | |
| 14997 | [TestLabelsSource/164 - 1] |
| 14998 | expr: |- |
| 14999 | group by (env, cluster) ( |
| 15000 | up{env="prod", job="foo"} * on (instance) (services_enabled == 999) |
| 15001 | ) |
| 15002 | output: |
| 15003 | - labels: |
| 15004 | "": |
| 15005 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 15006 | kind: excluded |
| 15007 | fragment: |
| 15008 | start: 6 |
| 15009 | end: 8 |
| 15010 | __name__: |
| 15011 | reason: Aggregation removes metric name. |
| 15012 | kind: excluded |
| 15013 | fragment: |
| 15014 | start: 0 |
| 15015 | end: 102 |
| 15016 | cluster: |
| 15017 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 15018 | kind: excluded |
| 15019 | fragment: |
| 15020 | start: 60 |
| 15021 | end: 73 |
| 15022 | env: |
| 15023 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 15024 | kind: excluded |
| 15025 | fragment: |
| 15026 | start: 60 |
| 15027 | end: 73 |
| 15028 | instance: |
| 15029 | reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results. |
| 15030 | kind: excluded |
| 15031 | fragment: |
| 15032 | start: 6 |
| 15033 | end: 23 |
| 15034 | job: |
| 15035 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 15036 | kind: excluded |
| 15037 | fragment: |
| 15038 | start: 60 |
| 15039 | end: 73 |
| 15040 | returns: vector |
| 15041 | deadLabels: |
| 15042 | - name: env |
| 15043 | reason: You can't use `env` because this label is not possible here. |
| 15044 | labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 15045 | usagefragment: |
| 15046 | start: 10 |
| 15047 | end: 13 |
| 15048 | labelfragment: |
| 15049 | start: 60 |
| 15050 | end: 73 |
| 15051 | kind: 0 |
| 15052 | - name: cluster |
| 15053 | reason: You can't use `cluster` because this label is not possible here. |
| 15054 | labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 15055 | usagefragment: |
| 15056 | start: 15 |
| 15057 | end: 22 |
| 15058 | labelfragment: |
| 15059 | start: 60 |
| 15060 | end: 73 |
| 15061 | kind: 0 |
| 15062 | operations: |
| 15063 | - node: '[*parser.VectorSelector] up{env="prod",job="foo"}' |
| 15064 | op: "" |
| 15065 | - node: '[*parser.AggregateExpr] group by (env, cluster) (up{env="prod",job="foo"} * on (instance) (services_enabled == 999))' |
| 15066 | op: group |
| 15067 | joins: |
| 15068 | - addedlabels: [] |
| 15069 | depth: 1 |
| 15070 | ison: true |
| 15071 | matchinglabels: |
| 15072 | - instance |
| 15073 | op: '*' |
| 15074 | src: |
| 15075 | returns: vector |
| 15076 | operations: |
| 15077 | - node: '[*parser.VectorSelector] services_enabled' |
| 15078 | op: "" |
| 15079 | indirect: |
| 15080 | - src: |
| 15081 | labels: |
| 15082 | "": |
| 15083 | reason: This query returns a number value with no labels. |
| 15084 | kind: excluded |
| 15085 | fragment: |
| 15086 | start: 95 |
| 15087 | end: 98 |
| 15088 | returns: scalar |
| 15089 | returnInfo: |
| 15090 | logicalexpr: "" |
| 15091 | valueposition: |
| 15092 | start: 95 |
| 15093 | end: 98 |
| 15094 | returnednumber: 999 |
| 15095 | alwaysreturns: true |
| 15096 | knownreturn: true |
| 15097 | isreturnbool: false |
| 15098 | position: |
| 15099 | start: 95 |
| 15100 | end: 98 |
| 15101 | type: number |
| 15102 | fixedLabels: true |
| 15103 | op: 57385 |
| 15104 | side: 1 |
| 15105 | condition: |
| 15106 | op: 57385 |
| 15107 | value: 999 |
| 15108 | present: true |
| 15109 | knownValue: true |
| 15110 | position: |
| 15111 | start: 75 |
| 15112 | end: 91 |
| 15113 | type: selector |
| 15114 | usedLabels: |
| 15115 | - env |
| 15116 | - cluster |
| 15117 | position: |
| 15118 | start: 32 |
| 15119 | end: 57 |
| 15120 | type: aggregation |
| 15121 | fixedLabels: true |
| 15122 | |
| 15123 | --- |
| 15124 | |
| 15125 | [TestLabelsSource/165 - 1] |
| 15126 | expr: foo / on(instance) sum(bar) |
| 15127 | output: |
| 15128 | - labels: |
| 15129 | "": |
| 15130 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 15131 | kind: excluded |
| 15132 | fragment: |
| 15133 | start: 6 |
| 15134 | end: 18 |
| 15135 | __name__: |
| 15136 | reason: Binary operation between two vectors removes metric names. |
| 15137 | kind: excluded |
| 15138 | fragment: |
| 15139 | start: 0 |
| 15140 | end: 27 |
| 15141 | instance: |
| 15142 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 15143 | kind: included |
| 15144 | fragment: |
| 15145 | start: 9 |
| 15146 | end: 17 |
| 15147 | returns: vector |
| 15148 | operations: |
| 15149 | - node: '[*parser.VectorSelector] foo' |
| 15150 | op: "" |
| 15151 | joins: |
| 15152 | - addedlabels: [] |
| 15153 | deadinfo: |
| 15154 | 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. |
| 15155 | fragment: |
| 15156 | start: 19 |
| 15157 | end: 22 |
| 15158 | depth: 0 |
| 15159 | ison: true |
| 15160 | matchinglabels: |
| 15161 | - instance |
| 15162 | op: / |
| 15163 | src: |
| 15164 | labels: |
| 15165 | "": |
| 15166 | reason: Query is using aggregation that removes all labels. |
| 15167 | kind: excluded |
| 15168 | fragment: |
| 15169 | start: 19 |
| 15170 | end: 22 |
| 15171 | __name__: |
| 15172 | reason: Aggregation removes metric name. |
| 15173 | kind: excluded |
| 15174 | fragment: |
| 15175 | start: 19 |
| 15176 | end: 27 |
| 15177 | returns: vector |
| 15178 | operations: |
| 15179 | - node: '[*parser.VectorSelector] bar' |
| 15180 | op: "" |
| 15181 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 15182 | op: sum |
| 15183 | position: |
| 15184 | start: 23 |
| 15185 | end: 26 |
| 15186 | type: aggregation |
| 15187 | fixedLabels: true |
| 15188 | usedLabels: |
| 15189 | - instance |
| 15190 | position: |
| 15191 | start: 0 |
| 15192 | end: 3 |
| 15193 | type: selector |
| 15194 | fixedLabels: true |
| 15195 | |
| 15196 | --- |
| 15197 | |
| 15198 | [TestLabelsSource/166 - 1] |
| 15199 | expr: foo / on(instance) group_left(cluster) sum(bar) |
| 15200 | output: |
| 15201 | - labels: |
| 15202 | __name__: |
| 15203 | reason: Binary operation between two vectors removes metric names. |
| 15204 | kind: excluded |
| 15205 | fragment: |
| 15206 | start: 0 |
| 15207 | end: 47 |
| 15208 | cluster: |
| 15209 | 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. |
| 15210 | kind: included |
| 15211 | fragment: |
| 15212 | start: 30 |
| 15213 | end: 37 |
| 15214 | instance: |
| 15215 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 15216 | kind: included |
| 15217 | fragment: |
| 15218 | start: 9 |
| 15219 | end: 17 |
| 15220 | returns: vector |
| 15221 | operations: |
| 15222 | - node: '[*parser.VectorSelector] foo' |
| 15223 | op: "" |
| 15224 | joins: |
| 15225 | - addedlabels: |
| 15226 | - cluster |
| 15227 | deadinfo: |
| 15228 | 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. |
| 15229 | fragment: |
| 15230 | start: 39 |
| 15231 | end: 42 |
| 15232 | deadlabels: |
| 15233 | - name: cluster |
| 15234 | reason: You can't use `cluster` because this label is not possible here. |
| 15235 | labelreason: Query is using aggregation that removes all labels. |
| 15236 | usagefragment: |
| 15237 | start: 30 |
| 15238 | end: 37 |
| 15239 | labelfragment: |
| 15240 | start: 39 |
| 15241 | end: 42 |
| 15242 | kind: 0 |
| 15243 | depth: 0 |
| 15244 | ison: true |
| 15245 | matchinglabels: |
| 15246 | - instance |
| 15247 | op: / |
| 15248 | src: |
| 15249 | labels: |
| 15250 | "": |
| 15251 | reason: Query is using aggregation that removes all labels. |
| 15252 | kind: excluded |
| 15253 | fragment: |
| 15254 | start: 39 |
| 15255 | end: 42 |
| 15256 | __name__: |
| 15257 | reason: Aggregation removes metric name. |
| 15258 | kind: excluded |
| 15259 | fragment: |
| 15260 | start: 39 |
| 15261 | end: 47 |
| 15262 | returns: vector |
| 15263 | operations: |
| 15264 | - node: '[*parser.VectorSelector] bar' |
| 15265 | op: "" |
| 15266 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 15267 | op: sum |
| 15268 | position: |
| 15269 | start: 43 |
| 15270 | end: 46 |
| 15271 | type: aggregation |
| 15272 | fixedLabels: true |
| 15273 | usedLabels: |
| 15274 | - instance |
| 15275 | position: |
| 15276 | start: 0 |
| 15277 | end: 3 |
| 15278 | type: selector |
| 15279 | |
| 15280 | --- |
| 15281 | |
| 15282 | [TestLabelsSource/167 - 1] |
| 15283 | expr: sum(bar) / on(instance) group_right(cluster) foo |
| 15284 | output: |
| 15285 | - labels: |
| 15286 | __name__: |
| 15287 | reason: Binary operation between two vectors removes metric names. |
| 15288 | kind: excluded |
| 15289 | fragment: |
| 15290 | start: 0 |
| 15291 | end: 48 |
| 15292 | cluster: |
| 15293 | 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. |
| 15294 | kind: included |
| 15295 | fragment: |
| 15296 | start: 36 |
| 15297 | end: 43 |
| 15298 | instance: |
| 15299 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 15300 | kind: included |
| 15301 | fragment: |
| 15302 | start: 14 |
| 15303 | end: 22 |
| 15304 | returns: vector |
| 15305 | operations: |
| 15306 | - node: '[*parser.VectorSelector] foo' |
| 15307 | op: "" |
| 15308 | joins: |
| 15309 | - addedlabels: |
| 15310 | - cluster |
| 15311 | deadinfo: |
| 15312 | 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. |
| 15313 | fragment: |
| 15314 | start: 0 |
| 15315 | end: 3 |
| 15316 | deadlabels: |
| 15317 | - name: cluster |
| 15318 | reason: You can't use `cluster` because this label is not possible here. |
| 15319 | labelreason: Query is using aggregation that removes all labels. |
| 15320 | usagefragment: |
| 15321 | start: 36 |
| 15322 | end: 43 |
| 15323 | labelfragment: |
| 15324 | start: 0 |
| 15325 | end: 3 |
| 15326 | kind: 0 |
| 15327 | depth: 0 |
| 15328 | ison: true |
| 15329 | matchinglabels: |
| 15330 | - instance |
| 15331 | op: / |
| 15332 | src: |
| 15333 | labels: |
| 15334 | "": |
| 15335 | reason: Query is using aggregation that removes all labels. |
| 15336 | kind: excluded |
| 15337 | fragment: |
| 15338 | start: 0 |
| 15339 | end: 3 |
| 15340 | __name__: |
| 15341 | reason: Aggregation removes metric name. |
| 15342 | kind: excluded |
| 15343 | fragment: |
| 15344 | start: 0 |
| 15345 | end: 8 |
| 15346 | returns: vector |
| 15347 | operations: |
| 15348 | - node: '[*parser.VectorSelector] bar' |
| 15349 | op: "" |
| 15350 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 15351 | op: sum |
| 15352 | position: |
| 15353 | start: 4 |
| 15354 | end: 7 |
| 15355 | type: aggregation |
| 15356 | fixedLabels: true |
| 15357 | usedLabels: |
| 15358 | - instance |
| 15359 | position: |
| 15360 | start: 45 |
| 15361 | end: 48 |
| 15362 | type: selector |
| 15363 | |
| 15364 | --- |
| 15365 | |
| 15366 | [TestLabelsSource/168 - 1] |
| 15367 | expr: sum(bar) * on(cluster) sum(foo) |
| 15368 | output: |
| 15369 | - labels: |
| 15370 | "": |
| 15371 | reason: Query is using one-to-one vector matching with `on(cluster)`, only labels included inside `on(...)` will be present on the results. |
| 15372 | kind: excluded |
| 15373 | fragment: |
| 15374 | start: 11 |
| 15375 | end: 22 |
| 15376 | __name__: |
| 15377 | reason: Binary operation between two vectors removes metric names. |
| 15378 | kind: excluded |
| 15379 | fragment: |
| 15380 | start: 0 |
| 15381 | end: 31 |
| 15382 | cluster: |
| 15383 | reason: Query is using aggregation that removes all labels. |
| 15384 | kind: excluded |
| 15385 | fragment: |
| 15386 | start: 0 |
| 15387 | end: 3 |
| 15388 | returns: vector |
| 15389 | deadLabels: |
| 15390 | - name: cluster |
| 15391 | reason: You can't use `cluster` because this label is not possible here. |
| 15392 | labelreason: Query is using aggregation that removes all labels. |
| 15393 | usagefragment: |
| 15394 | start: 14 |
| 15395 | end: 21 |
| 15396 | labelfragment: |
| 15397 | start: 0 |
| 15398 | end: 3 |
| 15399 | kind: 0 |
| 15400 | operations: |
| 15401 | - node: '[*parser.VectorSelector] bar' |
| 15402 | op: "" |
| 15403 | - node: '[*parser.AggregateExpr] sum(bar)' |
| 15404 | op: sum |
| 15405 | joins: |
| 15406 | - addedlabels: [] |
| 15407 | depth: 0 |
| 15408 | ison: true |
| 15409 | matchinglabels: |
| 15410 | - cluster |
| 15411 | op: '*' |
| 15412 | src: |
| 15413 | labels: |
| 15414 | "": |
| 15415 | reason: Query is using aggregation that removes all labels. |
| 15416 | kind: excluded |
| 15417 | fragment: |
| 15418 | start: 23 |
| 15419 | end: 26 |
| 15420 | __name__: |
| 15421 | reason: Aggregation removes metric name. |
| 15422 | kind: excluded |
| 15423 | fragment: |
| 15424 | start: 23 |
| 15425 | end: 31 |
| 15426 | returns: vector |
| 15427 | operations: |
| 15428 | - node: '[*parser.VectorSelector] foo' |
| 15429 | op: "" |
| 15430 | - node: '[*parser.AggregateExpr] sum(foo)' |
| 15431 | op: sum |
| 15432 | position: |
| 15433 | start: 27 |
| 15434 | end: 30 |
| 15435 | type: aggregation |
| 15436 | fixedLabels: true |
| 15437 | usedLabels: |
| 15438 | - cluster |
| 15439 | position: |
| 15440 | start: 4 |
| 15441 | end: 7 |
| 15442 | type: aggregation |
| 15443 | fixedLabels: true |
| 15444 | |
| 15445 | --- |
| 15446 | |
| 15447 | [TestLabelsSource/169 - 1] |
| 15448 | expr: |4- |
| 15449 | |
| 15450 | group by (colo_name, instance, tier, animal, brand, sliver, pop_name) ( |
| 15451 | up{node_status="v", job="node_exporter"} |
| 15452 | and on (instance) (metal_services_enabled == 999) |
| 15453 | * on (colo_name) group_left(tier, animal, brand, pop_name) colo_metadata{colo_status="v"} |
| 15454 | * on (instance) group_left (sliver) sliver_metadata{node_status="v"} |
| 15455 | ) |
| 15456 | output: |
| 15457 | - labels: |
| 15458 | "": |
| 15459 | 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. |
| 15460 | kind: excluded |
| 15461 | fragment: |
| 15462 | start: 7 |
| 15463 | end: 9 |
| 15464 | __name__: |
| 15465 | reason: Aggregation removes metric name. |
| 15466 | kind: excluded |
| 15467 | fragment: |
| 15468 | start: 1 |
| 15469 | end: 332 |
| 15470 | animal: |
| 15471 | 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. |
| 15472 | kind: included |
| 15473 | fragment: |
| 15474 | start: 38 |
| 15475 | end: 44 |
| 15476 | brand: |
| 15477 | 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. |
| 15478 | kind: included |
| 15479 | fragment: |
| 15480 | start: 46 |
| 15481 | end: 51 |
| 15482 | colo_name: |
| 15483 | 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. |
| 15484 | kind: included |
| 15485 | fragment: |
| 15486 | start: 11 |
| 15487 | end: 20 |
| 15488 | instance: |
| 15489 | 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. |
| 15490 | kind: included |
| 15491 | fragment: |
| 15492 | start: 22 |
| 15493 | end: 30 |
| 15494 | job: |
| 15495 | 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. |
| 15496 | kind: excluded |
| 15497 | fragment: |
| 15498 | start: 7 |
| 15499 | end: 70 |
| 15500 | node_status: |
| 15501 | 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. |
| 15502 | kind: excluded |
| 15503 | fragment: |
| 15504 | start: 7 |
| 15505 | end: 70 |
| 15506 | pop_name: |
| 15507 | 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. |
| 15508 | kind: included |
| 15509 | fragment: |
| 15510 | start: 61 |
| 15511 | end: 69 |
| 15512 | sliver: |
| 15513 | 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. |
| 15514 | kind: included |
| 15515 | fragment: |
| 15516 | start: 53 |
| 15517 | end: 59 |
| 15518 | tier: |
| 15519 | 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. |
| 15520 | kind: included |
| 15521 | fragment: |
| 15522 | start: 32 |
| 15523 | end: 36 |
| 15524 | returns: vector |
| 15525 | deadLabels: |
| 15526 | - name: tier |
| 15527 | reason: This binary operation prevents previously joined label `tier` from being added to the results. |
| 15528 | 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. |
| 15529 | usagefragment: |
| 15530 | start: 118 |
| 15531 | end: 121 |
| 15532 | labelfragment: |
| 15533 | start: 198 |
| 15534 | end: 202 |
| 15535 | kind: 1 |
| 15536 | - name: animal |
| 15537 | reason: This binary operation prevents previously joined label `animal` from being added to the results. |
| 15538 | 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. |
| 15539 | usagefragment: |
| 15540 | start: 118 |
| 15541 | end: 121 |
| 15542 | labelfragment: |
| 15543 | start: 204 |
| 15544 | end: 210 |
| 15545 | kind: 1 |
| 15546 | - name: brand |
| 15547 | reason: This binary operation prevents previously joined label `brand` from being added to the results. |
| 15548 | 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. |
| 15549 | usagefragment: |
| 15550 | start: 118 |
| 15551 | end: 121 |
| 15552 | labelfragment: |
| 15553 | start: 212 |
| 15554 | end: 217 |
| 15555 | kind: 1 |
| 15556 | - name: pop_name |
| 15557 | reason: This binary operation prevents previously joined label `pop_name` from being added to the results. |
| 15558 | 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. |
| 15559 | usagefragment: |
| 15560 | start: 118 |
| 15561 | end: 121 |
| 15562 | labelfragment: |
| 15563 | start: 219 |
| 15564 | end: 227 |
| 15565 | kind: 1 |
| 15566 | - name: sliver |
| 15567 | reason: This binary operation prevents previously joined label `sliver` from being added to the results. |
| 15568 | 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. |
| 15569 | usagefragment: |
| 15570 | start: 118 |
| 15571 | end: 121 |
| 15572 | labelfragment: |
| 15573 | start: 290 |
| 15574 | end: 296 |
| 15575 | kind: 1 |
| 15576 | operations: |
| 15577 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 15578 | op: "" |
| 15579 | - 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"})' |
| 15580 | op: group |
| 15581 | joins: |
| 15582 | - addedlabels: [] |
| 15583 | depth: 1 |
| 15584 | ison: true |
| 15585 | matchinglabels: |
| 15586 | - instance |
| 15587 | op: and |
| 15588 | src: |
| 15589 | labels: |
| 15590 | __name__: |
| 15591 | reason: Binary operation between two vectors removes metric names. |
| 15592 | kind: excluded |
| 15593 | fragment: |
| 15594 | start: 136 |
| 15595 | end: 330 |
| 15596 | animal: |
| 15597 | 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. |
| 15598 | kind: included |
| 15599 | fragment: |
| 15600 | start: 204 |
| 15601 | end: 210 |
| 15602 | brand: |
| 15603 | 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. |
| 15604 | kind: included |
| 15605 | fragment: |
| 15606 | start: 212 |
| 15607 | end: 217 |
| 15608 | colo_name: |
| 15609 | reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 15610 | kind: included |
| 15611 | fragment: |
| 15612 | start: 176 |
| 15613 | end: 185 |
| 15614 | instance: |
| 15615 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 15616 | kind: included |
| 15617 | fragment: |
| 15618 | start: 268 |
| 15619 | end: 276 |
| 15620 | pop_name: |
| 15621 | 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. |
| 15622 | kind: included |
| 15623 | fragment: |
| 15624 | start: 219 |
| 15625 | end: 227 |
| 15626 | sliver: |
| 15627 | 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. |
| 15628 | kind: included |
| 15629 | fragment: |
| 15630 | start: 290 |
| 15631 | end: 296 |
| 15632 | tier: |
| 15633 | 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. |
| 15634 | kind: included |
| 15635 | fragment: |
| 15636 | start: 198 |
| 15637 | end: 202 |
| 15638 | returns: vector |
| 15639 | operations: |
| 15640 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 15641 | op: "" |
| 15642 | joins: |
| 15643 | - addedlabels: |
| 15644 | - tier |
| 15645 | - animal |
| 15646 | - brand |
| 15647 | - pop_name |
| 15648 | depth: 0 |
| 15649 | ison: true |
| 15650 | matchinglabels: |
| 15651 | - colo_name |
| 15652 | op: '*' |
| 15653 | src: |
| 15654 | labels: |
| 15655 | colo_status: |
| 15656 | reason: Query will only return series where these labels are present. |
| 15657 | kind: guaranteed |
| 15658 | fragment: |
| 15659 | start: 229 |
| 15660 | end: 259 |
| 15661 | returns: vector |
| 15662 | operations: |
| 15663 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 15664 | op: "" |
| 15665 | position: |
| 15666 | start: 229 |
| 15667 | end: 259 |
| 15668 | type: selector |
| 15669 | - addedlabels: |
| 15670 | - sliver |
| 15671 | depth: 0 |
| 15672 | ison: true |
| 15673 | matchinglabels: |
| 15674 | - instance |
| 15675 | op: '*' |
| 15676 | src: |
| 15677 | labels: |
| 15678 | node_status: |
| 15679 | reason: Query will only return series where these labels are present. |
| 15680 | kind: guaranteed |
| 15681 | fragment: |
| 15682 | start: 298 |
| 15683 | end: 330 |
| 15684 | returns: vector |
| 15685 | operations: |
| 15686 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 15687 | op: "" |
| 15688 | position: |
| 15689 | start: 298 |
| 15690 | end: 330 |
| 15691 | type: selector |
| 15692 | indirect: |
| 15693 | - src: |
| 15694 | labels: |
| 15695 | "": |
| 15696 | reason: This query returns a number value with no labels. |
| 15697 | kind: excluded |
| 15698 | fragment: |
| 15699 | start: 163 |
| 15700 | end: 166 |
| 15701 | returns: scalar |
| 15702 | returnInfo: |
| 15703 | logicalexpr: "" |
| 15704 | valueposition: |
| 15705 | start: 163 |
| 15706 | end: 166 |
| 15707 | returnednumber: 999 |
| 15708 | alwaysreturns: true |
| 15709 | knownreturn: true |
| 15710 | isreturnbool: false |
| 15711 | position: |
| 15712 | start: 163 |
| 15713 | end: 166 |
| 15714 | type: number |
| 15715 | fixedLabels: true |
| 15716 | op: 57385 |
| 15717 | side: 1 |
| 15718 | usedLabels: |
| 15719 | - colo_name |
| 15720 | - instance |
| 15721 | condition: |
| 15722 | op: 57385 |
| 15723 | value: 999 |
| 15724 | present: true |
| 15725 | knownValue: true |
| 15726 | position: |
| 15727 | start: 137 |
| 15728 | end: 159 |
| 15729 | type: selector |
| 15730 | usedLabels: |
| 15731 | - instance |
| 15732 | - colo_name |
| 15733 | - tier |
| 15734 | - animal |
| 15735 | - brand |
| 15736 | - sliver |
| 15737 | - pop_name |
| 15738 | condition: |
| 15739 | op: 57391 |
| 15740 | present: true |
| 15741 | position: |
| 15742 | start: 75 |
| 15743 | end: 115 |
| 15744 | type: aggregation |
| 15745 | fixedLabels: true |
| 15746 | |
| 15747 | --- |
| 15748 | |
| 15749 | [TestLabelsSource/170 - 1] |
| 15750 | expr: |4 |
| 15751 | |
| 15752 | up{node_status="v", job="node_exporter"} |
| 15753 | * on (colo_name) group_left(tier) colo_metadata{colo_status="v"} |
| 15754 | * on (instance) group_left (sliver) sliver_metadata{node_status="v"} |
| 15755 | output: |
| 15756 | - labels: |
| 15757 | __name__: |
| 15758 | reason: Binary operation between two vectors removes metric names. |
| 15759 | kind: excluded |
| 15760 | fragment: |
| 15761 | start: 1 |
| 15762 | end: 175 |
| 15763 | colo_name: |
| 15764 | reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 15765 | kind: included |
| 15766 | fragment: |
| 15767 | start: 48 |
| 15768 | end: 57 |
| 15769 | instance: |
| 15770 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 15771 | kind: included |
| 15772 | fragment: |
| 15773 | start: 113 |
| 15774 | end: 121 |
| 15775 | job: |
| 15776 | reason: Query will only return series where these labels are present. |
| 15777 | kind: guaranteed |
| 15778 | fragment: |
| 15779 | start: 1 |
| 15780 | end: 41 |
| 15781 | node_status: |
| 15782 | reason: Query will only return series where these labels are present. |
| 15783 | kind: guaranteed |
| 15784 | fragment: |
| 15785 | start: 1 |
| 15786 | end: 41 |
| 15787 | sliver: |
| 15788 | 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. |
| 15789 | kind: included |
| 15790 | fragment: |
| 15791 | start: 135 |
| 15792 | end: 141 |
| 15793 | tier: |
| 15794 | 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. |
| 15795 | kind: included |
| 15796 | fragment: |
| 15797 | start: 70 |
| 15798 | end: 74 |
| 15799 | returns: vector |
| 15800 | operations: |
| 15801 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 15802 | op: "" |
| 15803 | joins: |
| 15804 | - addedlabels: |
| 15805 | - tier |
| 15806 | depth: 0 |
| 15807 | ison: true |
| 15808 | matchinglabels: |
| 15809 | - colo_name |
| 15810 | op: '*' |
| 15811 | src: |
| 15812 | labels: |
| 15813 | colo_status: |
| 15814 | reason: Query will only return series where these labels are present. |
| 15815 | kind: guaranteed |
| 15816 | fragment: |
| 15817 | start: 76 |
| 15818 | end: 106 |
| 15819 | returns: vector |
| 15820 | operations: |
| 15821 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 15822 | op: "" |
| 15823 | position: |
| 15824 | start: 76 |
| 15825 | end: 106 |
| 15826 | type: selector |
| 15827 | - addedlabels: |
| 15828 | - sliver |
| 15829 | depth: 0 |
| 15830 | ison: true |
| 15831 | matchinglabels: |
| 15832 | - instance |
| 15833 | op: '*' |
| 15834 | src: |
| 15835 | labels: |
| 15836 | node_status: |
| 15837 | reason: Query will only return series where these labels are present. |
| 15838 | kind: guaranteed |
| 15839 | fragment: |
| 15840 | start: 143 |
| 15841 | end: 175 |
| 15842 | returns: vector |
| 15843 | operations: |
| 15844 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 15845 | op: "" |
| 15846 | position: |
| 15847 | start: 143 |
| 15848 | end: 175 |
| 15849 | type: selector |
| 15850 | usedLabels: |
| 15851 | - colo_name |
| 15852 | - instance |
| 15853 | position: |
| 15854 | start: 1 |
| 15855 | end: 41 |
| 15856 | type: selector |
| 15857 | |
| 15858 | --- |
| 15859 | |
| 15860 | [TestLabelsSource/171 - 1] |
| 15861 | expr: |4 |
| 15862 | |
| 15863 | up{node_status="v", job="node_exporter"} |
| 15864 | and on (colo_name) colo_metadata{colo_status="v"} |
| 15865 | * on (instance) group_left (sliver) sliver_metadata{node_status="v"} |
| 15866 | output: |
| 15867 | - labels: |
| 15868 | colo_name: |
| 15869 | 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. |
| 15870 | kind: included |
| 15871 | fragment: |
| 15872 | start: 50 |
| 15873 | end: 59 |
| 15874 | job: |
| 15875 | reason: Query will only return series where these labels are present. |
| 15876 | kind: guaranteed |
| 15877 | fragment: |
| 15878 | start: 1 |
| 15879 | end: 41 |
| 15880 | node_status: |
| 15881 | reason: Query will only return series where these labels are present. |
| 15882 | kind: guaranteed |
| 15883 | fragment: |
| 15884 | start: 1 |
| 15885 | end: 41 |
| 15886 | returns: vector |
| 15887 | deadLabels: |
| 15888 | - name: sliver |
| 15889 | reason: This binary operation prevents previously joined label `sliver` from being added to the results. |
| 15890 | 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. |
| 15891 | usagefragment: |
| 15892 | start: 42 |
| 15893 | end: 45 |
| 15894 | labelfragment: |
| 15895 | start: 120 |
| 15896 | end: 126 |
| 15897 | kind: 1 |
| 15898 | operations: |
| 15899 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 15900 | op: "" |
| 15901 | joins: |
| 15902 | - addedlabels: [] |
| 15903 | depth: 0 |
| 15904 | ison: true |
| 15905 | matchinglabels: |
| 15906 | - colo_name |
| 15907 | op: and |
| 15908 | src: |
| 15909 | labels: |
| 15910 | __name__: |
| 15911 | reason: Binary operation between two vectors removes metric names. |
| 15912 | kind: excluded |
| 15913 | fragment: |
| 15914 | start: 61 |
| 15915 | end: 160 |
| 15916 | colo_status: |
| 15917 | reason: Query will only return series where these labels are present. |
| 15918 | kind: guaranteed |
| 15919 | fragment: |
| 15920 | start: 61 |
| 15921 | end: 91 |
| 15922 | instance: |
| 15923 | reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 15924 | kind: included |
| 15925 | fragment: |
| 15926 | start: 98 |
| 15927 | end: 106 |
| 15928 | sliver: |
| 15929 | 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. |
| 15930 | kind: included |
| 15931 | fragment: |
| 15932 | start: 120 |
| 15933 | end: 126 |
| 15934 | returns: vector |
| 15935 | operations: |
| 15936 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 15937 | op: "" |
| 15938 | joins: |
| 15939 | - addedlabels: |
| 15940 | - sliver |
| 15941 | depth: 0 |
| 15942 | ison: true |
| 15943 | matchinglabels: |
| 15944 | - instance |
| 15945 | op: '*' |
| 15946 | src: |
| 15947 | labels: |
| 15948 | node_status: |
| 15949 | reason: Query will only return series where these labels are present. |
| 15950 | kind: guaranteed |
| 15951 | fragment: |
| 15952 | start: 128 |
| 15953 | end: 160 |
| 15954 | returns: vector |
| 15955 | operations: |
| 15956 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 15957 | op: "" |
| 15958 | position: |
| 15959 | start: 128 |
| 15960 | end: 160 |
| 15961 | type: selector |
| 15962 | usedLabels: |
| 15963 | - instance |
| 15964 | position: |
| 15965 | start: 61 |
| 15966 | end: 91 |
| 15967 | type: selector |
| 15968 | usedLabels: |
| 15969 | - colo_name |
| 15970 | position: |
| 15971 | start: 1 |
| 15972 | end: 41 |
| 15973 | type: selector |
| 15974 | |
| 15975 | --- |
| 15976 | |
| 15977 | [TestLabelsSource/172 - 1] |
| 15978 | expr: |4 |
| 15979 | |
| 15980 | colo_metadata{colo_status="v"} * on (colo_name) group_right(tier, animal, brand, pop_name) |
| 15981 | sliver_metadata{node_status="v"} * on (instance) group_right (sliver) |
| 15982 | (metal_services_enabled == 999) * on (instance) |
| 15983 | up{node_status="v", job="node_exporter"} |
| 15984 | output: |
| 15985 | - labels: |
| 15986 | "": |
| 15987 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 15988 | kind: excluded |
| 15989 | fragment: |
| 15990 | start: 1 |
| 15991 | end: 250 |
| 15992 | __name__: |
| 15993 | reason: Binary operation between two vectors removes metric names. |
| 15994 | kind: excluded |
| 15995 | fragment: |
| 15996 | start: 1 |
| 15997 | end: 250 |
| 15998 | instance: |
| 15999 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 16000 | kind: included |
| 16001 | fragment: |
| 16002 | start: 200 |
| 16003 | end: 208 |
| 16004 | sliver: |
| 16005 | reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 16006 | kind: excluded |
| 16007 | fragment: |
| 16008 | start: 1 |
| 16009 | end: 250 |
| 16010 | returns: vector |
| 16011 | deadLabels: |
| 16012 | - name: tier |
| 16013 | reason: This binary operation prevents previously joined label `tier` from being added to the results. |
| 16014 | labelreason: "" |
| 16015 | usagefragment: |
| 16016 | start: 125 |
| 16017 | end: 126 |
| 16018 | labelfragment: |
| 16019 | start: 125 |
| 16020 | end: 126 |
| 16021 | kind: 1 |
| 16022 | - name: animal |
| 16023 | reason: This binary operation prevents previously joined label `animal` from being added to the results. |
| 16024 | labelreason: "" |
| 16025 | usagefragment: |
| 16026 | start: 125 |
| 16027 | end: 126 |
| 16028 | labelfragment: |
| 16029 | start: 125 |
| 16030 | end: 126 |
| 16031 | kind: 1 |
| 16032 | - name: brand |
| 16033 | reason: This binary operation prevents previously joined label `brand` from being added to the results. |
| 16034 | labelreason: "" |
| 16035 | usagefragment: |
| 16036 | start: 125 |
| 16037 | end: 126 |
| 16038 | labelfragment: |
| 16039 | start: 125 |
| 16040 | end: 126 |
| 16041 | kind: 1 |
| 16042 | - name: pop_name |
| 16043 | reason: This binary operation prevents previously joined label `pop_name` from being added to the results. |
| 16044 | labelreason: "" |
| 16045 | usagefragment: |
| 16046 | start: 125 |
| 16047 | end: 126 |
| 16048 | labelfragment: |
| 16049 | start: 125 |
| 16050 | end: 126 |
| 16051 | kind: 1 |
| 16052 | - name: sliver |
| 16053 | reason: This binary operation prevents previously joined label `sliver` from being added to the results. |
| 16054 | labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results. |
| 16055 | usagefragment: |
| 16056 | start: 194 |
| 16057 | end: 195 |
| 16058 | labelfragment: |
| 16059 | start: 1 |
| 16060 | end: 250 |
| 16061 | kind: 1 |
| 16062 | operations: |
| 16063 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 16064 | op: "" |
| 16065 | joins: |
| 16066 | - addedlabels: |
| 16067 | - sliver |
| 16068 | depth: 0 |
| 16069 | ison: true |
| 16070 | matchinglabels: |
| 16071 | - instance |
| 16072 | op: '*' |
| 16073 | src: |
| 16074 | labels: |
| 16075 | __name__: |
| 16076 | reason: Binary operation between two vectors removes metric names. |
| 16077 | kind: excluded |
| 16078 | fragment: |
| 16079 | start: 1 |
| 16080 | end: 124 |
| 16081 | animal: |
| 16082 | 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. |
| 16083 | kind: included |
| 16084 | fragment: |
| 16085 | start: 67 |
| 16086 | end: 73 |
| 16087 | brand: |
| 16088 | 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. |
| 16089 | kind: included |
| 16090 | fragment: |
| 16091 | start: 75 |
| 16092 | end: 80 |
| 16093 | colo_name: |
| 16094 | reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 16095 | kind: included |
| 16096 | fragment: |
| 16097 | start: 38 |
| 16098 | end: 47 |
| 16099 | node_status: |
| 16100 | reason: Query will only return series where these labels are present. |
| 16101 | kind: guaranteed |
| 16102 | fragment: |
| 16103 | start: 92 |
| 16104 | end: 124 |
| 16105 | pop_name: |
| 16106 | 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. |
| 16107 | kind: included |
| 16108 | fragment: |
| 16109 | start: 82 |
| 16110 | end: 90 |
| 16111 | tier: |
| 16112 | 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. |
| 16113 | kind: included |
| 16114 | fragment: |
| 16115 | start: 61 |
| 16116 | end: 65 |
| 16117 | returns: vector |
| 16118 | operations: |
| 16119 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 16120 | op: "" |
| 16121 | joins: |
| 16122 | - addedlabels: |
| 16123 | - tier |
| 16124 | - animal |
| 16125 | - brand |
| 16126 | - pop_name |
| 16127 | depth: 0 |
| 16128 | ison: true |
| 16129 | matchinglabels: |
| 16130 | - colo_name |
| 16131 | op: '*' |
| 16132 | src: |
| 16133 | labels: |
| 16134 | colo_status: |
| 16135 | reason: Query will only return series where these labels are present. |
| 16136 | kind: guaranteed |
| 16137 | fragment: |
| 16138 | start: 1 |
| 16139 | end: 31 |
| 16140 | returns: vector |
| 16141 | operations: |
| 16142 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 16143 | op: "" |
| 16144 | position: |
| 16145 | start: 1 |
| 16146 | end: 31 |
| 16147 | type: selector |
| 16148 | usedLabels: |
| 16149 | - colo_name |
| 16150 | position: |
| 16151 | start: 92 |
| 16152 | end: 124 |
| 16153 | type: selector |
| 16154 | - addedlabels: [] |
| 16155 | depth: 0 |
| 16156 | ison: true |
| 16157 | matchinglabels: |
| 16158 | - instance |
| 16159 | op: '*' |
| 16160 | src: |
| 16161 | labels: |
| 16162 | job: |
| 16163 | reason: Query will only return series where these labels are present. |
| 16164 | kind: guaranteed |
| 16165 | fragment: |
| 16166 | start: 210 |
| 16167 | end: 250 |
| 16168 | node_status: |
| 16169 | reason: Query will only return series where these labels are present. |
| 16170 | kind: guaranteed |
| 16171 | fragment: |
| 16172 | start: 210 |
| 16173 | end: 250 |
| 16174 | returns: vector |
| 16175 | operations: |
| 16176 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 16177 | op: "" |
| 16178 | position: |
| 16179 | start: 210 |
| 16180 | end: 250 |
| 16181 | type: selector |
| 16182 | indirect: |
| 16183 | - src: |
| 16184 | labels: |
| 16185 | "": |
| 16186 | reason: This query returns a number value with no labels. |
| 16187 | kind: excluded |
| 16188 | fragment: |
| 16189 | start: 189 |
| 16190 | end: 192 |
| 16191 | returns: scalar |
| 16192 | returnInfo: |
| 16193 | logicalexpr: "" |
| 16194 | valueposition: |
| 16195 | start: 189 |
| 16196 | end: 192 |
| 16197 | returnednumber: 999 |
| 16198 | alwaysreturns: true |
| 16199 | knownreturn: true |
| 16200 | isreturnbool: false |
| 16201 | position: |
| 16202 | start: 189 |
| 16203 | end: 192 |
| 16204 | type: number |
| 16205 | fixedLabels: true |
| 16206 | op: 57385 |
| 16207 | side: 1 |
| 16208 | usedLabels: |
| 16209 | - instance |
| 16210 | condition: |
| 16211 | op: 57385 |
| 16212 | value: 999 |
| 16213 | present: true |
| 16214 | knownValue: true |
| 16215 | position: |
| 16216 | start: 163 |
| 16217 | end: 185 |
| 16218 | type: selector |
| 16219 | fixedLabels: true |
| 16220 | |
| 16221 | --- |
| 16222 | |
| 16223 | [TestLabelsSource/173 - 1] |
| 16224 | expr: |4 |
| 16225 | |
| 16226 | colo_metadata{colo_status="v"} * on (colo_name) group_right(tier, animal, brand, pop_name) |
| 16227 | sliver_metadata{node_status="v"} * on (instance) group_right (sliver) |
| 16228 | (metal_services_enabled == 999) * on (instance) group_right() |
| 16229 | up{node_status="v", job="node_exporter"} |
| 16230 | output: |
| 16231 | - labels: |
| 16232 | __name__: |
| 16233 | reason: Binary operation between two vectors removes metric names. |
| 16234 | kind: excluded |
| 16235 | fragment: |
| 16236 | start: 1 |
| 16237 | end: 264 |
| 16238 | instance: |
| 16239 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 16240 | kind: included |
| 16241 | fragment: |
| 16242 | start: 200 |
| 16243 | end: 208 |
| 16244 | job: |
| 16245 | reason: Query will only return series where these labels are present. |
| 16246 | kind: guaranteed |
| 16247 | fragment: |
| 16248 | start: 224 |
| 16249 | end: 264 |
| 16250 | node_status: |
| 16251 | reason: Query will only return series where these labels are present. |
| 16252 | kind: guaranteed |
| 16253 | fragment: |
| 16254 | start: 224 |
| 16255 | end: 264 |
| 16256 | returns: vector |
| 16257 | deadLabels: |
| 16258 | - name: sliver |
| 16259 | reason: This binary operation prevents previously joined label `sliver` from being added to the results. |
| 16260 | labelreason: "" |
| 16261 | usagefragment: |
| 16262 | start: 194 |
| 16263 | end: 195 |
| 16264 | labelfragment: |
| 16265 | start: 194 |
| 16266 | end: 195 |
| 16267 | kind: 1 |
| 16268 | operations: |
| 16269 | - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}' |
| 16270 | op: "" |
| 16271 | joins: |
| 16272 | - addedlabels: [] |
| 16273 | depth: 0 |
| 16274 | ison: true |
| 16275 | matchinglabels: |
| 16276 | - instance |
| 16277 | op: '*' |
| 16278 | src: |
| 16279 | labels: |
| 16280 | __name__: |
| 16281 | reason: Binary operation between two vectors removes metric names. |
| 16282 | kind: excluded |
| 16283 | fragment: |
| 16284 | start: 1 |
| 16285 | end: 193 |
| 16286 | instance: |
| 16287 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 16288 | kind: included |
| 16289 | fragment: |
| 16290 | start: 131 |
| 16291 | end: 139 |
| 16292 | sliver: |
| 16293 | 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. |
| 16294 | kind: included |
| 16295 | fragment: |
| 16296 | start: 154 |
| 16297 | end: 160 |
| 16298 | returns: vector |
| 16299 | deadLabels: |
| 16300 | - name: tier |
| 16301 | reason: This binary operation prevents previously joined label `tier` from being added to the results. |
| 16302 | labelreason: "" |
| 16303 | usagefragment: |
| 16304 | start: 125 |
| 16305 | end: 126 |
| 16306 | labelfragment: |
| 16307 | start: 125 |
| 16308 | end: 126 |
| 16309 | kind: 1 |
| 16310 | - name: animal |
| 16311 | reason: This binary operation prevents previously joined label `animal` from being added to the results. |
| 16312 | labelreason: "" |
| 16313 | usagefragment: |
| 16314 | start: 125 |
| 16315 | end: 126 |
| 16316 | labelfragment: |
| 16317 | start: 125 |
| 16318 | end: 126 |
| 16319 | kind: 1 |
| 16320 | - name: brand |
| 16321 | reason: This binary operation prevents previously joined label `brand` from being added to the results. |
| 16322 | labelreason: "" |
| 16323 | usagefragment: |
| 16324 | start: 125 |
| 16325 | end: 126 |
| 16326 | labelfragment: |
| 16327 | start: 125 |
| 16328 | end: 126 |
| 16329 | kind: 1 |
| 16330 | - name: pop_name |
| 16331 | reason: This binary operation prevents previously joined label `pop_name` from being added to the results. |
| 16332 | labelreason: "" |
| 16333 | usagefragment: |
| 16334 | start: 125 |
| 16335 | end: 126 |
| 16336 | labelfragment: |
| 16337 | start: 125 |
| 16338 | end: 126 |
| 16339 | kind: 1 |
| 16340 | operations: |
| 16341 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 16342 | op: "" |
| 16343 | joins: |
| 16344 | - addedlabels: |
| 16345 | - sliver |
| 16346 | depth: 0 |
| 16347 | ison: true |
| 16348 | matchinglabels: |
| 16349 | - instance |
| 16350 | op: '*' |
| 16351 | src: |
| 16352 | labels: |
| 16353 | __name__: |
| 16354 | reason: Binary operation between two vectors removes metric names. |
| 16355 | kind: excluded |
| 16356 | fragment: |
| 16357 | start: 1 |
| 16358 | end: 124 |
| 16359 | animal: |
| 16360 | 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. |
| 16361 | kind: included |
| 16362 | fragment: |
| 16363 | start: 67 |
| 16364 | end: 73 |
| 16365 | brand: |
| 16366 | 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. |
| 16367 | kind: included |
| 16368 | fragment: |
| 16369 | start: 75 |
| 16370 | end: 80 |
| 16371 | colo_name: |
| 16372 | reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 16373 | kind: included |
| 16374 | fragment: |
| 16375 | start: 38 |
| 16376 | end: 47 |
| 16377 | node_status: |
| 16378 | reason: Query will only return series where these labels are present. |
| 16379 | kind: guaranteed |
| 16380 | fragment: |
| 16381 | start: 92 |
| 16382 | end: 124 |
| 16383 | pop_name: |
| 16384 | 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. |
| 16385 | kind: included |
| 16386 | fragment: |
| 16387 | start: 82 |
| 16388 | end: 90 |
| 16389 | tier: |
| 16390 | 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. |
| 16391 | kind: included |
| 16392 | fragment: |
| 16393 | start: 61 |
| 16394 | end: 65 |
| 16395 | returns: vector |
| 16396 | operations: |
| 16397 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 16398 | op: "" |
| 16399 | joins: |
| 16400 | - addedlabels: |
| 16401 | - tier |
| 16402 | - animal |
| 16403 | - brand |
| 16404 | - pop_name |
| 16405 | depth: 0 |
| 16406 | ison: true |
| 16407 | matchinglabels: |
| 16408 | - colo_name |
| 16409 | op: '*' |
| 16410 | src: |
| 16411 | labels: |
| 16412 | colo_status: |
| 16413 | reason: Query will only return series where these labels are present. |
| 16414 | kind: guaranteed |
| 16415 | fragment: |
| 16416 | start: 1 |
| 16417 | end: 31 |
| 16418 | returns: vector |
| 16419 | operations: |
| 16420 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 16421 | op: "" |
| 16422 | position: |
| 16423 | start: 1 |
| 16424 | end: 31 |
| 16425 | type: selector |
| 16426 | usedLabels: |
| 16427 | - colo_name |
| 16428 | position: |
| 16429 | start: 92 |
| 16430 | end: 124 |
| 16431 | type: selector |
| 16432 | indirect: |
| 16433 | - src: |
| 16434 | labels: |
| 16435 | "": |
| 16436 | reason: This query returns a number value with no labels. |
| 16437 | kind: excluded |
| 16438 | fragment: |
| 16439 | start: 189 |
| 16440 | end: 192 |
| 16441 | returns: scalar |
| 16442 | returnInfo: |
| 16443 | logicalexpr: "" |
| 16444 | valueposition: |
| 16445 | start: 189 |
| 16446 | end: 192 |
| 16447 | returnednumber: 999 |
| 16448 | alwaysreturns: true |
| 16449 | knownreturn: true |
| 16450 | isreturnbool: false |
| 16451 | position: |
| 16452 | start: 189 |
| 16453 | end: 192 |
| 16454 | type: number |
| 16455 | fixedLabels: true |
| 16456 | op: 57385 |
| 16457 | side: 1 |
| 16458 | usedLabels: |
| 16459 | - instance |
| 16460 | condition: |
| 16461 | op: 57385 |
| 16462 | value: 999 |
| 16463 | present: true |
| 16464 | knownValue: true |
| 16465 | position: |
| 16466 | start: 163 |
| 16467 | end: 185 |
| 16468 | type: selector |
| 16469 | usedLabels: |
| 16470 | - instance |
| 16471 | position: |
| 16472 | start: 224 |
| 16473 | end: 264 |
| 16474 | type: selector |
| 16475 | |
| 16476 | --- |
| 16477 | |
| 16478 | [TestLabelsSource/174 - 1] |
| 16479 | expr: |4 |
| 16480 | |
| 16481 | sliver_metadata{node_status="v"} * on (instance) group_right (sliver) |
| 16482 | (metal_services_enabled == 999) * on (colo_name) group_left(tier, animal, brand, pop_name) |
| 16483 | colo_metadata{colo_status="v"} |
| 16484 | output: |
| 16485 | - labels: |
| 16486 | __name__: |
| 16487 | reason: Binary operation between two vectors removes metric names. |
| 16488 | kind: excluded |
| 16489 | fragment: |
| 16490 | start: 1 |
| 16491 | end: 192 |
| 16492 | animal: |
| 16493 | 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. |
| 16494 | kind: included |
| 16495 | fragment: |
| 16496 | start: 137 |
| 16497 | end: 143 |
| 16498 | brand: |
| 16499 | 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. |
| 16500 | kind: included |
| 16501 | fragment: |
| 16502 | start: 145 |
| 16503 | end: 150 |
| 16504 | colo_name: |
| 16505 | reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results. |
| 16506 | kind: included |
| 16507 | fragment: |
| 16508 | start: 109 |
| 16509 | end: 118 |
| 16510 | instance: |
| 16511 | reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results. |
| 16512 | kind: included |
| 16513 | fragment: |
| 16514 | start: 40 |
| 16515 | end: 48 |
| 16516 | pop_name: |
| 16517 | 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. |
| 16518 | kind: included |
| 16519 | fragment: |
| 16520 | start: 152 |
| 16521 | end: 160 |
| 16522 | sliver: |
| 16523 | 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. |
| 16524 | kind: included |
| 16525 | fragment: |
| 16526 | start: 63 |
| 16527 | end: 69 |
| 16528 | tier: |
| 16529 | 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. |
| 16530 | kind: included |
| 16531 | fragment: |
| 16532 | start: 131 |
| 16533 | end: 135 |
| 16534 | returns: vector |
| 16535 | operations: |
| 16536 | - node: '[*parser.VectorSelector] metal_services_enabled' |
| 16537 | op: "" |
| 16538 | joins: |
| 16539 | - addedlabels: |
| 16540 | - sliver |
| 16541 | depth: 0 |
| 16542 | ison: true |
| 16543 | matchinglabels: |
| 16544 | - instance |
| 16545 | op: '*' |
| 16546 | src: |
| 16547 | labels: |
| 16548 | node_status: |
| 16549 | reason: Query will only return series where these labels are present. |
| 16550 | kind: guaranteed |
| 16551 | fragment: |
| 16552 | start: 1 |
| 16553 | end: 33 |
| 16554 | returns: vector |
| 16555 | operations: |
| 16556 | - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}' |
| 16557 | op: "" |
| 16558 | position: |
| 16559 | start: 1 |
| 16560 | end: 33 |
| 16561 | type: selector |
| 16562 | - addedlabels: |
| 16563 | - tier |
| 16564 | - animal |
| 16565 | - brand |
| 16566 | - pop_name |
| 16567 | depth: 0 |
| 16568 | ison: true |
| 16569 | matchinglabels: |
| 16570 | - colo_name |
| 16571 | op: '*' |
| 16572 | src: |
| 16573 | labels: |
| 16574 | colo_status: |
| 16575 | reason: Query will only return series where these labels are present. |
| 16576 | kind: guaranteed |
| 16577 | fragment: |
| 16578 | start: 162 |
| 16579 | end: 192 |
| 16580 | returns: vector |
| 16581 | operations: |
| 16582 | - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}' |
| 16583 | op: "" |
| 16584 | position: |
| 16585 | start: 162 |
| 16586 | end: 192 |
| 16587 | type: selector |
| 16588 | indirect: |
| 16589 | - src: |
| 16590 | labels: |
| 16591 | "": |
| 16592 | reason: This query returns a number value with no labels. |
| 16593 | kind: excluded |
| 16594 | fragment: |
| 16595 | start: 98 |
| 16596 | end: 101 |
| 16597 | returns: scalar |
| 16598 | returnInfo: |
| 16599 | logicalexpr: "" |
| 16600 | valueposition: |
| 16601 | start: 98 |
| 16602 | end: 101 |
| 16603 | returnednumber: 999 |
| 16604 | alwaysreturns: true |
| 16605 | knownreturn: true |
| 16606 | isreturnbool: false |
| 16607 | position: |
| 16608 | start: 98 |
| 16609 | end: 101 |
| 16610 | type: number |
| 16611 | fixedLabels: true |
| 16612 | op: 57385 |
| 16613 | side: 1 |
| 16614 | usedLabels: |
| 16615 | - instance |
| 16616 | - colo_name |
| 16617 | condition: |
| 16618 | op: 57385 |
| 16619 | value: 999 |
| 16620 | present: true |
| 16621 | knownValue: true |
| 16622 | position: |
| 16623 | start: 72 |
| 16624 | end: 94 |
| 16625 | type: selector |
| 16626 | |
| 16627 | --- |
| 16628 | |
| 16629 | [TestLabelsSource/175 - 1] |
| 16630 | expr: |4 |
| 16631 | |
| 16632 | colo_metadat |