cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.74.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

internal/parser/utils/source_test.snap

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