cloudflare/pint

Public

mirrored from https://github.com/cloudflare/pintAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.74.5

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

internal/parser/utils/source_test.snap

11733lines · modecode

1[TestLabelsSource/1 - 1]
2expr: "1"
3output:
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 deadinfo: null
12 returns: scalar
13 operations: []
14 joins: []
15 unless: []
16 returninfo:
17 logicalexpr: ""
18 valueposition:
19 start: 0
20 end: 1
21 returnednumber: 1
22 alwaysreturns: true
23 knownreturn: true
24 isreturnbool: false
25 position:
26 start: 0
27 end: 1
28 type: number
29 fixedlabels: true
30 isconditional: false
31
32---
33
34[TestLabelsSource/2 - 1]
35expr: 1 / 5
36output:
37 - labels:
38 "":
39 reason: This query returns a number value with no labels.
40 kind: excluded
41 fragment:
42 start: 0
43 end: 1
44 deadinfo: null
45 returns: scalar
46 operations: []
47 joins: []
48 unless: []
49 returninfo:
50 logicalexpr: 1 / 5
51 valueposition:
52 start: 0
53 end: 1
54 returnednumber: 0.2
55 alwaysreturns: true
56 knownreturn: true
57 isreturnbool: false
58 position:
59 start: 0
60 end: 1
61 type: number
62 fixedlabels: true
63 isconditional: false
64
65---
66
67[TestLabelsSource/3 - 1]
68expr: (2 ^ 5) == bool 5
69output:
70 - labels:
71 "":
72 reason: This query returns a number value with no labels.
73 kind: excluded
74 fragment:
75 start: 1
76 end: 2
77 deadinfo:
78 reason: '`2 ^ 5 == 5` always evaluates to `32 == 5` and uses the `bool` modifier which means it will always return 0'
79 fragment:
80 start: 1
81 end: 2
82 returns: scalar
83 operations: []
84 joins: []
85 unless: []
86 returninfo:
87 logicalexpr: 2 ^ 5
88 valueposition:
89 start: 1
90 end: 2
91 returnednumber: 32
92 alwaysreturns: true
93 knownreturn: true
94 isreturnbool: true
95 position:
96 start: 1
97 end: 2
98 type: number
99 fixedlabels: true
100 isconditional: true
101
102---
103
104[TestLabelsSource/4 - 1]
105expr: (2 ^ 5 + 11) % 5 <= bool 2
106output:
107 - labels:
108 "":
109 reason: This query returns a number value with no labels.
110 kind: excluded
111 fragment:
112 start: 1
113 end: 2
114 deadinfo:
115 reason: '`2 ^ 5 + 11 % 5 <= 2` always evaluates to `3 <= 2` and uses the `bool` modifier which means it will always return 0'
116 fragment:
117 start: 1
118 end: 2
119 returns: scalar
120 operations: []
121 joins: []
122 unless: []
123 returninfo:
124 logicalexpr: 2 ^ 5 + 11 % 5
125 valueposition:
126 start: 1
127 end: 2
128 returnednumber: 3
129 alwaysreturns: true
130 knownreturn: true
131 isreturnbool: true
132 position:
133 start: 1
134 end: 2
135 type: number
136 fixedlabels: true
137 isconditional: true
138
139---
140
141[TestLabelsSource/5 - 1]
142expr: (2 ^ 5 + 11) % 5 >= bool 20
143output:
144 - labels:
145 "":
146 reason: This query returns a number value with no labels.
147 kind: excluded
148 fragment:
149 start: 1
150 end: 2
151 deadinfo:
152 reason: '`2 ^ 5 + 11 % 5 >= 20` always evaluates to `3 >= 20` and uses the `bool` modifier which means it will always return 0'
153 fragment:
154 start: 1
155 end: 2
156 returns: scalar
157 operations: []
158 joins: []
159 unless: []
160 returninfo:
161 logicalexpr: 2 ^ 5 + 11 % 5
162 valueposition:
163 start: 1
164 end: 2
165 returnednumber: 3
166 alwaysreturns: true
167 knownreturn: true
168 isreturnbool: true
169 position:
170 start: 1
171 end: 2
172 type: number
173 fixedlabels: true
174 isconditional: true
175
176---
177
178[TestLabelsSource/6 - 1]
179expr: (2 ^ 5 + 11) % 5 <= bool 3
180output:
181 - labels:
182 "":
183 reason: This query returns a number value with no labels.
184 kind: excluded
185 fragment:
186 start: 1
187 end: 2
188 deadinfo: null
189 returns: scalar
190 operations: []
191 joins: []
192 unless: []
193 returninfo:
194 logicalexpr: 2 ^ 5 + 11 % 5
195 valueposition:
196 start: 1
197 end: 2
198 returnednumber: 3
199 alwaysreturns: true
200 knownreturn: true
201 isreturnbool: true
202 position:
203 start: 1
204 end: 2
205 type: number
206 fixedlabels: true
207 isconditional: true
208
209---
210
211[TestLabelsSource/7 - 1]
212expr: (2 ^ 5 + 11) % 5 < bool 1
213output:
214 - labels:
215 "":
216 reason: This query returns a number value with no labels.
217 kind: excluded
218 fragment:
219 start: 1
220 end: 2
221 deadinfo:
222 reason: '`2 ^ 5 + 11 % 5 < 1` always evaluates to `3 < 1` and uses the `bool` modifier which means it will always return 0'
223 fragment:
224 start: 1
225 end: 2
226 returns: scalar
227 operations: []
228 joins: []
229 unless: []
230 returninfo:
231 logicalexpr: 2 ^ 5 + 11 % 5
232 valueposition:
233 start: 1
234 end: 2
235 returnednumber: 3
236 alwaysreturns: true
237 knownreturn: true
238 isreturnbool: true
239 position:
240 start: 1
241 end: 2
242 type: number
243 fixedlabels: true
244 isconditional: true
245
246---
247
248[TestLabelsSource/8 - 1]
249expr: 20 - 15 < bool 1
250output:
251 - labels:
252 "":
253 reason: This query returns a number value with no labels.
254 kind: excluded
255 fragment:
256 start: 0
257 end: 2
258 deadinfo:
259 reason: '`20 - 15 < 1` always evaluates to `5 < 1` and uses the `bool` modifier which means it will always return 0'
260 fragment:
261 start: 0
262 end: 2
263 returns: scalar
264 operations: []
265 joins: []
266 unless: []
267 returninfo:
268 logicalexpr: 20 - 15
269 valueposition:
270 start: 0
271 end: 2
272 returnednumber: 5
273 alwaysreturns: true
274 knownreturn: true
275 isreturnbool: true
276 position:
277 start: 0
278 end: 2
279 type: number
280 fixedlabels: true
281 isconditional: true
282
283---
284
285[TestLabelsSource/9 - 1]
286expr: 2 * 5
287output:
288 - labels:
289 "":
290 reason: This query returns a number value with no labels.
291 kind: excluded
292 fragment:
293 start: 0
294 end: 1
295 deadinfo: null
296 returns: scalar
297 operations: []
298 joins: []
299 unless: []
300 returninfo:
301 logicalexpr: 2 * 5
302 valueposition:
303 start: 0
304 end: 1
305 returnednumber: 10
306 alwaysreturns: true
307 knownreturn: true
308 isreturnbool: false
309 position:
310 start: 0
311 end: 1
312 type: number
313 fixedlabels: true
314 isconditional: false
315
316---
317
318[TestLabelsSource/10 - 1]
319expr: (foo or bar) * 5
320output:
321 - labels: {}
322 deadinfo: null
323 returns: vector
324 operations:
325 - node: '[*parser.VectorSelector] foo'
326 op: ""
327 joins: []
328 unless: []
329 returninfo:
330 logicalexpr: ""
331 valueposition:
332 start: 0
333 end: 0
334 returnednumber: 0
335 alwaysreturns: false
336 knownreturn: false
337 isreturnbool: false
338 position:
339 start: 1
340 end: 4
341 type: selector
342 fixedlabels: false
343 isconditional: false
344 - labels: {}
345 deadinfo: null
346 returns: vector
347 operations:
348 - node: '[*parser.VectorSelector] bar'
349 op: ""
350 joins: []
351 unless: []
352 returninfo:
353 logicalexpr: ""
354 valueposition:
355 start: 0
356 end: 0
357 returnednumber: 0
358 alwaysreturns: false
359 knownreturn: false
360 isreturnbool: false
361 position:
362 start: 8
363 end: 11
364 type: selector
365 fixedlabels: false
366 isconditional: false
367
368---
369
370[TestLabelsSource/11 - 1]
371expr: (foo or vector(2)) * 5
372output:
373 - labels: {}
374 deadinfo: null
375 returns: vector
376 operations:
377 - node: '[*parser.VectorSelector] foo'
378 op: ""
379 joins: []
380 unless: []
381 returninfo:
382 logicalexpr: ""
383 valueposition:
384 start: 0
385 end: 0
386 returnednumber: 0
387 alwaysreturns: false
388 knownreturn: false
389 isreturnbool: false
390 position:
391 start: 1
392 end: 4
393 type: selector
394 fixedlabels: false
395 isconditional: false
396 - labels:
397 "":
398 reason: Calling `vector()` will return a vector value with no labels.
399 kind: excluded
400 fragment:
401 start: 8
402 end: 14
403 deadinfo: null
404 returns: vector
405 operations:
406 - node: '[*parser.Call] vector(2)'
407 op: vector
408 joins: []
409 unless: []
410 returninfo:
411 logicalexpr: vector(2) * 5
412 valueposition:
413 start: 8
414 end: 17
415 returnednumber: 10
416 alwaysreturns: true
417 knownreturn: true
418 isreturnbool: false
419 position:
420 start: 8
421 end: 17
422 type: function
423 fixedlabels: true
424 isconditional: false
425
426---
427
428[TestLabelsSource/12 - 1]
429expr: (foo or vector(5)) * (vector(2) or bar)
430output:
431 - labels: {}
432 deadinfo: null
433 returns: vector
434 operations:
435 - node: '[*parser.VectorSelector] foo'
436 op: ""
437 joins:
438 - "on": []
439 ignoring: []
440 addedlabels: []
441 src:
442 labels:
443 "":
444 reason: Calling `vector()` will return a vector value with no labels.
445 kind: excluded
446 fragment:
447 start: 22
448 end: 28
449 deadinfo: null
450 returns: vector
451 operations:
452 - node: '[*parser.Call] vector(2)'
453 op: vector
454 joins: []
455 unless: []
456 returninfo:
457 logicalexpr: ""
458 valueposition:
459 start: 22
460 end: 31
461 returnednumber: 2
462 alwaysreturns: true
463 knownreturn: true
464 isreturnbool: false
465 position:
466 start: 22
467 end: 31
468 type: function
469 fixedlabels: true
470 isconditional: false
471 op: 57395
472 depth: 0
473 - "on": []
474 ignoring: []
475 addedlabels: []
476 src:
477 labels: {}
478 deadinfo:
479 reason: The left hand side always returs something and so the right hand side is never used.
480 fragment:
481 start: 35
482 end: 38
483 returns: vector
484 operations:
485 - node: '[*parser.VectorSelector] bar'
486 op: ""
487 joins: []
488 unless: []
489 returninfo:
490 logicalexpr: ""
491 valueposition:
492 start: 0
493 end: 0
494 returnednumber: 0
495 alwaysreturns: false
496 knownreturn: false
497 isreturnbool: false
498 position:
499 start: 35
500 end: 38
501 type: selector
502 fixedlabels: false
503 isconditional: false
504 op: 57395
505 depth: 0
506 unless: []
507 returninfo:
508 logicalexpr: ""
509 valueposition:
510 start: 0
511 end: 0
512 returnednumber: 0
513 alwaysreturns: false
514 knownreturn: false
515 isreturnbool: false
516 position:
517 start: 1
518 end: 4
519 type: selector
520 fixedlabels: false
521 isconditional: false
522 - labels:
523 "":
524 reason: Calling `vector()` will return a vector value with no labels.
525 kind: excluded
526 fragment:
527 start: 8
528 end: 14
529 deadinfo: null
530 returns: vector
531 operations:
532 - node: '[*parser.Call] vector(5)'
533 op: vector
534 joins:
535 - "on": []
536 ignoring: []
537 addedlabels: []
538 src:
539 labels:
540 "":
541 reason: Calling `vector()` will return a vector value with no labels.
542 kind: excluded
543 fragment:
544 start: 22
545 end: 28
546 deadinfo: null
547 returns: vector
548 operations:
549 - node: '[*parser.Call] vector(2)'
550 op: vector
551 joins: []
552 unless: []
553 returninfo:
554 logicalexpr: ""
555 valueposition:
556 start: 22
557 end: 31
558 returnednumber: 2
559 alwaysreturns: true
560 knownreturn: true
561 isreturnbool: false
562 position:
563 start: 22
564 end: 31
565 type: function
566 fixedlabels: true
567 isconditional: false
568 op: 57395
569 depth: 0
570 - "on": []
571 ignoring: []
572 addedlabels: []
573 src:
574 labels: {}
575 deadinfo:
576 reason: The left hand side always returs something and so the right hand side is never used.
577 fragment:
578 start: 35
579 end: 38
580 returns: vector
581 operations:
582 - node: '[*parser.VectorSelector] bar'
583 op: ""
584 joins: []
585 unless: []
586 returninfo:
587 logicalexpr: ""
588 valueposition:
589 start: 0
590 end: 0
591 returnednumber: 0
592 alwaysreturns: false
593 knownreturn: false
594 isreturnbool: false
595 position:
596 start: 35
597 end: 38
598 type: selector
599 fixedlabels: false
600 isconditional: false
601 op: 57395
602 depth: 0
603 unless: []
604 returninfo:
605 logicalexpr: vector(5) * vector(2)
606 valueposition:
607 start: 8
608 end: 17
609 returnednumber: 10
610 alwaysreturns: true
611 knownreturn: true
612 isreturnbool: false
613 position:
614 start: 8
615 end: 17
616 type: function
617 fixedlabels: true
618 isconditional: false
619
620---
621
622[TestLabelsSource/13 - 1]
623expr: 1 > bool 0
624output:
625 - labels:
626 "":
627 reason: This query returns a number value with no labels.
628 kind: excluded
629 fragment:
630 start: 0
631 end: 1
632 deadinfo: null
633 returns: scalar
634 operations: []
635 joins: []
636 unless: []
637 returninfo:
638 logicalexpr: ""
639 valueposition:
640 start: 0
641 end: 1
642 returnednumber: 1
643 alwaysreturns: true
644 knownreturn: true
645 isreturnbool: true
646 position:
647 start: 0
648 end: 1
649 type: number
650 fixedlabels: true
651 isconditional: true
652
653---
654
655[TestLabelsSource/14 - 1]
656expr: 20 > bool 10
657output:
658 - labels:
659 "":
660 reason: This query returns a number value with no labels.
661 kind: excluded
662 fragment:
663 start: 0
664 end: 2
665 deadinfo: null
666 returns: scalar
667 operations: []
668 joins: []
669 unless: []
670 returninfo:
671 logicalexpr: ""
672 valueposition:
673 start: 0
674 end: 2
675 returnednumber: 20
676 alwaysreturns: true
677 knownreturn: true
678 isreturnbool: true
679 position:
680 start: 0
681 end: 2
682 type: number
683 fixedlabels: true
684 isconditional: true
685
686---
687
688[TestLabelsSource/15 - 1]
689expr: '"test"'
690output:
691 - labels:
692 "":
693 reason: This query returns a string value with no labels.
694 kind: excluded
695 fragment:
696 start: 0
697 end: 6
698 deadinfo: null
699 returns: string
700 operations: []
701 joins: []
702 unless: []
703 returninfo:
704 logicalexpr: ""
705 valueposition:
706 start: 0
707 end: 0
708 returnednumber: 0
709 alwaysreturns: true
710 knownreturn: false
711 isreturnbool: false
712 position:
713 start: 0
714 end: 6
715 type: string
716 fixedlabels: true
717 isconditional: false
718
719---
720
721[TestLabelsSource/16 - 1]
722expr: foo
723output:
724 - labels: {}
725 deadinfo: null
726 returns: vector
727 operations:
728 - node: '[*parser.VectorSelector] foo'
729 op: ""
730 joins: []
731 unless: []
732 returninfo:
733 logicalexpr: ""
734 valueposition:
735 start: 0
736 end: 0
737 returnednumber: 0
738 alwaysreturns: false
739 knownreturn: false
740 isreturnbool: false
741 position:
742 start: 0
743 end: 3
744 type: selector
745 fixedlabels: false
746 isconditional: false
747
748---
749
750[TestLabelsSource/17 - 1]
751expr: (foo > 1) > bool 1
752output:
753 - labels: {}
754 deadinfo: null
755 returns: vector
756 operations:
757 - node: '[*parser.VectorSelector] foo'
758 op: ""
759 joins: []
760 unless: []
761 returninfo:
762 logicalexpr: ""
763 valueposition:
764 start: 0
765 end: 0
766 returnednumber: 0
767 alwaysreturns: false
768 knownreturn: false
769 isreturnbool: false
770 position:
771 start: 1
772 end: 4
773 type: selector
774 fixedlabels: false
775 isconditional: true
776
777---
778
779[TestLabelsSource/18 - 1]
780expr: foo > bool 5
781output:
782 - labels: {}
783 deadinfo: null
784 returns: vector
785 operations:
786 - node: '[*parser.VectorSelector] foo'
787 op: ""
788 joins: []
789 unless: []
790 returninfo:
791 logicalexpr: ""
792 valueposition:
793 start: 0
794 end: 0
795 returnednumber: 0
796 alwaysreturns: false
797 knownreturn: false
798 isreturnbool: true
799 position:
800 start: 0
801 end: 3
802 type: selector
803 fixedlabels: false
804 isconditional: true
805
806---
807
808[TestLabelsSource/19 - 1]
809expr: foo > bool 5 == 1
810output:
811 - labels: {}
812 deadinfo: null
813 returns: vector
814 operations:
815 - node: '[*parser.VectorSelector] foo'
816 op: ""
817 joins: []
818 unless: []
819 returninfo:
820 logicalexpr: ""
821 valueposition:
822 start: 0
823 end: 0
824 returnednumber: 0
825 alwaysreturns: false
826 knownreturn: false
827 isreturnbool: false
828 position:
829 start: 0
830 end: 3
831 type: selector
832 fixedlabels: false
833 isconditional: true
834
835---
836
837[TestLabelsSource/20 - 1]
838expr: foo > bool bar
839output:
840 - labels: {}
841 deadinfo: null
842 returns: vector
843 operations:
844 - node: '[*parser.VectorSelector] foo'
845 op: ""
846 joins:
847 - "on": []
848 ignoring: []
849 addedlabels: []
850 src:
851 labels: {}
852 deadinfo: null
853 returns: vector
854 operations:
855 - node: '[*parser.VectorSelector] bar'
856 op: ""
857 joins: []
858 unless: []
859 returninfo:
860 logicalexpr: ""
861 valueposition:
862 start: 0
863 end: 0
864 returnednumber: 0
865 alwaysreturns: false
866 knownreturn: false
867 isreturnbool: false
868 position:
869 start: 11
870 end: 14
871 type: selector
872 fixedlabels: false
873 isconditional: false
874 op: 57388
875 depth: 0
876 unless: []
877 returninfo:
878 logicalexpr: ""
879 valueposition:
880 start: 0
881 end: 0
882 returnednumber: 0
883 alwaysreturns: false
884 knownreturn: false
885 isreturnbool: true
886 position:
887 start: 0
888 end: 3
889 type: selector
890 fixedlabels: false
891 isconditional: true
892
893---
894
895[TestLabelsSource/21 - 1]
896expr: (foo > bool bar) == 0
897output:
898 - labels: {}
899 deadinfo: null
900 returns: vector
901 operations:
902 - node: '[*parser.VectorSelector] foo'
903 op: ""
904 joins:
905 - "on": []
906 ignoring: []
907 addedlabels: []
908 src:
909 labels: {}
910 deadinfo: null
911 returns: vector
912 operations:
913 - node: '[*parser.VectorSelector] bar'
914 op: ""
915 joins: []
916 unless: []
917 returninfo:
918 logicalexpr: ""
919 valueposition:
920 start: 0
921 end: 0
922 returnednumber: 0
923 alwaysreturns: false
924 knownreturn: false
925 isreturnbool: false
926 position:
927 start: 12
928 end: 15
929 type: selector
930 fixedlabels: false
931 isconditional: false
932 op: 57388
933 depth: 0
934 unless: []
935 returninfo:
936 logicalexpr: ""
937 valueposition:
938 start: 0
939 end: 0
940 returnednumber: 0
941 alwaysreturns: false
942 knownreturn: false
943 isreturnbool: false
944 position:
945 start: 1
946 end: 4
947 type: selector
948 fixedlabels: false
949 isconditional: true
950
951---
952
953[TestLabelsSource/22 - 1]
954expr: foo > bool on(instance) bar
955output:
956 - labels:
957 "":
958 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
959 kind: excluded
960 fragment:
961 start: 11
962 end: 13
963 instance:
964 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
965 kind: included
966 fragment:
967 start: 11
968 end: 13
969 deadinfo: null
970 returns: vector
971 operations:
972 - node: '[*parser.VectorSelector] foo'
973 op: ""
974 joins:
975 - "on":
976 - instance
977 ignoring: []
978 addedlabels: []
979 src:
980 labels: {}
981 deadinfo: null
982 returns: vector
983 operations:
984 - node: '[*parser.VectorSelector] bar'
985 op: ""
986 joins: []
987 unless: []
988 returninfo:
989 logicalexpr: ""
990 valueposition:
991 start: 0
992 end: 0
993 returnednumber: 0
994 alwaysreturns: false
995 knownreturn: false
996 isreturnbool: false
997 position:
998 start: 24
999 end: 27
1000 type: selector
1001 fixedlabels: false
1002 isconditional: false
1003 op: 57388
1004 depth: 0
1005 unless: []
1006 returninfo:
1007 logicalexpr: ""
1008 valueposition:
1009 start: 0
1010 end: 0
1011 returnednumber: 0
1012 alwaysreturns: false
1013 knownreturn: false
1014 isreturnbool: true
1015 position:
1016 start: 0
1017 end: 3
1018 type: selector
1019 fixedlabels: true
1020 isconditional: true
1021
1022---
1023
1024[TestLabelsSource/23 - 1]
1025expr: (foo > bool on(instance) bar) == 1
1026output:
1027 - labels:
1028 "":
1029 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
1030 kind: excluded
1031 fragment:
1032 start: 12
1033 end: 14
1034 instance:
1035 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
1036 kind: included
1037 fragment:
1038 start: 12
1039 end: 14
1040 deadinfo: null
1041 returns: vector
1042 operations:
1043 - node: '[*parser.VectorSelector] foo'
1044 op: ""
1045 joins:
1046 - "on":
1047 - instance
1048 ignoring: []
1049 addedlabels: []
1050 src:
1051 labels: {}
1052 deadinfo: null
1053 returns: vector
1054 operations:
1055 - node: '[*parser.VectorSelector] bar'
1056 op: ""
1057 joins: []
1058 unless: []
1059 returninfo:
1060 logicalexpr: ""
1061 valueposition:
1062 start: 0
1063 end: 0
1064 returnednumber: 0
1065 alwaysreturns: false
1066 knownreturn: false
1067 isreturnbool: false
1068 position:
1069 start: 25
1070 end: 28
1071 type: selector
1072 fixedlabels: false
1073 isconditional: false
1074 op: 57388
1075 depth: 0
1076 unless: []
1077 returninfo:
1078 logicalexpr: ""
1079 valueposition:
1080 start: 0
1081 end: 0
1082 returnednumber: 0
1083 alwaysreturns: false
1084 knownreturn: false
1085 isreturnbool: false
1086 position:
1087 start: 1
1088 end: 4
1089 type: selector
1090 fixedlabels: true
1091 isconditional: true
1092
1093---
1094
1095[TestLabelsSource/24 - 1]
1096expr: foo > bool on(instance) group_left(version) bar
1097output:
1098 - labels:
1099 instance:
1100 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
1101 kind: included
1102 fragment:
1103 start: 11
1104 end: 13
1105 version:
1106 reason: Query is using many-to-one vector matching with `group_left(version)`, all labels included inside `group_left(...)` will be include on the results.
1107 kind: included
1108 fragment:
1109 start: 24
1110 end: 34
1111 deadinfo: null
1112 returns: vector
1113 operations:
1114 - node: '[*parser.VectorSelector] foo'
1115 op: ""
1116 joins:
1117 - "on":
1118 - instance
1119 ignoring: []
1120 addedlabels:
1121 - version
1122 src:
1123 labels: {}
1124 deadinfo: null
1125 returns: vector
1126 operations:
1127 - node: '[*parser.VectorSelector] bar'
1128 op: ""
1129 joins: []
1130 unless: []
1131 returninfo:
1132 logicalexpr: ""
1133 valueposition:
1134 start: 0
1135 end: 0
1136 returnednumber: 0
1137 alwaysreturns: false
1138 knownreturn: false
1139 isreturnbool: false
1140 position:
1141 start: 44
1142 end: 47
1143 type: selector
1144 fixedlabels: false
1145 isconditional: false
1146 op: 57388
1147 depth: 0
1148 unless: []
1149 returninfo:
1150 logicalexpr: ""
1151 valueposition:
1152 start: 0
1153 end: 0
1154 returnednumber: 0
1155 alwaysreturns: false
1156 knownreturn: false
1157 isreturnbool: true
1158 position:
1159 start: 0
1160 end: 3
1161 type: selector
1162 fixedlabels: false
1163 isconditional: true
1164
1165---
1166
1167[TestLabelsSource/25 - 1]
1168expr: bar > bool on(instance) group_right(version) foo
1169output:
1170 - labels:
1171 instance:
1172 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
1173 kind: included
1174 fragment:
1175 start: 11
1176 end: 13
1177 version:
1178 reason: Query is using one-to-many vector matching with `group_right(version)`, all labels included inside `group_right(...)` will be include on the results.
1179 kind: included
1180 fragment:
1181 start: 24
1182 end: 35
1183 deadinfo: null
1184 returns: vector
1185 operations:
1186 - node: '[*parser.VectorSelector] foo'
1187 op: ""
1188 joins:
1189 - "on":
1190 - instance
1191 ignoring: []
1192 addedlabels:
1193 - version
1194 src:
1195 labels: {}
1196 deadinfo: null
1197 returns: vector
1198 operations:
1199 - node: '[*parser.VectorSelector] bar'
1200 op: ""
1201 joins: []
1202 unless: []
1203 returninfo:
1204 logicalexpr: ""
1205 valueposition:
1206 start: 0
1207 end: 0
1208 returnednumber: 0
1209 alwaysreturns: false
1210 knownreturn: false
1211 isreturnbool: false
1212 position:
1213 start: 0
1214 end: 3
1215 type: selector
1216 fixedlabels: false
1217 isconditional: false
1218 op: 57388
1219 depth: 0
1220 unless: []
1221 returninfo:
1222 logicalexpr: ""
1223 valueposition:
1224 start: 0
1225 end: 0
1226 returnednumber: 0
1227 alwaysreturns: false
1228 knownreturn: false
1229 isreturnbool: true
1230 position:
1231 start: 45
1232 end: 48
1233 type: selector
1234 fixedlabels: false
1235 isconditional: true
1236
1237---
1238
1239[TestLabelsSource/26 - 1]
1240expr: foo and bar > bool 0
1241output:
1242 - labels: {}
1243 deadinfo: null
1244 returns: vector
1245 operations:
1246 - node: '[*parser.VectorSelector] foo'
1247 op: ""
1248 joins:
1249 - "on": []
1250 ignoring: []
1251 addedlabels: []
1252 src:
1253 labels: {}
1254 deadinfo: null
1255 returns: vector
1256 operations:
1257 - node: '[*parser.VectorSelector] bar'
1258 op: ""
1259 joins: []
1260 unless: []
1261 returninfo:
1262 logicalexpr: ""
1263 valueposition:
1264 start: 0
1265 end: 0
1266 returnednumber: 0
1267 alwaysreturns: false
1268 knownreturn: false
1269 isreturnbool: true
1270 position:
1271 start: 8
1272 end: 11
1273 type: selector
1274 fixedlabels: false
1275 isconditional: true
1276 op: 57389
1277 depth: 0
1278 unless: []
1279 returninfo:
1280 logicalexpr: ""
1281 valueposition:
1282 start: 0
1283 end: 0
1284 returnednumber: 0
1285 alwaysreturns: false
1286 knownreturn: false
1287 isreturnbool: false
1288 position:
1289 start: 0
1290 end: 3
1291 type: selector
1292 fixedlabels: false
1293 isconditional: true
1294
1295---
1296
1297[TestLabelsSource/27 - 1]
1298expr: foo offset 5m
1299output:
1300 - labels: {}
1301 deadinfo: null
1302 returns: vector
1303 operations:
1304 - node: '[*parser.VectorSelector] foo offset 5m'
1305 op: ""
1306 joins: []
1307 unless: []
1308 returninfo:
1309 logicalexpr: ""
1310 valueposition:
1311 start: 0
1312 end: 0
1313 returnednumber: 0
1314 alwaysreturns: false
1315 knownreturn: false
1316 isreturnbool: false
1317 position:
1318 start: 0
1319 end: 13
1320 type: selector
1321 fixedlabels: false
1322 isconditional: false
1323
1324---
1325
1326[TestLabelsSource/28 - 1]
1327expr: foo{job="bar"}
1328output:
1329 - labels:
1330 job:
1331 reason: Query will only return series where these labels are present.
1332 kind: guaranteed
1333 fragment:
1334 start: 0
1335 end: 14
1336 deadinfo: null
1337 returns: vector
1338 operations:
1339 - node: '[*parser.VectorSelector] foo{job="bar"}'
1340 op: ""
1341 joins: []
1342 unless: []
1343 returninfo:
1344 logicalexpr: ""
1345 valueposition:
1346 start: 0
1347 end: 0
1348 returnednumber: 0
1349 alwaysreturns: false
1350 knownreturn: false
1351 isreturnbool: false
1352 position:
1353 start: 0
1354 end: 14
1355 type: selector
1356 fixedlabels: false
1357 isconditional: false
1358
1359---
1360
1361[TestLabelsSource/29 - 1]
1362expr: foo{job=""}
1363output:
1364 - labels:
1365 job:
1366 reason: Query uses `{job=""}` selector which will filter out any time series with the `job` label set.
1367 kind: excluded
1368 fragment:
1369 start: 0
1370 end: 11
1371 deadinfo: null
1372 returns: vector
1373 operations:
1374 - node: '[*parser.VectorSelector] foo{job=""}'
1375 op: ""
1376 joins: []
1377 unless: []
1378 returninfo:
1379 logicalexpr: ""
1380 valueposition:
1381 start: 0
1382 end: 0
1383 returnednumber: 0
1384 alwaysreturns: false
1385 knownreturn: false
1386 isreturnbool: false
1387 position:
1388 start: 0
1389 end: 11
1390 type: selector
1391 fixedlabels: false
1392 isconditional: false
1393
1394---
1395
1396[TestLabelsSource/30 - 1]
1397expr: foo{job="bar"} or bar{job="foo"}
1398output:
1399 - labels:
1400 job:
1401 reason: Query will only return series where these labels are present.
1402 kind: guaranteed
1403 fragment:
1404 start: 0
1405 end: 14
1406 deadinfo: null
1407 returns: vector
1408 operations:
1409 - node: '[*parser.VectorSelector] foo{job="bar"}'
1410 op: ""
1411 joins: []
1412 unless: []
1413 returninfo:
1414 logicalexpr: ""
1415 valueposition:
1416 start: 0
1417 end: 0
1418 returnednumber: 0
1419 alwaysreturns: false
1420 knownreturn: false
1421 isreturnbool: false
1422 position:
1423 start: 0
1424 end: 14
1425 type: selector
1426 fixedlabels: false
1427 isconditional: false
1428 - labels:
1429 job:
1430 reason: Query will only return series where these labels are present.
1431 kind: guaranteed
1432 fragment:
1433 start: 18
1434 end: 32
1435 deadinfo: null
1436 returns: vector
1437 operations:
1438 - node: '[*parser.VectorSelector] bar{job="foo"}'
1439 op: ""
1440 joins: []
1441 unless: []
1442 returninfo:
1443 logicalexpr: ""
1444 valueposition:
1445 start: 0
1446 end: 0
1447 returnednumber: 0
1448 alwaysreturns: false
1449 knownreturn: false
1450 isreturnbool: false
1451 position:
1452 start: 18
1453 end: 32
1454 type: selector
1455 fixedlabels: false
1456 isconditional: false
1457
1458---
1459
1460[TestLabelsSource/31 - 1]
1461expr: foo{a="bar"} or bar{b="foo"}
1462output:
1463 - labels:
1464 a:
1465 reason: Query will only return series where these labels are present.
1466 kind: guaranteed
1467 fragment:
1468 start: 0
1469 end: 12
1470 deadinfo: null
1471 returns: vector
1472 operations:
1473 - node: '[*parser.VectorSelector] foo{a="bar"}'
1474 op: ""
1475 joins: []
1476 unless: []
1477 returninfo:
1478 logicalexpr: ""
1479 valueposition:
1480 start: 0
1481 end: 0
1482 returnednumber: 0
1483 alwaysreturns: false
1484 knownreturn: false
1485 isreturnbool: false
1486 position:
1487 start: 0
1488 end: 12
1489 type: selector
1490 fixedlabels: false
1491 isconditional: false
1492 - labels:
1493 b:
1494 reason: Query will only return series where these labels are present.
1495 kind: guaranteed
1496 fragment:
1497 start: 16
1498 end: 28
1499 deadinfo: null
1500 returns: vector
1501 operations:
1502 - node: '[*parser.VectorSelector] bar{b="foo"}'
1503 op: ""
1504 joins: []
1505 unless: []
1506 returninfo:
1507 logicalexpr: ""
1508 valueposition:
1509 start: 0
1510 end: 0
1511 returnednumber: 0
1512 alwaysreturns: false
1513 knownreturn: false
1514 isreturnbool: false
1515 position:
1516 start: 16
1517 end: 28
1518 type: selector
1519 fixedlabels: false
1520 isconditional: false
1521
1522---
1523
1524[TestLabelsSource/32 - 1]
1525expr: foo[5m]
1526output:
1527 - labels: {}
1528 deadinfo: null
1529 returns: matrix
1530 operations:
1531 - node: '[*parser.VectorSelector] foo'
1532 op: ""
1533 joins: []
1534 unless: []
1535 returninfo:
1536 logicalexpr: ""
1537 valueposition:
1538 start: 0
1539 end: 0
1540 returnednumber: 0
1541 alwaysreturns: false
1542 knownreturn: false
1543 isreturnbool: false
1544 position:
1545 start: 0
1546 end: 3
1547 type: selector
1548 fixedlabels: false
1549 isconditional: false
1550
1551---
1552
1553[TestLabelsSource/33 - 1]
1554expr: prometheus_build_info[2m:1m]
1555output:
1556 - labels: {}
1557 deadinfo: null
1558 returns: vector
1559 operations:
1560 - node: '[*parser.VectorSelector] prometheus_build_info'
1561 op: ""
1562 joins: []
1563 unless: []
1564 returninfo:
1565 logicalexpr: ""
1566 valueposition:
1567 start: 0
1568 end: 0
1569 returnednumber: 0
1570 alwaysreturns: false
1571 knownreturn: false
1572 isreturnbool: false
1573 position:
1574 start: 0
1575 end: 21
1576 type: selector
1577 fixedlabels: false
1578 isconditional: false
1579
1580---
1581
1582[TestLabelsSource/34 - 1]
1583expr: deriv(rate(distance_covered_meters_total[1m])[5m:1m])
1584output:
1585 - labels: {}
1586 deadinfo: null
1587 returns: vector
1588 operations:
1589 - node: '[*parser.VectorSelector] distance_covered_meters_total'
1590 op: ""
1591 - node: '[*parser.Call] rate(distance_covered_meters_total[1m])'
1592 op: rate
1593 - node: '[*parser.Call] deriv(rate(distance_covered_meters_total[1m])[5m:1m])'
1594 op: deriv
1595 joins: []
1596 unless: []
1597 returninfo:
1598 logicalexpr: ""
1599 valueposition:
1600 start: 0
1601 end: 0
1602 returnednumber: 0
1603 alwaysreturns: false
1604 knownreturn: false
1605 isreturnbool: false
1606 position:
1607 start: 6
1608 end: 52
1609 type: function
1610 fixedlabels: false
1611 isconditional: false
1612
1613---
1614
1615[TestLabelsSource/35 - 1]
1616expr: foo - 1
1617output:
1618 - labels: {}
1619 deadinfo: null
1620 returns: vector
1621 operations:
1622 - node: '[*parser.VectorSelector] foo'
1623 op: ""
1624 joins: []
1625 unless: []
1626 returninfo:
1627 logicalexpr: ""
1628 valueposition:
1629 start: 0
1630 end: 0
1631 returnednumber: 0
1632 alwaysreturns: false
1633 knownreturn: false
1634 isreturnbool: false
1635 position:
1636 start: 0
1637 end: 3
1638 type: selector
1639 fixedlabels: false
1640 isconditional: false
1641
1642---
1643
1644[TestLabelsSource/36 - 1]
1645expr: foo / 5
1646output:
1647 - labels: {}
1648 deadinfo: null
1649 returns: vector
1650 operations:
1651 - node: '[*parser.VectorSelector] foo'
1652 op: ""
1653 joins: []
1654 unless: []
1655 returninfo:
1656 logicalexpr: ""
1657 valueposition:
1658 start: 0
1659 end: 0
1660 returnednumber: 0
1661 alwaysreturns: false
1662 knownreturn: false
1663 isreturnbool: false
1664 position:
1665 start: 0
1666 end: 3
1667 type: selector
1668 fixedlabels: false
1669 isconditional: false
1670
1671---
1672
1673[TestLabelsSource/37 - 1]
1674expr: -foo
1675output:
1676 - labels: {}
1677 deadinfo: null
1678 returns: vector
1679 operations:
1680 - node: '[*parser.VectorSelector] foo'
1681 op: ""
1682 joins: []
1683 unless: []
1684 returninfo:
1685 logicalexpr: ""
1686 valueposition:
1687 start: 0
1688 end: 0
1689 returnednumber: 0
1690 alwaysreturns: false
1691 knownreturn: false
1692 isreturnbool: false
1693 position:
1694 start: 1
1695 end: 4
1696 type: selector
1697 fixedlabels: false
1698 isconditional: false
1699
1700---
1701
1702[TestLabelsSource/38 - 1]
1703expr: sum(foo{job="myjob"})
1704output:
1705 - labels:
1706 "":
1707 reason: Query is using aggregation that removes all labels.
1708 kind: excluded
1709 fragment:
1710 start: 0
1711 end: 3
1712 __name__:
1713 reason: Aggregation removes metric name.
1714 kind: excluded
1715 fragment:
1716 start: 0
1717 end: 21
1718 job:
1719 reason: Query is using aggregation that removes all labels.
1720 kind: excluded
1721 fragment:
1722 start: 0
1723 end: 3
1724 deadinfo: null
1725 returns: vector
1726 operations:
1727 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1728 op: ""
1729 - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})'
1730 op: sum
1731 joins: []
1732 unless: []
1733 returninfo:
1734 logicalexpr: ""
1735 valueposition:
1736 start: 0
1737 end: 0
1738 returnednumber: 0
1739 alwaysreturns: false
1740 knownreturn: false
1741 isreturnbool: false
1742 position:
1743 start: 4
1744 end: 20
1745 type: aggregation
1746 fixedlabels: true
1747 isconditional: false
1748
1749---
1750
1751[TestLabelsSource/39 - 1]
1752expr: sum(count(foo{job="myjob"}) by(instance))
1753output:
1754 - labels:
1755 "":
1756 reason: Query is using aggregation that removes all labels.
1757 kind: excluded
1758 fragment:
1759 start: 0
1760 end: 3
1761 __name__:
1762 reason: Aggregation removes metric name.
1763 kind: excluded
1764 fragment:
1765 start: 0
1766 end: 41
1767 instance:
1768 reason: Query is using aggregation that removes all labels.
1769 kind: excluded
1770 fragment:
1771 start: 0
1772 end: 3
1773 job:
1774 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
1775 kind: excluded
1776 fragment:
1777 start: 28
1778 end: 30
1779 deadinfo: null
1780 returns: vector
1781 operations:
1782 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1783 op: ""
1784 - node: '[*parser.AggregateExpr] count by (instance) (foo{job="myjob"})'
1785 op: count
1786 - node: '[*parser.AggregateExpr] sum(count by (instance) (foo{job="myjob"}))'
1787 op: sum
1788 joins: []
1789 unless: []
1790 returninfo:
1791 logicalexpr: ""
1792 valueposition:
1793 start: 0
1794 end: 0
1795 returnednumber: 0
1796 alwaysreturns: false
1797 knownreturn: false
1798 isreturnbool: false
1799 position:
1800 start: 10
1801 end: 26
1802 type: aggregation
1803 fixedlabels: true
1804 isconditional: false
1805
1806---
1807
1808[TestLabelsSource/40 - 1]
1809expr: sum(foo{job="myjob"}) > 20
1810output:
1811 - labels:
1812 "":
1813 reason: Query is using aggregation that removes all labels.
1814 kind: excluded
1815 fragment:
1816 start: 0
1817 end: 3
1818 __name__:
1819 reason: Aggregation removes metric name.
1820 kind: excluded
1821 fragment:
1822 start: 0
1823 end: 21
1824 job:
1825 reason: Query is using aggregation that removes all labels.
1826 kind: excluded
1827 fragment:
1828 start: 0
1829 end: 3
1830 deadinfo: null
1831 returns: vector
1832 operations:
1833 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1834 op: ""
1835 - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})'
1836 op: sum
1837 joins: []
1838 unless: []
1839 returninfo:
1840 logicalexpr: ""
1841 valueposition:
1842 start: 0
1843 end: 0
1844 returnednumber: 0
1845 alwaysreturns: false
1846 knownreturn: false
1847 isreturnbool: false
1848 position:
1849 start: 4
1850 end: 20
1851 type: aggregation
1852 fixedlabels: true
1853 isconditional: true
1854
1855---
1856
1857[TestLabelsSource/41 - 1]
1858expr: sum(foo{job="myjob"}) without(job)
1859output:
1860 - labels:
1861 __name__:
1862 reason: Aggregation removes metric name.
1863 kind: excluded
1864 fragment:
1865 start: 0
1866 end: 34
1867 job:
1868 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
1869 kind: excluded
1870 fragment:
1871 start: 22
1872 end: 29
1873 deadinfo: null
1874 returns: vector
1875 operations:
1876 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1877 op: ""
1878 - node: '[*parser.AggregateExpr] sum without (job) (foo{job="myjob"})'
1879 op: sum
1880 joins: []
1881 unless: []
1882 returninfo:
1883 logicalexpr: ""
1884 valueposition:
1885 start: 0
1886 end: 0
1887 returnednumber: 0
1888 alwaysreturns: false
1889 knownreturn: false
1890 isreturnbool: false
1891 position:
1892 start: 4
1893 end: 20
1894 type: aggregation
1895 fixedlabels: false
1896 isconditional: false
1897
1898---
1899
1900[TestLabelsSource/42 - 1]
1901expr: sum(foo) by(job)
1902output:
1903 - labels:
1904 "":
1905 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1906 kind: excluded
1907 fragment:
1908 start: 9
1909 end: 11
1910 __name__:
1911 reason: Aggregation removes metric name.
1912 kind: excluded
1913 fragment:
1914 start: 0
1915 end: 16
1916 job:
1917 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1918 kind: included
1919 fragment:
1920 start: 9
1921 end: 11
1922 deadinfo: null
1923 returns: vector
1924 operations:
1925 - node: '[*parser.VectorSelector] foo'
1926 op: ""
1927 - node: '[*parser.AggregateExpr] sum by (job) (foo)'
1928 op: sum
1929 joins: []
1930 unless: []
1931 returninfo:
1932 logicalexpr: ""
1933 valueposition:
1934 start: 0
1935 end: 0
1936 returnednumber: 0
1937 alwaysreturns: false
1938 knownreturn: false
1939 isreturnbool: false
1940 position:
1941 start: 4
1942 end: 7
1943 type: aggregation
1944 fixedlabels: true
1945 isconditional: false
1946
1947---
1948
1949[TestLabelsSource/43 - 1]
1950expr: sum(foo{job="myjob"}) by(job)
1951output:
1952 - labels:
1953 "":
1954 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1955 kind: excluded
1956 fragment:
1957 start: 22
1958 end: 24
1959 __name__:
1960 reason: Aggregation removes metric name.
1961 kind: excluded
1962 fragment:
1963 start: 0
1964 end: 29
1965 job:
1966 reason: Query will only return series where these labels are present.
1967 kind: guaranteed
1968 fragment:
1969 start: 4
1970 end: 20
1971 deadinfo: null
1972 returns: vector
1973 operations:
1974 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1975 op: ""
1976 - node: '[*parser.AggregateExpr] sum by (job) (foo{job="myjob"})'
1977 op: sum
1978 joins: []
1979 unless: []
1980 returninfo:
1981 logicalexpr: ""
1982 valueposition:
1983 start: 0
1984 end: 0
1985 returnednumber: 0
1986 alwaysreturns: false
1987 knownreturn: false
1988 isreturnbool: false
1989 position:
1990 start: 4
1991 end: 20
1992 type: aggregation
1993 fixedlabels: true
1994 isconditional: false
1995
1996---
1997
1998[TestLabelsSource/44 - 1]
1999expr: abs(foo{job="myjob"} offset 5m)
2000output:
2001 - labels:
2002 job:
2003 reason: Query will only return series where these labels are present.
2004 kind: guaranteed
2005 fragment:
2006 start: 0
2007 end: 31
2008 deadinfo: null
2009 returns: vector
2010 operations:
2011 - node: '[*parser.VectorSelector] foo{job="myjob"} offset 5m'
2012 op: ""
2013 - node: '[*parser.Call] abs(foo{job="myjob"} offset 5m)'
2014 op: abs
2015 joins: []
2016 unless: []
2017 returninfo:
2018 logicalexpr: ""
2019 valueposition:
2020 start: 0
2021 end: 0
2022 returnednumber: 0
2023 alwaysreturns: false
2024 knownreturn: false
2025 isreturnbool: false
2026 position:
2027 start: 4
2028 end: 30
2029 type: function
2030 fixedlabels: false
2031 isconditional: false
2032
2033---
2034
2035[TestLabelsSource/45 - 1]
2036expr: abs(foo{job="myjob"} or bar{cluster="dev"})
2037output:
2038 - labels:
2039 job:
2040 reason: Query will only return series where these labels are present.
2041 kind: guaranteed
2042 fragment:
2043 start: 0
2044 end: 43
2045 deadinfo: null
2046 returns: vector
2047 operations:
2048 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2049 op: ""
2050 - node: '[*parser.Call] abs(foo{job="myjob"} or bar{cluster="dev"})'
2051 op: abs
2052 joins: []
2053 unless: []
2054 returninfo:
2055 logicalexpr: ""
2056 valueposition:
2057 start: 0
2058 end: 0
2059 returnednumber: 0
2060 alwaysreturns: false
2061 knownreturn: false
2062 isreturnbool: false
2063 position:
2064 start: 4
2065 end: 42
2066 type: function
2067 fixedlabels: false
2068 isconditional: false
2069 - labels:
2070 cluster:
2071 reason: Query will only return series where these labels are present.
2072 kind: guaranteed
2073 fragment:
2074 start: 0
2075 end: 43
2076 deadinfo: null
2077 returns: vector
2078 operations:
2079 - node: '[*parser.VectorSelector] bar{cluster="dev"}'
2080 op: ""
2081 - node: '[*parser.Call] abs(foo{job="myjob"} or bar{cluster="dev"})'
2082 op: abs
2083 joins: []
2084 unless: []
2085 returninfo:
2086 logicalexpr: ""
2087 valueposition:
2088 start: 0
2089 end: 0
2090 returnednumber: 0
2091 alwaysreturns: false
2092 knownreturn: false
2093 isreturnbool: false
2094 position:
2095 start: 4
2096 end: 42
2097 type: function
2098 fixedlabels: false
2099 isconditional: false
2100
2101---
2102
2103[TestLabelsSource/46 - 1]
2104expr: sum(foo{job="myjob"} or bar{cluster="dev"}) without(instance)
2105output:
2106 - labels:
2107 __name__:
2108 reason: Aggregation removes metric name.
2109 kind: excluded
2110 fragment:
2111 start: 0
2112 end: 61
2113 instance:
2114 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
2115 kind: excluded
2116 fragment:
2117 start: 44
2118 end: 51
2119 job:
2120 reason: Query will only return series where these labels are present.
2121 kind: guaranteed
2122 fragment:
2123 start: 4
2124 end: 20
2125 deadinfo: null
2126 returns: vector
2127 operations:
2128 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2129 op: ""
2130 - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"} or bar{cluster="dev"})'
2131 op: sum
2132 joins: []
2133 unless: []
2134 returninfo:
2135 logicalexpr: ""
2136 valueposition:
2137 start: 0
2138 end: 0
2139 returnednumber: 0
2140 alwaysreturns: false
2141 knownreturn: false
2142 isreturnbool: false
2143 position:
2144 start: 4
2145 end: 20
2146 type: aggregation
2147 fixedlabels: false
2148 isconditional: false
2149 - labels:
2150 __name__:
2151 reason: Aggregation removes metric name.
2152 kind: excluded
2153 fragment:
2154 start: 0
2155 end: 61
2156 cluster:
2157 reason: Query will only return series where these labels are present.
2158 kind: guaranteed
2159 fragment:
2160 start: 24
2161 end: 42
2162 instance:
2163 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
2164 kind: excluded
2165 fragment:
2166 start: 44
2167 end: 51
2168 deadinfo: null
2169 returns: vector
2170 operations:
2171 - node: '[*parser.VectorSelector] bar{cluster="dev"}'
2172 op: ""
2173 - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"} or bar{cluster="dev"})'
2174 op: sum
2175 joins: []
2176 unless: []
2177 returninfo:
2178 logicalexpr: ""
2179 valueposition:
2180 start: 0
2181 end: 0
2182 returnednumber: 0
2183 alwaysreturns: false
2184 knownreturn: false
2185 isreturnbool: false
2186 position:
2187 start: 24
2188 end: 42
2189 type: aggregation
2190 fixedlabels: false
2191 isconditional: false
2192
2193---
2194
2195[TestLabelsSource/47 - 1]
2196expr: sum(foo{job="myjob"}) without(instance)
2197output:
2198 - labels:
2199 __name__:
2200 reason: Aggregation removes metric name.
2201 kind: excluded
2202 fragment:
2203 start: 0
2204 end: 39
2205 instance:
2206 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
2207 kind: excluded
2208 fragment:
2209 start: 22
2210 end: 29
2211 job:
2212 reason: Query will only return series where these labels are present.
2213 kind: guaranteed
2214 fragment:
2215 start: 4
2216 end: 20
2217 deadinfo: null
2218 returns: vector
2219 operations:
2220 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2221 op: ""
2222 - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"})'
2223 op: sum
2224 joins: []
2225 unless: []
2226 returninfo:
2227 logicalexpr: ""
2228 valueposition:
2229 start: 0
2230 end: 0
2231 returnednumber: 0
2232 alwaysreturns: false
2233 knownreturn: false
2234 isreturnbool: false
2235 position:
2236 start: 4
2237 end: 20
2238 type: aggregation
2239 fixedlabels: false
2240 isconditional: false
2241
2242---
2243
2244[TestLabelsSource/48 - 1]
2245expr: min(foo{job="myjob"}) / max(foo{job="myjob"})
2246output:
2247 - labels:
2248 "":
2249 reason: Query is using aggregation that removes all labels.
2250 kind: excluded
2251 fragment:
2252 start: 0
2253 end: 21
2254 __name__:
2255 reason: Aggregation removes metric name.
2256 kind: excluded
2257 fragment:
2258 start: 0
2259 end: 21
2260 job:
2261 reason: Query is using aggregation that removes all labels.
2262 kind: excluded
2263 fragment:
2264 start: 0
2265 end: 21
2266 deadinfo: null
2267 returns: vector
2268 operations:
2269 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2270 op: ""
2271 - node: '[*parser.AggregateExpr] min(foo{job="myjob"})'
2272 op: min
2273 joins:
2274 - "on": []
2275 ignoring: []
2276 addedlabels: []
2277 src:
2278 labels:
2279 "":
2280 reason: Query is using aggregation that removes all labels.
2281 kind: excluded
2282 fragment:
2283 start: 24
2284 end: 45
2285 __name__:
2286 reason: Aggregation removes metric name.
2287 kind: excluded
2288 fragment:
2289 start: 24
2290 end: 45
2291 job:
2292 reason: Query is using aggregation that removes all labels.
2293 kind: excluded
2294 fragment:
2295 start: 24
2296 end: 45
2297 deadinfo: null
2298 returns: vector
2299 operations:
2300 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2301 op: ""
2302 - node: '[*parser.AggregateExpr] max(foo{job="myjob"})'
2303 op: max
2304 joins: []
2305 unless: []
2306 returninfo:
2307 logicalexpr: ""
2308 valueposition:
2309 start: 0
2310 end: 0
2311 returnednumber: 0
2312 alwaysreturns: false
2313 knownreturn: false
2314 isreturnbool: false
2315 position:
2316 start: 28
2317 end: 44
2318 type: aggregation
2319 fixedlabels: true
2320 isconditional: false
2321 op: 57384
2322 depth: 0
2323 unless: []
2324 returninfo:
2325 logicalexpr: ""
2326 valueposition:
2327 start: 0
2328 end: 0
2329 returnednumber: 0
2330 alwaysreturns: false
2331 knownreturn: false
2332 isreturnbool: false
2333 position:
2334 start: 4
2335 end: 20
2336 type: aggregation
2337 fixedlabels: true
2338 isconditional: false
2339
2340---
2341
2342[TestLabelsSource/49 - 1]
2343expr: max(foo{job="myjob"}) / min(foo{job="myjob"})
2344output:
2345 - labels:
2346 "":
2347 reason: Query is using aggregation that removes all labels.
2348 kind: excluded
2349 fragment:
2350 start: 0
2351 end: 21
2352 __name__:
2353 reason: Aggregation removes metric name.
2354 kind: excluded
2355 fragment:
2356 start: 0
2357 end: 21
2358 job:
2359 reason: Query is using aggregation that removes all labels.
2360 kind: excluded
2361 fragment:
2362 start: 0
2363 end: 21
2364 deadinfo: null
2365 returns: vector
2366 operations:
2367 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2368 op: ""
2369 - node: '[*parser.AggregateExpr] max(foo{job="myjob"})'
2370 op: max
2371 joins:
2372 - "on": []
2373 ignoring: []
2374 addedlabels: []
2375 src:
2376 labels:
2377 "":
2378 reason: Query is using aggregation that removes all labels.
2379 kind: excluded
2380 fragment:
2381 start: 24
2382 end: 45
2383 __name__:
2384 reason: Aggregation removes metric name.
2385 kind: excluded
2386 fragment:
2387 start: 24
2388 end: 45
2389 job:
2390 reason: Query is using aggregation that removes all labels.
2391 kind: excluded
2392 fragment:
2393 start: 24
2394 end: 45
2395 deadinfo: null
2396 returns: vector
2397 operations:
2398 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2399 op: ""
2400 - node: '[*parser.AggregateExpr] min(foo{job="myjob"})'
2401 op: min
2402 joins: []
2403 unless: []
2404 returninfo:
2405 logicalexpr: ""
2406 valueposition:
2407 start: 0
2408 end: 0
2409 returnednumber: 0
2410 alwaysreturns: false
2411 knownreturn: false
2412 isreturnbool: false
2413 position:
2414 start: 28
2415 end: 44
2416 type: aggregation
2417 fixedlabels: true
2418 isconditional: false
2419 op: 57384
2420 depth: 0
2421 unless: []
2422 returninfo:
2423 logicalexpr: ""
2424 valueposition:
2425 start: 0
2426 end: 0
2427 returnednumber: 0
2428 alwaysreturns: false
2429 knownreturn: false
2430 isreturnbool: false
2431 position:
2432 start: 4
2433 end: 20
2434 type: aggregation
2435 fixedlabels: true
2436 isconditional: false
2437
2438---
2439
2440[TestLabelsSource/50 - 1]
2441expr: avg(foo{job="myjob"}) by(job)
2442output:
2443 - labels:
2444 "":
2445 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
2446 kind: excluded
2447 fragment:
2448 start: 22
2449 end: 24
2450 __name__:
2451 reason: Aggregation removes metric name.
2452 kind: excluded
2453 fragment:
2454 start: 0
2455 end: 29
2456 job:
2457 reason: Query will only return series where these labels are present.
2458 kind: guaranteed
2459 fragment:
2460 start: 4
2461 end: 20
2462 deadinfo: null
2463 returns: vector
2464 operations:
2465 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2466 op: ""
2467 - node: '[*parser.AggregateExpr] avg by (job) (foo{job="myjob"})'
2468 op: avg
2469 joins: []
2470 unless: []
2471 returninfo:
2472 logicalexpr: ""
2473 valueposition:
2474 start: 0
2475 end: 0
2476 returnednumber: 0
2477 alwaysreturns: false
2478 knownreturn: false
2479 isreturnbool: false
2480 position:
2481 start: 4
2482 end: 20
2483 type: aggregation
2484 fixedlabels: true
2485 isconditional: false
2486
2487---
2488
2489[TestLabelsSource/51 - 1]
2490expr: group(foo) by(job)
2491output:
2492 - labels:
2493 "":
2494 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
2495 kind: excluded
2496 fragment:
2497 start: 11
2498 end: 13
2499 __name__:
2500 reason: Aggregation removes metric name.
2501 kind: excluded
2502 fragment:
2503 start: 0
2504 end: 18
2505 job:
2506 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
2507 kind: included
2508 fragment:
2509 start: 11
2510 end: 13
2511 deadinfo: null
2512 returns: vector
2513 operations:
2514 - node: '[*parser.VectorSelector] foo'
2515 op: ""
2516 - node: '[*parser.AggregateExpr] group by (job) (foo)'
2517 op: group
2518 joins: []
2519 unless: []
2520 returninfo:
2521 logicalexpr: ""
2522 valueposition:
2523 start: 0
2524 end: 0
2525 returnednumber: 0
2526 alwaysreturns: false
2527 knownreturn: false
2528 isreturnbool: false
2529 position:
2530 start: 6
2531 end: 9
2532 type: aggregation
2533 fixedlabels: true
2534 isconditional: false
2535
2536---
2537
2538[TestLabelsSource/52 - 1]
2539expr: stddev(rate(foo[5m]))
2540output:
2541 - labels:
2542 "":
2543 reason: Query is using aggregation that removes all labels.
2544 kind: excluded
2545 fragment:
2546 start: 0
2547 end: 21
2548 __name__:
2549 reason: Aggregation removes metric name.
2550 kind: excluded
2551 fragment:
2552 start: 0
2553 end: 21
2554 deadinfo: null
2555 returns: vector
2556 operations:
2557 - node: '[*parser.VectorSelector] foo'
2558 op: ""
2559 - node: '[*parser.Call] rate(foo[5m])'
2560 op: rate
2561 - node: '[*parser.AggregateExpr] stddev(rate(foo[5m]))'
2562 op: stddev
2563 joins: []
2564 unless: []
2565 returninfo:
2566 logicalexpr: ""
2567 valueposition:
2568 start: 0
2569 end: 0
2570 returnednumber: 0
2571 alwaysreturns: false
2572 knownreturn: false
2573 isreturnbool: false
2574 position:
2575 start: 12
2576 end: 19
2577 type: aggregation
2578 fixedlabels: true
2579 isconditional: false
2580
2581---
2582
2583[TestLabelsSource/53 - 1]
2584expr: stdvar(rate(foo[5m]))
2585output:
2586 - labels:
2587 "":
2588 reason: Query is using aggregation that removes all labels.
2589 kind: excluded
2590 fragment:
2591 start: 0
2592 end: 21
2593 __name__:
2594 reason: Aggregation removes metric name.
2595 kind: excluded
2596 fragment:
2597 start: 0
2598 end: 21
2599 deadinfo: null
2600 returns: vector
2601 operations:
2602 - node: '[*parser.VectorSelector] foo'
2603 op: ""
2604 - node: '[*parser.Call] rate(foo[5m])'
2605 op: rate
2606 - node: '[*parser.AggregateExpr] stdvar(rate(foo[5m]))'
2607 op: stdvar
2608 joins: []
2609 unless: []
2610 returninfo:
2611 logicalexpr: ""
2612 valueposition:
2613 start: 0
2614 end: 0
2615 returnednumber: 0
2616 alwaysreturns: false
2617 knownreturn: false
2618 isreturnbool: false
2619 position:
2620 start: 12
2621 end: 19
2622 type: aggregation
2623 fixedlabels: true
2624 isconditional: false
2625
2626---
2627
2628[TestLabelsSource/54 - 1]
2629expr: stddev_over_time(foo[5m])
2630output:
2631 - labels: {}
2632 deadinfo: null
2633 returns: vector
2634 operations:
2635 - node: '[*parser.VectorSelector] foo'
2636 op: ""
2637 - node: '[*parser.Call] stddev_over_time(foo[5m])'
2638 op: stddev_over_time
2639 joins: []
2640 unless: []
2641 returninfo:
2642 logicalexpr: ""
2643 valueposition:
2644 start: 0
2645 end: 0
2646 returnednumber: 0
2647 alwaysreturns: false
2648 knownreturn: false
2649 isreturnbool: false
2650 position:
2651 start: 17
2652 end: 24
2653 type: function
2654 fixedlabels: false
2655 isconditional: false
2656
2657---
2658
2659[TestLabelsSource/55 - 1]
2660expr: stdvar_over_time(foo[5m])
2661output:
2662 - labels: {}
2663 deadinfo: null
2664 returns: vector
2665 operations:
2666 - node: '[*parser.VectorSelector] foo'
2667 op: ""
2668 - node: '[*parser.Call] stdvar_over_time(foo[5m])'
2669 op: stdvar_over_time
2670 joins: []
2671 unless: []
2672 returninfo:
2673 logicalexpr: ""
2674 valueposition:
2675 start: 0
2676 end: 0
2677 returnednumber: 0
2678 alwaysreturns: false
2679 knownreturn: false
2680 isreturnbool: false
2681 position:
2682 start: 17
2683 end: 24
2684 type: function
2685 fixedlabels: false
2686 isconditional: false
2687
2688---
2689
2690[TestLabelsSource/56 - 1]
2691expr: quantile(0.9, rate(foo[5m]))
2692output:
2693 - labels:
2694 "":
2695 reason: Query is using aggregation that removes all labels.
2696 kind: excluded
2697 fragment:
2698 start: 0
2699 end: 28
2700 __name__:
2701 reason: Aggregation removes metric name.
2702 kind: excluded
2703 fragment:
2704 start: 0
2705 end: 28
2706 deadinfo: null
2707 returns: vector
2708 operations:
2709 - node: '[*parser.VectorSelector] foo'
2710 op: ""
2711 - node: '[*parser.Call] rate(foo[5m])'
2712 op: rate
2713 - node: '[*parser.AggregateExpr] quantile(0.9, rate(foo[5m]))'
2714 op: quantile
2715 joins: []
2716 unless: []
2717 returninfo:
2718 logicalexpr: ""
2719 valueposition:
2720 start: 0
2721 end: 0
2722 returnednumber: 0
2723 alwaysreturns: false
2724 knownreturn: false
2725 isreturnbool: false
2726 position:
2727 start: 19
2728 end: 26
2729 type: aggregation
2730 fixedlabels: true
2731 isconditional: false
2732
2733---
2734
2735[TestLabelsSource/57 - 1]
2736expr: count_values("version", build_version)
2737output:
2738 - labels:
2739 "":
2740 reason: Query is using aggregation that removes all labels.
2741 kind: excluded
2742 fragment:
2743 start: 0
2744 end: 38
2745 __name__:
2746 reason: Aggregation removes metric name.
2747 kind: excluded
2748 fragment:
2749 start: 0
2750 end: 38
2751 version:
2752 reason: This label will be added to the results by the count_values() call.
2753 kind: guaranteed
2754 fragment:
2755 start: 0
2756 end: 38
2757 deadinfo: null
2758 returns: vector
2759 operations:
2760 - node: '[*parser.VectorSelector] build_version'
2761 op: ""
2762 - node: '[*parser.AggregateExpr] count_values("version", build_version)'
2763 op: count_values
2764 joins: []
2765 unless: []
2766 returninfo:
2767 logicalexpr: ""
2768 valueposition:
2769 start: 0
2770 end: 0
2771 returnednumber: 0
2772 alwaysreturns: false
2773 knownreturn: false
2774 isreturnbool: false
2775 position:
2776 start: 24
2777 end: 37
2778 type: aggregation
2779 fixedlabels: true
2780 isconditional: false
2781
2782---
2783
2784[TestLabelsSource/58 - 1]
2785expr: count_values("version", build_version) without(job)
2786output:
2787 - labels:
2788 __name__:
2789 reason: Aggregation removes metric name.
2790 kind: excluded
2791 fragment:
2792 start: 0
2793 end: 51
2794 job:
2795 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
2796 kind: excluded
2797 fragment:
2798 start: 39
2799 end: 46
2800 version:
2801 reason: This label will be added to the results by the count_values() call.
2802 kind: guaranteed
2803 fragment:
2804 start: 0
2805 end: 51
2806 deadinfo: null
2807 returns: vector
2808 operations:
2809 - node: '[*parser.VectorSelector] build_version'
2810 op: ""
2811 - node: '[*parser.AggregateExpr] count_values without (job) ("version", build_version)'
2812 op: count_values
2813 joins: []
2814 unless: []
2815 returninfo:
2816 logicalexpr: ""
2817 valueposition:
2818 start: 0
2819 end: 0
2820 returnednumber: 0
2821 alwaysreturns: false
2822 knownreturn: false
2823 isreturnbool: false
2824 position:
2825 start: 24
2826 end: 37
2827 type: aggregation
2828 fixedlabels: false
2829 isconditional: false
2830
2831---
2832
2833[TestLabelsSource/59 - 1]
2834expr: count_values("version", build_version{job="foo"}) without(job)
2835output:
2836 - labels:
2837 __name__:
2838 reason: Aggregation removes metric name.
2839 kind: excluded
2840 fragment:
2841 start: 0
2842 end: 62
2843 job:
2844 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
2845 kind: excluded
2846 fragment:
2847 start: 50
2848 end: 57
2849 version:
2850 reason: This label will be added to the results by the count_values() call.
2851 kind: guaranteed
2852 fragment:
2853 start: 0
2854 end: 62
2855 deadinfo: null
2856 returns: vector
2857 operations:
2858 - node: '[*parser.VectorSelector] build_version{job="foo"}'
2859 op: ""
2860 - node: '[*parser.AggregateExpr] count_values without (job) ("version", build_version{job="foo"})'
2861 op: count_values
2862 joins: []
2863 unless: []
2864 returninfo:
2865 logicalexpr: ""
2866 valueposition:
2867 start: 0
2868 end: 0
2869 returnednumber: 0
2870 alwaysreturns: false
2871 knownreturn: false
2872 isreturnbool: false
2873 position:
2874 start: 24
2875 end: 48
2876 type: aggregation
2877 fixedlabels: false
2878 isconditional: false
2879
2880---
2881
2882[TestLabelsSource/60 - 1]
2883expr: count_values("version", build_version) by(job)
2884output:
2885 - labels:
2886 "":
2887 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
2888 kind: excluded
2889 fragment:
2890 start: 39
2891 end: 41
2892 __name__:
2893 reason: Aggregation removes metric name.
2894 kind: excluded
2895 fragment:
2896 start: 0
2897 end: 46
2898 job:
2899 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
2900 kind: included
2901 fragment:
2902 start: 39
2903 end: 41
2904 version:
2905 reason: This label will be added to the results by the count_values() call.
2906 kind: guaranteed
2907 fragment:
2908 start: 0
2909 end: 46
2910 deadinfo: null
2911 returns: vector
2912 operations:
2913 - node: '[*parser.VectorSelector] build_version'
2914 op: ""
2915 - node: '[*parser.AggregateExpr] count_values by (job) ("version", build_version)'
2916 op: count_values
2917 joins: []
2918 unless: []
2919 returninfo:
2920 logicalexpr: ""
2921 valueposition:
2922 start: 0
2923 end: 0
2924 returnednumber: 0
2925 alwaysreturns: false
2926 knownreturn: false
2927 isreturnbool: false
2928 position:
2929 start: 24
2930 end: 37
2931 type: aggregation
2932 fixedlabels: true
2933 isconditional: false
2934
2935---
2936
2937[TestLabelsSource/61 - 1]
2938expr: topk(10, foo{job="myjob"}) > 10
2939output:
2940 - labels:
2941 job:
2942 reason: Query will only return series where these labels are present.
2943 kind: guaranteed
2944 fragment:
2945 start: 9
2946 end: 25
2947 deadinfo: null
2948 returns: vector
2949 operations:
2950 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2951 op: ""
2952 - node: '[*parser.AggregateExpr] topk(10, foo{job="myjob"})'
2953 op: topk
2954 joins: []
2955 unless: []
2956 returninfo:
2957 logicalexpr: ""
2958 valueposition:
2959 start: 0
2960 end: 0
2961 returnednumber: 0
2962 alwaysreturns: false
2963 knownreturn: false
2964 isreturnbool: false
2965 position:
2966 start: 9
2967 end: 25
2968 type: aggregation
2969 fixedlabels: false
2970 isconditional: true
2971
2972---
2973
2974[TestLabelsSource/62 - 1]
2975expr: topk(10, foo or bar)
2976output:
2977 - labels: {}
2978 deadinfo: null
2979 returns: vector
2980 operations:
2981 - node: '[*parser.VectorSelector] foo'
2982 op: ""
2983 - node: '[*parser.AggregateExpr] topk(10, foo or bar)'
2984 op: topk
2985 joins: []
2986 unless: []
2987 returninfo:
2988 logicalexpr: ""
2989 valueposition:
2990 start: 0
2991 end: 0
2992 returnednumber: 0
2993 alwaysreturns: false
2994 knownreturn: false
2995 isreturnbool: false
2996 position:
2997 start: 9
2998 end: 12
2999 type: aggregation
3000 fixedlabels: false
3001 isconditional: false
3002 - labels: {}
3003 deadinfo: null
3004 returns: vector
3005 operations:
3006 - node: '[*parser.VectorSelector] bar'
3007 op: ""
3008 - node: '[*parser.AggregateExpr] topk(10, foo or bar)'
3009 op: topk
3010 joins: []
3011 unless: []
3012 returninfo:
3013 logicalexpr: ""
3014 valueposition:
3015 start: 0
3016 end: 0
3017 returnednumber: 0
3018 alwaysreturns: false
3019 knownreturn: false
3020 isreturnbool: false
3021 position:
3022 start: 16
3023 end: 19
3024 type: aggregation
3025 fixedlabels: false
3026 isconditional: false
3027
3028---
3029
3030[TestLabelsSource/63 - 1]
3031expr: rate(foo[10m])
3032output:
3033 - labels: {}
3034 deadinfo: null
3035 returns: vector
3036 operations:
3037 - node: '[*parser.VectorSelector] foo'
3038 op: ""
3039 - node: '[*parser.Call] rate(foo[10m])'
3040 op: rate
3041 joins: []
3042 unless: []
3043 returninfo:
3044 logicalexpr: ""
3045 valueposition:
3046 start: 0
3047 end: 0
3048 returnednumber: 0
3049 alwaysreturns: false
3050 knownreturn: false
3051 isreturnbool: false
3052 position:
3053 start: 5
3054 end: 13
3055 type: function
3056 fixedlabels: false
3057 isconditional: false
3058
3059---
3060
3061[TestLabelsSource/64 - 1]
3062expr: sum(rate(foo[10m])) without(instance)
3063output:
3064 - labels:
3065 __name__:
3066 reason: Aggregation removes metric name.
3067 kind: excluded
3068 fragment:
3069 start: 0
3070 end: 37
3071 instance:
3072 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
3073 kind: excluded
3074 fragment:
3075 start: 20
3076 end: 27
3077 deadinfo: null
3078 returns: vector
3079 operations:
3080 - node: '[*parser.VectorSelector] foo'
3081 op: ""
3082 - node: '[*parser.Call] rate(foo[10m])'
3083 op: rate
3084 - node: '[*parser.AggregateExpr] sum without (instance) (rate(foo[10m]))'
3085 op: sum
3086 joins: []
3087 unless: []
3088 returninfo:
3089 logicalexpr: ""
3090 valueposition:
3091 start: 0
3092 end: 0
3093 returnednumber: 0
3094 alwaysreturns: false
3095 knownreturn: false
3096 isreturnbool: false
3097 position:
3098 start: 9
3099 end: 17
3100 type: aggregation
3101 fixedlabels: false
3102 isconditional: false
3103
3104---
3105
3106[TestLabelsSource/65 - 1]
3107expr: foo{job="foo"} / bar
3108output:
3109 - labels:
3110 job:
3111 reason: Query will only return series where these labels are present.
3112 kind: guaranteed
3113 fragment:
3114 start: 0
3115 end: 14
3116 deadinfo: null
3117 returns: vector
3118 operations:
3119 - node: '[*parser.VectorSelector] foo{job="foo"}'
3120 op: ""
3121 joins:
3122 - "on": []
3123 ignoring: []
3124 addedlabels: []
3125 src:
3126 labels: {}
3127 deadinfo: null
3128 returns: vector
3129 operations:
3130 - node: '[*parser.VectorSelector] bar'
3131 op: ""
3132 joins: []
3133 unless: []
3134 returninfo:
3135 logicalexpr: ""
3136 valueposition:
3137 start: 0
3138 end: 0
3139 returnednumber: 0
3140 alwaysreturns: false
3141 knownreturn: false
3142 isreturnbool: false
3143 position:
3144 start: 17
3145 end: 20
3146 type: selector
3147 fixedlabels: false
3148 isconditional: false
3149 op: 57384
3150 depth: 0
3151 unless: []
3152 returninfo:
3153 logicalexpr: ""
3154 valueposition:
3155 start: 0
3156 end: 0
3157 returnednumber: 0
3158 alwaysreturns: false
3159 knownreturn: false
3160 isreturnbool: false
3161 position:
3162 start: 0
3163 end: 14
3164 type: selector
3165 fixedlabels: false
3166 isconditional: false
3167
3168---
3169
3170[TestLabelsSource/66 - 1]
3171expr: foo{job="foo"} * on(instance) bar
3172output:
3173 - labels:
3174 "":
3175 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
3176 kind: excluded
3177 fragment:
3178 start: 17
3179 end: 19
3180 instance:
3181 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
3182 kind: included
3183 fragment:
3184 start: 17
3185 end: 19
3186 job:
3187 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
3188 kind: excluded
3189 fragment:
3190 start: 17
3191 end: 19
3192 deadinfo: null
3193 returns: vector
3194 operations:
3195 - node: '[*parser.VectorSelector] foo{job="foo"}'
3196 op: ""
3197 joins:
3198 - "on":
3199 - instance
3200 ignoring: []
3201 addedlabels: []
3202 src:
3203 labels: {}
3204 deadinfo: null
3205 returns: vector
3206 operations:
3207 - node: '[*parser.VectorSelector] bar'
3208 op: ""
3209 joins: []
3210 unless: []
3211 returninfo:
3212 logicalexpr: ""
3213 valueposition:
3214 start: 0
3215 end: 0
3216 returnednumber: 0
3217 alwaysreturns: false
3218 knownreturn: false
3219 isreturnbool: false
3220 position:
3221 start: 30
3222 end: 33
3223 type: selector
3224 fixedlabels: false
3225 isconditional: false
3226 op: 57395
3227 depth: 0
3228 unless: []
3229 returninfo:
3230 logicalexpr: ""
3231 valueposition:
3232 start: 0
3233 end: 0
3234 returnednumber: 0
3235 alwaysreturns: false
3236 knownreturn: false
3237 isreturnbool: false
3238 position:
3239 start: 0
3240 end: 14
3241 type: selector
3242 fixedlabels: true
3243 isconditional: false
3244
3245---
3246
3247[TestLabelsSource/67 - 1]
3248expr: foo{job="foo"} * on(instance) group_left(bar) bar
3249output:
3250 - labels:
3251 bar:
3252 reason: Query is using many-to-one vector matching with `group_left(bar)`, all labels included inside `group_left(...)` will be include on the results.
3253 kind: included
3254 fragment:
3255 start: 30
3256 end: 40
3257 instance:
3258 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
3259 kind: included
3260 fragment:
3261 start: 17
3262 end: 19
3263 job:
3264 reason: Query will only return series where these labels are present.
3265 kind: guaranteed
3266 fragment:
3267 start: 0
3268 end: 14
3269 deadinfo: null
3270 returns: vector
3271 operations:
3272 - node: '[*parser.VectorSelector] foo{job="foo"}'
3273 op: ""
3274 joins:
3275 - "on":
3276 - instance
3277 ignoring: []
3278 addedlabels:
3279 - bar
3280 src:
3281 labels: {}
3282 deadinfo: null
3283 returns: vector
3284 operations:
3285 - node: '[*parser.VectorSelector] bar'
3286 op: ""
3287 joins: []
3288 unless: []
3289 returninfo:
3290 logicalexpr: ""
3291 valueposition:
3292 start: 0
3293 end: 0
3294 returnednumber: 0
3295 alwaysreturns: false
3296 knownreturn: false
3297 isreturnbool: false
3298 position:
3299 start: 46
3300 end: 49
3301 type: selector
3302 fixedlabels: false
3303 isconditional: false
3304 op: 57395
3305 depth: 0
3306 unless: []
3307 returninfo:
3308 logicalexpr: ""
3309 valueposition:
3310 start: 0
3311 end: 0
3312 returnednumber: 0
3313 alwaysreturns: false
3314 knownreturn: false
3315 isreturnbool: false
3316 position:
3317 start: 0
3318 end: 14
3319 type: selector
3320 fixedlabels: false
3321 isconditional: false
3322
3323---
3324
3325[TestLabelsSource/68 - 1]
3326expr: foo{job="foo"} * on(instance) group_left(cluster) bar{cluster="bar", ignored="true"}
3327output:
3328 - labels:
3329 cluster:
3330 reason: Query is using many-to-one vector matching with `group_left(cluster)`, all labels included inside `group_left(...)` will be include on the results.
3331 kind: included
3332 fragment:
3333 start: 30
3334 end: 40
3335 instance:
3336 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
3337 kind: included
3338 fragment:
3339 start: 17
3340 end: 19
3341 job:
3342 reason: Query will only return series where these labels are present.
3343 kind: guaranteed
3344 fragment:
3345 start: 0
3346 end: 14
3347 deadinfo: null
3348 returns: vector
3349 operations:
3350 - node: '[*parser.VectorSelector] foo{job="foo"}'
3351 op: ""
3352 joins:
3353 - "on":
3354 - instance
3355 ignoring: []
3356 addedlabels:
3357 - cluster
3358 src:
3359 labels:
3360 cluster:
3361 reason: Query will only return series where these labels are present.
3362 kind: guaranteed
3363 fragment:
3364 start: 50
3365 end: 84
3366 ignored:
3367 reason: Query will only return series where these labels are present.
3368 kind: guaranteed
3369 fragment:
3370 start: 50
3371 end: 84
3372 deadinfo: null
3373 returns: vector
3374 operations:
3375 - node: '[*parser.VectorSelector] bar{cluster="bar",ignored="true"}'
3376 op: ""
3377 joins: []
3378 unless: []
3379 returninfo:
3380 logicalexpr: ""
3381 valueposition:
3382 start: 0
3383 end: 0
3384 returnednumber: 0
3385 alwaysreturns: false
3386 knownreturn: false
3387 isreturnbool: false
3388 position:
3389 start: 50
3390 end: 84
3391 type: selector
3392 fixedlabels: false
3393 isconditional: false
3394 op: 57395
3395 depth: 0
3396 unless: []
3397 returninfo:
3398 logicalexpr: ""
3399 valueposition:
3400 start: 0
3401 end: 0
3402 returnednumber: 0
3403 alwaysreturns: false
3404 knownreturn: false
3405 isreturnbool: false
3406 position:
3407 start: 0
3408 end: 14
3409 type: selector
3410 fixedlabels: false
3411 isconditional: false
3412
3413---
3414
3415[TestLabelsSource/69 - 1]
3416expr: foo{job="foo", ignored="true"} * on(instance) group_right(job) bar{cluster="bar"}
3417output:
3418 - labels:
3419 cluster:
3420 reason: Query will only return series where these labels are present.
3421 kind: guaranteed
3422 fragment:
3423 start: 63
3424 end: 81
3425 instance:
3426 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
3427 kind: included
3428 fragment:
3429 start: 33
3430 end: 35
3431 job:
3432 reason: Query is using one-to-many vector matching with `group_right(job)`, all labels included inside `group_right(...)` will be include on the results.
3433 kind: included
3434 fragment:
3435 start: 46
3436 end: 57
3437 deadinfo: null
3438 returns: vector
3439 operations:
3440 - node: '[*parser.VectorSelector] bar{cluster="bar"}'
3441 op: ""
3442 joins:
3443 - "on":
3444 - instance
3445 ignoring: []
3446 addedlabels:
3447 - job
3448 src:
3449 labels:
3450 ignored:
3451 reason: Query will only return series where these labels are present.
3452 kind: guaranteed
3453 fragment:
3454 start: 0
3455 end: 30
3456 job:
3457 reason: Query will only return series where these labels are present.
3458 kind: guaranteed
3459 fragment:
3460 start: 0
3461 end: 30
3462 deadinfo: null
3463 returns: vector
3464 operations:
3465 - node: '[*parser.VectorSelector] foo{ignored="true",job="foo"}'
3466 op: ""
3467 joins: []
3468 unless: []
3469 returninfo:
3470 logicalexpr: ""
3471 valueposition:
3472 start: 0
3473 end: 0
3474 returnednumber: 0
3475 alwaysreturns: false
3476 knownreturn: false
3477 isreturnbool: false
3478 position:
3479 start: 0
3480 end: 30
3481 type: selector
3482 fixedlabels: false
3483 isconditional: false
3484 op: 57395
3485 depth: 0
3486 unless: []
3487 returninfo:
3488 logicalexpr: ""
3489 valueposition:
3490 start: 0
3491 end: 0
3492 returnednumber: 0
3493 alwaysreturns: false
3494 knownreturn: false
3495 isreturnbool: false
3496 position:
3497 start: 63
3498 end: 81
3499 type: selector
3500 fixedlabels: false
3501 isconditional: false
3502
3503---
3504
3505[TestLabelsSource/70 - 1]
3506expr: count(foo / bar)
3507output:
3508 - labels:
3509 "":
3510 reason: Query is using aggregation that removes all labels.
3511 kind: excluded
3512 fragment:
3513 start: 0
3514 end: 16
3515 __name__:
3516 reason: Aggregation removes metric name.
3517 kind: excluded
3518 fragment:
3519 start: 0
3520 end: 16
3521 deadinfo: null
3522 returns: vector
3523 operations:
3524 - node: '[*parser.VectorSelector] foo'
3525 op: ""
3526 - node: '[*parser.AggregateExpr] count(foo / bar)'
3527 op: count
3528 joins:
3529 - "on": []
3530 ignoring: []
3531 addedlabels: []
3532 src:
3533 labels: {}
3534 deadinfo: null
3535 returns: vector
3536 operations:
3537 - node: '[*parser.VectorSelector] bar'
3538 op: ""
3539 joins: []
3540 unless: []
3541 returninfo:
3542 logicalexpr: ""
3543 valueposition:
3544 start: 0
3545 end: 0
3546 returnednumber: 0
3547 alwaysreturns: false
3548 knownreturn: false
3549 isreturnbool: false
3550 position:
3551 start: 12
3552 end: 15
3553 type: selector
3554 fixedlabels: false
3555 isconditional: false
3556 op: 57384
3557 depth: 1
3558 unless: []
3559 returninfo:
3560 logicalexpr: ""
3561 valueposition:
3562 start: 0
3563 end: 0
3564 returnednumber: 0
3565 alwaysreturns: false
3566 knownreturn: false
3567 isreturnbool: false
3568 position:
3569 start: 6
3570 end: 9
3571 type: aggregation
3572 fixedlabels: true
3573 isconditional: false
3574
3575---
3576
3577[TestLabelsSource/71 - 1]
3578expr: count(up{job="a"} / on () up{job="b"})
3579output:
3580 - labels:
3581 "":
3582 reason: Query is using aggregation that removes all labels.
3583 kind: excluded
3584 fragment:
3585 start: 0
3586 end: 38
3587 __name__:
3588 reason: Aggregation removes metric name.
3589 kind: excluded
3590 fragment:
3591 start: 0
3592 end: 38
3593 job:
3594 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
3595 kind: excluded
3596 fragment:
3597 start: 20
3598 end: 23
3599 deadinfo: null
3600 returns: vector
3601 operations:
3602 - node: '[*parser.VectorSelector] up{job="a"}'
3603 op: ""
3604 - node: '[*parser.AggregateExpr] count(up{job="a"} / on () up{job="b"})'
3605 op: count
3606 joins:
3607 - "on": []
3608 ignoring: []
3609 addedlabels: []
3610 src:
3611 labels:
3612 job:
3613 reason: Query will only return series where these labels are present.
3614 kind: guaranteed
3615 fragment:
3616 start: 26
3617 end: 37
3618 deadinfo: null
3619 returns: vector
3620 operations:
3621 - node: '[*parser.VectorSelector] up{job="b"}'
3622 op: ""
3623 joins: []
3624 unless: []
3625 returninfo:
3626 logicalexpr: ""
3627 valueposition:
3628 start: 0
3629 end: 0
3630 returnednumber: 0
3631 alwaysreturns: false
3632 knownreturn: false
3633 isreturnbool: false
3634 position:
3635 start: 26
3636 end: 37
3637 type: selector
3638 fixedlabels: false
3639 isconditional: false
3640 op: 57384
3641 depth: 1
3642 unless: []
3643 returninfo:
3644 logicalexpr: ""
3645 valueposition:
3646 start: 0
3647 end: 0
3648 returnednumber: 0
3649 alwaysreturns: false
3650 knownreturn: false
3651 isreturnbool: false
3652 position:
3653 start: 6
3654 end: 17
3655 type: aggregation
3656 fixedlabels: true
3657 isconditional: false
3658
3659---
3660
3661[TestLabelsSource/72 - 1]
3662expr: count(up{job="a"} / on (env) up{job="b"})
3663output:
3664 - labels:
3665 "":
3666 reason: Query is using aggregation that removes all labels.
3667 kind: excluded
3668 fragment:
3669 start: 0
3670 end: 41
3671 __name__:
3672 reason: Aggregation removes metric name.
3673 kind: excluded
3674 fragment:
3675 start: 0
3676 end: 41
3677 env:
3678 reason: Query is using aggregation that removes all labels.
3679 kind: excluded
3680 fragment:
3681 start: 0
3682 end: 41
3683 job:
3684 reason: Query is using one-to-one vector matching with `on(env)`, only labels included inside `on(...)` will be present on the results.
3685 kind: excluded
3686 fragment:
3687 start: 20
3688 end: 23
3689 deadinfo: null
3690 returns: vector
3691 operations:
3692 - node: '[*parser.VectorSelector] up{job="a"}'
3693 op: ""
3694 - node: '[*parser.AggregateExpr] count(up{job="a"} / on (env) up{job="b"})'
3695 op: count
3696 joins:
3697 - "on":
3698 - env
3699 ignoring: []
3700 addedlabels: []
3701 src:
3702 labels:
3703 job:
3704 reason: Query will only return series where these labels are present.
3705 kind: guaranteed
3706 fragment:
3707 start: 29
3708 end: 40
3709 deadinfo: null
3710 returns: vector
3711 operations:
3712 - node: '[*parser.VectorSelector] up{job="b"}'
3713 op: ""
3714 joins: []
3715 unless: []
3716 returninfo:
3717 logicalexpr: ""
3718 valueposition:
3719 start: 0
3720 end: 0
3721 returnednumber: 0
3722 alwaysreturns: false
3723 knownreturn: false
3724 isreturnbool: false
3725 position:
3726 start: 29
3727 end: 40
3728 type: selector
3729 fixedlabels: false
3730 isconditional: false
3731 op: 57384
3732 depth: 1
3733 unless: []
3734 returninfo:
3735 logicalexpr: ""
3736 valueposition:
3737 start: 0
3738 end: 0
3739 returnednumber: 0
3740 alwaysreturns: false
3741 knownreturn: false
3742 isreturnbool: false
3743 position:
3744 start: 6
3745 end: 17
3746 type: aggregation
3747 fixedlabels: true
3748 isconditional: false
3749
3750---
3751
3752[TestLabelsSource/73 - 1]
3753expr: foo{job="foo", instance="1"} and bar
3754output:
3755 - labels:
3756 instance:
3757 reason: Query will only return series where these labels are present.
3758 kind: guaranteed
3759 fragment:
3760 start: 0
3761 end: 28
3762 job:
3763 reason: Query will only return series where these labels are present.
3764 kind: guaranteed
3765 fragment:
3766 start: 0
3767 end: 28
3768 deadinfo: null
3769 returns: vector
3770 operations:
3771 - node: '[*parser.VectorSelector] foo{instance="1",job="foo"}'
3772 op: ""
3773 joins:
3774 - "on": []
3775 ignoring: []
3776 addedlabels: []
3777 src:
3778 labels: {}
3779 deadinfo: null
3780 returns: vector
3781 operations:
3782 - node: '[*parser.VectorSelector] bar'
3783 op: ""
3784 joins: []
3785 unless: []
3786 returninfo:
3787 logicalexpr: ""
3788 valueposition:
3789 start: 0
3790 end: 0
3791 returnednumber: 0
3792 alwaysreturns: false
3793 knownreturn: false
3794 isreturnbool: false
3795 position:
3796 start: 33
3797 end: 36
3798 type: selector
3799 fixedlabels: false
3800 isconditional: false
3801 op: 57389
3802 depth: 0
3803 unless: []
3804 returninfo:
3805 logicalexpr: ""
3806 valueposition:
3807 start: 0
3808 end: 0
3809 returnednumber: 0
3810 alwaysreturns: false
3811 knownreturn: false
3812 isreturnbool: false
3813 position:
3814 start: 0
3815 end: 28
3816 type: selector
3817 fixedlabels: false
3818 isconditional: false
3819
3820---
3821
3822[TestLabelsSource/74 - 1]
3823expr: foo{job="foo", instance="1"} and on(cluster) bar
3824output:
3825 - labels:
3826 cluster:
3827 reason: Query is using many-to-many vector matching with `on(cluster)`, labels included inside `on(...)` will be present on the results.
3828 kind: included
3829 fragment:
3830 start: 33
3831 end: 35
3832 instance:
3833 reason: Query will only return series where these labels are present.
3834 kind: guaranteed
3835 fragment:
3836 start: 0
3837 end: 28
3838 job:
3839 reason: Query will only return series where these labels are present.
3840 kind: guaranteed
3841 fragment:
3842 start: 0
3843 end: 28
3844 deadinfo: null
3845 returns: vector
3846 operations:
3847 - node: '[*parser.VectorSelector] foo{instance="1",job="foo"}'
3848 op: ""
3849 joins:
3850 - "on":
3851 - cluster
3852 ignoring: []
3853 addedlabels: []
3854 src:
3855 labels: {}
3856 deadinfo: null
3857 returns: vector
3858 operations:
3859 - node: '[*parser.VectorSelector] bar'
3860 op: ""
3861 joins: []
3862 unless: []
3863 returninfo:
3864 logicalexpr: ""
3865 valueposition:
3866 start: 0
3867 end: 0
3868 returnednumber: 0
3869 alwaysreturns: false
3870 knownreturn: false
3871 isreturnbool: false
3872 position:
3873 start: 45
3874 end: 48
3875 type: selector
3876 fixedlabels: false
3877 isconditional: false
3878 op: 57389
3879 depth: 0
3880 unless: []
3881 returninfo:
3882 logicalexpr: ""
3883 valueposition:
3884 start: 0
3885 end: 0
3886 returnednumber: 0
3887 alwaysreturns: false
3888 knownreturn: false
3889 isreturnbool: false
3890 position:
3891 start: 0
3892 end: 28
3893 type: selector
3894 fixedlabels: false
3895 isconditional: false
3896
3897---
3898
3899[TestLabelsSource/75 - 1]
3900expr: topk(10, foo)
3901output:
3902 - labels: {}
3903 deadinfo: null
3904 returns: vector
3905 operations:
3906 - node: '[*parser.VectorSelector] foo'
3907 op: ""
3908 - node: '[*parser.AggregateExpr] topk(10, foo)'
3909 op: topk
3910 joins: []
3911 unless: []
3912 returninfo:
3913 logicalexpr: ""
3914 valueposition:
3915 start: 0
3916 end: 0
3917 returnednumber: 0
3918 alwaysreturns: false
3919 knownreturn: false
3920 isreturnbool: false
3921 position:
3922 start: 9
3923 end: 12
3924 type: aggregation
3925 fixedlabels: false
3926 isconditional: false
3927
3928---
3929
3930[TestLabelsSource/76 - 1]
3931expr: topk(10, foo) without(cluster)
3932output:
3933 - labels: {}
3934 deadinfo: null
3935 returns: vector
3936 operations:
3937 - node: '[*parser.VectorSelector] foo'
3938 op: ""
3939 - node: '[*parser.AggregateExpr] topk without (cluster) (10, foo)'
3940 op: topk
3941 joins: []
3942 unless: []
3943 returninfo:
3944 logicalexpr: ""
3945 valueposition:
3946 start: 0
3947 end: 0
3948 returnednumber: 0
3949 alwaysreturns: false
3950 knownreturn: false
3951 isreturnbool: false
3952 position:
3953 start: 9
3954 end: 12
3955 type: aggregation
3956 fixedlabels: false
3957 isconditional: false
3958
3959---
3960
3961[TestLabelsSource/77 - 1]
3962expr: topk(10, foo) by(cluster)
3963output:
3964 - labels: {}
3965 deadinfo: null
3966 returns: vector
3967 operations:
3968 - node: '[*parser.VectorSelector] foo'
3969 op: ""
3970 - node: '[*parser.AggregateExpr] topk by (cluster) (10, foo)'
3971 op: topk
3972 joins: []
3973 unless: []
3974 returninfo:
3975 logicalexpr: ""
3976 valueposition:
3977 start: 0
3978 end: 0
3979 returnednumber: 0
3980 alwaysreturns: false
3981 knownreturn: false
3982 isreturnbool: false
3983 position:
3984 start: 9
3985 end: 12
3986 type: aggregation
3987 fixedlabels: false
3988 isconditional: false
3989
3990---
3991
3992[TestLabelsSource/78 - 1]
3993expr: bottomk(10, sum(rate(foo[5m])) without(job))
3994output:
3995 - labels:
3996 __name__:
3997 reason: Aggregation removes metric name.
3998 kind: excluded
3999 fragment:
4000 start: 12
4001 end: 43
4002 job:
4003 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
4004 kind: excluded
4005 fragment:
4006 start: 31
4007 end: 38
4008 deadinfo: null
4009 returns: vector
4010 operations:
4011 - node: '[*parser.VectorSelector] foo'
4012 op: ""
4013 - node: '[*parser.Call] rate(foo[5m])'
4014 op: rate
4015 - node: '[*parser.AggregateExpr] sum without (job) (rate(foo[5m]))'
4016 op: sum
4017 - node: '[*parser.AggregateExpr] bottomk(10, sum without (job) (rate(foo[5m])))'
4018 op: bottomk
4019 joins: []
4020 unless: []
4021 returninfo:
4022 logicalexpr: ""
4023 valueposition:
4024 start: 0
4025 end: 0
4026 returnednumber: 0
4027 alwaysreturns: false
4028 knownreturn: false
4029 isreturnbool: false
4030 position:
4031 start: 21
4032 end: 28
4033 type: aggregation
4034 fixedlabels: false
4035 isconditional: false
4036
4037---
4038
4039[TestLabelsSource/79 - 1]
4040expr: foo or bar
4041output:
4042 - labels: {}
4043 deadinfo: null
4044 returns: vector
4045 operations:
4046 - node: '[*parser.VectorSelector] foo'
4047 op: ""
4048 joins: []
4049 unless: []
4050 returninfo:
4051 logicalexpr: ""
4052 valueposition:
4053 start: 0
4054 end: 0
4055 returnednumber: 0
4056 alwaysreturns: false
4057 knownreturn: false
4058 isreturnbool: false
4059 position:
4060 start: 0
4061 end: 3
4062 type: selector
4063 fixedlabels: false
4064 isconditional: false
4065 - labels: {}
4066 deadinfo: null
4067 returns: vector
4068 operations:
4069 - node: '[*parser.VectorSelector] bar'
4070 op: ""
4071 joins: []
4072 unless: []
4073 returninfo:
4074 logicalexpr: ""
4075 valueposition:
4076 start: 0
4077 end: 0
4078 returnednumber: 0
4079 alwaysreturns: false
4080 knownreturn: false
4081 isreturnbool: false
4082 position:
4083 start: 7
4084 end: 10
4085 type: selector
4086 fixedlabels: false
4087 isconditional: false
4088
4089---
4090
4091[TestLabelsSource/80 - 1]
4092expr: foo or bar or baz
4093output:
4094 - labels: {}
4095 deadinfo: null
4096 returns: vector
4097 operations:
4098 - node: '[*parser.VectorSelector] foo'
4099 op: ""
4100 joins: []
4101 unless: []
4102 returninfo:
4103 logicalexpr: ""
4104 valueposition:
4105 start: 0
4106 end: 0
4107 returnednumber: 0
4108 alwaysreturns: false
4109 knownreturn: false
4110 isreturnbool: false
4111 position:
4112 start: 0
4113 end: 3
4114 type: selector
4115 fixedlabels: false
4116 isconditional: false
4117 - labels: {}
4118 deadinfo: null
4119 returns: vector
4120 operations:
4121 - node: '[*parser.VectorSelector] bar'
4122 op: ""
4123 joins: []
4124 unless: []
4125 returninfo:
4126 logicalexpr: ""
4127 valueposition:
4128 start: 0
4129 end: 0
4130 returnednumber: 0
4131 alwaysreturns: false
4132 knownreturn: false
4133 isreturnbool: false
4134 position:
4135 start: 7
4136 end: 10
4137 type: selector
4138 fixedlabels: false
4139 isconditional: false
4140 - labels: {}
4141 deadinfo: null
4142 returns: vector
4143 operations:
4144 - node: '[*parser.VectorSelector] baz'
4145 op: ""
4146 joins: []
4147 unless: []
4148 returninfo:
4149 logicalexpr: ""
4150 valueposition:
4151 start: 0
4152 end: 0
4153 returnednumber: 0
4154 alwaysreturns: false
4155 knownreturn: false
4156 isreturnbool: false
4157 position:
4158 start: 14
4159 end: 17
4160 type: selector
4161 fixedlabels: false
4162 isconditional: false
4163
4164---
4165
4166[TestLabelsSource/81 - 1]
4167expr: (foo or bar) or baz
4168output:
4169 - labels: {}
4170 deadinfo: null
4171 returns: vector
4172 operations:
4173 - node: '[*parser.VectorSelector] foo'
4174 op: ""
4175 joins: []
4176 unless: []
4177 returninfo:
4178 logicalexpr: ""
4179 valueposition:
4180 start: 0
4181 end: 0
4182 returnednumber: 0
4183 alwaysreturns: false
4184 knownreturn: false
4185 isreturnbool: false
4186 position:
4187 start: 1
4188 end: 4
4189 type: selector
4190 fixedlabels: false
4191 isconditional: false
4192 - labels: {}
4193 deadinfo: null
4194 returns: vector
4195 operations:
4196 - node: '[*parser.VectorSelector] bar'
4197 op: ""
4198 joins: []
4199 unless: []
4200 returninfo:
4201 logicalexpr: ""
4202 valueposition:
4203 start: 0
4204 end: 0
4205 returnednumber: 0
4206 alwaysreturns: false
4207 knownreturn: false
4208 isreturnbool: false
4209 position:
4210 start: 8
4211 end: 11
4212 type: selector
4213 fixedlabels: false
4214 isconditional: false
4215 - labels: {}
4216 deadinfo: null
4217 returns: vector
4218 operations:
4219 - node: '[*parser.VectorSelector] baz'
4220 op: ""
4221 joins: []
4222 unless: []
4223 returninfo:
4224 logicalexpr: ""
4225 valueposition:
4226 start: 0
4227 end: 0
4228 returnednumber: 0
4229 alwaysreturns: false
4230 knownreturn: false
4231 isreturnbool: false
4232 position:
4233 start: 16
4234 end: 19
4235 type: selector
4236 fixedlabels: false
4237 isconditional: false
4238
4239---
4240
4241[TestLabelsSource/82 - 1]
4242expr: foo unless bar
4243output:
4244 - labels: {}
4245 deadinfo: null
4246 returns: vector
4247 operations:
4248 - node: '[*parser.VectorSelector] foo'
4249 op: ""
4250 joins: []
4251 unless:
4252 - "on": []
4253 ignoring: []
4254 src:
4255 labels: {}
4256 deadinfo: null
4257 returns: vector
4258 operations:
4259 - node: '[*parser.VectorSelector] bar'
4260 op: ""
4261 joins: []
4262 unless: []
4263 returninfo:
4264 logicalexpr: ""
4265 valueposition:
4266 start: 0
4267 end: 0
4268 returnednumber: 0
4269 alwaysreturns: false
4270 knownreturn: false
4271 isreturnbool: false
4272 position:
4273 start: 11
4274 end: 14
4275 type: selector
4276 fixedlabels: false
4277 isconditional: false
4278 returninfo:
4279 logicalexpr: ""
4280 valueposition:
4281 start: 0
4282 end: 0
4283 returnednumber: 0
4284 alwaysreturns: false
4285 knownreturn: false
4286 isreturnbool: false
4287 position:
4288 start: 0
4289 end: 3
4290 type: selector
4291 fixedlabels: false
4292 isconditional: false
4293
4294---
4295
4296[TestLabelsSource/83 - 1]
4297expr: foo unless bar > 5
4298output:
4299 - labels: {}
4300 deadinfo: null
4301 returns: vector
4302 operations:
4303 - node: '[*parser.VectorSelector] foo'
4304 op: ""
4305 joins: []
4306 unless:
4307 - "on": []
4308 ignoring: []
4309 src:
4310 labels: {}
4311 deadinfo: null
4312 returns: vector
4313 operations:
4314 - node: '[*parser.VectorSelector] bar'
4315 op: ""
4316 joins: []
4317 unless: []
4318 returninfo:
4319 logicalexpr: ""
4320 valueposition:
4321 start: 0
4322 end: 0
4323 returnednumber: 0
4324 alwaysreturns: false
4325 knownreturn: false
4326 isreturnbool: false
4327 position:
4328 start: 11
4329 end: 14
4330 type: selector
4331 fixedlabels: false
4332 isconditional: true
4333 returninfo:
4334 logicalexpr: ""
4335 valueposition:
4336 start: 0
4337 end: 0
4338 returnednumber: 0
4339 alwaysreturns: false
4340 knownreturn: false
4341 isreturnbool: false
4342 position:
4343 start: 0
4344 end: 3
4345 type: selector
4346 fixedlabels: false
4347 isconditional: false
4348
4349---
4350
4351[TestLabelsSource/84 - 1]
4352expr: foo unless bar unless baz
4353output:
4354 - labels: {}
4355 deadinfo: null
4356 returns: vector
4357 operations:
4358 - node: '[*parser.VectorSelector] foo'
4359 op: ""
4360 joins: []
4361 unless:
4362 - "on": []
4363 ignoring: []
4364 src:
4365 labels: {}
4366 deadinfo: null
4367 returns: vector
4368 operations:
4369 - node: '[*parser.VectorSelector] bar'
4370 op: ""
4371 joins: []
4372 unless: []
4373 returninfo:
4374 logicalexpr: ""
4375 valueposition:
4376 start: 0
4377 end: 0
4378 returnednumber: 0
4379 alwaysreturns: false
4380 knownreturn: false
4381 isreturnbool: false
4382 position:
4383 start: 11
4384 end: 14
4385 type: selector
4386 fixedlabels: false
4387 isconditional: false
4388 - "on": []
4389 ignoring: []
4390 src:
4391 labels: {}
4392 deadinfo: null
4393 returns: vector
4394 operations:
4395 - node: '[*parser.VectorSelector] baz'
4396 op: ""
4397 joins: []
4398 unless: []
4399 returninfo:
4400 logicalexpr: ""
4401 valueposition:
4402 start: 0
4403 end: 0
4404 returnednumber: 0
4405 alwaysreturns: false
4406 knownreturn: false
4407 isreturnbool: false
4408 position:
4409 start: 22
4410 end: 25
4411 type: selector
4412 fixedlabels: false
4413 isconditional: false
4414 returninfo:
4415 logicalexpr: ""
4416 valueposition:
4417 start: 0
4418 end: 0
4419 returnednumber: 0
4420 alwaysreturns: false
4421 knownreturn: false
4422 isreturnbool: false
4423 position:
4424 start: 0
4425 end: 3
4426 type: selector
4427 fixedlabels: false
4428 isconditional: false
4429
4430---
4431
4432[TestLabelsSource/85 - 1]
4433expr: count(sum(up{job="foo", cluster="dev"}) by(job, cluster) == 0) without(job, cluster)
4434output:
4435 - labels:
4436 "":
4437 reason: Query is using aggregation with `by(job, cluster)`, only labels included inside `by(...)` will be present on the results.
4438 kind: excluded
4439 fragment:
4440 start: 40
4441 end: 42
4442 __name__:
4443 reason: Aggregation removes metric name.
4444 kind: excluded
4445 fragment:
4446 start: 0
4447 end: 84
4448 cluster:
4449 reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results.
4450 kind: excluded
4451 fragment:
4452 start: 63
4453 end: 70
4454 job:
4455 reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results.
4456 kind: excluded
4457 fragment:
4458 start: 63
4459 end: 70
4460 deadinfo: null
4461 returns: vector
4462 operations:
4463 - node: '[*parser.VectorSelector] up{cluster="dev",job="foo"}'
4464 op: ""
4465 - node: '[*parser.AggregateExpr] sum by (job, cluster) (up{cluster="dev",job="foo"})'
4466 op: sum
4467 - node: '[*parser.AggregateExpr] count without (job, cluster) (sum by (job, cluster) (up{cluster="dev",job="foo"}) == 0)'
4468 op: count
4469 joins: []
4470 unless: []
4471 returninfo:
4472 logicalexpr: ""
4473 valueposition:
4474 start: 0
4475 end: 0
4476 returnednumber: 0
4477 alwaysreturns: false
4478 knownreturn: false
4479 isreturnbool: false
4480 position:
4481 start: 10
4482 end: 38
4483 type: aggregation
4484 fixedlabels: true
4485 isconditional: true
4486
4487---
4488
4489[TestLabelsSource/86 - 1]
4490expr: year()
4491output:
4492 - labels:
4493 "":
4494 reason: Calling `year()` with no arguments will return an empty time series with no labels.
4495 kind: excluded
4496 fragment:
4497 start: 0
4498 end: 6
4499 deadinfo: null
4500 returns: vector
4501 operations:
4502 - node: '[*parser.Call] year()'
4503 op: year
4504 joins: []
4505 unless: []
4506 returninfo:
4507 logicalexpr: ""
4508 valueposition:
4509 start: 0
4510 end: 0
4511 returnednumber: 0
4512 alwaysreturns: true
4513 knownreturn: false
4514 isreturnbool: false
4515 position:
4516 start: 0
4517 end: 6
4518 type: function
4519 fixedlabels: true
4520 isconditional: false
4521
4522---
4523
4524[TestLabelsSource/87 - 1]
4525expr: year(foo)
4526output:
4527 - labels: {}
4528 deadinfo: null
4529 returns: vector
4530 operations:
4531 - node: '[*parser.VectorSelector] foo'
4532 op: ""
4533 - node: '[*parser.Call] year(foo)'
4534 op: year
4535 joins: []
4536 unless: []
4537 returninfo:
4538 logicalexpr: ""
4539 valueposition:
4540 start: 0
4541 end: 0
4542 returnednumber: 0
4543 alwaysreturns: false
4544 knownreturn: false
4545 isreturnbool: false
4546 position:
4547 start: 5
4548 end: 8
4549 type: function
4550 fixedlabels: false
4551 isconditional: false
4552
4553---
4554
4555[TestLabelsSource/88 - 1]
4556expr: label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")
4557output:
4558 - labels:
4559 foo:
4560 reason: This label will be added to the result by label_join() call.
4561 kind: guaranteed
4562 fragment:
4563 start: 0
4564 end: 95
4565 job:
4566 reason: Query will only return series where these labels are present.
4567 kind: guaranteed
4568 fragment:
4569 start: 11
4570 end: 58
4571 src1:
4572 reason: Query will only return series where these labels are present.
4573 kind: guaranteed
4574 fragment:
4575 start: 11
4576 end: 58
4577 src2:
4578 reason: Query will only return series where these labels are present.
4579 kind: guaranteed
4580 fragment:
4581 start: 11
4582 end: 58
4583 src3:
4584 reason: Query will only return series where these labels are present.
4585 kind: guaranteed
4586 fragment:
4587 start: 11
4588 end: 58
4589 deadinfo: null
4590 returns: vector
4591 operations:
4592 - node: '[*parser.VectorSelector] up{job="api-server",src1="a",src2="b",src3="c"}'
4593 op: ""
4594 - node: '[*parser.Call] label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")'
4595 op: label_join
4596 joins: []
4597 unless: []
4598 returninfo:
4599 logicalexpr: ""
4600 valueposition:
4601 start: 0
4602 end: 0
4603 returnednumber: 0
4604 alwaysreturns: false
4605 knownreturn: false
4606 isreturnbool: false
4607 position:
4608 start: 11
4609 end: 58
4610 type: function
4611 fixedlabels: false
4612 isconditional: false
4613
4614---
4615
4616[TestLabelsSource/89 - 1]
4617expr: |4-
4618 (
4619 sum(foo:sum > 0) without(notify)
4620 * on(job) group_left(notify)
4621 job:notify
4622 )
4623 and on(job)
4624 sum(foo:count) by(job) > 20
4625output:
4626 - labels:
4627 __name__:
4628 reason: Aggregation removes metric name.
4629 kind: excluded
4630 fragment:
4631 start: 4
4632 end: 36
4633 job:
4634 reason: Query is using many-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
4635 kind: included
4636 fragment:
4637 start: 40
4638 end: 42
4639 notify:
4640 reason: Query is using many-to-one vector matching with `group_left(notify)`, all labels included inside `group_left(...)` will be include on the results.
4641 kind: included
4642 fragment:
4643 start: 48
4644 end: 58
4645 deadinfo: null
4646 returns: vector
4647 operations:
4648 - node: '[*parser.VectorSelector] foo:sum'
4649 op: ""
4650 - node: '[*parser.AggregateExpr] sum without (notify) (foo:sum > 0)'
4651 op: sum
4652 joins:
4653 - "on":
4654 - job
4655 ignoring: []
4656 addedlabels:
4657 - notify
4658 src:
4659 labels: {}
4660 deadinfo: null
4661 returns: vector
4662 operations:
4663 - node: '[*parser.VectorSelector] job:notify'
4664 op: ""
4665 joins: []
4666 unless: []
4667 returninfo:
4668 logicalexpr: ""
4669 valueposition:
4670 start: 0
4671 end: 0
4672 returnednumber: 0
4673 alwaysreturns: false
4674 knownreturn: false
4675 isreturnbool: false
4676 position:
4677 start: 68
4678 end: 78
4679 type: selector
4680 fixedlabels: false
4681 isconditional: false
4682 op: 57395
4683 depth: 0
4684 - "on":
4685 - job
4686 ignoring: []
4687 addedlabels: []
4688 src:
4689 labels:
4690 "":
4691 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
4692 kind: excluded
4693 fragment:
4694 start: 108
4695 end: 110
4696 __name__:
4697 reason: Aggregation removes metric name.
4698 kind: excluded
4699 fragment:
4700 start: 93
4701 end: 115
4702 job:
4703 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
4704 kind: included
4705 fragment:
4706 start: 108
4707 end: 110
4708 deadinfo: null
4709 returns: vector
4710 operations:
4711 - node: '[*parser.VectorSelector] foo:count'
4712 op: ""
4713 - node: '[*parser.AggregateExpr] sum by (job) (foo:count)'
4714 op: sum
4715 joins: []
4716 unless: []
4717 returninfo:
4718 logicalexpr: ""
4719 valueposition:
4720 start: 0
4721 end: 0
4722 returnednumber: 0
4723 alwaysreturns: false
4724 knownreturn: false
4725 isreturnbool: false
4726 position:
4727 start: 97
4728 end: 106
4729 type: aggregation
4730 fixedlabels: true
4731 isconditional: true
4732 op: 57389
4733 depth: 0
4734 unless: []
4735 returninfo:
4736 logicalexpr: ""
4737 valueposition:
4738 start: 0
4739 end: 0
4740 returnednumber: 0
4741 alwaysreturns: false
4742 knownreturn: false
4743 isreturnbool: false
4744 position:
4745 start: 8
4746 end: 15
4747 type: aggregation
4748 fixedlabels: false
4749 isconditional: true
4750
4751---
4752
4753[TestLabelsSource/90 - 1]
4754expr: container_file_descriptors / on (instance, app_name) container_ulimits_soft{ulimit="max_open_files"}
4755output:
4756 - labels:
4757 "":
4758 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.
4759 kind: excluded
4760 fragment:
4761 start: 29
4762 end: 32
4763 app_name:
4764 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.
4765 kind: included
4766 fragment:
4767 start: 29
4768 end: 32
4769 instance:
4770 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.
4771 kind: included
4772 fragment:
4773 start: 29
4774 end: 32
4775 deadinfo: null
4776 returns: vector
4777 operations:
4778 - node: '[*parser.VectorSelector] container_file_descriptors'
4779 op: ""
4780 joins:
4781 - "on":
4782 - instance
4783 - app_name
4784 ignoring: []
4785 addedlabels: []
4786 src:
4787 labels:
4788 ulimit:
4789 reason: Query will only return series where these labels are present.
4790 kind: guaranteed
4791 fragment:
4792 start: 53
4793 end: 100
4794 deadinfo: null
4795 returns: vector
4796 operations:
4797 - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}'
4798 op: ""
4799 joins: []
4800 unless: []
4801 returninfo:
4802 logicalexpr: ""
4803 valueposition:
4804 start: 0
4805 end: 0
4806 returnednumber: 0
4807 alwaysreturns: false
4808 knownreturn: false
4809 isreturnbool: false
4810 position:
4811 start: 53
4812 end: 100
4813 type: selector
4814 fixedlabels: false
4815 isconditional: false
4816 op: 57384
4817 depth: 0
4818 unless: []
4819 returninfo:
4820 logicalexpr: ""
4821 valueposition:
4822 start: 0
4823 end: 0
4824 returnednumber: 0
4825 alwaysreturns: false
4826 knownreturn: false
4827 isreturnbool: false
4828 position:
4829 start: 0
4830 end: 26
4831 type: selector
4832 fixedlabels: true
4833 isconditional: false
4834
4835---
4836
4837[TestLabelsSource/91 - 1]
4838expr: container_file_descriptors / on (instance, app_name) group_left() container_ulimits_soft{ulimit="max_open_files"}
4839output:
4840 - labels:
4841 app_name:
4842 reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results.
4843 kind: included
4844 fragment:
4845 start: 29
4846 end: 32
4847 instance:
4848 reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results.
4849 kind: included
4850 fragment:
4851 start: 29
4852 end: 32
4853 deadinfo: null
4854 returns: vector
4855 operations:
4856 - node: '[*parser.VectorSelector] container_file_descriptors'
4857 op: ""
4858 joins:
4859 - "on":
4860 - instance
4861 - app_name
4862 ignoring: []
4863 addedlabels: []
4864 src:
4865 labels:
4866 ulimit:
4867 reason: Query will only return series where these labels are present.
4868 kind: guaranteed
4869 fragment:
4870 start: 66
4871 end: 113
4872 deadinfo: null
4873 returns: vector
4874 operations:
4875 - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}'
4876 op: ""
4877 joins: []
4878 unless: []
4879 returninfo:
4880 logicalexpr: ""
4881 valueposition:
4882 start: 0
4883 end: 0
4884 returnednumber: 0
4885 alwaysreturns: false
4886 knownreturn: false
4887 isreturnbool: false
4888 position:
4889 start: 66
4890 end: 113
4891 type: selector
4892 fixedlabels: false
4893 isconditional: false
4894 op: 57384
4895 depth: 0
4896 unless: []
4897 returninfo:
4898 logicalexpr: ""
4899 valueposition:
4900 start: 0
4901 end: 0
4902 returnednumber: 0
4903 alwaysreturns: false
4904 knownreturn: false
4905 isreturnbool: false
4906 position:
4907 start: 0
4908 end: 26
4909 type: selector
4910 fixedlabels: false
4911 isconditional: false
4912
4913---
4914
4915[TestLabelsSource/92 - 1]
4916expr: absent(foo{job="bar"})
4917output:
4918 - labels:
4919 "":
4920 reason: |-
4921 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
4922 You will only get any results back if the metric selector you pass doesn't match anything.
4923 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
4924 This means that the only labels you can get back from absent call are the ones you pass to it.
4925 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.
4926 kind: excluded
4927 fragment:
4928 start: 0
4929 end: 6
4930 job:
4931 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
4932 kind: guaranteed
4933 fragment:
4934 start: 0
4935 end: 22
4936 deadinfo: null
4937 returns: vector
4938 operations:
4939 - node: '[*parser.VectorSelector] foo{job="bar"}'
4940 op: ""
4941 - node: '[*parser.Call] absent(foo{job="bar"})'
4942 op: absent
4943 joins: []
4944 unless: []
4945 returninfo:
4946 logicalexpr: ""
4947 valueposition:
4948 start: 0
4949 end: 0
4950 returnednumber: 0
4951 alwaysreturns: false
4952 knownreturn: false
4953 isreturnbool: false
4954 position:
4955 start: 7
4956 end: 21
4957 type: function
4958 fixedlabels: true
4959 isconditional: false
4960
4961---
4962
4963[TestLabelsSource/93 - 1]
4964expr: absent(foo{job="bar", cluster!="dev", instance=~".+", env="prod"})
4965output:
4966 - labels:
4967 "":
4968 reason: |-
4969 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
4970 You will only get any results back if the metric selector you pass doesn't match anything.
4971 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
4972 This means that the only labels you can get back from absent call are the ones you pass to it.
4973 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.
4974 kind: excluded
4975 fragment:
4976 start: 0
4977 end: 6
4978 env:
4979 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
4980 kind: guaranteed
4981 fragment:
4982 start: 0
4983 end: 66
4984 instance:
4985 reason: |-
4986 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
4987 You will only get any results back if the metric selector you pass doesn't match anything.
4988 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
4989 This means that the only labels you can get back from absent call are the ones you pass to it.
4990 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.
4991 kind: excluded
4992 fragment:
4993 start: 0
4994 end: 6
4995 job:
4996 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
4997 kind: guaranteed
4998 fragment:
4999 start: 0
5000 end: 66
5001 deadinfo: null
5002 returns: vector
5003 operations:
5004 - node: '[*parser.VectorSelector] foo{cluster!="dev",env="prod",instance=~".+",job="bar"}'
5005 op: ""
5006 - node: '[*parser.Call] absent(foo{cluster!="dev",env="prod",instance=~".+",job="bar"})'
5007 op: absent
5008 joins: []
5009 unless: []
5010 returninfo:
5011 logicalexpr: ""
5012 valueposition:
5013 start: 0
5014 end: 0
5015 returnednumber: 0
5016 alwaysreturns: false
5017 knownreturn: false
5018 isreturnbool: false
5019 position:
5020 start: 7
5021 end: 65
5022 type: function
5023 fixedlabels: true
5024 isconditional: false
5025
5026---
5027
5028[TestLabelsSource/94 - 1]
5029expr: absent(sum(foo) by(job, instance))
5030output:
5031 - labels:
5032 "":
5033 reason: |-
5034 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5035 You will only get any results back if the metric selector you pass doesn't match anything.
5036 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5037 This means that the only labels you can get back from absent call are the ones you pass to it.
5038 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.
5039 kind: excluded
5040 fragment:
5041 start: 0
5042 end: 6
5043 __name__:
5044 reason: Aggregation removes metric name.
5045 kind: excluded
5046 fragment:
5047 start: 7
5048 end: 33
5049 instance:
5050 reason: |-
5051 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5052 You will only get any results back if the metric selector you pass doesn't match anything.
5053 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5054 This means that the only labels you can get back from absent call are the ones you pass to it.
5055 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.
5056 kind: excluded
5057 fragment:
5058 start: 0
5059 end: 6
5060 job:
5061 reason: |-
5062 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5063 You will only get any results back if the metric selector you pass doesn't match anything.
5064 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5065 This means that the only labels you can get back from absent call are the ones you pass to it.
5066 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.
5067 kind: excluded
5068 fragment:
5069 start: 0
5070 end: 6
5071 deadinfo: null
5072 returns: vector
5073 operations:
5074 - node: '[*parser.VectorSelector] foo'
5075 op: ""
5076 - node: '[*parser.AggregateExpr] sum by (job, instance) (foo)'
5077 op: sum
5078 - node: '[*parser.Call] absent(sum by (job, instance) (foo))'
5079 op: absent
5080 joins: []
5081 unless: []
5082 returninfo:
5083 logicalexpr: ""
5084 valueposition:
5085 start: 0
5086 end: 0
5087 returnednumber: 0
5088 alwaysreturns: false
5089 knownreturn: false
5090 isreturnbool: false
5091 position:
5092 start: 7
5093 end: 33
5094 type: function
5095 fixedlabels: true
5096 isconditional: false
5097
5098---
5099
5100[TestLabelsSource/95 - 1]
5101expr: absent(foo{job="prometheus", xxx="1"}) AND on(job) prometheus_build_info
5102output:
5103 - labels:
5104 "":
5105 reason: |-
5106 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5107 You will only get any results back if the metric selector you pass doesn't match anything.
5108 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5109 This means that the only labels you can get back from absent call are the ones you pass to it.
5110 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.
5111 kind: excluded
5112 fragment:
5113 start: 0
5114 end: 6
5115 job:
5116 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
5117 kind: guaranteed
5118 fragment:
5119 start: 0
5120 end: 38
5121 xxx:
5122 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
5123 kind: guaranteed
5124 fragment:
5125 start: 0
5126 end: 38
5127 deadinfo: null
5128 returns: vector
5129 operations:
5130 - node: '[*parser.VectorSelector] foo{job="prometheus",xxx="1"}'
5131 op: ""
5132 - node: '[*parser.Call] absent(foo{job="prometheus",xxx="1"})'
5133 op: absent
5134 joins:
5135 - "on":
5136 - job
5137 ignoring: []
5138 addedlabels: []
5139 src:
5140 labels: {}
5141 deadinfo: null
5142 returns: vector
5143 operations:
5144 - node: '[*parser.VectorSelector] prometheus_build_info'
5145 op: ""
5146 joins: []
5147 unless: []
5148 returninfo:
5149 logicalexpr: ""
5150 valueposition:
5151 start: 0
5152 end: 0
5153 returnednumber: 0
5154 alwaysreturns: false
5155 knownreturn: false
5156 isreturnbool: false
5157 position:
5158 start: 51
5159 end: 72
5160 type: selector
5161 fixedlabels: false
5162 isconditional: false
5163 op: 57389
5164 depth: 0
5165 unless: []
5166 returninfo:
5167 logicalexpr: ""
5168 valueposition:
5169 start: 0
5170 end: 0
5171 returnednumber: 0
5172 alwaysreturns: false
5173 knownreturn: false
5174 isreturnbool: false
5175 position:
5176 start: 7
5177 end: 37
5178 type: function
5179 fixedlabels: true
5180 isconditional: false
5181
5182---
5183
5184[TestLabelsSource/96 - 1]
5185expr: 1 + sum(foo) by(notjob)
5186output:
5187 - labels:
5188 "":
5189 reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results.
5190 kind: excluded
5191 fragment:
5192 start: 13
5193 end: 15
5194 __name__:
5195 reason: Aggregation removes metric name.
5196 kind: excluded
5197 fragment:
5198 start: 4
5199 end: 23
5200 notjob:
5201 reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results.
5202 kind: included
5203 fragment:
5204 start: 13
5205 end: 15
5206 deadinfo: null
5207 returns: vector
5208 operations:
5209 - node: '[*parser.VectorSelector] foo'
5210 op: ""
5211 - node: '[*parser.AggregateExpr] sum by (notjob) (foo)'
5212 op: sum
5213 joins: []
5214 unless: []
5215 returninfo:
5216 logicalexpr: ""
5217 valueposition:
5218 start: 0
5219 end: 0
5220 returnednumber: 0
5221 alwaysreturns: false
5222 knownreturn: false
5223 isreturnbool: false
5224 position:
5225 start: 8
5226 end: 11
5227 type: aggregation
5228 fixedlabels: true
5229 isconditional: false
5230
5231---
5232
5233[TestLabelsSource/97 - 1]
5234expr: count(node_exporter_build_info) by (instance, version) != ignoring(package,version) group_left(foo) count(deb_package_version) by (instance, version, package)
5235output:
5236 - labels:
5237 "":
5238 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
5239 kind: excluded
5240 fragment:
5241 start: 32
5242 end: 35
5243 __name__:
5244 reason: Aggregation removes metric name.
5245 kind: excluded
5246 fragment:
5247 start: 0
5248 end: 54
5249 foo:
5250 reason: Query is using many-to-one vector matching with `group_left(foo)`, all labels included inside `group_left(...)` will be include on the results.
5251 kind: included
5252 fragment:
5253 start: 84
5254 end: 94
5255 instance:
5256 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
5257 kind: included
5258 fragment:
5259 start: 32
5260 end: 35
5261 version:
5262 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
5263 kind: included
5264 fragment:
5265 start: 32
5266 end: 35
5267 deadinfo: null
5268 returns: vector
5269 operations:
5270 - node: '[*parser.VectorSelector] node_exporter_build_info'
5271 op: ""
5272 - node: '[*parser.AggregateExpr] count by (instance, version) (node_exporter_build_info)'
5273 op: count
5274 joins:
5275 - "on": []
5276 ignoring:
5277 - package
5278 - version
5279 addedlabels:
5280 - foo
5281 src:
5282 labels:
5283 "":
5284 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
5285 kind: excluded
5286 fragment:
5287 start: 127
5288 end: 130
5289 __name__:
5290 reason: Aggregation removes metric name.
5291 kind: excluded
5292 fragment:
5293 start: 100
5294 end: 158
5295 instance:
5296 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
5297 kind: included
5298 fragment:
5299 start: 127
5300 end: 130
5301 package:
5302 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
5303 kind: included
5304 fragment:
5305 start: 127
5306 end: 130
5307 version:
5308 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
5309 kind: included
5310 fragment:
5311 start: 127
5312 end: 130
5313 deadinfo: null
5314 returns: vector
5315 operations:
5316 - node: '[*parser.VectorSelector] deb_package_version'
5317 op: ""
5318 - node: '[*parser.AggregateExpr] count by (instance, version, package) (deb_package_version)'
5319 op: count
5320 joins: []
5321 unless: []
5322 returninfo:
5323 logicalexpr: ""
5324 valueposition:
5325 start: 0
5326 end: 0
5327 returnednumber: 0
5328 alwaysreturns: false
5329 knownreturn: false
5330 isreturnbool: false
5331 position:
5332 start: 106
5333 end: 125
5334 type: aggregation
5335 fixedlabels: true
5336 isconditional: false
5337 op: 57396
5338 depth: 0
5339 unless: []
5340 returninfo:
5341 logicalexpr: ""
5342 valueposition:
5343 start: 0
5344 end: 0
5345 returnednumber: 0
5346 alwaysreturns: false
5347 knownreturn: false
5348 isreturnbool: false
5349 position:
5350 start: 6
5351 end: 30
5352 type: aggregation
5353 fixedlabels: true
5354 isconditional: true
5355
5356---
5357
5358[TestLabelsSource/98 - 1]
5359expr: absent(foo) or absent(bar)
5360output:
5361 - labels:
5362 "":
5363 reason: |-
5364 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5365 You will only get any results back if the metric selector you pass doesn't match anything.
5366 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5367 This means that the only labels you can get back from absent call are the ones you pass to it.
5368 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.
5369 kind: excluded
5370 fragment:
5371 start: 0
5372 end: 6
5373 deadinfo: null
5374 returns: vector
5375 operations:
5376 - node: '[*parser.VectorSelector] foo'
5377 op: ""
5378 - node: '[*parser.Call] absent(foo)'
5379 op: absent
5380 joins: []
5381 unless: []
5382 returninfo:
5383 logicalexpr: ""
5384 valueposition:
5385 start: 0
5386 end: 0
5387 returnednumber: 0
5388 alwaysreturns: false
5389 knownreturn: false
5390 isreturnbool: false
5391 position:
5392 start: 7
5393 end: 10
5394 type: function
5395 fixedlabels: true
5396 isconditional: false
5397 - labels:
5398 "":
5399 reason: |-
5400 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5401 You will only get any results back if the metric selector you pass doesn't match anything.
5402 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5403 This means that the only labels you can get back from absent call are the ones you pass to it.
5404 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.
5405 kind: excluded
5406 fragment:
5407 start: 15
5408 end: 21
5409 deadinfo: null
5410 returns: vector
5411 operations:
5412 - node: '[*parser.VectorSelector] bar'
5413 op: ""
5414 - node: '[*parser.Call] absent(bar)'
5415 op: absent
5416 joins: []
5417 unless: []
5418 returninfo:
5419 logicalexpr: ""
5420 valueposition:
5421 start: 0
5422 end: 0
5423 returnednumber: 0
5424 alwaysreturns: false
5425 knownreturn: false
5426 isreturnbool: false
5427 position:
5428 start: 22
5429 end: 25
5430 type: function
5431 fixedlabels: true
5432 isconditional: false
5433
5434---
5435
5436[TestLabelsSource/99 - 1]
5437expr: absent_over_time(foo[5m]) or absent(bar)
5438output:
5439 - labels:
5440 "":
5441 reason: |-
5442 The [absent_over_time()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent_over_time) function is used to check if provided query doesn't match any time series.
5443 You will only get any results back if the metric selector you pass doesn't match anything.
5444 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5445 This means that the only labels you can get back from absent call are the ones you pass to it.
5446 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.
5447 kind: excluded
5448 fragment:
5449 start: 0
5450 end: 16
5451 deadinfo: null
5452 returns: vector
5453 operations:
5454 - node: '[*parser.VectorSelector] foo'
5455 op: ""
5456 - node: '[*parser.Call] absent_over_time(foo[5m])'
5457 op: absent_over_time
5458 joins: []
5459 unless: []
5460 returninfo:
5461 logicalexpr: ""
5462 valueposition:
5463 start: 0
5464 end: 0
5465 returnednumber: 0
5466 alwaysreturns: false
5467 knownreturn: false
5468 isreturnbool: false
5469 position:
5470 start: 17
5471 end: 24
5472 type: function
5473 fixedlabels: true
5474 isconditional: false
5475 - labels:
5476 "":
5477 reason: |-
5478 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5479 You will only get any results back if the metric selector you pass doesn't match anything.
5480 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5481 This means that the only labels you can get back from absent call are the ones you pass to it.
5482 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.
5483 kind: excluded
5484 fragment:
5485 start: 29
5486 end: 35
5487 deadinfo: null
5488 returns: vector
5489 operations:
5490 - node: '[*parser.VectorSelector] bar'
5491 op: ""
5492 - node: '[*parser.Call] absent(bar)'
5493 op: absent
5494 joins: []
5495 unless: []
5496 returninfo:
5497 logicalexpr: ""
5498 valueposition:
5499 start: 0
5500 end: 0
5501 returnednumber: 0
5502 alwaysreturns: false
5503 knownreturn: false
5504 isreturnbool: false
5505 position:
5506 start: 36
5507 end: 39
5508 type: function
5509 fixedlabels: true
5510 isconditional: false
5511
5512---
5513
5514[TestLabelsSource/100 - 1]
5515expr: bar * on() group_right(cluster, env) absent(foo{job="xxx"})
5516output:
5517 - labels:
5518 "":
5519 reason: |-
5520 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5521 You will only get any results back if the metric selector you pass doesn't match anything.
5522 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5523 This means that the only labels you can get back from absent call are the ones you pass to it.
5524 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.
5525 kind: excluded
5526 fragment:
5527 start: 37
5528 end: 43
5529 cluster:
5530 reason: Query is using one-to-many vector matching with `group_right(cluster, env)`, all labels included inside `group_right(...)` will be include on the results.
5531 kind: included
5532 fragment:
5533 start: 11
5534 end: 22
5535 env:
5536 reason: Query is using one-to-many vector matching with `group_right(cluster, env)`, all labels included inside `group_right(...)` will be include on the results.
5537 kind: included
5538 fragment:
5539 start: 11
5540 end: 22
5541 job:
5542 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
5543 kind: guaranteed
5544 fragment:
5545 start: 37
5546 end: 59
5547 deadinfo: null
5548 returns: vector
5549 operations:
5550 - node: '[*parser.VectorSelector] foo{job="xxx"}'
5551 op: ""
5552 - node: '[*parser.Call] absent(foo{job="xxx"})'
5553 op: absent
5554 joins:
5555 - "on": []
5556 ignoring: []
5557 addedlabels:
5558 - cluster
5559 - env
5560 src:
5561 labels: {}
5562 deadinfo: null
5563 returns: vector
5564 operations:
5565 - node: '[*parser.VectorSelector] bar'
5566 op: ""
5567 joins: []
5568 unless: []
5569 returninfo:
5570 logicalexpr: ""
5571 valueposition:
5572 start: 0
5573 end: 0
5574 returnednumber: 0
5575 alwaysreturns: false
5576 knownreturn: false
5577 isreturnbool: false
5578 position:
5579 start: 0
5580 end: 3
5581 type: selector
5582 fixedlabels: false
5583 isconditional: false
5584 op: 57395
5585 depth: 0
5586 unless: []
5587 returninfo:
5588 logicalexpr: ""
5589 valueposition:
5590 start: 0
5591 end: 0
5592 returnednumber: 0
5593 alwaysreturns: false
5594 knownreturn: false
5595 isreturnbool: false
5596 position:
5597 start: 44
5598 end: 58
5599 type: function
5600 fixedlabels: true
5601 isconditional: false
5602
5603---
5604
5605[TestLabelsSource/101 - 1]
5606expr: bar * on() group_right() absent(foo{job="xxx"})
5607output:
5608 - labels:
5609 "":
5610 reason: |-
5611 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5612 You will only get any results back if the metric selector you pass doesn't match anything.
5613 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5614 This means that the only labels you can get back from absent call are the ones you pass to it.
5615 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.
5616 kind: excluded
5617 fragment:
5618 start: 25
5619 end: 31
5620 job:
5621 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
5622 kind: guaranteed
5623 fragment:
5624 start: 25
5625 end: 47
5626 deadinfo: null
5627 returns: vector
5628 operations:
5629 - node: '[*parser.VectorSelector] foo{job="xxx"}'
5630 op: ""
5631 - node: '[*parser.Call] absent(foo{job="xxx"})'
5632 op: absent
5633 joins:
5634 - "on": []
5635 ignoring: []
5636 addedlabels: []
5637 src:
5638 labels: {}
5639 deadinfo: null
5640 returns: vector
5641 operations:
5642 - node: '[*parser.VectorSelector] bar'
5643 op: ""
5644 joins: []
5645 unless: []
5646 returninfo:
5647 logicalexpr: ""
5648 valueposition:
5649 start: 0
5650 end: 0
5651 returnednumber: 0
5652 alwaysreturns: false
5653 knownreturn: false
5654 isreturnbool: false
5655 position:
5656 start: 0
5657 end: 3
5658 type: selector
5659 fixedlabels: false
5660 isconditional: false
5661 op: 57395
5662 depth: 0
5663 unless: []
5664 returninfo:
5665 logicalexpr: ""
5666 valueposition:
5667 start: 0
5668 end: 0
5669 returnednumber: 0
5670 alwaysreturns: false
5671 knownreturn: false
5672 isreturnbool: false
5673 position:
5674 start: 32
5675 end: 46
5676 type: function
5677 fixedlabels: true
5678 isconditional: false
5679
5680---
5681
5682[TestLabelsSource/102 - 1]
5683expr: vector(1)
5684output:
5685 - labels:
5686 "":
5687 reason: Calling `vector()` will return a vector value with no labels.
5688 kind: excluded
5689 fragment:
5690 start: 0
5691 end: 6
5692 deadinfo: null
5693 returns: vector
5694 operations:
5695 - node: '[*parser.Call] vector(1)'
5696 op: vector
5697 joins: []
5698 unless: []
5699 returninfo:
5700 logicalexpr: ""
5701 valueposition:
5702 start: 0
5703 end: 9
5704 returnednumber: 1
5705 alwaysreturns: true
5706 knownreturn: true
5707 isreturnbool: false
5708 position:
5709 start: 0
5710 end: 9
5711 type: function
5712 fixedlabels: true
5713 isconditional: false
5714
5715---
5716
5717[TestLabelsSource/103 - 1]
5718expr: vector(scalar(foo))
5719output:
5720 - labels:
5721 "":
5722 reason: Calling `vector()` will return a vector value with no labels.
5723 kind: excluded
5724 fragment:
5725 start: 0
5726 end: 6
5727 deadinfo: null
5728 returns: vector
5729 operations:
5730 - node: '[*parser.Call] vector(scalar(foo))'
5731 op: vector
5732 joins: []
5733 unless: []
5734 returninfo:
5735 logicalexpr: ""
5736 valueposition:
5737 start: 0
5738 end: 19
5739 returnednumber: 0
5740 alwaysreturns: true
5741 knownreturn: false
5742 isreturnbool: false
5743 position:
5744 start: 0
5745 end: 19
5746 type: function
5747 fixedlabels: true
5748 isconditional: false
5749
5750---
5751
5752[TestLabelsSource/104 - 1]
5753expr: vector(0.0 >= bool 0.5) == 1
5754output:
5755 - labels:
5756 "":
5757 reason: Calling `vector()` will return a vector value with no labels.
5758 kind: excluded
5759 fragment:
5760 start: 0
5761 end: 6
5762 deadinfo:
5763 reason: '`vector(0.0 >= bool 0.5) == 1` always evaluates to `0 == 1` which is not possible, so it will never return anything.'
5764 fragment:
5765 start: 0
5766 end: 24
5767 returns: vector
5768 operations:
5769 - node: '[*parser.Call] vector(0 >= bool 0.5)'
5770 op: vector
5771 joins: []
5772 unless: []
5773 returninfo:
5774 logicalexpr: ""
5775 valueposition:
5776 start: 0
5777 end: 24
5778 returnednumber: 0
5779 alwaysreturns: true
5780 knownreturn: true
5781 isreturnbool: false
5782 position:
5783 start: 0
5784 end: 24
5785 type: function
5786 fixedlabels: true
5787 isconditional: true
5788
5789---
5790
5791[TestLabelsSource/105 - 1]
5792expr: sum_over_time(foo{job="myjob"}[5m])
5793output:
5794 - labels:
5795 job:
5796 reason: Query will only return series where these labels are present.
5797 kind: guaranteed
5798 fragment:
5799 start: 0
5800 end: 35
5801 deadinfo: null
5802 returns: vector
5803 operations:
5804 - node: '[*parser.VectorSelector] foo{job="myjob"}'
5805 op: ""
5806 - node: '[*parser.Call] sum_over_time(foo{job="myjob"}[5m])'
5807 op: sum_over_time
5808 joins: []
5809 unless: []
5810 returninfo:
5811 logicalexpr: ""
5812 valueposition:
5813 start: 0
5814 end: 0
5815 returnednumber: 0
5816 alwaysreturns: false
5817 knownreturn: false
5818 isreturnbool: false
5819 position:
5820 start: 14
5821 end: 34
5822 type: function
5823 fixedlabels: false
5824 isconditional: false
5825
5826---
5827
5828[TestLabelsSource/106 - 1]
5829expr: days_in_month()
5830output:
5831 - labels:
5832 "":
5833 reason: Calling `days_in_month()` with no arguments will return an empty time series with no labels.
5834 kind: excluded
5835 fragment:
5836 start: 0
5837 end: 15
5838 deadinfo: null
5839 returns: vector
5840 operations:
5841 - node: '[*parser.Call] days_in_month()'
5842 op: days_in_month
5843 joins: []
5844 unless: []
5845 returninfo:
5846 logicalexpr: ""
5847 valueposition:
5848 start: 0
5849 end: 0
5850 returnednumber: 0
5851 alwaysreturns: true
5852 knownreturn: false
5853 isreturnbool: false
5854 position:
5855 start: 0
5856 end: 15
5857 type: function
5858 fixedlabels: true
5859 isconditional: false
5860
5861---
5862
5863[TestLabelsSource/107 - 1]
5864expr: days_in_month(foo{job="foo"})
5865output:
5866 - labels:
5867 job:
5868 reason: Query will only return series where these labels are present.
5869 kind: guaranteed
5870 fragment:
5871 start: 0
5872 end: 29
5873 deadinfo: null
5874 returns: vector
5875 operations:
5876 - node: '[*parser.VectorSelector] foo{job="foo"}'
5877 op: ""
5878 - node: '[*parser.Call] days_in_month(foo{job="foo"})'
5879 op: days_in_month
5880 joins: []
5881 unless: []
5882 returninfo:
5883 logicalexpr: ""
5884 valueposition:
5885 start: 0
5886 end: 0
5887 returnednumber: 0
5888 alwaysreturns: false
5889 knownreturn: false
5890 isreturnbool: false
5891 position:
5892 start: 14
5893 end: 28
5894 type: function
5895 fixedlabels: false
5896 isconditional: false
5897
5898---
5899
5900[TestLabelsSource/108 - 1]
5901expr: label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*")
5902output:
5903 - labels:
5904 foo:
5905 reason: This label will be added to the result by label_replace() call.
5906 kind: guaranteed
5907 fragment:
5908 start: 0
5909 end: 84
5910 job:
5911 reason: Query will only return series where these labels are present.
5912 kind: guaranteed
5913 fragment:
5914 start: 14
5915 end: 48
5916 service:
5917 reason: Query will only return series where these labels are present.
5918 kind: guaranteed
5919 fragment:
5920 start: 14
5921 end: 48
5922 deadinfo: null
5923 returns: vector
5924 operations:
5925 - node: '[*parser.VectorSelector] up{job="api-server",service="a:c"}'
5926 op: ""
5927 - node: '[*parser.Call] label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*")'
5928 op: label_replace
5929 joins: []
5930 unless: []
5931 returninfo:
5932 logicalexpr: ""
5933 valueposition:
5934 start: 0
5935 end: 0
5936 returnednumber: 0
5937 alwaysreturns: false
5938 knownreturn: false
5939 isreturnbool: false
5940 position:
5941 start: 14
5942 end: 48
5943 type: function
5944 fixedlabels: false
5945 isconditional: false
5946
5947---
5948
5949[TestLabelsSource/109 - 1]
5950expr: label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)")
5951output:
5952 - labels:
5953 "":
5954 reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results.
5955 kind: excluded
5956 fragment:
5957 start: 18
5958 end: 21
5959 __name__:
5960 reason: Aggregation removes metric name.
5961 kind: excluded
5962 fragment:
5963 start: 14
5964 end: 39
5965 cluster:
5966 reason: This label will be added to the result by label_replace() call.
5967 kind: guaranteed
5968 fragment:
5969 start: 0
5970 end: 76
5971 pod:
5972 reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results.
5973 kind: included
5974 fragment:
5975 start: 18
5976 end: 21
5977 deadinfo: null
5978 returns: vector
5979 operations:
5980 - node: '[*parser.VectorSelector] pod_status'
5981 op: ""
5982 - node: '[*parser.AggregateExpr] sum by (pod) (pod_status)'
5983 op: sum
5984 - node: '[*parser.Call] label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)")'
5985 op: label_replace
5986 joins: []
5987 unless: []
5988 returninfo:
5989 logicalexpr: ""
5990 valueposition:
5991 start: 0
5992 end: 0
5993 returnednumber: 0
5994 alwaysreturns: false
5995 knownreturn: false
5996 isreturnbool: false
5997 position:
5998 start: 14
5999 end: 43
6000 type: function
6001 fixedlabels: true
6002 isconditional: true
6003
6004---
6005
6006[TestLabelsSource/110 - 1]
6007expr: (time() - my_metric) > 5*3600
6008output:
6009 - labels: {}
6010 deadinfo: null
6011 returns: vector
6012 operations:
6013 - node: '[*parser.VectorSelector] my_metric'
6014 op: ""
6015 joins: []
6016 unless: []
6017 returninfo:
6018 logicalexpr: ""
6019 valueposition:
6020 start: 0
6021 end: 0
6022 returnednumber: 0
6023 alwaysreturns: false
6024 knownreturn: false
6025 isreturnbool: false
6026 position:
6027 start: 10
6028 end: 19
6029 type: selector
6030 fixedlabels: false
6031 isconditional: true
6032
6033---
6034
6035[TestLabelsSource/111 - 1]
6036expr: up{instance="a", job="prometheus"} * ignoring(job) up{instance="a", job="pint"}
6037output:
6038 - labels:
6039 instance:
6040 reason: Query will only return series where these labels are present.
6041 kind: guaranteed
6042 fragment:
6043 start: 0
6044 end: 34
6045 job:
6046 reason: Query is using one-to-one vector matching with `ignoring(job)`, all labels included inside `ignoring(...)` will be removed on the results.
6047 kind: excluded
6048 fragment:
6049 start: 37
6050 end: 45
6051 deadinfo: null
6052 returns: vector
6053 operations:
6054 - node: '[*parser.VectorSelector] up{instance="a",job="prometheus"}'
6055 op: ""
6056 joins:
6057 - "on": []
6058 ignoring:
6059 - job
6060 addedlabels: []
6061 src:
6062 labels:
6063 instance:
6064 reason: Query will only return series where these labels are present.
6065 kind: guaranteed
6066 fragment:
6067 start: 51
6068 end: 79
6069 job:
6070 reason: Query will only return series where these labels are present.
6071 kind: guaranteed
6072 fragment:
6073 start: 51
6074 end: 79
6075 deadinfo: null
6076 returns: vector
6077 operations:
6078 - node: '[*parser.VectorSelector] up{instance="a",job="pint"}'
6079 op: ""
6080 joins: []
6081 unless: []
6082 returninfo:
6083 logicalexpr: ""
6084 valueposition:
6085 start: 0
6086 end: 0
6087 returnednumber: 0
6088 alwaysreturns: false
6089 knownreturn: false
6090 isreturnbool: false
6091 position:
6092 start: 51
6093 end: 79
6094 type: selector
6095 fixedlabels: false
6096 isconditional: false
6097 op: 57395
6098 depth: 0
6099 unless: []
6100 returninfo:
6101 logicalexpr: ""
6102 valueposition:
6103 start: 0
6104 end: 0
6105 returnednumber: 0
6106 alwaysreturns: false
6107 knownreturn: false
6108 isreturnbool: false
6109 position:
6110 start: 0
6111 end: 34
6112 type: selector
6113 fixedlabels: false
6114 isconditional: false
6115
6116---
6117
6118[TestLabelsSource/112 - 1]
6119expr: |4
6120 avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"})
6121 < 0.5 > 0
6122 or sum without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"})
6123 < on() count(colo_router_tier:disabled_pops:max{tier="1",router=~"edge.*"}) * 0.4 > 0
6124 or avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"})
6125 < 0.1 > 0
6126output:
6127 - labels:
6128 __name__:
6129 reason: Aggregation removes metric name.
6130 kind: excluded
6131 fragment:
6132 start: 1
6133 end: 101
6134 colo_id:
6135 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6136 kind: excluded
6137 fragment:
6138 start: 5
6139 end: 12
6140 instance:
6141 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6142 kind: excluded
6143 fragment:
6144 start: 5
6145 end: 12
6146 router:
6147 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6148 kind: excluded
6149 fragment:
6150 start: 5
6151 end: 12
6152 deadinfo: null
6153 returns: vector
6154 operations:
6155 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"}'
6156 op: ""
6157 - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"})'
6158 op: avg
6159 joins: []
6160 unless: []
6161 returninfo:
6162 logicalexpr: ""
6163 valueposition:
6164 start: 0
6165 end: 0
6166 returnednumber: 0
6167 alwaysreturns: false
6168 knownreturn: false
6169 isreturnbool: false
6170 position:
6171 start: 41
6172 end: 100
6173 type: aggregation
6174 fixedlabels: false
6175 isconditional: true
6176 - labels:
6177 "":
6178 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
6179 kind: excluded
6180 fragment:
6181 start: 216
6182 end: 218
6183 __name__:
6184 reason: Aggregation removes metric name.
6185 kind: excluded
6186 fragment:
6187 start: 115
6188 end: 213
6189 cidr_use_case:
6190 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
6191 kind: excluded
6192 fragment:
6193 start: 216
6194 end: 218
6195 colo_id:
6196 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6197 kind: excluded
6198 fragment:
6199 start: 119
6200 end: 126
6201 instance:
6202 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6203 kind: excluded
6204 fragment:
6205 start: 119
6206 end: 126
6207 router:
6208 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6209 kind: excluded
6210 fragment:
6211 start: 119
6212 end: 126
6213 deadinfo: null
6214 returns: vector
6215 operations:
6216 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"}'
6217 op: ""
6218 - node: '[*parser.AggregateExpr] sum without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"})'
6219 op: sum
6220 joins:
6221 - "on": []
6222 ignoring: []
6223 addedlabels: []
6224 src:
6225 labels:
6226 "":
6227 reason: Query is using aggregation that removes all labels.
6228 kind: excluded
6229 fragment:
6230 start: 221
6231 end: 289
6232 __name__:
6233 reason: Aggregation removes metric name.
6234 kind: excluded
6235 fragment:
6236 start: 221
6237 end: 289
6238 router:
6239 reason: Query is using aggregation that removes all labels.
6240 kind: excluded
6241 fragment:
6242 start: 221
6243 end: 289
6244 tier:
6245 reason: Query is using aggregation that removes all labels.
6246 kind: excluded
6247 fragment:
6248 start: 221
6249 end: 289
6250 deadinfo: null
6251 returns: vector
6252 operations:
6253 - node: '[*parser.VectorSelector] colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"}'
6254 op: ""
6255 - node: '[*parser.AggregateExpr] count(colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"})'
6256 op: count
6257 joins: []
6258 unless: []
6259 returninfo:
6260 logicalexpr: ""
6261 valueposition:
6262 start: 0
6263 end: 0
6264 returnednumber: 0
6265 alwaysreturns: false
6266 knownreturn: false
6267 isreturnbool: false
6268 position:
6269 start: 227
6270 end: 288
6271 type: aggregation
6272 fixedlabels: true
6273 isconditional: false
6274 op: 57391
6275 depth: 0
6276 unless: []
6277 returninfo:
6278 logicalexpr: ""
6279 valueposition:
6280 start: 0
6281 end: 0
6282 returnednumber: 0
6283 alwaysreturns: false
6284 knownreturn: false
6285 isreturnbool: false
6286 position:
6287 start: 155
6288 end: 212
6289 type: aggregation
6290 fixedlabels: true
6291 isconditional: true
6292 - labels:
6293 __name__:
6294 reason: Aggregation removes metric name.
6295 kind: excluded
6296 fragment:
6297 start: 303
6298 end: 404
6299 cidr_use_case:
6300 reason: Query will only return series where these labels are present.
6301 kind: guaranteed
6302 fragment:
6303 start: 343
6304 end: 403
6305 colo_id:
6306 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6307 kind: excluded
6308 fragment:
6309 start: 307
6310 end: 314
6311 instance:
6312 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6313 kind: excluded
6314 fragment:
6315 start: 307
6316 end: 314
6317 router:
6318 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6319 kind: excluded
6320 fragment:
6321 start: 307
6322 end: 314
6323 deadinfo: null
6324 returns: vector
6325 operations:
6326 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"}'
6327 op: ""
6328 - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"})'
6329 op: avg
6330 joins: []
6331 unless: []
6332 returninfo:
6333 logicalexpr: ""
6334 valueposition:
6335 start: 0
6336 end: 0
6337 returnednumber: 0
6338 alwaysreturns: false
6339 knownreturn: false
6340 isreturnbool: false
6341 position:
6342 start: 343
6343 end: 403
6344 type: aggregation
6345 fixedlabels: false
6346 isconditional: true
6347
6348---
6349
6350[TestLabelsSource/113 - 1]
6351expr: label_replace(sum(foo) without(instance), "instance", "none", "", "")
6352output:
6353 - labels:
6354 __name__:
6355 reason: Aggregation removes metric name.
6356 kind: excluded
6357 fragment:
6358 start: 14
6359 end: 40
6360 instance:
6361 reason: This label will be added to the result by label_replace() call.
6362 kind: guaranteed
6363 fragment:
6364 start: 0
6365 end: 69
6366 deadinfo: null
6367 returns: vector
6368 operations:
6369 - node: '[*parser.VectorSelector] foo'
6370 op: ""
6371 - node: '[*parser.AggregateExpr] sum without (instance) (foo)'
6372 op: sum
6373 - node: '[*parser.Call] label_replace(sum without (instance) (foo), "instance", "none", "", "")'
6374 op: label_replace
6375 joins: []
6376 unless: []
6377 returninfo:
6378 logicalexpr: ""
6379 valueposition:
6380 start: 0
6381 end: 0
6382 returnednumber: 0
6383 alwaysreturns: false
6384 knownreturn: false
6385 isreturnbool: false
6386 position:
6387 start: 14
6388 end: 40
6389 type: function
6390 fixedlabels: false
6391 isconditional: false
6392
6393---
6394
6395[TestLabelsSource/114 - 1]
6396expr: |4-
6397 sum by (region, target, colo_name) (
6398 sum_over_time(probe_success{job="abc"}[5m])
6399 or
6400 vector(1)
6401 ) == 0
6402output:
6403 - labels:
6404 "":
6405 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6406 kind: excluded
6407 fragment:
6408 start: 5
6409 end: 8
6410 __name__:
6411 reason: Aggregation removes metric name.
6412 kind: excluded
6413 fragment:
6414 start: 1
6415 end: 102
6416 colo_name:
6417 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6418 kind: included
6419 fragment:
6420 start: 5
6421 end: 8
6422 job:
6423 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6424 kind: excluded
6425 fragment:
6426 start: 5
6427 end: 8
6428 region:
6429 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6430 kind: included
6431 fragment:
6432 start: 5
6433 end: 8
6434 target:
6435 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6436 kind: included
6437 fragment:
6438 start: 5
6439 end: 8
6440 deadinfo: null
6441 returns: vector
6442 operations:
6443 - node: '[*parser.VectorSelector] probe_success{job="abc"}'
6444 op: ""
6445 - node: '[*parser.Call] sum_over_time(probe_success{job="abc"}[5m])'
6446 op: sum_over_time
6447 - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))'
6448 op: sum
6449 joins: []
6450 unless: []
6451 returninfo:
6452 logicalexpr: ""
6453 valueposition:
6454 start: 0
6455 end: 0
6456 returnednumber: 0
6457 alwaysreturns: false
6458 knownreturn: false
6459 isreturnbool: false
6460 position:
6461 start: 56
6462 end: 84
6463 type: aggregation
6464 fixedlabels: true
6465 isconditional: true
6466 - labels:
6467 "":
6468 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6469 kind: excluded
6470 fragment:
6471 start: 5
6472 end: 8
6473 __name__:
6474 reason: Aggregation removes metric name.
6475 kind: excluded
6476 fragment:
6477 start: 1
6478 end: 102
6479 colo_name:
6480 reason: Calling `vector()` will return a vector value with no labels.
6481 kind: excluded
6482 fragment:
6483 start: 91
6484 end: 97
6485 region:
6486 reason: Calling `vector()` will return a vector value with no labels.
6487 kind: excluded
6488 fragment:
6489 start: 91
6490 end: 97
6491 target:
6492 reason: Calling `vector()` will return a vector value with no labels.
6493 kind: excluded
6494 fragment:
6495 start: 91
6496 end: 97
6497 deadinfo:
6498 reason: '`vector(1) == 0` always evaluates to `1 == 0` which is not possible, so it will never return anything.'
6499 fragment:
6500 start: 91
6501 end: 100
6502 returns: vector
6503 operations:
6504 - node: '[*parser.Call] vector(1)'
6505 op: vector
6506 - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))'
6507 op: sum
6508 joins: []
6509 unless: []
6510 returninfo:
6511 logicalexpr: ""
6512 valueposition:
6513 start: 91
6514 end: 100
6515 returnednumber: 1
6516 alwaysreturns: true
6517 knownreturn: true
6518 isreturnbool: false
6519 position:
6520 start: 91
6521 end: 100
6522 type: aggregation
6523 fixedlabels: true
6524 isconditional: true
6525
6526---
6527
6528[TestLabelsSource/115 - 1]
6529expr: vector(1) or foo
6530output:
6531 - labels:
6532 "":
6533 reason: Calling `vector()` will return a vector value with no labels.
6534 kind: excluded
6535 fragment:
6536 start: 0
6537 end: 6
6538 deadinfo: null
6539 returns: vector
6540 operations:
6541 - node: '[*parser.Call] vector(1)'
6542 op: vector
6543 joins: []
6544 unless: []
6545 returninfo:
6546 logicalexpr: ""
6547 valueposition:
6548 start: 0
6549 end: 9
6550 returnednumber: 1
6551 alwaysreturns: true
6552 knownreturn: true
6553 isreturnbool: false
6554 position:
6555 start: 0
6556 end: 9
6557 type: function
6558 fixedlabels: true
6559 isconditional: false
6560 - labels: {}
6561 deadinfo:
6562 reason: The left hand side always returs something and so the right hand side is never used.
6563 fragment:
6564 start: 13
6565 end: 16
6566 returns: vector
6567 operations:
6568 - node: '[*parser.VectorSelector] foo'
6569 op: ""
6570 joins: []
6571 unless: []
6572 returninfo:
6573 logicalexpr: ""
6574 valueposition:
6575 start: 0
6576 end: 0
6577 returnednumber: 0
6578 alwaysreturns: false
6579 knownreturn: false
6580 isreturnbool: false
6581 position:
6582 start: 13
6583 end: 16
6584 type: selector
6585 fixedlabels: false
6586 isconditional: false
6587
6588---
6589
6590[TestLabelsSource/116 - 1]
6591expr: vector(0) > 0
6592output:
6593 - labels:
6594 "":
6595 reason: Calling `vector()` will return a vector value with no labels.
6596 kind: excluded
6597 fragment:
6598 start: 0
6599 end: 6
6600 deadinfo:
6601 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
6602 fragment:
6603 start: 0
6604 end: 9
6605 returns: vector
6606 operations:
6607 - node: '[*parser.Call] vector(0)'
6608 op: vector
6609 joins: []
6610 unless: []
6611 returninfo:
6612 logicalexpr: ""
6613 valueposition:
6614 start: 0
6615 end: 9
6616 returnednumber: 0
6617 alwaysreturns: true
6618 knownreturn: true
6619 isreturnbool: false
6620 position:
6621 start: 0
6622 end: 9
6623 type: function
6624 fixedlabels: true
6625 isconditional: true
6626
6627---
6628
6629[TestLabelsSource/117 - 1]
6630expr: vector(0) > vector(1)
6631output:
6632 - labels:
6633 "":
6634 reason: Calling `vector()` will return a vector value with no labels.
6635 kind: excluded
6636 fragment:
6637 start: 0
6638 end: 6
6639 deadinfo:
6640 reason: '`vector(0) > vector(1)` always evaluates to `0 > 1` which is not possible, so it will never return anything.'
6641 fragment:
6642 start: 0
6643 end: 9
6644 returns: vector
6645 operations:
6646 - node: '[*parser.Call] vector(0)'
6647 op: vector
6648 joins:
6649 - "on": []
6650 ignoring: []
6651 addedlabels: []
6652 src:
6653 labels:
6654 "":
6655 reason: Calling `vector()` will return a vector value with no labels.
6656 kind: excluded
6657 fragment:
6658 start: 12
6659 end: 18
6660 deadinfo: null
6661 returns: vector
6662 operations:
6663 - node: '[*parser.Call] vector(1)'
6664 op: vector
6665 joins: []
6666 unless: []
6667 returninfo:
6668 logicalexpr: ""
6669 valueposition:
6670 start: 12
6671 end: 21
6672 returnednumber: 1
6673 alwaysreturns: true
6674 knownreturn: true
6675 isreturnbool: false
6676 position:
6677 start: 12
6678 end: 21
6679 type: function
6680 fixedlabels: true
6681 isconditional: false
6682 op: 57388
6683 depth: 0
6684 unless: []
6685 returninfo:
6686 logicalexpr: ""
6687 valueposition:
6688 start: 0
6689 end: 9
6690 returnednumber: 0
6691 alwaysreturns: true
6692 knownreturn: true
6693 isreturnbool: false
6694 position:
6695 start: 0
6696 end: 9
6697 type: function
6698 fixedlabels: true
6699 isconditional: true
6700
6701---
6702
6703[TestLabelsSource/118 - 1]
6704expr: sum(foo or vector(0)) > 0
6705output:
6706 - labels:
6707 "":
6708 reason: Query is using aggregation that removes all labels.
6709 kind: excluded
6710 fragment:
6711 start: 0
6712 end: 3
6713 __name__:
6714 reason: Aggregation removes metric name.
6715 kind: excluded
6716 fragment:
6717 start: 0
6718 end: 21
6719 deadinfo: null
6720 returns: vector
6721 operations:
6722 - node: '[*parser.VectorSelector] foo'
6723 op: ""
6724 - node: '[*parser.AggregateExpr] sum(foo or vector(0))'
6725 op: sum
6726 joins: []
6727 unless: []
6728 returninfo:
6729 logicalexpr: ""
6730 valueposition:
6731 start: 0
6732 end: 0
6733 returnednumber: 0
6734 alwaysreturns: false
6735 knownreturn: false
6736 isreturnbool: false
6737 position:
6738 start: 4
6739 end: 7
6740 type: aggregation
6741 fixedlabels: true
6742 isconditional: true
6743 - labels:
6744 "":
6745 reason: Query is using aggregation that removes all labels.
6746 kind: excluded
6747 fragment:
6748 start: 0
6749 end: 3
6750 __name__:
6751 reason: Aggregation removes metric name.
6752 kind: excluded
6753 fragment:
6754 start: 0
6755 end: 21
6756 deadinfo:
6757 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
6758 fragment:
6759 start: 11
6760 end: 20
6761 returns: vector
6762 operations:
6763 - node: '[*parser.Call] vector(0)'
6764 op: vector
6765 - node: '[*parser.AggregateExpr] sum(foo or vector(0))'
6766 op: sum
6767 joins: []
6768 unless: []
6769 returninfo:
6770 logicalexpr: ""
6771 valueposition:
6772 start: 11
6773 end: 20
6774 returnednumber: 0
6775 alwaysreturns: true
6776 knownreturn: true
6777 isreturnbool: false
6778 position:
6779 start: 11
6780 end: 20
6781 type: aggregation
6782 fixedlabels: true
6783 isconditional: true
6784
6785---
6786
6787[TestLabelsSource/119 - 1]
6788expr: (sum(foo or vector(1)) > 0) == 2
6789output:
6790 - labels:
6791 "":
6792 reason: Query is using aggregation that removes all labels.
6793 kind: excluded
6794 fragment:
6795 start: 1
6796 end: 4
6797 __name__:
6798 reason: Aggregation removes metric name.
6799 kind: excluded
6800 fragment:
6801 start: 1
6802 end: 22
6803 deadinfo: null
6804 returns: vector
6805 operations:
6806 - node: '[*parser.VectorSelector] foo'
6807 op: ""
6808 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
6809 op: sum
6810 joins: []
6811 unless: []
6812 returninfo:
6813 logicalexpr: ""
6814 valueposition:
6815 start: 0
6816 end: 0
6817 returnednumber: 0
6818 alwaysreturns: false
6819 knownreturn: false
6820 isreturnbool: false
6821 position:
6822 start: 5
6823 end: 8
6824 type: aggregation
6825 fixedlabels: true
6826 isconditional: true
6827 - labels:
6828 "":
6829 reason: Query is using aggregation that removes all labels.
6830 kind: excluded
6831 fragment:
6832 start: 1
6833 end: 4
6834 __name__:
6835 reason: Aggregation removes metric name.
6836 kind: excluded
6837 fragment:
6838 start: 1
6839 end: 22
6840 deadinfo:
6841 reason: '`vector(1) == 2` always evaluates to `1 == 2` which is not possible, so it will never return anything.'
6842 fragment:
6843 start: 12
6844 end: 21
6845 returns: vector
6846 operations:
6847 - node: '[*parser.Call] vector(1)'
6848 op: vector
6849 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
6850 op: sum
6851 joins: []
6852 unless: []
6853 returninfo:
6854 logicalexpr: ""
6855 valueposition:
6856 start: 12
6857 end: 21
6858 returnednumber: 1
6859 alwaysreturns: true
6860 knownreturn: true
6861 isreturnbool: false
6862 position:
6863 start: 12
6864 end: 21
6865 type: aggregation
6866 fixedlabels: true
6867 isconditional: true
6868
6869---
6870
6871[TestLabelsSource/120 - 1]
6872expr: (sum(foo or vector(1)) > 0) != 2
6873output:
6874 - labels:
6875 "":
6876 reason: Query is using aggregation that removes all labels.
6877 kind: excluded
6878 fragment:
6879 start: 1
6880 end: 4
6881 __name__:
6882 reason: Aggregation removes metric name.
6883 kind: excluded
6884 fragment:
6885 start: 1
6886 end: 22
6887 deadinfo: null
6888 returns: vector
6889 operations:
6890 - node: '[*parser.VectorSelector] foo'
6891 op: ""
6892 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
6893 op: sum
6894 joins: []
6895 unless: []
6896 returninfo:
6897 logicalexpr: ""
6898 valueposition:
6899 start: 0
6900 end: 0
6901 returnednumber: 0
6902 alwaysreturns: false
6903 knownreturn: false
6904 isreturnbool: false
6905 position:
6906 start: 5
6907 end: 8
6908 type: aggregation
6909 fixedlabels: true
6910 isconditional: true
6911 - labels:
6912 "":
6913 reason: Query is using aggregation that removes all labels.
6914 kind: excluded
6915 fragment:
6916 start: 1
6917 end: 4
6918 __name__:
6919 reason: Aggregation removes metric name.
6920 kind: excluded
6921 fragment:
6922 start: 1
6923 end: 22
6924 deadinfo: null
6925 returns: vector
6926 operations:
6927 - node: '[*parser.Call] vector(1)'
6928 op: vector
6929 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
6930 op: sum
6931 joins: []
6932 unless: []
6933 returninfo:
6934 logicalexpr: ""
6935 valueposition:
6936 start: 12
6937 end: 21
6938 returnednumber: 1
6939 alwaysreturns: true
6940 knownreturn: true
6941 isreturnbool: false
6942 position:
6943 start: 12
6944 end: 21
6945 type: aggregation
6946 fixedlabels: true
6947 isconditional: true
6948
6949---
6950
6951[TestLabelsSource/121 - 1]
6952expr: (sum(foo or vector(2)) > 0) != 2
6953output:
6954 - labels:
6955 "":
6956 reason: Query is using aggregation that removes all labels.
6957 kind: excluded
6958 fragment:
6959 start: 1
6960 end: 4
6961 __name__:
6962 reason: Aggregation removes metric name.
6963 kind: excluded
6964 fragment:
6965 start: 1
6966 end: 22
6967 deadinfo: null
6968 returns: vector
6969 operations:
6970 - node: '[*parser.VectorSelector] foo'
6971 op: ""
6972 - node: '[*parser.AggregateExpr] sum(foo or vector(2))'
6973 op: sum
6974 joins: []
6975 unless: []
6976 returninfo:
6977 logicalexpr: ""
6978 valueposition:
6979 start: 0
6980 end: 0
6981 returnednumber: 0
6982 alwaysreturns: false
6983 knownreturn: false
6984 isreturnbool: false
6985 position:
6986 start: 5
6987 end: 8
6988 type: aggregation
6989 fixedlabels: true
6990 isconditional: true
6991 - labels:
6992 "":
6993 reason: Query is using aggregation that removes all labels.
6994 kind: excluded
6995 fragment:
6996 start: 1
6997 end: 4
6998 __name__:
6999 reason: Aggregation removes metric name.
7000 kind: excluded
7001 fragment:
7002 start: 1
7003 end: 22
7004 deadinfo:
7005 reason: '`vector(2) != 2` always evaluates to `2 != 2` which is not possible, so it will never return anything.'
7006 fragment:
7007 start: 12
7008 end: 21
7009 returns: vector
7010 operations:
7011 - node: '[*parser.Call] vector(2)'
7012 op: vector
7013 - node: '[*parser.AggregateExpr] sum(foo or vector(2))'
7014 op: sum
7015 joins: []
7016 unless: []
7017 returninfo:
7018 logicalexpr: ""
7019 valueposition:
7020 start: 12
7021 end: 21
7022 returnednumber: 2
7023 alwaysreturns: true
7024 knownreturn: true
7025 isreturnbool: false
7026 position:
7027 start: 12
7028 end: 21
7029 type: aggregation
7030 fixedlabels: true
7031 isconditional: true
7032
7033---
7034
7035[TestLabelsSource/122 - 1]
7036expr: |-
7037 (sum(sometimes{foo!="bar"} or vector(0)))
7038 or
7039 ((bob > 10) or sum(foo) or vector(1))
7040output:
7041 - labels:
7042 "":
7043 reason: Query is using aggregation that removes all labels.
7044 kind: excluded
7045 fragment:
7046 start: 1
7047 end: 4
7048 __name__:
7049 reason: Aggregation removes metric name.
7050 kind: excluded
7051 fragment:
7052 start: 1
7053 end: 41
7054 deadinfo: null
7055 returns: vector
7056 operations:
7057 - node: '[*parser.VectorSelector] sometimes{foo!="bar"}'
7058 op: ""
7059 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))'
7060 op: sum
7061 joins: []
7062 unless: []
7063 returninfo:
7064 logicalexpr: ""
7065 valueposition:
7066 start: 0
7067 end: 0
7068 returnednumber: 0
7069 alwaysreturns: false
7070 knownreturn: false
7071 isreturnbool: false
7072 position:
7073 start: 5
7074 end: 26
7075 type: aggregation
7076 fixedlabels: true
7077 isconditional: false
7078 - labels:
7079 "":
7080 reason: Query is using aggregation that removes all labels.
7081 kind: excluded
7082 fragment:
7083 start: 1
7084 end: 4
7085 __name__:
7086 reason: Aggregation removes metric name.
7087 kind: excluded
7088 fragment:
7089 start: 1
7090 end: 41
7091 deadinfo: null
7092 returns: vector
7093 operations:
7094 - node: '[*parser.Call] vector(0)'
7095 op: vector
7096 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))'
7097 op: sum
7098 joins: []
7099 unless: []
7100 returninfo:
7101 logicalexpr: ""
7102 valueposition:
7103 start: 30
7104 end: 39
7105 returnednumber: 0
7106 alwaysreturns: true
7107 knownreturn: true
7108 isreturnbool: false
7109 position:
7110 start: 30
7111 end: 39
7112 type: aggregation
7113 fixedlabels: true
7114 isconditional: false
7115 - labels: {}
7116 deadinfo: null
7117 returns: vector
7118 operations:
7119 - node: '[*parser.VectorSelector] bob'
7120 op: ""
7121 joins: []
7122 unless: []
7123 returninfo:
7124 logicalexpr: ""
7125 valueposition:
7126 start: 0
7127 end: 0
7128 returnednumber: 0
7129 alwaysreturns: false
7130 knownreturn: false
7131 isreturnbool: false
7132 position:
7133 start: 47
7134 end: 50
7135 type: selector
7136 fixedlabels: false
7137 isconditional: true
7138 - labels:
7139 "":
7140 reason: Query is using aggregation that removes all labels.
7141 kind: excluded
7142 fragment:
7143 start: 60
7144 end: 63
7145 __name__:
7146 reason: Aggregation removes metric name.
7147 kind: excluded
7148 fragment:
7149 start: 60
7150 end: 68
7151 deadinfo: null
7152 returns: vector
7153 operations:
7154 - node: '[*parser.VectorSelector] foo'
7155 op: ""
7156 - node: '[*parser.AggregateExpr] sum(foo)'
7157 op: sum
7158 joins: []
7159 unless: []
7160 returninfo:
7161 logicalexpr: ""
7162 valueposition:
7163 start: 0
7164 end: 0
7165 returnednumber: 0
7166 alwaysreturns: false
7167 knownreturn: false
7168 isreturnbool: false
7169 position:
7170 start: 64
7171 end: 67
7172 type: aggregation
7173 fixedlabels: true
7174 isconditional: false
7175 - labels:
7176 "":
7177 reason: Calling `vector()` will return a vector value with no labels.
7178 kind: excluded
7179 fragment:
7180 start: 72
7181 end: 78
7182 deadinfo: null
7183 returns: vector
7184 operations:
7185 - node: '[*parser.Call] vector(1)'
7186 op: vector
7187 joins: []
7188 unless: []
7189 returninfo:
7190 logicalexpr: ""
7191 valueposition:
7192 start: 72
7193 end: 81
7194 returnednumber: 1
7195 alwaysreturns: true
7196 knownreturn: true
7197 isreturnbool: false
7198 position:
7199 start: 72
7200 end: 81
7201 type: function
7202 fixedlabels: true
7203 isconditional: false
7204
7205---
7206
7207[TestLabelsSource/123 - 1]
7208expr: |4-
7209 (
7210 sum(sometimes{foo!="bar"})
7211 or
7212 vector(1)
7213 ) and (
7214 ((bob > 10) or sum(bar))
7215 or
7216 notfound > 0
7217 )
7218output:
7219 - labels:
7220 "":
7221 reason: Query is using aggregation that removes all labels.
7222 kind: excluded
7223 fragment:
7224 start: 4
7225 end: 7
7226 __name__:
7227 reason: Aggregation removes metric name.
7228 kind: excluded
7229 fragment:
7230 start: 4
7231 end: 30
7232 deadinfo: null
7233 returns: vector
7234 operations:
7235 - node: '[*parser.VectorSelector] sometimes{foo!="bar"}'
7236 op: ""
7237 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"})'
7238 op: sum
7239 joins:
7240 - "on": []
7241 ignoring: []
7242 addedlabels: []
7243 src:
7244 labels: {}
7245 deadinfo: null
7246 returns: vector
7247 operations:
7248 - node: '[*parser.VectorSelector] bob'
7249 op: ""
7250 joins: []
7251 unless: []
7252 returninfo:
7253 logicalexpr: ""
7254 valueposition:
7255 start: 0
7256 end: 0
7257 returnednumber: 0
7258 alwaysreturns: false
7259 knownreturn: false
7260 isreturnbool: false
7261 position:
7262 start: 57
7263 end: 60
7264 type: selector
7265 fixedlabels: false
7266 isconditional: true
7267 op: 57389
7268 depth: 0
7269 - "on": []
7270 ignoring: []
7271 addedlabels: []
7272 src:
7273 labels:
7274 "":
7275 reason: Query is using aggregation that removes all labels.
7276 kind: excluded
7277 fragment:
7278 start: 70
7279 end: 73
7280 __name__:
7281 reason: Aggregation removes metric name.
7282 kind: excluded
7283 fragment:
7284 start: 70
7285 end: 79
7286 deadinfo: null
7287 returns: vector
7288 operations:
7289 - node: '[*parser.VectorSelector] bar'
7290 op: ""
7291 - node: '[*parser.AggregateExpr] sum(bar)'
7292 op: sum
7293 joins: []
7294 unless: []
7295 returninfo:
7296 logicalexpr: ""
7297 valueposition:
7298 start: 0
7299 end: 0
7300 returnednumber: 0
7301 alwaysreturns: false
7302 knownreturn: false
7303 isreturnbool: false
7304 position:
7305 start: 74
7306 end: 77
7307 type: aggregation
7308 fixedlabels: true
7309 isconditional: false
7310 op: 57389
7311 depth: 0
7312 - "on": []
7313 ignoring: []
7314 addedlabels: []
7315 src:
7316 labels: {}
7317 deadinfo: null
7318 returns: vector
7319 operations:
7320 - node: '[*parser.VectorSelector] notfound'
7321 op: ""
7322 joins: []
7323 unless: []
7324 returninfo:
7325 logicalexpr: ""
7326 valueposition:
7327 start: 0
7328 end: 0
7329 returnednumber: 0
7330 alwaysreturns: false
7331 knownreturn: false
7332 isreturnbool: false
7333 position:
7334 start: 85
7335 end: 93
7336 type: selector
7337 fixedlabels: false
7338 isconditional: true
7339 op: 57389
7340 depth: 0
7341 unless: []
7342 returninfo:
7343 logicalexpr: ""
7344 valueposition:
7345 start: 0
7346 end: 0
7347 returnednumber: 0
7348 alwaysreturns: false
7349 knownreturn: false
7350 isreturnbool: false
7351 position:
7352 start: 8
7353 end: 29
7354 type: aggregation
7355 fixedlabels: true
7356 isconditional: true
7357 - labels:
7358 "":
7359 reason: Calling `vector()` will return a vector value with no labels.
7360 kind: excluded
7361 fragment:
7362 start: 36
7363 end: 42
7364 deadinfo: null
7365 returns: vector
7366 operations:
7367 - node: '[*parser.Call] vector(1)'
7368 op: vector
7369 joins:
7370 - "on": []
7371 ignoring: []
7372 addedlabels: []
7373 src:
7374 labels: {}
7375 deadinfo: null
7376 returns: vector
7377 operations:
7378 - node: '[*parser.VectorSelector] bob'
7379 op: ""
7380 joins: []
7381 unless: []
7382 returninfo:
7383 logicalexpr: ""
7384 valueposition:
7385 start: 0
7386 end: 0
7387 returnednumber: 0
7388 alwaysreturns: false
7389 knownreturn: false
7390 isreturnbool: false
7391 position:
7392 start: 57
7393 end: 60
7394 type: selector
7395 fixedlabels: false
7396 isconditional: true
7397 op: 57389
7398 depth: 0
7399 - "on": []
7400 ignoring: []
7401 addedlabels: []
7402 src:
7403 labels:
7404 "":
7405 reason: Query is using aggregation that removes all labels.
7406 kind: excluded
7407 fragment:
7408 start: 70
7409 end: 73
7410 __name__:
7411 reason: Aggregation removes metric name.
7412 kind: excluded
7413 fragment:
7414 start: 70
7415 end: 79
7416 deadinfo: null
7417 returns: vector
7418 operations:
7419 - node: '[*parser.VectorSelector] bar'
7420 op: ""
7421 - node: '[*parser.AggregateExpr] sum(bar)'
7422 op: sum
7423 joins: []
7424 unless: []
7425 returninfo:
7426 logicalexpr: ""
7427 valueposition:
7428 start: 0
7429 end: 0
7430 returnednumber: 0
7431 alwaysreturns: false
7432 knownreturn: false
7433 isreturnbool: false
7434 position:
7435 start: 74
7436 end: 77
7437 type: aggregation
7438 fixedlabels: true
7439 isconditional: false
7440 op: 57389
7441 depth: 0
7442 - "on": []
7443 ignoring: []
7444 addedlabels: []
7445 src:
7446 labels: {}
7447 deadinfo: null
7448 returns: vector
7449 operations:
7450 - node: '[*parser.VectorSelector] notfound'
7451 op: ""
7452 joins: []
7453 unless: []
7454 returninfo:
7455 logicalexpr: ""
7456 valueposition:
7457 start: 0
7458 end: 0
7459 returnednumber: 0
7460 alwaysreturns: false
7461 knownreturn: false
7462 isreturnbool: false
7463 position:
7464 start: 85
7465 end: 93
7466 type: selector
7467 fixedlabels: false
7468 isconditional: true
7469 op: 57389
7470 depth: 0
7471 unless: []
7472 returninfo:
7473 logicalexpr: ""
7474 valueposition:
7475 start: 36
7476 end: 45
7477 returnednumber: 1
7478 alwaysreturns: true
7479 knownreturn: true
7480 isreturnbool: false
7481 position:
7482 start: 36
7483 end: 45
7484 type: function
7485 fixedlabels: true
7486 isconditional: true
7487
7488---
7489
7490[TestLabelsSource/124 - 1]
7491expr: foo offset 5m > 5
7492output:
7493 - labels: {}
7494 deadinfo: null
7495 returns: vector
7496 operations:
7497 - node: '[*parser.VectorSelector] foo offset 5m'
7498 op: ""
7499 joins: []
7500 unless: []
7501 returninfo:
7502 logicalexpr: ""
7503 valueposition:
7504 start: 0
7505 end: 0
7506 returnednumber: 0
7507 alwaysreturns: false
7508 knownreturn: false
7509 isreturnbool: false
7510 position:
7511 start: 0
7512 end: 13
7513 type: selector
7514 fixedlabels: false
7515 isconditional: true
7516
7517---
7518
7519[TestLabelsSource/125 - 1]
7520expr: |4
7521 (rate(metric2[5m]) or vector(0)) +
7522 (rate(metric1[5m]) or vector(1)) +
7523 (rate(metric3{log_name="samplerd"}[5m]) or vector(2)) > 0
7524output:
7525 - labels: {}
7526 deadinfo: null
7527 returns: vector
7528 operations:
7529 - node: '[*parser.VectorSelector] metric2'
7530 op: ""
7531 - node: '[*parser.Call] rate(metric2[5m])'
7532 op: rate
7533 joins:
7534 - "on": []
7535 ignoring: []
7536 addedlabels: []
7537 src:
7538 labels: {}
7539 deadinfo: null
7540 returns: vector
7541 operations:
7542 - node: '[*parser.VectorSelector] metric1'
7543 op: ""
7544 - node: '[*parser.Call] rate(metric1[5m])'
7545 op: rate
7546 joins: []
7547 unless: []
7548 returninfo:
7549 logicalexpr: ""
7550 valueposition:
7551 start: 0
7552 end: 0
7553 returnednumber: 0
7554 alwaysreturns: false
7555 knownreturn: false
7556 isreturnbool: false
7557 position:
7558 start: 42
7559 end: 53
7560 type: function
7561 fixedlabels: false
7562 isconditional: false
7563 op: 57383
7564 depth: 0
7565 - "on": []
7566 ignoring: []
7567 addedlabels: []
7568 src:
7569 labels:
7570 "":
7571 reason: Calling `vector()` will return a vector value with no labels.
7572 kind: excluded
7573 fragment:
7574 start: 58
7575 end: 64
7576 deadinfo: null
7577 returns: vector
7578 operations:
7579 - node: '[*parser.Call] vector(1)'
7580 op: vector
7581 joins: []
7582 unless: []
7583 returninfo:
7584 logicalexpr: ""
7585 valueposition:
7586 start: 58
7587 end: 67
7588 returnednumber: 1
7589 alwaysreturns: true
7590 knownreturn: true
7591 isreturnbool: false
7592 position:
7593 start: 58
7594 end: 67
7595 type: function
7596 fixedlabels: true
7597 isconditional: false
7598 op: 57383
7599 depth: 0
7600 - "on": []
7601 ignoring: []
7602 addedlabels: []
7603 src:
7604 labels:
7605 log_name:
7606 reason: Query will only return series where these labels are present.
7607 kind: guaranteed
7608 fragment:
7609 start: 72
7610 end: 110
7611 deadinfo: null
7612 returns: vector
7613 operations:
7614 - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}'
7615 op: ""
7616 - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])'
7617 op: rate
7618 joins: []
7619 unless: []
7620 returninfo:
7621 logicalexpr: ""
7622 valueposition:
7623 start: 0
7624 end: 0
7625 returnednumber: 0
7626 alwaysreturns: false
7627 knownreturn: false
7628 isreturnbool: false
7629 position:
7630 start: 77
7631 end: 109
7632 type: function
7633 fixedlabels: false
7634 isconditional: false
7635 op: 57383
7636 depth: 0
7637 - "on": []
7638 ignoring: []
7639 addedlabels: []
7640 src:
7641 labels:
7642 "":
7643 reason: Calling `vector()` will return a vector value with no labels.
7644 kind: excluded
7645 fragment:
7646 start: 114
7647 end: 120
7648 deadinfo: null
7649 returns: vector
7650 operations:
7651 - node: '[*parser.Call] vector(2)'
7652 op: vector
7653 joins: []
7654 unless: []
7655 returninfo:
7656 logicalexpr: ""
7657 valueposition:
7658 start: 114
7659 end: 123
7660 returnednumber: 2
7661 alwaysreturns: true
7662 knownreturn: true
7663 isreturnbool: false
7664 position:
7665 start: 114
7666 end: 123
7667 type: function
7668 fixedlabels: true
7669 isconditional: false
7670 op: 57383
7671 depth: 0
7672 unless: []
7673 returninfo:
7674 logicalexpr: ""
7675 valueposition:
7676 start: 0
7677 end: 0
7678 returnednumber: 0
7679 alwaysreturns: false
7680 knownreturn: false
7681 isreturnbool: false
7682 position:
7683 start: 7
7684 end: 18
7685 type: function
7686 fixedlabels: false
7687 isconditional: true
7688 - labels:
7689 "":
7690 reason: Calling `vector()` will return a vector value with no labels.
7691 kind: excluded
7692 fragment:
7693 start: 23
7694 end: 29
7695 deadinfo: null
7696 returns: vector
7697 operations:
7698 - node: '[*parser.Call] vector(0)'
7699 op: vector
7700 joins:
7701 - "on": []
7702 ignoring: []
7703 addedlabels: []
7704 src:
7705 labels: {}
7706 deadinfo: null
7707 returns: vector
7708 operations:
7709 - node: '[*parser.VectorSelector] metric1'
7710 op: ""
7711 - node: '[*parser.Call] rate(metric1[5m])'
7712 op: rate
7713 joins: []
7714 unless: []
7715 returninfo:
7716 logicalexpr: ""
7717 valueposition:
7718 start: 0
7719 end: 0
7720 returnednumber: 0
7721 alwaysreturns: false
7722 knownreturn: false
7723 isreturnbool: false
7724 position:
7725 start: 42
7726 end: 53
7727 type: function
7728 fixedlabels: false
7729 isconditional: false
7730 op: 57383
7731 depth: 0
7732 - "on": []
7733 ignoring: []
7734 addedlabels: []
7735 src:
7736 labels:
7737 "":
7738 reason: Calling `vector()` will return a vector value with no labels.
7739 kind: excluded
7740 fragment:
7741 start: 58
7742 end: 64
7743 deadinfo: null
7744 returns: vector
7745 operations:
7746 - node: '[*parser.Call] vector(1)'
7747 op: vector
7748 joins: []
7749 unless: []
7750 returninfo:
7751 logicalexpr: ""
7752 valueposition:
7753 start: 58
7754 end: 67
7755 returnednumber: 1
7756 alwaysreturns: true
7757 knownreturn: true
7758 isreturnbool: false
7759 position:
7760 start: 58
7761 end: 67
7762 type: function
7763 fixedlabels: true
7764 isconditional: false
7765 op: 57383
7766 depth: 0
7767 - "on": []
7768 ignoring: []
7769 addedlabels: []
7770 src:
7771 labels:
7772 log_name:
7773 reason: Query will only return series where these labels are present.
7774 kind: guaranteed
7775 fragment:
7776 start: 72
7777 end: 110
7778 deadinfo: null
7779 returns: vector
7780 operations:
7781 - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}'
7782 op: ""
7783 - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])'
7784 op: rate
7785 joins: []
7786 unless: []
7787 returninfo:
7788 logicalexpr: ""
7789 valueposition:
7790 start: 0
7791 end: 0
7792 returnednumber: 0
7793 alwaysreturns: false
7794 knownreturn: false
7795 isreturnbool: false
7796 position:
7797 start: 77
7798 end: 109
7799 type: function
7800 fixedlabels: false
7801 isconditional: false
7802 op: 57383
7803 depth: 0
7804 - "on": []
7805 ignoring: []
7806 addedlabels: []
7807 src:
7808 labels:
7809 "":
7810 reason: Calling `vector()` will return a vector value with no labels.
7811 kind: excluded
7812 fragment:
7813 start: 114
7814 end: 120
7815 deadinfo: null
7816 returns: vector
7817 operations:
7818 - node: '[*parser.Call] vector(2)'
7819 op: vector
7820 joins: []
7821 unless: []
7822 returninfo:
7823 logicalexpr: ""
7824 valueposition:
7825 start: 114
7826 end: 123
7827 returnednumber: 2
7828 alwaysreturns: true
7829 knownreturn: true
7830 isreturnbool: false
7831 position:
7832 start: 114
7833 end: 123
7834 type: function
7835 fixedlabels: true
7836 isconditional: false
7837 op: 57383
7838 depth: 0
7839 unless: []
7840 returninfo:
7841 logicalexpr: vector(0) + vector(1) + vector(2)
7842 valueposition:
7843 start: 23
7844 end: 32
7845 returnednumber: 3
7846 alwaysreturns: true
7847 knownreturn: true
7848 isreturnbool: false
7849 position:
7850 start: 23
7851 end: 32
7852 type: function
7853 fixedlabels: true
7854 isconditional: true
7855
7856---
7857
7858[TestLabelsSource/126 - 1]
7859expr: label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)")
7860output:
7861 - labels:
7862 "":
7863 reason: Calling `vector()` will return a vector value with no labels.
7864 kind: excluded
7865 fragment:
7866 start: 14
7867 end: 20
7868 nexthop_tag:
7869 reason: This label will be added to the result by label_replace() call.
7870 kind: guaranteed
7871 fragment:
7872 start: 0
7873 end: 64
7874 deadinfo: null
7875 returns: vector
7876 operations:
7877 - node: '[*parser.Call] vector(1)'
7878 op: vector
7879 - node: '[*parser.Call] label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)")'
7880 op: label_replace
7881 joins: []
7882 unless: []
7883 returninfo:
7884 logicalexpr: ""
7885 valueposition:
7886 start: 14
7887 end: 23
7888 returnednumber: 1
7889 alwaysreturns: true
7890 knownreturn: true
7891 isreturnbool: false
7892 position:
7893 start: 14
7894 end: 23
7895 type: function
7896 fixedlabels: true
7897 isconditional: false
7898
7899---
7900
7901[TestLabelsSource/127 - 1]
7902expr: (sum(foo{job="myjob"}))
7903output:
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: 23
7917 job:
7918 reason: Query is using aggregation that removes all labels.
7919 kind: excluded
7920 fragment:
7921 start: 1
7922 end: 4
7923 deadinfo: null
7924 returns: vector
7925 operations:
7926 - node: '[*parser.VectorSelector] foo{job="myjob"}'
7927 op: ""
7928 - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})'
7929 op: sum
7930 joins: []
7931 unless: []
7932 returninfo:
7933 logicalexpr: ""
7934 valueposition:
7935 start: 0
7936 end: 0
7937 returnednumber: 0
7938 alwaysreturns: false
7939 knownreturn: false
7940 isreturnbool: false
7941 position:
7942 start: 5
7943 end: 21
7944 type: aggregation
7945 fixedlabels: true
7946 isconditional: false
7947
7948---
7949
7950[TestLabelsSource/128 - 1]
7951expr: (-foo{job="myjob"})
7952output:
7953 - labels:
7954 job:
7955 reason: Query will only return series where these labels are present.
7956 kind: guaranteed
7957 fragment:
7958 start: 2
7959 end: 18
7960 deadinfo: null
7961 returns: vector
7962 operations:
7963 - node: '[*parser.VectorSelector] foo{job="myjob"}'
7964 op: ""
7965 joins: []
7966 unless: []
7967 returninfo:
7968 logicalexpr: ""
7969 valueposition:
7970 start: 0
7971 end: 0
7972 returnednumber: 0
7973 alwaysreturns: false
7974 knownreturn: false
7975 isreturnbool: false
7976 position:
7977 start: 2
7978 end: 18
7979 type: selector
7980 fixedlabels: false
7981 isconditional: false
7982
7983---
7984
7985[TestLabelsSource/129 - 1]
7986expr: |4-
7987 ((( group(vector(0)) ))) > 0
7988output:
7989 - labels:
7990 "":
7991 reason: Query is using aggregation that removes all labels.
7992 kind: excluded
7993 fragment:
7994 start: 5
7995 end: 23
7996 __name__:
7997 reason: Aggregation removes metric name.
7998 kind: excluded
7999 fragment:
8000 start: 5
8001 end: 23
8002 deadinfo:
8003 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
8004 fragment:
8005 start: 11
8006 end: 20
8007 returns: vector
8008 operations:
8009 - node: '[*parser.Call] vector(0)'
8010 op: vector
8011 - node: '[*parser.AggregateExpr] group(vector(0))'
8012 op: group
8013 joins: []
8014 unless: []
8015 returninfo:
8016 logicalexpr: ""
8017 valueposition:
8018 start: 11
8019 end: 20
8020 returnednumber: 0
8021 alwaysreturns: true
8022 knownreturn: true
8023 isreturnbool: false
8024 position:
8025 start: 11
8026 end: 20
8027 type: aggregation
8028 fixedlabels: true
8029 isconditional: true
8030
8031---
8032
8033[TestLabelsSource/130 - 1]
8034expr: 1 > bool 5
8035output:
8036 - labels:
8037 "":
8038 reason: This query returns a number value with no labels.
8039 kind: excluded
8040 fragment:
8041 start: 0
8042 end: 1
8043 deadinfo:
8044 reason: '`1 > 5` always evaluates to `1 > 5` and uses the `bool` modifier which means it will always return 0'
8045 fragment:
8046 start: 0
8047 end: 1
8048 returns: scalar
8049 operations: []
8050 joins: []
8051 unless: []
8052 returninfo:
8053 logicalexpr: ""
8054 valueposition:
8055 start: 0
8056 end: 1
8057 returnednumber: 1
8058 alwaysreturns: true
8059 knownreturn: true
8060 isreturnbool: true
8061 position:
8062 start: 0
8063 end: 1
8064 type: number
8065 fixedlabels: true
8066 isconditional: true
8067
8068---
8069
8070[TestLabelsSource/131 - 1]
8071expr: prometheus_ready{job="prometheus"} unless vector(0)
8072output:
8073 - labels:
8074 job:
8075 reason: Query will only return series where these labels are present.
8076 kind: guaranteed
8077 fragment:
8078 start: 0
8079 end: 34
8080 deadinfo: null
8081 returns: vector
8082 operations:
8083 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
8084 op: ""
8085 joins: []
8086 unless:
8087 - "on": []
8088 ignoring: []
8089 src:
8090 labels:
8091 "":
8092 reason: Calling `vector()` will return a vector value with no labels.
8093 kind: excluded
8094 fragment:
8095 start: 42
8096 end: 48
8097 deadinfo:
8098 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.
8099 fragment:
8100 start: 42
8101 end: 48
8102 returns: vector
8103 operations:
8104 - node: '[*parser.Call] vector(0)'
8105 op: vector
8106 joins: []
8107 unless: []
8108 returninfo:
8109 logicalexpr: ""
8110 valueposition:
8111 start: 42
8112 end: 51
8113 returnednumber: 0
8114 alwaysreturns: true
8115 knownreturn: true
8116 isreturnbool: false
8117 position:
8118 start: 42
8119 end: 51
8120 type: function
8121 fixedlabels: true
8122 isconditional: false
8123 returninfo:
8124 logicalexpr: ""
8125 valueposition:
8126 start: 0
8127 end: 0
8128 returnednumber: 0
8129 alwaysreturns: false
8130 knownreturn: false
8131 isreturnbool: false
8132 position:
8133 start: 0
8134 end: 34
8135 type: selector
8136 fixedlabels: false
8137 isconditional: false
8138
8139---
8140
8141[TestLabelsSource/132 - 1]
8142expr: prometheus_ready{job="prometheus"} unless on() vector(0)
8143output:
8144 - labels:
8145 job:
8146 reason: Query will only return series where these labels are present.
8147 kind: guaranteed
8148 fragment:
8149 start: 0
8150 end: 34
8151 deadinfo:
8152 reason: This query will never return anything because the `unless` query always returns something.
8153 fragment:
8154 start: 47
8155 end: 56
8156 returns: vector
8157 operations:
8158 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
8159 op: ""
8160 joins: []
8161 unless:
8162 - "on": []
8163 ignoring: []
8164 src:
8165 labels:
8166 "":
8167 reason: Calling `vector()` will return a vector value with no labels.
8168 kind: excluded
8169 fragment:
8170 start: 47
8171 end: 53
8172 deadinfo: null
8173 returns: vector
8174 operations:
8175 - node: '[*parser.Call] vector(0)'
8176 op: vector
8177 joins: []
8178 unless: []
8179 returninfo:
8180 logicalexpr: ""
8181 valueposition:
8182 start: 47
8183 end: 56
8184 returnednumber: 0
8185 alwaysreturns: true
8186 knownreturn: true
8187 isreturnbool: false
8188 position:
8189 start: 47
8190 end: 56
8191 type: function
8192 fixedlabels: true
8193 isconditional: false
8194 returninfo:
8195 logicalexpr: ""
8196 valueposition:
8197 start: 0
8198 end: 0
8199 returnednumber: 0
8200 alwaysreturns: false
8201 knownreturn: false
8202 isreturnbool: false
8203 position:
8204 start: 0
8205 end: 34
8206 type: selector
8207 fixedlabels: false
8208 isconditional: false
8209
8210---
8211
8212[TestLabelsSource/133 - 1]
8213expr: prometheus_ready{job="prometheus"} unless on(job) vector(0)
8214output:
8215 - labels:
8216 job:
8217 reason: Query will only return series where these labels are present.
8218 kind: guaranteed
8219 fragment:
8220 start: 0
8221 end: 34
8222 deadinfo: null
8223 returns: vector
8224 operations:
8225 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
8226 op: ""
8227 joins: []
8228 unless:
8229 - "on":
8230 - job
8231 ignoring: []
8232 src:
8233 labels:
8234 "":
8235 reason: Calling `vector()` will return a vector value with no labels.
8236 kind: excluded
8237 fragment:
8238 start: 50
8239 end: 56
8240 deadinfo:
8241 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.
8242 fragment:
8243 start: 50
8244 end: 56
8245 returns: vector
8246 operations:
8247 - node: '[*parser.Call] vector(0)'
8248 op: vector
8249 joins: []
8250 unless: []
8251 returninfo:
8252 logicalexpr: ""
8253 valueposition:
8254 start: 50
8255 end: 59
8256 returnednumber: 0
8257 alwaysreturns: true
8258 knownreturn: true
8259 isreturnbool: false
8260 position:
8261 start: 50
8262 end: 59
8263 type: function
8264 fixedlabels: true
8265 isconditional: false
8266 returninfo:
8267 logicalexpr: ""
8268 valueposition:
8269 start: 0
8270 end: 0
8271 returnednumber: 0
8272 alwaysreturns: false
8273 knownreturn: false
8274 isreturnbool: false
8275 position:
8276 start: 0
8277 end: 34
8278 type: selector
8279 fixedlabels: false
8280 isconditional: false
8281
8282---
8283
8284[TestLabelsSource/134 - 1]
8285expr: |4
8286 max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"})
8287 unless
8288 sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"})
8289 * on (instance) group_left (cluster)
8290 cf_node_role{kubernetes_role="master",role="kubernetes"}
8291output:
8292 - labels:
8293 "":
8294 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8295 kind: excluded
8296 fragment:
8297 start: 5
8298 end: 8
8299 __name__:
8300 reason: Aggregation removes metric name.
8301 kind: excluded
8302 fragment:
8303 start: 1
8304 end: 86
8305 cluster:
8306 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8307 kind: included
8308 fragment:
8309 start: 5
8310 end: 8
8311 instance:
8312 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8313 kind: included
8314 fragment:
8315 start: 5
8316 end: 8
8317 kubernetes_role:
8318 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8319 kind: excluded
8320 fragment:
8321 start: 5
8322 end: 8
8323 role:
8324 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8325 kind: excluded
8326 fragment:
8327 start: 5
8328 end: 8
8329 deadinfo: null
8330 returns: vector
8331 operations:
8332 - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}'
8333 op: ""
8334 - node: '[*parser.AggregateExpr] max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"})'
8335 op: max
8336 joins: []
8337 unless:
8338 - "on": []
8339 ignoring: []
8340 src:
8341 labels:
8342 "":
8343 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8344 kind: excluded
8345 fragment:
8346 start: 99
8347 end: 102
8348 __name__:
8349 reason: Aggregation removes metric name.
8350 kind: excluded
8351 fragment:
8352 start: 95
8353 end: 202
8354 cluster:
8355 reason: Query is using many-to-one vector matching with `group_left(cluster)`, all labels included inside `group_left(...)` will be include on the results.
8356 kind: included
8357 fragment:
8358 start: 222
8359 end: 233
8360 instance:
8361 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8362 kind: included
8363 fragment:
8364 start: 208
8365 end: 211
8366 name:
8367 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8368 kind: excluded
8369 fragment:
8370 start: 99
8371 end: 102
8372 deadinfo: null
8373 returns: vector
8374 operations:
8375 - node: '[*parser.VectorSelector] node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"}'
8376 op: ""
8377 - node: '[*parser.AggregateExpr] sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"})'
8378 op: sum
8379 joins:
8380 - "on":
8381 - instance
8382 ignoring: []
8383 addedlabels:
8384 - cluster
8385 src:
8386 labels:
8387 kubernetes_role:
8388 reason: Query will only return series where these labels are present.
8389 kind: guaranteed
8390 fragment:
8391 start: 247
8392 end: 303
8393 role:
8394 reason: Query will only return series where these labels are present.
8395 kind: guaranteed
8396 fragment:
8397 start: 247
8398 end: 303
8399 deadinfo: null
8400 returns: vector
8401 operations:
8402 - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}'
8403 op: ""
8404 joins: []
8405 unless: []
8406 returninfo:
8407 logicalexpr: ""
8408 valueposition:
8409 start: 0
8410 end: 0
8411 returnednumber: 0
8412 alwaysreturns: false
8413 knownreturn: false
8414 isreturnbool: false
8415 position:
8416 start: 247
8417 end: 303
8418 type: selector
8419 fixedlabels: false
8420 isconditional: false
8421 op: 57395
8422 depth: 0
8423 unless: []
8424 returninfo:
8425 logicalexpr: ""
8426 valueposition:
8427 start: 0
8428 end: 0
8429 returnednumber: 0
8430 alwaysreturns: false
8431 knownreturn: false
8432 isreturnbool: false
8433 position:
8434 start: 132
8435 end: 201
8436 type: aggregation
8437 fixedlabels: true
8438 isconditional: false
8439 returninfo:
8440 logicalexpr: ""
8441 valueposition:
8442 start: 0
8443 end: 0
8444 returnednumber: 0
8445 alwaysreturns: false
8446 knownreturn: false
8447 isreturnbool: false
8448 position:
8449 start: 29
8450 end: 85
8451 type: aggregation
8452 fixedlabels: true
8453 isconditional: false
8454
8455---
8456
8457[TestLabelsSource/135 - 1]
8458expr: foo{a="1"} * on() bar{b="2"}
8459output:
8460 - labels:
8461 "":
8462 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
8463 kind: excluded
8464 fragment:
8465 start: 13
8466 end: 15
8467 a:
8468 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
8469 kind: excluded
8470 fragment:
8471 start: 13
8472 end: 15
8473 deadinfo: null
8474 returns: vector
8475 operations:
8476 - node: '[*parser.VectorSelector] foo{a="1"}'
8477 op: ""
8478 joins:
8479 - "on": []
8480 ignoring: []
8481 addedlabels: []
8482 src:
8483 labels:
8484 b:
8485 reason: Query will only return series where these labels are present.
8486 kind: guaranteed
8487 fragment:
8488 start: 18
8489 end: 28
8490 deadinfo: null
8491 returns: vector
8492 operations:
8493 - node: '[*parser.VectorSelector] bar{b="2"}'
8494 op: ""
8495 joins: []
8496 unless: []
8497 returninfo:
8498 logicalexpr: ""
8499 valueposition:
8500 start: 0
8501 end: 0
8502 returnednumber: 0
8503 alwaysreturns: false
8504 knownreturn: false
8505 isreturnbool: false
8506 position:
8507 start: 18
8508 end: 28
8509 type: selector
8510 fixedlabels: false
8511 isconditional: false
8512 op: 57395
8513 depth: 0
8514 unless: []
8515 returninfo:
8516 logicalexpr: ""
8517 valueposition:
8518 start: 0
8519 end: 0
8520 returnednumber: 0
8521 alwaysreturns: false
8522 knownreturn: false
8523 isreturnbool: false
8524 position:
8525 start: 0
8526 end: 10
8527 type: selector
8528 fixedlabels: true
8529 isconditional: false
8530
8531---
8532
8533[TestLabelsSource/136 - 1]
8534expr: foo{a="1"} * on(instance) group_left(c,d) bar{b="2"}
8535output:
8536 - labels:
8537 a:
8538 reason: Query will only return series where these labels are present.
8539 kind: guaranteed
8540 fragment:
8541 start: 0
8542 end: 10
8543 c:
8544 reason: Query is using many-to-one vector matching with `group_left(c, d)`, all labels included inside `group_left(...)` will be include on the results.
8545 kind: included
8546 fragment:
8547 start: 26
8548 end: 36
8549 d:
8550 reason: Query is using many-to-one vector matching with `group_left(c, d)`, all labels included inside `group_left(...)` will be include on the results.
8551 kind: included
8552 fragment:
8553 start: 26
8554 end: 36
8555 instance:
8556 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8557 kind: included
8558 fragment:
8559 start: 13
8560 end: 15
8561 deadinfo: null
8562 returns: vector
8563 operations:
8564 - node: '[*parser.VectorSelector] foo{a="1"}'
8565 op: ""
8566 joins:
8567 - "on":
8568 - instance
8569 ignoring: []
8570 addedlabels:
8571 - c
8572 - d
8573 src:
8574 labels:
8575 b:
8576 reason: Query will only return series where these labels are present.
8577 kind: guaranteed
8578 fragment:
8579 start: 42
8580 end: 52
8581 deadinfo: null
8582 returns: vector
8583 operations:
8584 - node: '[*parser.VectorSelector] bar{b="2"}'
8585 op: ""
8586 joins: []
8587 unless: []
8588 returninfo:
8589 logicalexpr: ""
8590 valueposition:
8591 start: 0
8592 end: 0
8593 returnednumber: 0
8594 alwaysreturns: false
8595 knownreturn: false
8596 isreturnbool: false
8597 position:
8598 start: 42
8599 end: 52
8600 type: selector
8601 fixedlabels: false
8602 isconditional: false
8603 op: 57395
8604 depth: 0
8605 unless: []
8606 returninfo:
8607 logicalexpr: ""
8608 valueposition:
8609 start: 0
8610 end: 0
8611 returnednumber: 0
8612 alwaysreturns: false
8613 knownreturn: false
8614 isreturnbool: false
8615 position:
8616 start: 0
8617 end: 10
8618 type: selector
8619 fixedlabels: false
8620 isconditional: false
8621
8622---
8623
8624[TestLabelsSource/137 - 1]
8625expr: foo{a="1"} * on(instance) group_right(c,d) bar{b="2"}
8626output:
8627 - labels:
8628 b:
8629 reason: Query will only return series where these labels are present.
8630 kind: guaranteed
8631 fragment:
8632 start: 43
8633 end: 53
8634 c:
8635 reason: Query is using one-to-many vector matching with `group_right(c, d)`, all labels included inside `group_right(...)` will be include on the results.
8636 kind: included
8637 fragment:
8638 start: 26
8639 end: 37
8640 d:
8641 reason: Query is using one-to-many vector matching with `group_right(c, d)`, all labels included inside `group_right(...)` will be include on the results.
8642 kind: included
8643 fragment:
8644 start: 26
8645 end: 37
8646 instance:
8647 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8648 kind: included
8649 fragment:
8650 start: 13
8651 end: 15
8652 deadinfo: null
8653 returns: vector
8654 operations:
8655 - node: '[*parser.VectorSelector] bar{b="2"}'
8656 op: ""
8657 joins:
8658 - "on":
8659 - instance
8660 ignoring: []
8661 addedlabels:
8662 - c
8663 - d
8664 src:
8665 labels:
8666 a:
8667 reason: Query will only return series where these labels are present.
8668 kind: guaranteed
8669 fragment:
8670 start: 0
8671 end: 10
8672 deadinfo: null
8673 returns: vector
8674 operations:
8675 - node: '[*parser.VectorSelector] foo{a="1"}'
8676 op: ""
8677 joins: []
8678 unless: []
8679 returninfo:
8680 logicalexpr: ""
8681 valueposition:
8682 start: 0
8683 end: 0
8684 returnednumber: 0
8685 alwaysreturns: false
8686 knownreturn: false
8687 isreturnbool: false
8688 position:
8689 start: 0
8690 end: 10
8691 type: selector
8692 fixedlabels: false
8693 isconditional: false
8694 op: 57395
8695 depth: 0
8696 unless: []
8697 returninfo:
8698 logicalexpr: ""
8699 valueposition:
8700 start: 0
8701 end: 0
8702 returnednumber: 0
8703 alwaysreturns: false
8704 knownreturn: false
8705 isreturnbool: false
8706 position:
8707 start: 43
8708 end: 53
8709 type: selector
8710 fixedlabels: false
8711 isconditional: false
8712
8713---
8714
8715[TestLabelsSource/138 - 1]
8716expr: foo{a="1"} * on(instance) sum(bar{b="2"})
8717output:
8718 - labels:
8719 "":
8720 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
8721 kind: excluded
8722 fragment:
8723 start: 13
8724 end: 15
8725 a:
8726 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
8727 kind: excluded
8728 fragment:
8729 start: 13
8730 end: 15
8731 instance:
8732 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
8733 kind: included
8734 fragment:
8735 start: 13
8736 end: 15
8737 deadinfo: null
8738 returns: vector
8739 operations:
8740 - node: '[*parser.VectorSelector] foo{a="1"}'
8741 op: ""
8742 joins:
8743 - "on":
8744 - instance
8745 ignoring: []
8746 addedlabels: []
8747 src:
8748 labels:
8749 "":
8750 reason: Query is using aggregation that removes all labels.
8751 kind: excluded
8752 fragment:
8753 start: 26
8754 end: 29
8755 __name__:
8756 reason: Aggregation removes metric name.
8757 kind: excluded
8758 fragment:
8759 start: 26
8760 end: 41
8761 b:
8762 reason: Query is using aggregation that removes all labels.
8763 kind: excluded
8764 fragment:
8765 start: 26
8766 end: 29
8767 deadinfo:
8768 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.
8769 fragment:
8770 start: 26
8771 end: 29
8772 returns: vector
8773 operations:
8774 - node: '[*parser.VectorSelector] bar{b="2"}'
8775 op: ""
8776 - node: '[*parser.AggregateExpr] sum(bar{b="2"})'
8777 op: sum
8778 joins: []
8779 unless: []
8780 returninfo:
8781 logicalexpr: ""
8782 valueposition:
8783 start: 0
8784 end: 0
8785 returnednumber: 0
8786 alwaysreturns: false
8787 knownreturn: false
8788 isreturnbool: false
8789 position:
8790 start: 30
8791 end: 40
8792 type: aggregation
8793 fixedlabels: true
8794 isconditional: false
8795 op: 57395
8796 depth: 0
8797 unless: []
8798 returninfo:
8799 logicalexpr: ""
8800 valueposition:
8801 start: 0
8802 end: 0
8803 returnednumber: 0
8804 alwaysreturns: false
8805 knownreturn: false
8806 isreturnbool: false
8807 position:
8808 start: 0
8809 end: 10
8810 type: selector
8811 fixedlabels: true
8812 isconditional: false
8813
8814---
8815
8816[TestLabelsSource/139 - 1]
8817expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"})
8818output:
8819 - labels:
8820 a:
8821 reason: Query will only return series where these labels are present.
8822 kind: guaranteed
8823 fragment:
8824 start: 0
8825 end: 10
8826 c:
8827 reason: Query is using many-to-one vector matching with `group_left(c, d)`, all labels included inside `group_left(...)` will be include on the results.
8828 kind: included
8829 fragment:
8830 start: 26
8831 end: 36
8832 d:
8833 reason: Query is using many-to-one vector matching with `group_left(c, d)`, all labels included inside `group_left(...)` will be include on the results.
8834 kind: included
8835 fragment:
8836 start: 26
8837 end: 36
8838 instance:
8839 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8840 kind: included
8841 fragment:
8842 start: 13
8843 end: 15
8844 deadinfo: null
8845 returns: vector
8846 operations:
8847 - node: '[*parser.VectorSelector] foo{a="1"}'
8848 op: ""
8849 joins:
8850 - "on":
8851 - instance
8852 ignoring: []
8853 addedlabels:
8854 - c
8855 - d
8856 src:
8857 labels:
8858 "":
8859 reason: Query is using aggregation that removes all labels.
8860 kind: excluded
8861 fragment:
8862 start: 42
8863 end: 45
8864 __name__:
8865 reason: Aggregation removes metric name.
8866 kind: excluded
8867 fragment:
8868 start: 42
8869 end: 57
8870 b:
8871 reason: Query is using aggregation that removes all labels.
8872 kind: excluded
8873 fragment:
8874 start: 42
8875 end: 45
8876 deadinfo:
8877 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.
8878 fragment:
8879 start: 42
8880 end: 45
8881 returns: vector
8882 operations:
8883 - node: '[*parser.VectorSelector] bar{b="2"}'
8884 op: ""
8885 - node: '[*parser.AggregateExpr] sum(bar{b="2"})'
8886 op: sum
8887 joins: []
8888 unless: []
8889 returninfo:
8890 logicalexpr: ""
8891 valueposition:
8892 start: 0
8893 end: 0
8894 returnednumber: 0
8895 alwaysreturns: false
8896 knownreturn: false
8897 isreturnbool: false
8898 position:
8899 start: 46
8900 end: 56
8901 type: aggregation
8902 fixedlabels: true
8903 isconditional: false
8904 op: 57395
8905 depth: 0
8906 unless: []
8907 returninfo:
8908 logicalexpr: ""
8909 valueposition:
8910 start: 0
8911 end: 0
8912 returnednumber: 0
8913 alwaysreturns: false
8914 knownreturn: false
8915 isreturnbool: false
8916 position:
8917 start: 0
8918 end: 10
8919 type: selector
8920 fixedlabels: false
8921 isconditional: false
8922
8923---
8924
8925[TestLabelsSource/140 - 1]
8926expr: sum(foo{a="1"}) * on(instance) group_right(c,d) bar{b="2"}
8927output:
8928 - labels:
8929 b:
8930 reason: Query will only return series where these labels are present.
8931 kind: guaranteed
8932 fragment:
8933 start: 48
8934 end: 58
8935 c:
8936 reason: Query is using one-to-many vector matching with `group_right(c, d)`, all labels included inside `group_right(...)` will be include on the results.
8937 kind: included
8938 fragment:
8939 start: 31
8940 end: 42
8941 d:
8942 reason: Query is using one-to-many vector matching with `group_right(c, d)`, all labels included inside `group_right(...)` will be include on the results.
8943 kind: included
8944 fragment:
8945 start: 31
8946 end: 42
8947 instance:
8948 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8949 kind: included
8950 fragment:
8951 start: 18
8952 end: 20
8953 deadinfo: null
8954 returns: vector
8955 operations:
8956 - node: '[*parser.VectorSelector] bar{b="2"}'
8957 op: ""
8958 joins:
8959 - "on":
8960 - instance
8961 ignoring: []
8962 addedlabels:
8963 - c
8964 - d
8965 src:
8966 labels:
8967 "":
8968 reason: Query is using aggregation that removes all labels.
8969 kind: excluded
8970 fragment:
8971 start: 0
8972 end: 3
8973 __name__:
8974 reason: Aggregation removes metric name.
8975 kind: excluded
8976 fragment:
8977 start: 0
8978 end: 15
8979 a:
8980 reason: Query is using aggregation that removes all labels.
8981 kind: excluded
8982 fragment:
8983 start: 0
8984 end: 3
8985 deadinfo:
8986 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.
8987 fragment:
8988 start: 0
8989 end: 3
8990 returns: vector
8991 operations:
8992 - node: '[*parser.VectorSelector] foo{a="1"}'
8993 op: ""
8994 - node: '[*parser.AggregateExpr] sum(foo{a="1"})'
8995 op: sum
8996 joins: []
8997 unless: []
8998 returninfo:
8999 logicalexpr: ""
9000 valueposition:
9001 start: 0
9002 end: 0
9003 returnednumber: 0
9004 alwaysreturns: false
9005 knownreturn: false
9006 isreturnbool: false
9007 position:
9008 start: 4
9009 end: 14
9010 type: aggregation
9011 fixedlabels: true
9012 isconditional: false
9013 op: 57395
9014 depth: 0
9015 unless: []
9016 returninfo:
9017 logicalexpr: ""
9018 valueposition:
9019 start: 0
9020 end: 0
9021 returnednumber: 0
9022 alwaysreturns: false
9023 knownreturn: false
9024 isreturnbool: false
9025 position:
9026 start: 48
9027 end: 58
9028 type: selector
9029 fixedlabels: false
9030 isconditional: false
9031
9032---
9033
9034[TestLabelsSource/141 - 1]
9035expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"}) without(instance)
9036output:
9037 - labels:
9038 a:
9039 reason: Query will only return series where these labels are present.
9040 kind: guaranteed
9041 fragment:
9042 start: 0
9043 end: 10
9044 c:
9045 reason: Query is using many-to-one vector matching with `group_left(c, d)`, all labels included inside `group_left(...)` will be include on the results.
9046 kind: included
9047 fragment:
9048 start: 26
9049 end: 36
9050 d:
9051 reason: Query is using many-to-one vector matching with `group_left(c, d)`, all labels included inside `group_left(...)` will be include on the results.
9052 kind: included
9053 fragment:
9054 start: 26
9055 end: 36
9056 instance:
9057 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
9058 kind: included
9059 fragment:
9060 start: 13
9061 end: 15
9062 deadinfo: null
9063 returns: vector
9064 operations:
9065 - node: '[*parser.VectorSelector] foo{a="1"}'
9066 op: ""
9067 joins:
9068 - "on":
9069 - instance
9070 ignoring: []
9071 addedlabels:
9072 - c
9073 - d
9074 src:
9075 labels:
9076 __name__:
9077 reason: Aggregation removes metric name.
9078 kind: excluded
9079 fragment:
9080 start: 42
9081 end: 75
9082 b:
9083 reason: Query will only return series where these labels are present.
9084 kind: guaranteed
9085 fragment:
9086 start: 46
9087 end: 56
9088 instance:
9089 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
9090 kind: excluded
9091 fragment:
9092 start: 58
9093 end: 65
9094 deadinfo:
9095 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.
9096 fragment:
9097 start: 58
9098 end: 65
9099 returns: vector
9100 operations:
9101 - node: '[*parser.VectorSelector] bar{b="2"}'
9102 op: ""
9103 - node: '[*parser.AggregateExpr] sum without (instance) (bar{b="2"})'
9104 op: sum
9105 joins: []
9106 unless: []
9107 returninfo:
9108 logicalexpr: ""
9109 valueposition:
9110 start: 0
9111 end: 0
9112 returnednumber: 0
9113 alwaysreturns: false
9114 knownreturn: false
9115 isreturnbool: false
9116 position:
9117 start: 46
9118 end: 56
9119 type: aggregation
9120 fixedlabels: false
9121 isconditional: false
9122 op: 57395
9123 depth: 0
9124 unless: []
9125 returninfo:
9126 logicalexpr: ""
9127 valueposition:
9128 start: 0
9129 end: 0
9130 returnednumber: 0
9131 alwaysreturns: false
9132 knownreturn: false
9133 isreturnbool: false
9134 position:
9135 start: 0
9136 end: 10
9137 type: selector
9138 fixedlabels: false
9139 isconditional: false
9140
9141---
9142
9143[TestLabelsSource/142 - 1]
9144expr: sum(foo{a="1"}) without(instance) * on(instance) group_right(c,d) bar{b="2"}
9145output:
9146 - labels:
9147 b:
9148 reason: Query will only return series where these labels are present.
9149 kind: guaranteed
9150 fragment:
9151 start: 66
9152 end: 76
9153 c:
9154 reason: Query is using one-to-many vector matching with `group_right(c, d)`, all labels included inside `group_right(...)` will be include on the results.
9155 kind: included
9156 fragment:
9157 start: 49
9158 end: 60
9159 d:
9160 reason: Query is using one-to-many vector matching with `group_right(c, d)`, all labels included inside `group_right(...)` will be include on the results.
9161 kind: included
9162 fragment:
9163 start: 49
9164 end: 60
9165 instance:
9166 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
9167 kind: included
9168 fragment:
9169 start: 36
9170 end: 38
9171 deadinfo: null
9172 returns: vector
9173 operations:
9174 - node: '[*parser.VectorSelector] bar{b="2"}'
9175 op: ""
9176 joins:
9177 - "on":
9178 - instance
9179 ignoring: []
9180 addedlabels:
9181 - c
9182 - d
9183 src:
9184 labels:
9185 __name__:
9186 reason: Aggregation removes metric name.
9187 kind: excluded
9188 fragment:
9189 start: 0
9190 end: 33
9191 a:
9192 reason: Query will only return series where these labels are present.
9193 kind: guaranteed
9194 fragment:
9195 start: 4
9196 end: 14
9197 instance:
9198 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
9199 kind: excluded
9200 fragment:
9201 start: 16
9202 end: 23
9203 deadinfo:
9204 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.
9205 fragment:
9206 start: 16
9207 end: 23
9208 returns: vector
9209 operations:
9210 - node: '[*parser.VectorSelector] foo{a="1"}'
9211 op: ""
9212 - node: '[*parser.AggregateExpr] sum without (instance) (foo{a="1"})'
9213 op: sum
9214 joins: []
9215 unless: []
9216 returninfo:
9217 logicalexpr: ""
9218 valueposition:
9219 start: 0
9220 end: 0
9221 returnednumber: 0
9222 alwaysreturns: false
9223 knownreturn: false
9224 isreturnbool: false
9225 position:
9226 start: 4
9227 end: 14
9228 type: aggregation
9229 fixedlabels: false
9230 isconditional: false
9231 op: 57395
9232 depth: 0
9233 unless: []
9234 returninfo:
9235 logicalexpr: ""
9236 valueposition:
9237 start: 0
9238 end: 0
9239 returnednumber: 0
9240 alwaysreturns: false
9241 knownreturn: false
9242 isreturnbool: false
9243 position:
9244 start: 66
9245 end: 76
9246 type: selector
9247 fixedlabels: false
9248 isconditional: false
9249
9250---
9251
9252[TestLabelsSource/143 - 1]
9253expr: |4
9254 max without (source_instance) (
9255 increase(kernel_device_io_errors_total{device!~"loop.+"}[120m]) > 3 unless on(instance, device) (
9256 increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[125m])*2 > increase(kernel_device_io_errors_total[120m])
9257 )
9258 and on(device, instance) absent(node_disk_info)
9259 ) * on(instance) group_left(group) label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)")
9260output:
9261 - labels:
9262 __name__:
9263 reason: Aggregation removes metric name.
9264 kind: excluded
9265 fragment:
9266 start: 2
9267 end: 317
9268 device:
9269 reason: Query is using many-to-many vector matching with `on(device, instance)`, labels included inside `on(...)` will be present on the results.
9270 kind: included
9271 fragment:
9272 start: 112
9273 end: 114
9274 group:
9275 reason: Query is using many-to-one vector matching with `group_left(group)`, all labels included inside `group_left(...)` will be include on the results.
9276 kind: included
9277 fragment:
9278 start: 333
9279 end: 343
9280 instance:
9281 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
9282 kind: included
9283 fragment:
9284 start: 112
9285 end: 114
9286 source_instance:
9287 reason: Query is using aggregation with `without(source_instance)`, all labels included inside `without(...)` will be removed from the results.
9288 kind: excluded
9289 fragment:
9290 start: 6
9291 end: 14
9292 deadinfo: null
9293 returns: vector
9294 operations:
9295 - node: '[*parser.VectorSelector] kernel_device_io_errors_total{device!~"loop.+"}'
9296 op: ""
9297 - node: '[*parser.Call] increase(kernel_device_io_errors_total{device!~"loop.+"}[2h])'
9298 op: increase
9299 - 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))'
9300 op: max
9301 joins:
9302 - "on":
9303 - device
9304 - instance
9305 ignoring: []
9306 addedlabels: []
9307 src:
9308 labels:
9309 "":
9310 reason: |-
9311 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
9312 You will only get any results back if the metric selector you pass doesn't match anything.
9313 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
9314 This means that the only labels you can get back from absent call are the ones you pass to it.
9315 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.
9316 kind: excluded
9317 fragment:
9318 start: 292
9319 end: 298
9320 deadinfo:
9321 reason: |-
9322 The right hand side will never be matched because it doesn't have the `device` label from `on(...)`. The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
9323 You will only get any results back if the metric selector you pass doesn't match anything.
9324 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
9325 This means that the only labels you can get back from absent call are the ones you pass to it.
9326 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.
9327 fragment:
9328 start: 292
9329 end: 298
9330 returns: vector
9331 operations:
9332 - node: '[*parser.VectorSelector] node_disk_info'
9333 op: ""
9334 - node: '[*parser.Call] absent(node_disk_info)'
9335 op: absent
9336 joins: []
9337 unless: []
9338 returninfo:
9339 logicalexpr: ""
9340 valueposition:
9341 start: 0
9342 end: 0
9343 returnednumber: 0
9344 alwaysreturns: false
9345 knownreturn: false
9346 isreturnbool: false
9347 position:
9348 start: 299
9349 end: 313
9350 type: function
9351 fixedlabels: true
9352 isconditional: false
9353 op: 57389
9354 depth: 1
9355 - "on":
9356 - instance
9357 ignoring: []
9358 addedlabels:
9359 - group
9360 src:
9361 labels:
9362 instance:
9363 reason: This label will be added to the result by label_replace() call.
9364 kind: guaranteed
9365 fragment:
9366 start: 351
9367 end: 442
9368 deadinfo: null
9369 returns: vector
9370 operations:
9371 - node: '[*parser.VectorSelector] salt_highstate_runner_configured_minions'
9372 op: ""
9373 - node: '[*parser.Call] label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)")'
9374 op: label_replace
9375 joins: []
9376 unless: []
9377 returninfo:
9378 logicalexpr: ""
9379 valueposition:
9380 start: 0
9381 end: 0
9382 returnednumber: 0
9383 alwaysreturns: false
9384 knownreturn: false
9385 isreturnbool: false
9386 position:
9387 start: 365
9388 end: 405
9389 type: function
9390 fixedlabels: false
9391 isconditional: false
9392 op: 57395
9393 depth: 0
9394 unless:
9395 - "on":
9396 - instance
9397 - device
9398 ignoring: []
9399 src:
9400 labels: {}
9401 deadinfo: null
9402 returns: vector
9403 operations:
9404 - node: '[*parser.VectorSelector] kernel_device_io_soft_errors_total{device!~"loop.+"}'
9405 op: ""
9406 - node: '[*parser.Call] increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[2h5m])'
9407 op: increase
9408 joins:
9409 - "on": []
9410 ignoring: []
9411 addedlabels: []
9412 src:
9413 labels: {}
9414 deadinfo: null
9415 returns: vector
9416 operations:
9417 - node: '[*parser.VectorSelector] kernel_device_io_errors_total'
9418 op: ""
9419 - node: '[*parser.Call] increase(kernel_device_io_errors_total[2h])'
9420 op: increase
9421 joins: []
9422 unless: []
9423 returninfo:
9424 logicalexpr: ""
9425 valueposition:
9426 start: 0
9427 end: 0
9428 returnednumber: 0
9429 alwaysreturns: false
9430 knownreturn: false
9431 isreturnbool: false
9432 position:
9433 start: 222
9434 end: 257
9435 type: function
9436 fixedlabels: false
9437 isconditional: false
9438 op: 57388
9439 depth: 0
9440 unless: []
9441 returninfo:
9442 logicalexpr: ""
9443 valueposition:
9444 start: 0
9445 end: 0
9446 returnednumber: 0
9447 alwaysreturns: false
9448 knownreturn: false
9449 isreturnbool: false
9450 position:
9451 start: 149
9452 end: 207
9453 type: function
9454 fixedlabels: false
9455 isconditional: true
9456 returninfo:
9457 logicalexpr: ""
9458 valueposition:
9459 start: 0
9460 end: 0
9461 returnednumber: 0
9462 alwaysreturns: false
9463 knownreturn: false
9464 isreturnbool: false
9465 position:
9466 start: 46
9467 end: 99
9468 type: aggregation
9469 fixedlabels: false
9470 isconditional: true
9471
9472---
9473
9474[TestLabelsSource/144 - 1]
9475expr: sum(foo{a="1"}) by(job) * on() bar{b="2"}
9476output:
9477 - labels:
9478 "":
9479 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
9480 kind: excluded
9481 fragment:
9482 start: 26
9483 end: 28
9484 __name__:
9485 reason: Aggregation removes metric name.
9486 kind: excluded
9487 fragment:
9488 start: 0
9489 end: 23
9490 a:
9491 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
9492 kind: excluded
9493 fragment:
9494 start: 16
9495 end: 18
9496 job:
9497 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
9498 kind: excluded
9499 fragment:
9500 start: 26
9501 end: 28
9502 deadinfo: null
9503 returns: vector
9504 operations:
9505 - node: '[*parser.VectorSelector] foo{a="1"}'
9506 op: ""
9507 - node: '[*parser.AggregateExpr] sum by (job) (foo{a="1"})'
9508 op: sum
9509 joins:
9510 - "on": []
9511 ignoring: []
9512 addedlabels: []
9513 src:
9514 labels:
9515 b:
9516 reason: Query will only return series where these labels are present.
9517 kind: guaranteed
9518 fragment:
9519 start: 31
9520 end: 41
9521 deadinfo: null
9522 returns: vector
9523 operations:
9524 - node: '[*parser.VectorSelector] bar{b="2"}'
9525 op: ""
9526 joins: []
9527 unless: []
9528 returninfo:
9529 logicalexpr: ""
9530 valueposition:
9531 start: 0
9532 end: 0
9533 returnednumber: 0
9534 alwaysreturns: false
9535 knownreturn: false
9536 isreturnbool: false
9537 position:
9538 start: 31
9539 end: 41
9540 type: selector
9541 fixedlabels: false
9542 isconditional: false
9543 op: 57395
9544 depth: 0
9545 unless: []
9546 returninfo:
9547 logicalexpr: ""
9548 valueposition:
9549 start: 0
9550 end: 0
9551 returnednumber: 0
9552 alwaysreturns: false
9553 knownreturn: false
9554 isreturnbool: false
9555 position:
9556 start: 4
9557 end: 14
9558 type: aggregation
9559 fixedlabels: true
9560 isconditional: false
9561
9562---
9563
9564[TestLabelsSource/145 - 1]
9565expr: sum(sum(foo) without(job)) by(job)
9566output:
9567 - labels:
9568 "":
9569 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
9570 kind: excluded
9571 fragment:
9572 start: 27
9573 end: 29
9574 __name__:
9575 reason: Aggregation removes metric name.
9576 kind: excluded
9577 fragment:
9578 start: 0
9579 end: 34
9580 job:
9581 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
9582 kind: excluded
9583 fragment:
9584 start: 13
9585 end: 20
9586 deadinfo: null
9587 returns: vector
9588 operations:
9589 - node: '[*parser.VectorSelector] foo'
9590 op: ""
9591 - node: '[*parser.AggregateExpr] sum without (job) (foo)'
9592 op: sum
9593 - node: '[*parser.AggregateExpr] sum by (job) (sum without (job) (foo))'
9594 op: sum
9595 joins: []
9596 unless: []
9597 returninfo:
9598 logicalexpr: ""
9599 valueposition:
9600 start: 0
9601 end: 0
9602 returnednumber: 0
9603 alwaysreturns: false
9604 knownreturn: false
9605 isreturnbool: false
9606 position:
9607 start: 8
9608 end: 11
9609 type: aggregation
9610 fixedlabels: true
9611 isconditional: false
9612
9613---
9614
9615[TestLabelsSource/146 - 1]
9616expr: |4
9617 prometheus:scrape_series_added:since_gc:sum
9618 * on(prometheus) group_left()
9619 label_replace(
9620 max(max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])) by(instance)
9621 /
9622 max(max_over_time(prometheus_tsdb_head_series[2h])) by(instance),
9623 "prometheus", "$1",
9624 "instance", "(.+)"
9625 )
9626output:
9627 - labels:
9628 prometheus:
9629 reason: Query is using many-to-one vector matching with `on(prometheus)`, labels included inside `on(...)` will be present on the results.
9630 kind: included
9631 fragment:
9632 start: 47
9633 end: 49
9634 deadinfo: null
9635 returns: vector
9636 operations:
9637 - node: '[*parser.VectorSelector] prometheus:scrape_series_added:since_gc:sum'
9638 op: ""
9639 joins:
9640 - "on":
9641 - prometheus
9642 ignoring: []
9643 addedlabels: []
9644 src:
9645 labels:
9646 "":
9647 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9648 kind: excluded
9649 fragment:
9650 start: 158
9651 end: 160
9652 __name__:
9653 reason: Aggregation removes metric name.
9654 kind: excluded
9655 fragment:
9656 start: 92
9657 end: 170
9658 instance:
9659 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9660 kind: included
9661 fragment:
9662 start: 158
9663 end: 160
9664 job:
9665 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9666 kind: excluded
9667 fragment:
9668 start: 158
9669 end: 160
9670 prometheus:
9671 reason: This label will be added to the result by label_replace() call.
9672 kind: guaranteed
9673 fragment:
9674 start: 75
9675 end: 287
9676 deadinfo: null
9677 returns: vector
9678 operations:
9679 - node: '[*parser.VectorSelector] go_memstats_alloc_bytes{job="prometheus"}'
9680 op: ""
9681 - node: '[*parser.Call] max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])'
9682 op: max_over_time
9683 - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h]))'
9684 op: max
9685 - 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", "(.+)")'
9686 op: label_replace
9687 joins:
9688 - "on": []
9689 ignoring: []
9690 addedlabels: []
9691 src:
9692 labels:
9693 "":
9694 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9695 kind: excluded
9696 fragment:
9697 start: 229
9698 end: 231
9699 __name__:
9700 reason: Aggregation removes metric name.
9701 kind: excluded
9702 fragment:
9703 start: 177
9704 end: 241
9705 instance:
9706 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9707 kind: included
9708 fragment:
9709 start: 229
9710 end: 231
9711 deadinfo: null
9712 returns: vector
9713 operations:
9714 - node: '[*parser.VectorSelector] prometheus_tsdb_head_series'
9715 op: ""
9716 - node: '[*parser.Call] max_over_time(prometheus_tsdb_head_series[2h])'
9717 op: max_over_time
9718 - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(prometheus_tsdb_head_series[2h]))'
9719 op: max
9720 joins: []
9721 unless: []
9722 returninfo:
9723 logicalexpr: ""
9724 valueposition:
9725 start: 0
9726 end: 0
9727 returnednumber: 0
9728 alwaysreturns: false
9729 knownreturn: false
9730 isreturnbool: false
9731 position:
9732 start: 195
9733 end: 226
9734 type: aggregation
9735 fixedlabels: true
9736 isconditional: false
9737 op: 57384
9738 depth: 0
9739 unless: []
9740 returninfo:
9741 logicalexpr: ""
9742 valueposition:
9743 start: 0
9744 end: 0
9745 returnednumber: 0
9746 alwaysreturns: false
9747 knownreturn: false
9748 isreturnbool: false
9749 position:
9750 start: 92
9751 end: 241
9752 type: function
9753 fixedlabels: true
9754 isconditional: false
9755 op: 57395
9756 depth: 0
9757 unless: []
9758 returninfo:
9759 logicalexpr: ""
9760 valueposition:
9761 start: 0
9762 end: 0
9763 returnednumber: 0
9764 alwaysreturns: false
9765 knownreturn: false
9766 isreturnbool: false
9767 position:
9768 start: 1
9769 end: 44
9770 type: selector
9771 fixedlabels: false
9772 isconditional: false
9773
9774---
9775
9776[TestLabelsSource/147 - 1]
9777expr: (day_of_week() == 6 and hour() < 1) or vector(1)
9778output:
9779 - labels:
9780 "":
9781 reason: Calling `day_of_week()` with no arguments will return an empty time series with no labels.
9782 kind: excluded
9783 fragment:
9784 start: 1
9785 end: 14
9786 deadinfo: null
9787 returns: vector
9788 operations:
9789 - node: '[*parser.Call] day_of_week()'
9790 op: day_of_week
9791 joins:
9792 - "on": []
9793 ignoring: []
9794 addedlabels: []
9795 src:
9796 labels:
9797 "":
9798 reason: Calling `hour()` with no arguments will return an empty time series with no labels.
9799 kind: excluded
9800 fragment:
9801 start: 24
9802 end: 30
9803 deadinfo: null
9804 returns: vector
9805 operations:
9806 - node: '[*parser.Call] hour()'
9807 op: hour
9808 joins: []
9809 unless: []
9810 returninfo:
9811 logicalexpr: ""
9812 valueposition:
9813 start: 0
9814 end: 0
9815 returnednumber: 0
9816 alwaysreturns: true
9817 knownreturn: false
9818 isreturnbool: false
9819 position:
9820 start: 24
9821 end: 30
9822 type: function
9823 fixedlabels: true
9824 isconditional: true
9825 op: 57389
9826 depth: 0
9827 unless: []
9828 returninfo:
9829 logicalexpr: ""
9830 valueposition:
9831 start: 0
9832 end: 0
9833 returnednumber: 0
9834 alwaysreturns: true
9835 knownreturn: false
9836 isreturnbool: false
9837 position:
9838 start: 1
9839 end: 14
9840 type: function
9841 fixedlabels: true
9842 isconditional: true
9843 - labels:
9844 "":
9845 reason: Calling `vector()` will return a vector value with no labels.
9846 kind: excluded
9847 fragment:
9848 start: 39
9849 end: 45
9850 deadinfo: null
9851 returns: vector
9852 operations:
9853 - node: '[*parser.Call] vector(1)'
9854 op: vector
9855 joins: []
9856 unless: []
9857 returninfo:
9858 logicalexpr: ""
9859 valueposition:
9860 start: 39
9861 end: 48
9862 returnednumber: 1
9863 alwaysreturns: true
9864 knownreturn: true
9865 isreturnbool: false
9866 position:
9867 start: 39
9868 end: 48
9869 type: function
9870 fixedlabels: true
9871 isconditional: false
9872
9873---
9874
9875[TestLabelsSource/148 - 1]
9876expr: |4-
9877 sum by (foo, bar) (
9878 rate(errors_total[5m])
9879 * on (instance) group_left (bob, alice)
9880 server_errors_total
9881 )
9882output:
9883 - labels:
9884 "":
9885 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9886 kind: excluded
9887 fragment:
9888 start: 5
9889 end: 8
9890 __name__:
9891 reason: Aggregation removes metric name.
9892 kind: excluded
9893 fragment:
9894 start: 1
9895 end: 115
9896 alice:
9897 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9898 kind: excluded
9899 fragment:
9900 start: 5
9901 end: 8
9902 bar:
9903 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9904 kind: included
9905 fragment:
9906 start: 5
9907 end: 8
9908 bob:
9909 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9910 kind: excluded
9911 fragment:
9912 start: 5
9913 end: 8
9914 foo:
9915 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9916 kind: included
9917 fragment:
9918 start: 5
9919 end: 8
9920 instance:
9921 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9922 kind: excluded
9923 fragment:
9924 start: 5
9925 end: 8
9926 deadinfo: null
9927 returns: vector
9928 operations:
9929 - node: '[*parser.VectorSelector] errors_total'
9930 op: ""
9931 - node: '[*parser.Call] rate(errors_total[5m])'
9932 op: rate
9933 - node: '[*parser.AggregateExpr] sum by (foo, bar) (rate(errors_total[5m]) * on (instance) group_left (bob, alice) server_errors_total)'
9934 op: sum
9935 joins:
9936 - "on":
9937 - instance
9938 ignoring: []
9939 addedlabels:
9940 - bob
9941 - alice
9942 src:
9943 labels: {}
9944 deadinfo: null
9945 returns: vector
9946 operations:
9947 - node: '[*parser.VectorSelector] server_errors_total'
9948 op: ""
9949 joins: []
9950 unless: []
9951 returninfo:
9952 logicalexpr: ""
9953 valueposition:
9954 start: 0
9955 end: 0
9956 returnednumber: 0
9957 alwaysreturns: false
9958 knownreturn: false
9959 isreturnbool: false
9960 position:
9961 start: 94
9962 end: 113
9963 type: selector
9964 fixedlabels: false
9965 isconditional: false
9966 op: 57395
9967 depth: 1
9968 unless: []
9969 returninfo:
9970 logicalexpr: ""
9971 valueposition:
9972 start: 0
9973 end: 0
9974 returnednumber: 0
9975 alwaysreturns: false
9976 knownreturn: false
9977 isreturnbool: false
9978 position:
9979 start: 30
9980 end: 46
9981 type: aggregation
9982 fixedlabels: true
9983 isconditional: false
9984
9985---
9986
9987[TestLabelsSource/149 - 1]
9988expr: 1 - (foo or vector(0)) < 0.999
9989output:
9990 - labels: {}
9991 deadinfo: null
9992 returns: vector
9993 operations:
9994 - node: '[*parser.VectorSelector] foo'
9995 op: ""
9996 joins: []
9997 unless: []
9998 returninfo:
9999 logicalexpr: ""
10000 valueposition:
10001 start: 0
10002 end: 0
10003 returnednumber: 0
10004 alwaysreturns: false
10005 knownreturn: false
10006 isreturnbool: false
10007 position:
10008 start: 5
10009 end: 8
10010 type: selector
10011 fixedlabels: false
10012 isconditional: true
10013 - labels:
10014 "":
10015 reason: Calling `vector()` will return a vector value with no labels.
10016 kind: excluded
10017 fragment:
10018 start: 12
10019 end: 18
10020 deadinfo:
10021 reason: '`1 - vector(0) < 0.999` always evaluates to `1 < 0.999` which is not possible, so it will never return anything.'
10022 fragment:
10023 start: 12
10024 end: 21
10025 returns: vector
10026 operations:
10027 - node: '[*parser.Call] vector(0)'
10028 op: vector
10029 joins: []
10030 unless: []
10031 returninfo:
10032 logicalexpr: 1 - vector(0)
10033 valueposition:
10034 start: 0
10035 end: 1
10036 returnednumber: 1
10037 alwaysreturns: true
10038 knownreturn: true
10039 isreturnbool: false
10040 position:
10041 start: 12
10042 end: 21
10043 type: function
10044 fixedlabels: true
10045 isconditional: true
10046
10047---
10048
10049[TestLabelsSource/150 - 1]
10050expr: |4
10051 (
10052 vector(1) and month() == 2
10053 ) or vector(0)
10054output:
10055 - labels:
10056 "":
10057 reason: Calling `vector()` will return a vector value with no labels.
10058 kind: excluded
10059 fragment:
10060 start: 5
10061 end: 11
10062 deadinfo: null
10063 returns: vector
10064 operations:
10065 - node: '[*parser.Call] vector(1)'
10066 op: vector
10067 joins:
10068 - "on": []
10069 ignoring: []
10070 addedlabels: []
10071 src:
10072 labels:
10073 "":
10074 reason: Calling `month()` with no arguments will return an empty time series with no labels.
10075 kind: excluded
10076 fragment:
10077 start: 19
10078 end: 26
10079 deadinfo: null
10080 returns: vector
10081 operations:
10082 - node: '[*parser.Call] month()'
10083 op: month
10084 joins: []
10085 unless: []
10086 returninfo:
10087 logicalexpr: ""
10088 valueposition:
10089 start: 0
10090 end: 0
10091 returnednumber: 0
10092 alwaysreturns: true
10093 knownreturn: false
10094 isreturnbool: false
10095 position:
10096 start: 19
10097 end: 26
10098 type: function
10099 fixedlabels: true
10100 isconditional: true
10101 op: 57389
10102 depth: 0
10103 unless: []
10104 returninfo:
10105 logicalexpr: ""
10106 valueposition:
10107 start: 5
10108 end: 14
10109 returnednumber: 1
10110 alwaysreturns: true
10111 knownreturn: true
10112 isreturnbool: false
10113 position:
10114 start: 5
10115 end: 14
10116 type: function
10117 fixedlabels: true
10118 isconditional: true
10119 - labels:
10120 "":
10121 reason: Calling `vector()` will return a vector value with no labels.
10122 kind: excluded
10123 fragment:
10124 start: 37
10125 end: 43
10126 deadinfo: null
10127 returns: vector
10128 operations:
10129 - node: '[*parser.Call] vector(0)'
10130 op: vector
10131 joins: []
10132 unless: []
10133 returninfo:
10134 logicalexpr: ""
10135 valueposition:
10136 start: 37
10137 end: 46
10138 returnednumber: 0
10139 alwaysreturns: true
10140 knownreturn: true
10141 isreturnbool: false
10142 position:
10143 start: 37
10144 end: 46
10145 type: function
10146 fixedlabels: true
10147 isconditional: false
10148
10149---
10150
10151[TestLabelsSource/151 - 1]
10152expr: count by (region) (stddev by (colo_name, region) (error_total))
10153output:
10154 - labels:
10155 "":
10156 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
10157 kind: excluded
10158 fragment:
10159 start: 6
10160 end: 9
10161 __name__:
10162 reason: Aggregation removes metric name.
10163 kind: excluded
10164 fragment:
10165 start: 0
10166 end: 63
10167 colo_name:
10168 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
10169 kind: excluded
10170 fragment:
10171 start: 6
10172 end: 9
10173 region:
10174 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
10175 kind: included
10176 fragment:
10177 start: 6
10178 end: 9
10179 deadinfo: null
10180 returns: vector
10181 operations:
10182 - node: '[*parser.VectorSelector] error_total'
10183 op: ""
10184 - node: '[*parser.AggregateExpr] stddev by (colo_name, region) (error_total)'
10185 op: stddev
10186 - node: '[*parser.AggregateExpr] count by (region) (stddev by (colo_name, region) (error_total))'
10187 op: count
10188 joins: []
10189 unless: []
10190 returninfo:
10191 logicalexpr: ""
10192 valueposition:
10193 start: 0
10194 end: 0
10195 returnednumber: 0
10196 alwaysreturns: false
10197 knownreturn: false
10198 isreturnbool: false
10199 position:
10200 start: 50
10201 end: 61
10202 type: aggregation
10203 fixedlabels: true
10204 isconditional: false
10205
10206---
10207
10208[TestLabelsSource/152 - 1]
10209expr: |4
10210 (
10211 avg(
10212 rate(foo_rejections[6h])
10213 or
10214 vector(0)
10215 ) by (colo_name)
10216 /
10217 (
10218 avg(
10219 rate(foo_total[6h])
10220 or
10221 vector(1)
10222 ) by (colo_name)
10223 )
10224 ) > 5
10225 *
10226 (
10227 avg(
10228 rate(foo_rejections[6h] offset 1d)
10229 or
10230 vector(0)
10231 ) by (colo_name)
10232 /
10233 avg(
10234 rate(foo_total[6h] offset 1d)
10235 or
10236 vector(1)
10237 ) by (colo_name)
10238 ) and on (colo_name) (colo_job:foo_total:rate2m or vector(0)) > 80
10239 and on (colo_name) (colo_job:foo_total:rate2m offset 1d or vector(0)) > 80
10240output:
10241 - labels:
10242 "":
10243 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10244 kind: excluded
10245 fragment:
10246 start: 64
10247 end: 67
10248 __name__:
10249 reason: Aggregation removes metric name.
10250 kind: excluded
10251 fragment:
10252 start: 5
10253 end: 78
10254 colo_name:
10255 reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10256 kind: included
10257 fragment:
10258 start: 341
10259 end: 344
10260 deadinfo: null
10261 returns: vector
10262 operations:
10263 - node: '[*parser.VectorSelector] foo_rejections'
10264 op: ""
10265 - node: '[*parser.Call] rate(foo_rejections[6h])'
10266 op: rate
10267 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))'
10268 op: avg
10269 joins:
10270 - "on": []
10271 ignoring: []
10272 addedlabels: []
10273 src:
10274 labels:
10275 "":
10276 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10277 kind: excluded
10278 fragment:
10279 start: 147
10280 end: 150
10281 __name__:
10282 reason: Aggregation removes metric name.
10283 kind: excluded
10284 fragment:
10285 start: 91
10286 end: 161
10287 colo_name:
10288 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10289 kind: included
10290 fragment:
10291 start: 147
10292 end: 150
10293 deadinfo: null
10294 returns: vector
10295 operations:
10296 - node: '[*parser.VectorSelector] foo_total'
10297 op: ""
10298 - node: '[*parser.Call] rate(foo_total[6h])'
10299 op: rate
10300 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
10301 op: avg
10302 joins: []
10303 unless: []
10304 returninfo:
10305 logicalexpr: ""
10306 valueposition:
10307 start: 0
10308 end: 0
10309 returnednumber: 0
10310 alwaysreturns: false
10311 knownreturn: false
10312 isreturnbool: false
10313 position:
10314 start: 107
10315 end: 120
10316 type: aggregation
10317 fixedlabels: true
10318 isconditional: false
10319 op: 57384
10320 depth: 0
10321 - "on": []
10322 ignoring: []
10323 addedlabels: []
10324 src:
10325 labels:
10326 "":
10327 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10328 kind: excluded
10329 fragment:
10330 start: 147
10331 end: 150
10332 __name__:
10333 reason: Aggregation removes metric name.
10334 kind: excluded
10335 fragment:
10336 start: 91
10337 end: 161
10338 colo_name:
10339 reason: Calling `vector()` will return a vector value with no labels.
10340 kind: excluded
10341 fragment:
10342 start: 131
10343 end: 137
10344 deadinfo: null
10345 returns: vector
10346 operations:
10347 - node: '[*parser.Call] vector(1)'
10348 op: vector
10349 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
10350 op: avg
10351 joins: []
10352 unless: []
10353 returninfo:
10354 logicalexpr: ""
10355 valueposition:
10356 start: 131
10357 end: 140
10358 returnednumber: 1
10359 alwaysreturns: true
10360 knownreturn: true
10361 isreturnbool: false
10362 position:
10363 start: 131
10364 end: 140
10365 type: aggregation
10366 fixedlabels: true
10367 isconditional: false
10368 op: 57384
10369 depth: 0
10370 - "on": []
10371 ignoring: []
10372 addedlabels: []
10373 src:
10374 labels:
10375 "":
10376 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10377 kind: excluded
10378 fragment:
10379 start: 241
10380 end: 244
10381 __name__:
10382 reason: Aggregation removes metric name.
10383 kind: excluded
10384 fragment:
10385 start: 178
10386 end: 255
10387 colo_name:
10388 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10389 kind: included
10390 fragment:
10391 start: 241
10392 end: 244
10393 deadinfo: null
10394 returns: vector
10395 operations:
10396 - node: '[*parser.VectorSelector] foo_rejections offset 1d'
10397 op: ""
10398 - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)'
10399 op: rate
10400 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
10401 op: avg
10402 joins:
10403 - "on": []
10404 ignoring: []
10405 addedlabels: []
10406 src:
10407 labels:
10408 "":
10409 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10410 kind: excluded
10411 fragment:
10412 start: 320
10413 end: 323
10414 __name__:
10415 reason: Aggregation removes metric name.
10416 kind: excluded
10417 fragment:
10418 start: 262
10419 end: 334
10420 colo_name:
10421 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10422 kind: included
10423 fragment:
10424 start: 320
10425 end: 323
10426 deadinfo: null
10427 returns: vector
10428 operations:
10429 - node: '[*parser.VectorSelector] foo_total offset 1d'
10430 op: ""
10431 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
10432 op: rate
10433 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10434 op: avg
10435 joins: []
10436 unless: []
10437 returninfo:
10438 logicalexpr: ""
10439 valueposition:
10440 start: 0
10441 end: 0
10442 returnednumber: 0
10443 alwaysreturns: false
10444 knownreturn: false
10445 isreturnbool: false
10446 position:
10447 start: 276
10448 end: 299
10449 type: aggregation
10450 fixedlabels: true
10451 isconditional: false
10452 op: 57384
10453 depth: 0
10454 - "on": []
10455 ignoring: []
10456 addedlabels: []
10457 src:
10458 labels:
10459 "":
10460 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10461 kind: excluded
10462 fragment:
10463 start: 320
10464 end: 323
10465 __name__:
10466 reason: Aggregation removes metric name.
10467 kind: excluded
10468 fragment:
10469 start: 262
10470 end: 334
10471 colo_name:
10472 reason: Calling `vector()` will return a vector value with no labels.
10473 kind: excluded
10474 fragment:
10475 start: 306
10476 end: 312
10477 deadinfo: null
10478 returns: vector
10479 operations:
10480 - node: '[*parser.Call] vector(1)'
10481 op: vector
10482 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10483 op: avg
10484 joins: []
10485 unless: []
10486 returninfo:
10487 logicalexpr: ""
10488 valueposition:
10489 start: 306
10490 end: 315
10491 returnednumber: 1
10492 alwaysreturns: true
10493 knownreturn: true
10494 isreturnbool: false
10495 position:
10496 start: 306
10497 end: 315
10498 type: aggregation
10499 fixedlabels: true
10500 isconditional: false
10501 op: 57384
10502 depth: 0
10503 unless: []
10504 returninfo:
10505 logicalexpr: ""
10506 valueposition:
10507 start: 0
10508 end: 0
10509 returnednumber: 0
10510 alwaysreturns: false
10511 knownreturn: false
10512 isreturnbool: false
10513 position:
10514 start: 192
10515 end: 220
10516 type: aggregation
10517 fixedlabels: true
10518 isconditional: false
10519 op: 57388
10520 depth: 0
10521 - "on": []
10522 ignoring: []
10523 addedlabels: []
10524 src:
10525 labels:
10526 "":
10527 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10528 kind: excluded
10529 fragment:
10530 start: 241
10531 end: 244
10532 __name__:
10533 reason: Aggregation removes metric name.
10534 kind: excluded
10535 fragment:
10536 start: 178
10537 end: 255
10538 colo_name:
10539 reason: Calling `vector()` will return a vector value with no labels.
10540 kind: excluded
10541 fragment:
10542 start: 227
10543 end: 233
10544 deadinfo: null
10545 returns: vector
10546 operations:
10547 - node: '[*parser.Call] vector(0)'
10548 op: vector
10549 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
10550 op: avg
10551 joins:
10552 - "on": []
10553 ignoring: []
10554 addedlabels: []
10555 src:
10556 labels:
10557 "":
10558 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10559 kind: excluded
10560 fragment:
10561 start: 320
10562 end: 323
10563 __name__:
10564 reason: Aggregation removes metric name.
10565 kind: excluded
10566 fragment:
10567 start: 262
10568 end: 334
10569 colo_name:
10570 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10571 kind: included
10572 fragment:
10573 start: 320
10574 end: 323
10575 deadinfo: null
10576 returns: vector
10577 operations:
10578 - node: '[*parser.VectorSelector] foo_total offset 1d'
10579 op: ""
10580 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
10581 op: rate
10582 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10583 op: avg
10584 joins: []
10585 unless: []
10586 returninfo:
10587 logicalexpr: ""
10588 valueposition:
10589 start: 0
10590 end: 0
10591 returnednumber: 0
10592 alwaysreturns: false
10593 knownreturn: false
10594 isreturnbool: false
10595 position:
10596 start: 276
10597 end: 299
10598 type: aggregation
10599 fixedlabels: true
10600 isconditional: false
10601 op: 57384
10602 depth: 0
10603 - "on": []
10604 ignoring: []
10605 addedlabels: []
10606 src:
10607 labels:
10608 "":
10609 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10610 kind: excluded
10611 fragment:
10612 start: 320
10613 end: 323
10614 __name__:
10615 reason: Aggregation removes metric name.
10616 kind: excluded
10617 fragment:
10618 start: 262
10619 end: 334
10620 colo_name:
10621 reason: Calling `vector()` will return a vector value with no labels.
10622 kind: excluded
10623 fragment:
10624 start: 306
10625 end: 312
10626 deadinfo: null
10627 returns: vector
10628 operations:
10629 - node: '[*parser.Call] vector(1)'
10630 op: vector
10631 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10632 op: avg
10633 joins: []
10634 unless: []
10635 returninfo:
10636 logicalexpr: ""
10637 valueposition:
10638 start: 306
10639 end: 315
10640 returnednumber: 1
10641 alwaysreturns: true
10642 knownreturn: true
10643 isreturnbool: false
10644 position:
10645 start: 306
10646 end: 315
10647 type: aggregation
10648 fixedlabels: true
10649 isconditional: false
10650 op: 57384
10651 depth: 0
10652 unless: []
10653 returninfo:
10654 logicalexpr: 5 * vector(0) / vector(1)
10655 valueposition:
10656 start: 170
10657 end: 171
10658 returnednumber: 0
10659 alwaysreturns: true
10660 knownreturn: true
10661 isreturnbool: false
10662 position:
10663 start: 227
10664 end: 236
10665 type: aggregation
10666 fixedlabels: true
10667 isconditional: false
10668 op: 57388
10669 depth: 0
10670 - "on":
10671 - colo_name
10672 ignoring: []
10673 addedlabels: []
10674 src:
10675 labels: {}
10676 deadinfo: null
10677 returns: vector
10678 operations:
10679 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m'
10680 op: ""
10681 joins: []
10682 unless: []
10683 returninfo:
10684 logicalexpr: ""
10685 valueposition:
10686 start: 0
10687 end: 0
10688 returnednumber: 0
10689 alwaysreturns: false
10690 knownreturn: false
10691 isreturnbool: false
10692 position:
10693 start: 357
10694 end: 382
10695 type: selector
10696 fixedlabels: false
10697 isconditional: true
10698 op: 57389
10699 depth: 0
10700 - "on":
10701 - colo_name
10702 ignoring: []
10703 addedlabels: []
10704 src:
10705 labels:
10706 "":
10707 reason: Calling `vector()` will return a vector value with no labels.
10708 kind: excluded
10709 fragment:
10710 start: 386
10711 end: 392
10712 deadinfo:
10713 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.
10714 fragment:
10715 start: 386
10716 end: 392
10717 returns: vector
10718 operations:
10719 - node: '[*parser.Call] vector(0)'
10720 op: vector
10721 joins: []
10722 unless: []
10723 returninfo:
10724 logicalexpr: ""
10725 valueposition:
10726 start: 386
10727 end: 395
10728 returnednumber: 0
10729 alwaysreturns: true
10730 knownreturn: true
10731 isreturnbool: false
10732 position:
10733 start: 386
10734 end: 395
10735 type: function
10736 fixedlabels: true
10737 isconditional: true
10738 op: 57389
10739 depth: 0
10740 - "on":
10741 - colo_name
10742 ignoring: []
10743 addedlabels: []
10744 src:
10745 labels: {}
10746 deadinfo: null
10747 returns: vector
10748 operations:
10749 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d'
10750 op: ""
10751 joins: []
10752 unless: []
10753 returninfo:
10754 logicalexpr: ""
10755 valueposition:
10756 start: 0
10757 end: 0
10758 returnednumber: 0
10759 alwaysreturns: false
10760 knownreturn: false
10761 isreturnbool: false
10762 position:
10763 start: 424
10764 end: 459
10765 type: selector
10766 fixedlabels: false
10767 isconditional: true
10768 op: 57389
10769 depth: 0
10770 - "on":
10771 - colo_name
10772 ignoring: []
10773 addedlabels: []
10774 src:
10775 labels:
10776 "":
10777 reason: Calling `vector()` will return a vector value with no labels.
10778 kind: excluded
10779 fragment:
10780 start: 463
10781 end: 469
10782 deadinfo:
10783 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.
10784 fragment:
10785 start: 463
10786 end: 469
10787 returns: vector
10788 operations:
10789 - node: '[*parser.Call] vector(0)'
10790 op: vector
10791 joins: []
10792 unless: []
10793 returninfo:
10794 logicalexpr: ""
10795 valueposition:
10796 start: 463
10797 end: 472
10798 returnednumber: 0
10799 alwaysreturns: true
10800 knownreturn: true
10801 isreturnbool: false
10802 position:
10803 start: 463
10804 end: 472
10805 type: function
10806 fixedlabels: true
10807 isconditional: true
10808 op: 57389
10809 depth: 0
10810 unless: []
10811 returninfo:
10812 logicalexpr: ""
10813 valueposition:
10814 start: 0
10815 end: 0
10816 returnednumber: 0
10817 alwaysreturns: false
10818 knownreturn: false
10819 isreturnbool: false
10820 position:
10821 start: 19
10822 end: 37
10823 type: aggregation
10824 fixedlabels: true
10825 isconditional: true
10826 - labels:
10827 "":
10828 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10829 kind: excluded
10830 fragment:
10831 start: 64
10832 end: 67
10833 __name__:
10834 reason: Aggregation removes metric name.
10835 kind: excluded
10836 fragment:
10837 start: 5
10838 end: 78
10839 colo_name:
10840 reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10841 kind: included
10842 fragment:
10843 start: 341
10844 end: 344
10845 deadinfo:
10846 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.'
10847 fragment:
10848 start: 50
10849 end: 59
10850 returns: vector
10851 operations:
10852 - node: '[*parser.Call] vector(0)'
10853 op: vector
10854 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))'
10855 op: avg
10856 joins:
10857 - "on": []
10858 ignoring: []
10859 addedlabels: []
10860 src:
10861 labels:
10862 "":
10863 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10864 kind: excluded
10865 fragment:
10866 start: 147
10867 end: 150
10868 __name__:
10869 reason: Aggregation removes metric name.
10870 kind: excluded
10871 fragment:
10872 start: 91
10873 end: 161
10874 colo_name:
10875 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10876 kind: included
10877 fragment:
10878 start: 147
10879 end: 150
10880 deadinfo: null
10881 returns: vector
10882 operations:
10883 - node: '[*parser.VectorSelector] foo_total'
10884 op: ""
10885 - node: '[*parser.Call] rate(foo_total[6h])'
10886 op: rate
10887 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
10888 op: avg
10889 joins: []
10890 unless: []
10891 returninfo:
10892 logicalexpr: ""
10893 valueposition:
10894 start: 0
10895 end: 0
10896 returnednumber: 0
10897 alwaysreturns: false
10898 knownreturn: false
10899 isreturnbool: false
10900 position:
10901 start: 107
10902 end: 120
10903 type: aggregation
10904 fixedlabels: true
10905 isconditional: false
10906 op: 57384
10907 depth: 0
10908 - "on": []
10909 ignoring: []
10910 addedlabels: []
10911 src:
10912 labels:
10913 "":
10914 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10915 kind: excluded
10916 fragment:
10917 start: 147
10918 end: 150
10919 __name__:
10920 reason: Aggregation removes metric name.
10921 kind: excluded
10922 fragment:
10923 start: 91
10924 end: 161
10925 colo_name:
10926 reason: Calling `vector()` will return a vector value with no labels.
10927 kind: excluded
10928 fragment:
10929 start: 131
10930 end: 137
10931 deadinfo: null
10932 returns: vector
10933 operations:
10934 - node: '[*parser.Call] vector(1)'
10935 op: vector
10936 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
10937 op: avg
10938 joins: []
10939 unless: []
10940 returninfo:
10941 logicalexpr: ""
10942 valueposition:
10943 start: 131
10944 end: 140
10945 returnednumber: 1
10946 alwaysreturns: true
10947 knownreturn: true
10948 isreturnbool: false
10949 position:
10950 start: 131
10951 end: 140
10952 type: aggregation
10953 fixedlabels: true
10954 isconditional: false
10955 op: 57384
10956 depth: 0
10957 - "on": []
10958 ignoring: []
10959 addedlabels: []
10960 src:
10961 labels:
10962 "":
10963 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10964 kind: excluded
10965 fragment:
10966 start: 241
10967 end: 244
10968 __name__:
10969 reason: Aggregation removes metric name.
10970 kind: excluded
10971 fragment:
10972 start: 178
10973 end: 255
10974 colo_name:
10975 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10976 kind: included
10977 fragment:
10978 start: 241
10979 end: 244
10980 deadinfo: null
10981 returns: vector
10982 operations:
10983 - node: '[*parser.VectorSelector] foo_rejections offset 1d'
10984 op: ""
10985 - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)'
10986 op: rate
10987 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
10988 op: avg
10989 joins:
10990 - "on": []
10991 ignoring: []
10992 addedlabels: []
10993 src:
10994 labels:
10995 "":
10996 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10997 kind: excluded
10998 fragment:
10999 start: 320
11000 end: 323
11001 __name__:
11002 reason: Aggregation removes metric name.
11003 kind: excluded
11004 fragment:
11005 start: 262
11006 end: 334
11007 colo_name:
11008 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11009 kind: included
11010 fragment:
11011 start: 320
11012 end: 323
11013 deadinfo: null
11014 returns: vector
11015 operations:
11016 - node: '[*parser.VectorSelector] foo_total offset 1d'
11017 op: ""
11018 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
11019 op: rate
11020 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
11021 op: avg
11022 joins: []
11023 unless: []
11024 returninfo:
11025 logicalexpr: ""
11026 valueposition:
11027 start: 0
11028 end: 0
11029 returnednumber: 0
11030 alwaysreturns: false
11031 knownreturn: false
11032 isreturnbool: false
11033 position:
11034 start: 276
11035 end: 299
11036 type: aggregation
11037 fixedlabels: true
11038 isconditional: false
11039 op: 57384
11040 depth: 0
11041 - "on": []
11042 ignoring: []
11043 addedlabels: []
11044 src:
11045 labels:
11046 "":
11047 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11048 kind: excluded
11049 fragment:
11050 start: 320
11051 end: 323
11052 __name__:
11053 reason: Aggregation removes metric name.
11054 kind: excluded
11055 fragment:
11056 start: 262
11057 end: 334
11058 colo_name:
11059 reason: Calling `vector()` will return a vector value with no labels.
11060 kind: excluded
11061 fragment:
11062 start: 306
11063 end: 312
11064 deadinfo: null
11065 returns: vector
11066 operations:
11067 - node: '[*parser.Call] vector(1)'
11068 op: vector
11069 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
11070 op: avg
11071 joins: []
11072 unless: []
11073 returninfo:
11074 logicalexpr: ""
11075 valueposition:
11076 start: 306
11077 end: 315
11078 returnednumber: 1
11079 alwaysreturns: true
11080 knownreturn: true
11081 isreturnbool: false
11082 position:
11083 start: 306
11084 end: 315
11085 type: aggregation
11086 fixedlabels: true
11087 isconditional: false
11088 op: 57384
11089 depth: 0
11090 unless: []
11091 returninfo:
11092 logicalexpr: ""
11093 valueposition:
11094 start: 0
11095 end: 0
11096 returnednumber: 0
11097 alwaysreturns: false
11098 knownreturn: false
11099 isreturnbool: false
11100 position:
11101 start: 192
11102 end: 220
11103 type: aggregation
11104 fixedlabels: true
11105 isconditional: false
11106 op: 57388
11107 depth: 0
11108 - "on": []
11109 ignoring: []
11110 addedlabels: []
11111 src:
11112 labels:
11113 "":
11114 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11115 kind: excluded
11116 fragment:
11117 start: 241
11118 end: 244
11119 __name__:
11120 reason: Aggregation removes metric name.
11121 kind: excluded
11122 fragment:
11123 start: 178
11124 end: 255
11125 colo_name:
11126 reason: Calling `vector()` will return a vector value with no labels.
11127 kind: excluded
11128 fragment:
11129 start: 227
11130 end: 233
11131 deadinfo: null
11132 returns: vector
11133 operations:
11134 - node: '[*parser.Call] vector(0)'
11135 op: vector
11136 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
11137 op: avg
11138 joins:
11139 - "on": []
11140 ignoring: []
11141 addedlabels: []
11142 src:
11143 labels:
11144 "":
11145 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11146 kind: excluded
11147 fragment:
11148 start: 320
11149 end: 323
11150 __name__:
11151 reason: Aggregation removes metric name.
11152 kind: excluded
11153 fragment:
11154 start: 262
11155 end: 334
11156 colo_name:
11157 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11158 kind: included
11159 fragment:
11160 start: 320
11161 end: 323
11162 deadinfo: null
11163 returns: vector
11164 operations:
11165 - node: '[*parser.VectorSelector] foo_total offset 1d'
11166 op: ""
11167 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
11168 op: rate
11169 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
11170 op: avg
11171 joins: []
11172 unless: []
11173 returninfo:
11174 logicalexpr: ""
11175 valueposition:
11176 start: 0
11177 end: 0
11178 returnednumber: 0
11179 alwaysreturns: false
11180 knownreturn: false
11181 isreturnbool: false
11182 position:
11183 start: 276
11184 end: 299
11185 type: aggregation
11186 fixedlabels: true
11187 isconditional: false
11188 op: 57384
11189 depth: 0
11190 - "on": []
11191 ignoring: []
11192 addedlabels: []
11193 src:
11194 labels:
11195 "":
11196 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11197 kind: excluded
11198 fragment:
11199 start: 320
11200 end: 323
11201 __name__:
11202 reason: Aggregation removes metric name.
11203 kind: excluded
11204 fragment:
11205 start: 262
11206 end: 334
11207 colo_name:
11208 reason: Calling `vector()` will return a vector value with no labels.
11209 kind: excluded
11210 fragment:
11211 start: 306
11212 end: 312
11213 deadinfo: null
11214 returns: vector
11215 operations:
11216 - node: '[*parser.Call] vector(1)'
11217 op: vector
11218 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
11219 op: avg
11220 joins: []
11221 unless: []
11222 returninfo:
11223 logicalexpr: ""
11224 valueposition:
11225 start: 306
11226 end: 315
11227 returnednumber: 1
11228 alwaysreturns: true
11229 knownreturn: true
11230 isreturnbool: false
11231 position:
11232 start: 306
11233 end: 315
11234 type: aggregation
11235 fixedlabels: true
11236 isconditional: false
11237 op: 57384
11238 depth: 0
11239 unless: []
11240 returninfo:
11241 logicalexpr: 5 * vector(0) / vector(1)
11242 valueposition:
11243 start: 170
11244 end: 171
11245 returnednumber: 0
11246 alwaysreturns: true
11247 knownreturn: true
11248 isreturnbool: false
11249 position:
11250 start: 227
11251 end: 236
11252 type: aggregation
11253 fixedlabels: true
11254 isconditional: false
11255 op: 57388
11256 depth: 0
11257 - "on":
11258 - colo_name
11259 ignoring: []
11260 addedlabels: []
11261 src:
11262 labels: {}
11263 deadinfo: null
11264 returns: vector
11265 operations:
11266 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m'
11267 op: ""
11268 joins: []
11269 unless: []
11270 returninfo:
11271 logicalexpr: ""
11272 valueposition:
11273 start: 0
11274 end: 0
11275 returnednumber: 0
11276 alwaysreturns: false
11277 knownreturn: false
11278 isreturnbool: false
11279 position:
11280 start: 357
11281 end: 382
11282 type: selector
11283 fixedlabels: false
11284 isconditional: true
11285 op: 57389
11286 depth: 0
11287 - "on":
11288 - colo_name
11289 ignoring: []
11290 addedlabels: []
11291 src:
11292 labels:
11293 "":
11294 reason: Calling `vector()` will return a vector value with no labels.
11295 kind: excluded
11296 fragment:
11297 start: 386
11298 end: 392
11299 deadinfo:
11300 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.
11301 fragment:
11302 start: 386
11303 end: 392
11304 returns: vector
11305 operations:
11306 - node: '[*parser.Call] vector(0)'
11307 op: vector
11308 joins: []
11309 unless: []
11310 returninfo:
11311 logicalexpr: ""
11312 valueposition:
11313 start: 386
11314 end: 395
11315 returnednumber: 0
11316 alwaysreturns: true
11317 knownreturn: true
11318 isreturnbool: false
11319 position:
11320 start: 386
11321 end: 395
11322 type: function
11323 fixedlabels: true
11324 isconditional: true
11325 op: 57389
11326 depth: 0
11327 - "on":
11328 - colo_name
11329 ignoring: []
11330 addedlabels: []
11331 src:
11332 labels: {}
11333 deadinfo: null
11334 returns: vector
11335 operations:
11336 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d'
11337 op: ""
11338 joins: []
11339 unless: []
11340 returninfo:
11341 logicalexpr: ""
11342 valueposition:
11343 start: 0
11344 end: 0
11345 returnednumber: 0
11346 alwaysreturns: false
11347 knownreturn: false
11348 isreturnbool: false
11349 position:
11350 start: 424
11351 end: 459
11352 type: selector
11353 fixedlabels: false
11354 isconditional: true
11355 op: 57389
11356 depth: 0
11357 - "on":
11358 - colo_name
11359 ignoring: []
11360 addedlabels: []
11361 src:
11362 labels:
11363 "":
11364 reason: Calling `vector()` will return a vector value with no labels.
11365 kind: excluded
11366 fragment:
11367 start: 463
11368 end: 469
11369 deadinfo:
11370 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.
11371 fragment:
11372 start: 463
11373 end: 469
11374 returns: vector
11375 operations:
11376 - node: '[*parser.Call] vector(0)'
11377 op: vector
11378 joins: []
11379 unless: []
11380 returninfo:
11381 logicalexpr: ""
11382 valueposition:
11383 start: 463
11384 end: 472
11385 returnednumber: 0
11386 alwaysreturns: true
11387 knownreturn: true
11388 isreturnbool: false
11389 position:
11390 start: 463
11391 end: 472
11392 type: function
11393 fixedlabels: true
11394 isconditional: true
11395 op: 57389
11396 depth: 0
11397 unless: []
11398 returninfo:
11399 logicalexpr: vector(0) / vector(1)
11400 valueposition:
11401 start: 50
11402 end: 59
11403 returnednumber: 0
11404 alwaysreturns: true
11405 knownreturn: true
11406 isreturnbool: false
11407 position:
11408 start: 50
11409 end: 59
11410 type: aggregation
11411 fixedlabels: true
11412 isconditional: true
11413
11414---
11415
11416[TestLabelsSource/153 - 1]
11417expr: sum(selector) / sum(selector offset 30m) > 5
11418output:
11419 - labels:
11420 "":
11421 reason: Query is using aggregation that removes all labels.
11422 kind: excluded
11423 fragment:
11424 start: 0
11425 end: 3
11426 __name__:
11427 reason: Aggregation removes metric name.
11428 kind: excluded
11429 fragment:
11430 start: 0
11431 end: 13
11432 deadinfo: null
11433 returns: vector
11434 operations:
11435 - node: '[*parser.VectorSelector] selector'
11436 op: ""
11437 - node: '[*parser.AggregateExpr] sum(selector)'
11438 op: sum
11439 joins:
11440 - "on": []
11441 ignoring: []
11442 addedlabels: []
11443 src:
11444 labels:
11445 "":
11446 reason: Query is using aggregation that removes all labels.
11447 kind: excluded
11448 fragment:
11449 start: 16
11450 end: 19
11451 __name__:
11452 reason: Aggregation removes metric name.
11453 kind: excluded
11454 fragment:
11455 start: 16
11456 end: 40
11457 deadinfo: null
11458 returns: vector
11459 operations:
11460 - node: '[*parser.VectorSelector] selector offset 30m'
11461 op: ""
11462 - node: '[*parser.AggregateExpr] sum(selector offset 30m)'
11463 op: sum
11464 joins: []
11465 unless: []
11466 returninfo:
11467 logicalexpr: ""
11468 valueposition:
11469 start: 0
11470 end: 0
11471 returnednumber: 0
11472 alwaysreturns: false
11473 knownreturn: false
11474 isreturnbool: false
11475 position:
11476 start: 20
11477 end: 39
11478 type: aggregation
11479 fixedlabels: true
11480 isconditional: false
11481 op: 57384
11482 depth: 0
11483 unless: []
11484 returninfo:
11485 logicalexpr: ""
11486 valueposition:
11487 start: 0
11488 end: 0
11489 returnednumber: 0
11490 alwaysreturns: false
11491 knownreturn: false
11492 isreturnbool: false
11493 position:
11494 start: 4
11495 end: 12
11496 type: aggregation
11497 fixedlabels: true
11498 isconditional: true
11499
11500---
11501
11502[TestLabelsSource/154 - 1]
11503expr: |4-
11504 count by (dc) (
11505 max(0 < (token_expiration - time()) < (6*60*60)) by (instance)
11506 * on (instance) group_right label_replace(
11507 configured_minions, "instance", "$1", "minion", "(.+)")
11508 ) > 5
11509output:
11510 - labels:
11511 "":
11512 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
11513 kind: excluded
11514 fragment:
11515 start: 7
11516 end: 10
11517 __name__:
11518 reason: Aggregation removes metric name.
11519 kind: excluded
11520 fragment:
11521 start: 1
11522 end: 190
11523 dc:
11524 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
11525 kind: included
11526 fragment:
11527 start: 7
11528 end: 10
11529 instance:
11530 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
11531 kind: excluded
11532 fragment:
11533 start: 7
11534 end: 10
11535 deadinfo: null
11536 returns: vector
11537 operations:
11538 - node: '[*parser.VectorSelector] configured_minions'
11539 op: ""
11540 - node: '[*parser.Call] label_replace(configured_minions, "instance", "$1", "minion", "(.+)")'
11541 op: label_replace
11542 - 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", "(.+)"))'
11543 op: count
11544 joins:
11545 - "on":
11546 - instance
11547 ignoring: []
11548 addedlabels: []
11549 src:
11550 labels:
11551 "":
11552 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
11553 kind: excluded
11554 fragment:
11555 start: 68
11556 end: 71
11557 __name__:
11558 reason: Aggregation removes metric name.
11559 kind: excluded
11560 fragment:
11561 start: 19
11562 end: 81
11563 instance:
11564 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
11565 kind: included
11566 fragment:
11567 start: 68
11568 end: 71
11569 deadinfo: null
11570 returns: vector
11571 operations:
11572 - node: '[*parser.VectorSelector] token_expiration'
11573 op: ""
11574 - node: '[*parser.AggregateExpr] max by (instance) (0 < (token_expiration - time()) < (6 * 60 * 60))'
11575 op: max
11576 joins: []
11577 unless: []
11578 returninfo:
11579 logicalexpr: ""
11580 valueposition:
11581 start: 0
11582 end: 0
11583 returnednumber: 0
11584 alwaysreturns: false
11585 knownreturn: false
11586 isreturnbool: false
11587 position:
11588 start: 28
11589 end: 44
11590 type: aggregation
11591 fixedlabels: true
11592 isconditional: true
11593 op: 57395
11594 depth: 1
11595 unless: []
11596 returninfo:
11597 logicalexpr: ""
11598 valueposition:
11599 start: 0
11600 end: 0
11601 returnednumber: 0
11602 alwaysreturns: false
11603 knownreturn: false
11604 isreturnbool: false
11605 position:
11606 start: 131
11607 end: 149
11608 type: aggregation
11609 fixedlabels: true
11610 isconditional: true
11611
11612---
11613
11614[TestLabelsSource/155 - 1]
11615expr: topk(10, prometheus_build_info*prometheus_ready)
11616output:
11617 - labels: {}
11618 deadinfo: null
11619 returns: vector
11620 operations:
11621 - node: '[*parser.VectorSelector] prometheus_build_info'
11622 op: ""
11623 - node: '[*parser.AggregateExpr] topk(10, prometheus_build_info * prometheus_ready)'
11624 op: topk
11625 joins:
11626 - "on": []
11627 ignoring: []
11628 addedlabels: []
11629 src:
11630 labels: {}
11631 deadinfo: null
11632 returns: vector
11633 operations:
11634 - node: '[*parser.VectorSelector] prometheus_ready'
11635 op: ""
11636 joins: []
11637 unless: []
11638 returninfo:
11639 logicalexpr: ""
11640 valueposition:
11641 start: 0
11642 end: 0
11643 returnednumber: 0
11644 alwaysreturns: false
11645 knownreturn: false
11646 isreturnbool: false
11647 position:
11648 start: 31
11649 end: 47
11650 type: selector
11651 fixedlabels: false
11652 isconditional: false
11653 op: 57395
11654 depth: 1
11655 unless: []
11656 returninfo:
11657 logicalexpr: ""
11658 valueposition:
11659 start: 0
11660 end: 0
11661 returnednumber: 0
11662 alwaysreturns: false
11663 knownreturn: false
11664 isreturnbool: false
11665 position:
11666 start: 9
11667 end: 30
11668 type: aggregation
11669 fixedlabels: false
11670 isconditional: false
11671
11672---
11673
11674[TestLabelsSource/156 - 1]
11675expr: bottomk(10, prometheus_build_info*prometheus_ready)
11676output:
11677 - labels: {}
11678 deadinfo: null
11679 returns: vector
11680 operations:
11681 - node: '[*parser.VectorSelector] prometheus_build_info'
11682 op: ""
11683 - node: '[*parser.AggregateExpr] bottomk(10, prometheus_build_info * prometheus_ready)'
11684 op: bottomk
11685 joins:
11686 - "on": []
11687 ignoring: []
11688 addedlabels: []
11689 src:
11690 labels: {}
11691 deadinfo: null
11692 returns: vector
11693 operations:
11694 - node: '[*parser.VectorSelector] prometheus_ready'
11695 op: ""
11696 joins: []
11697 unless: []
11698 returninfo:
11699 logicalexpr: ""
11700 valueposition:
11701 start: 0
11702 end: 0
11703 returnednumber: 0
11704 alwaysreturns: false
11705 knownreturn: false
11706 isreturnbool: false
11707 position:
11708 start: 34
11709 end: 50
11710 type: selector
11711 fixedlabels: false
11712 isconditional: false
11713 op: 57395
11714 depth: 1
11715 unless: []
11716 returninfo:
11717 logicalexpr: ""
11718 valueposition:
11719 start: 0
11720 end: 0
11721 returnednumber: 0
11722 alwaysreturns: false
11723 knownreturn: false
11724 isreturnbool: false
11725 position:
11726 start: 12
11727 end: 33
11728 type: aggregation
11729 fixedlabels: false
11730 isconditional: false
11731
11732---