cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.74.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

internal/parser/utils/source_test.snap

11614lines · 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 - "on": []
4225 ignoring: []
4226 src:
4227 labels: {}
4228 deadinfo: null
4229 returns: vector
4230 operations:
4231 - node: '[*parser.VectorSelector] bar'
4232 op: ""
4233 joins: []
4234 unless: []
4235 returninfo:
4236 logicalexpr: ""
4237 valueposition:
4238 start: 0
4239 end: 0
4240 returnednumber: 0
4241 alwaysreturns: false
4242 knownreturn: false
4243 isreturnbool: false
4244 position:
4245 start: 11
4246 end: 14
4247 type: selector
4248 fixedlabels: false
4249 isconditional: false
4250 returninfo:
4251 logicalexpr: ""
4252 valueposition:
4253 start: 0
4254 end: 0
4255 returnednumber: 0
4256 alwaysreturns: false
4257 knownreturn: false
4258 isreturnbool: false
4259 position:
4260 start: 0
4261 end: 3
4262 type: selector
4263 fixedlabels: false
4264 isconditional: false
4265
4266---
4267
4268[TestLabelsSource/83 - 1]
4269expr: foo unless bar > 5
4270output:
4271 - labels: {}
4272 deadinfo: null
4273 returns: vector
4274 operations:
4275 - node: '[*parser.VectorSelector] foo'
4276 op: ""
4277 joins: []
4278 unless:
4279 - "on": []
4280 ignoring: []
4281 src:
4282 labels: {}
4283 deadinfo: null
4284 returns: vector
4285 operations:
4286 - node: '[*parser.VectorSelector] bar'
4287 op: ""
4288 joins: []
4289 unless: []
4290 returninfo:
4291 logicalexpr: ""
4292 valueposition:
4293 start: 0
4294 end: 0
4295 returnednumber: 0
4296 alwaysreturns: false
4297 knownreturn: false
4298 isreturnbool: false
4299 position:
4300 start: 11
4301 end: 14
4302 type: selector
4303 fixedlabels: false
4304 isconditional: true
4305 returninfo:
4306 logicalexpr: ""
4307 valueposition:
4308 start: 0
4309 end: 0
4310 returnednumber: 0
4311 alwaysreturns: false
4312 knownreturn: false
4313 isreturnbool: false
4314 position:
4315 start: 0
4316 end: 3
4317 type: selector
4318 fixedlabels: false
4319 isconditional: false
4320
4321---
4322
4323[TestLabelsSource/84 - 1]
4324expr: foo unless bar unless baz
4325output:
4326 - labels: {}
4327 deadinfo: null
4328 returns: vector
4329 operations:
4330 - node: '[*parser.VectorSelector] foo'
4331 op: ""
4332 joins: []
4333 unless:
4334 - "on": []
4335 ignoring: []
4336 src:
4337 labels: {}
4338 deadinfo: null
4339 returns: vector
4340 operations:
4341 - node: '[*parser.VectorSelector] bar'
4342 op: ""
4343 joins: []
4344 unless: []
4345 returninfo:
4346 logicalexpr: ""
4347 valueposition:
4348 start: 0
4349 end: 0
4350 returnednumber: 0
4351 alwaysreturns: false
4352 knownreturn: false
4353 isreturnbool: false
4354 position:
4355 start: 11
4356 end: 14
4357 type: selector
4358 fixedlabels: false
4359 isconditional: false
4360 - "on": []
4361 ignoring: []
4362 src:
4363 labels: {}
4364 deadinfo: null
4365 returns: vector
4366 operations:
4367 - node: '[*parser.VectorSelector] baz'
4368 op: ""
4369 joins: []
4370 unless: []
4371 returninfo:
4372 logicalexpr: ""
4373 valueposition:
4374 start: 0
4375 end: 0
4376 returnednumber: 0
4377 alwaysreturns: false
4378 knownreturn: false
4379 isreturnbool: false
4380 position:
4381 start: 22
4382 end: 25
4383 type: selector
4384 fixedlabels: false
4385 isconditional: false
4386 returninfo:
4387 logicalexpr: ""
4388 valueposition:
4389 start: 0
4390 end: 0
4391 returnednumber: 0
4392 alwaysreturns: false
4393 knownreturn: false
4394 isreturnbool: false
4395 position:
4396 start: 0
4397 end: 3
4398 type: selector
4399 fixedlabels: false
4400 isconditional: false
4401
4402---
4403
4404[TestLabelsSource/85 - 1]
4405expr: count(sum(up{job="foo", cluster="dev"}) by(job, cluster) == 0) without(job, cluster)
4406output:
4407 - labels:
4408 "":
4409 reason: Query is using aggregation with `by(job, cluster)`, only labels included inside `by(...)` will be present on the results.
4410 kind: excluded
4411 fragment:
4412 start: 40
4413 end: 42
4414 __name__:
4415 reason: Aggregation removes metric name.
4416 kind: excluded
4417 fragment:
4418 start: 0
4419 end: 84
4420 cluster:
4421 reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results.
4422 kind: excluded
4423 fragment:
4424 start: 63
4425 end: 70
4426 job:
4427 reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results.
4428 kind: excluded
4429 fragment:
4430 start: 63
4431 end: 70
4432 deadinfo: null
4433 returns: vector
4434 operations:
4435 - node: '[*parser.VectorSelector] up{cluster="dev",job="foo"}'
4436 op: ""
4437 - node: '[*parser.AggregateExpr] sum by (job, cluster) (up{cluster="dev",job="foo"})'
4438 op: sum
4439 - node: '[*parser.AggregateExpr] count without (job, cluster) (sum by (job, cluster) (up{cluster="dev",job="foo"}) == 0)'
4440 op: count
4441 joins: []
4442 unless: []
4443 returninfo:
4444 logicalexpr: ""
4445 valueposition:
4446 start: 0
4447 end: 0
4448 returnednumber: 0
4449 alwaysreturns: false
4450 knownreturn: false
4451 isreturnbool: false
4452 position:
4453 start: 10
4454 end: 38
4455 type: aggregation
4456 fixedlabels: true
4457 isconditional: true
4458
4459---
4460
4461[TestLabelsSource/86 - 1]
4462expr: year()
4463output:
4464 - labels:
4465 "":
4466 reason: Calling `year()` with no arguments will return an empty time series with no labels.
4467 kind: excluded
4468 fragment:
4469 start: 0
4470 end: 6
4471 deadinfo: null
4472 returns: vector
4473 operations:
4474 - node: '[*parser.Call] year()'
4475 op: year
4476 joins: []
4477 unless: []
4478 returninfo:
4479 logicalexpr: ""
4480 valueposition:
4481 start: 0
4482 end: 0
4483 returnednumber: 0
4484 alwaysreturns: true
4485 knownreturn: false
4486 isreturnbool: false
4487 position:
4488 start: 0
4489 end: 6
4490 type: function
4491 fixedlabels: true
4492 isconditional: false
4493
4494---
4495
4496[TestLabelsSource/87 - 1]
4497expr: year(foo)
4498output:
4499 - labels: {}
4500 deadinfo: null
4501 returns: vector
4502 operations:
4503 - node: '[*parser.VectorSelector] foo'
4504 op: ""
4505 - node: '[*parser.Call] year(foo)'
4506 op: year
4507 joins: []
4508 unless: []
4509 returninfo:
4510 logicalexpr: ""
4511 valueposition:
4512 start: 0
4513 end: 0
4514 returnednumber: 0
4515 alwaysreturns: false
4516 knownreturn: false
4517 isreturnbool: false
4518 position:
4519 start: 5
4520 end: 8
4521 type: function
4522 fixedlabels: false
4523 isconditional: false
4524
4525---
4526
4527[TestLabelsSource/88 - 1]
4528expr: label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")
4529output:
4530 - labels:
4531 foo:
4532 reason: This label will be added to the result by label_join() call.
4533 kind: guaranteed
4534 fragment:
4535 start: 0
4536 end: 95
4537 job:
4538 reason: Query will only return series where these labels are present.
4539 kind: guaranteed
4540 fragment:
4541 start: 11
4542 end: 58
4543 src1:
4544 reason: Query will only return series where these labels are present.
4545 kind: guaranteed
4546 fragment:
4547 start: 11
4548 end: 58
4549 src2:
4550 reason: Query will only return series where these labels are present.
4551 kind: guaranteed
4552 fragment:
4553 start: 11
4554 end: 58
4555 src3:
4556 reason: Query will only return series where these labels are present.
4557 kind: guaranteed
4558 fragment:
4559 start: 11
4560 end: 58
4561 deadinfo: null
4562 returns: vector
4563 operations:
4564 - node: '[*parser.VectorSelector] up{job="api-server",src1="a",src2="b",src3="c"}'
4565 op: ""
4566 - node: '[*parser.Call] label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")'
4567 op: label_join
4568 joins: []
4569 unless: []
4570 returninfo:
4571 logicalexpr: ""
4572 valueposition:
4573 start: 0
4574 end: 0
4575 returnednumber: 0
4576 alwaysreturns: false
4577 knownreturn: false
4578 isreturnbool: false
4579 position:
4580 start: 11
4581 end: 58
4582 type: function
4583 fixedlabels: false
4584 isconditional: false
4585
4586---
4587
4588[TestLabelsSource/89 - 1]
4589expr: |4-
4590 (
4591 sum(foo:sum > 0) without(notify)
4592 * on(job) group_left(notify)
4593 job:notify
4594 )
4595 and on(job)
4596 sum(foo:count) by(job) > 20
4597output:
4598 - labels:
4599 __name__:
4600 reason: Aggregation removes metric name.
4601 kind: excluded
4602 fragment:
4603 start: 4
4604 end: 36
4605 job:
4606 reason: Query is using many-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
4607 kind: included
4608 fragment:
4609 start: 40
4610 end: 42
4611 notify:
4612 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.
4613 kind: included
4614 fragment:
4615 start: 48
4616 end: 58
4617 deadinfo: null
4618 returns: vector
4619 operations:
4620 - node: '[*parser.VectorSelector] foo:sum'
4621 op: ""
4622 - node: '[*parser.AggregateExpr] sum without (notify) (foo:sum > 0)'
4623 op: sum
4624 joins:
4625 - "on":
4626 - job
4627 ignoring: []
4628 src:
4629 labels: {}
4630 deadinfo: null
4631 returns: vector
4632 operations:
4633 - node: '[*parser.VectorSelector] job:notify'
4634 op: ""
4635 joins: []
4636 unless: []
4637 returninfo:
4638 logicalexpr: ""
4639 valueposition:
4640 start: 0
4641 end: 0
4642 returnednumber: 0
4643 alwaysreturns: false
4644 knownreturn: false
4645 isreturnbool: false
4646 position:
4647 start: 68
4648 end: 78
4649 type: selector
4650 fixedlabels: false
4651 isconditional: false
4652 op: 57395
4653 depth: 0
4654 - "on":
4655 - job
4656 ignoring: []
4657 src:
4658 labels:
4659 "":
4660 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
4661 kind: excluded
4662 fragment:
4663 start: 108
4664 end: 110
4665 __name__:
4666 reason: Aggregation removes metric name.
4667 kind: excluded
4668 fragment:
4669 start: 93
4670 end: 115
4671 job:
4672 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
4673 kind: included
4674 fragment:
4675 start: 108
4676 end: 110
4677 deadinfo: null
4678 returns: vector
4679 operations:
4680 - node: '[*parser.VectorSelector] foo:count'
4681 op: ""
4682 - node: '[*parser.AggregateExpr] sum by (job) (foo:count)'
4683 op: sum
4684 joins: []
4685 unless: []
4686 returninfo:
4687 logicalexpr: ""
4688 valueposition:
4689 start: 0
4690 end: 0
4691 returnednumber: 0
4692 alwaysreturns: false
4693 knownreturn: false
4694 isreturnbool: false
4695 position:
4696 start: 97
4697 end: 106
4698 type: aggregation
4699 fixedlabels: true
4700 isconditional: true
4701 op: 57389
4702 depth: 0
4703 unless: []
4704 returninfo:
4705 logicalexpr: ""
4706 valueposition:
4707 start: 0
4708 end: 0
4709 returnednumber: 0
4710 alwaysreturns: false
4711 knownreturn: false
4712 isreturnbool: false
4713 position:
4714 start: 8
4715 end: 15
4716 type: aggregation
4717 fixedlabels: false
4718 isconditional: true
4719
4720---
4721
4722[TestLabelsSource/90 - 1]
4723expr: container_file_descriptors / on (instance, app_name) container_ulimits_soft{ulimit="max_open_files"}
4724output:
4725 - labels:
4726 "":
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: excluded
4729 fragment:
4730 start: 29
4731 end: 32
4732 app_name:
4733 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.
4734 kind: included
4735 fragment:
4736 start: 29
4737 end: 32
4738 instance:
4739 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.
4740 kind: included
4741 fragment:
4742 start: 29
4743 end: 32
4744 deadinfo: null
4745 returns: vector
4746 operations:
4747 - node: '[*parser.VectorSelector] container_file_descriptors'
4748 op: ""
4749 joins:
4750 - "on":
4751 - instance
4752 - app_name
4753 ignoring: []
4754 src:
4755 labels:
4756 ulimit:
4757 reason: Query will only return series where these labels are present.
4758 kind: guaranteed
4759 fragment:
4760 start: 53
4761 end: 100
4762 deadinfo: null
4763 returns: vector
4764 operations:
4765 - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}'
4766 op: ""
4767 joins: []
4768 unless: []
4769 returninfo:
4770 logicalexpr: ""
4771 valueposition:
4772 start: 0
4773 end: 0
4774 returnednumber: 0
4775 alwaysreturns: false
4776 knownreturn: false
4777 isreturnbool: false
4778 position:
4779 start: 53
4780 end: 100
4781 type: selector
4782 fixedlabels: false
4783 isconditional: false
4784 op: 57384
4785 depth: 0
4786 unless: []
4787 returninfo:
4788 logicalexpr: ""
4789 valueposition:
4790 start: 0
4791 end: 0
4792 returnednumber: 0
4793 alwaysreturns: false
4794 knownreturn: false
4795 isreturnbool: false
4796 position:
4797 start: 0
4798 end: 26
4799 type: selector
4800 fixedlabels: true
4801 isconditional: false
4802
4803---
4804
4805[TestLabelsSource/91 - 1]
4806expr: container_file_descriptors / on (instance, app_name) group_left() container_ulimits_soft{ulimit="max_open_files"}
4807output:
4808 - labels:
4809 app_name:
4810 reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results.
4811 kind: included
4812 fragment:
4813 start: 29
4814 end: 32
4815 instance:
4816 reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results.
4817 kind: included
4818 fragment:
4819 start: 29
4820 end: 32
4821 deadinfo: null
4822 returns: vector
4823 operations:
4824 - node: '[*parser.VectorSelector] container_file_descriptors'
4825 op: ""
4826 joins:
4827 - "on":
4828 - instance
4829 - app_name
4830 ignoring: []
4831 src:
4832 labels:
4833 ulimit:
4834 reason: Query will only return series where these labels are present.
4835 kind: guaranteed
4836 fragment:
4837 start: 66
4838 end: 113
4839 deadinfo: null
4840 returns: vector
4841 operations:
4842 - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}'
4843 op: ""
4844 joins: []
4845 unless: []
4846 returninfo:
4847 logicalexpr: ""
4848 valueposition:
4849 start: 0
4850 end: 0
4851 returnednumber: 0
4852 alwaysreturns: false
4853 knownreturn: false
4854 isreturnbool: false
4855 position:
4856 start: 66
4857 end: 113
4858 type: selector
4859 fixedlabels: false
4860 isconditional: false
4861 op: 57384
4862 depth: 0
4863 unless: []
4864 returninfo:
4865 logicalexpr: ""
4866 valueposition:
4867 start: 0
4868 end: 0
4869 returnednumber: 0
4870 alwaysreturns: false
4871 knownreturn: false
4872 isreturnbool: false
4873 position:
4874 start: 0
4875 end: 26
4876 type: selector
4877 fixedlabels: false
4878 isconditional: false
4879
4880---
4881
4882[TestLabelsSource/92 - 1]
4883expr: absent(foo{job="bar"})
4884output:
4885 - labels:
4886 "":
4887 reason: |-
4888 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.
4889 You will only get any results back if the metric selector you pass doesn't match anything.
4890 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
4891 This means that the only labels you can get back from absent call are the ones you pass to it.
4892 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.
4893 kind: excluded
4894 fragment:
4895 start: 0
4896 end: 6
4897 job:
4898 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
4899 kind: guaranteed
4900 fragment:
4901 start: 0
4902 end: 22
4903 deadinfo: null
4904 returns: vector
4905 operations:
4906 - node: '[*parser.VectorSelector] foo{job="bar"}'
4907 op: ""
4908 - node: '[*parser.Call] absent(foo{job="bar"})'
4909 op: absent
4910 joins: []
4911 unless: []
4912 returninfo:
4913 logicalexpr: ""
4914 valueposition:
4915 start: 0
4916 end: 0
4917 returnednumber: 0
4918 alwaysreturns: false
4919 knownreturn: false
4920 isreturnbool: false
4921 position:
4922 start: 7
4923 end: 21
4924 type: function
4925 fixedlabels: true
4926 isconditional: false
4927
4928---
4929
4930[TestLabelsSource/93 - 1]
4931expr: absent(foo{job="bar", cluster!="dev", instance=~".+", env="prod"})
4932output:
4933 - labels:
4934 "":
4935 reason: |-
4936 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.
4937 You will only get any results back if the metric selector you pass doesn't match anything.
4938 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
4939 This means that the only labels you can get back from absent call are the ones you pass to it.
4940 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.
4941 kind: excluded
4942 fragment:
4943 start: 0
4944 end: 6
4945 env:
4946 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
4947 kind: guaranteed
4948 fragment:
4949 start: 0
4950 end: 66
4951 instance:
4952 reason: |-
4953 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.
4954 You will only get any results back if the metric selector you pass doesn't match anything.
4955 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
4956 This means that the only labels you can get back from absent call are the ones you pass to it.
4957 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.
4958 kind: excluded
4959 fragment:
4960 start: 0
4961 end: 6
4962 job:
4963 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
4964 kind: guaranteed
4965 fragment:
4966 start: 0
4967 end: 66
4968 deadinfo: null
4969 returns: vector
4970 operations:
4971 - node: '[*parser.VectorSelector] foo{cluster!="dev",env="prod",instance=~".+",job="bar"}'
4972 op: ""
4973 - node: '[*parser.Call] absent(foo{cluster!="dev",env="prod",instance=~".+",job="bar"})'
4974 op: absent
4975 joins: []
4976 unless: []
4977 returninfo:
4978 logicalexpr: ""
4979 valueposition:
4980 start: 0
4981 end: 0
4982 returnednumber: 0
4983 alwaysreturns: false
4984 knownreturn: false
4985 isreturnbool: false
4986 position:
4987 start: 7
4988 end: 65
4989 type: function
4990 fixedlabels: true
4991 isconditional: false
4992
4993---
4994
4995[TestLabelsSource/94 - 1]
4996expr: absent(sum(foo) by(job, instance))
4997output:
4998 - labels:
4999 "":
5000 reason: |-
5001 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.
5002 You will only get any results back if the metric selector you pass doesn't match anything.
5003 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5004 This means that the only labels you can get back from absent call are the ones you pass to it.
5005 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.
5006 kind: excluded
5007 fragment:
5008 start: 0
5009 end: 6
5010 __name__:
5011 reason: Aggregation removes metric name.
5012 kind: excluded
5013 fragment:
5014 start: 7
5015 end: 33
5016 instance:
5017 reason: |-
5018 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.
5019 You will only get any results back if the metric selector you pass doesn't match anything.
5020 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5021 This means that the only labels you can get back from absent call are the ones you pass to it.
5022 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.
5023 kind: excluded
5024 fragment:
5025 start: 0
5026 end: 6
5027 job:
5028 reason: |-
5029 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.
5030 You will only get any results back if the metric selector you pass doesn't match anything.
5031 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5032 This means that the only labels you can get back from absent call are the ones you pass to it.
5033 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.
5034 kind: excluded
5035 fragment:
5036 start: 0
5037 end: 6
5038 deadinfo: null
5039 returns: vector
5040 operations:
5041 - node: '[*parser.VectorSelector] foo'
5042 op: ""
5043 - node: '[*parser.AggregateExpr] sum by (job, instance) (foo)'
5044 op: sum
5045 - node: '[*parser.Call] absent(sum by (job, instance) (foo))'
5046 op: absent
5047 joins: []
5048 unless: []
5049 returninfo:
5050 logicalexpr: ""
5051 valueposition:
5052 start: 0
5053 end: 0
5054 returnednumber: 0
5055 alwaysreturns: false
5056 knownreturn: false
5057 isreturnbool: false
5058 position:
5059 start: 7
5060 end: 33
5061 type: function
5062 fixedlabels: true
5063 isconditional: false
5064
5065---
5066
5067[TestLabelsSource/95 - 1]
5068expr: absent(foo{job="prometheus", xxx="1"}) AND on(job) prometheus_build_info
5069output:
5070 - labels:
5071 "":
5072 reason: |-
5073 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.
5074 You will only get any results back if the metric selector you pass doesn't match anything.
5075 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5076 This means that the only labels you can get back from absent call are the ones you pass to it.
5077 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.
5078 kind: excluded
5079 fragment:
5080 start: 0
5081 end: 6
5082 job:
5083 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
5084 kind: guaranteed
5085 fragment:
5086 start: 0
5087 end: 38
5088 xxx:
5089 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
5090 kind: guaranteed
5091 fragment:
5092 start: 0
5093 end: 38
5094 deadinfo: null
5095 returns: vector
5096 operations:
5097 - node: '[*parser.VectorSelector] foo{job="prometheus",xxx="1"}'
5098 op: ""
5099 - node: '[*parser.Call] absent(foo{job="prometheus",xxx="1"})'
5100 op: absent
5101 joins:
5102 - "on":
5103 - job
5104 ignoring: []
5105 src:
5106 labels: {}
5107 deadinfo: null
5108 returns: vector
5109 operations:
5110 - node: '[*parser.VectorSelector] prometheus_build_info'
5111 op: ""
5112 joins: []
5113 unless: []
5114 returninfo:
5115 logicalexpr: ""
5116 valueposition:
5117 start: 0
5118 end: 0
5119 returnednumber: 0
5120 alwaysreturns: false
5121 knownreturn: false
5122 isreturnbool: false
5123 position:
5124 start: 51
5125 end: 72
5126 type: selector
5127 fixedlabels: false
5128 isconditional: false
5129 op: 57389
5130 depth: 0
5131 unless: []
5132 returninfo:
5133 logicalexpr: ""
5134 valueposition:
5135 start: 0
5136 end: 0
5137 returnednumber: 0
5138 alwaysreturns: false
5139 knownreturn: false
5140 isreturnbool: false
5141 position:
5142 start: 7
5143 end: 37
5144 type: function
5145 fixedlabels: true
5146 isconditional: false
5147
5148---
5149
5150[TestLabelsSource/96 - 1]
5151expr: 1 + sum(foo) by(notjob)
5152output:
5153 - labels:
5154 "":
5155 reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results.
5156 kind: excluded
5157 fragment:
5158 start: 13
5159 end: 15
5160 __name__:
5161 reason: Aggregation removes metric name.
5162 kind: excluded
5163 fragment:
5164 start: 4
5165 end: 23
5166 notjob:
5167 reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results.
5168 kind: included
5169 fragment:
5170 start: 13
5171 end: 15
5172 deadinfo: null
5173 returns: vector
5174 operations:
5175 - node: '[*parser.VectorSelector] foo'
5176 op: ""
5177 - node: '[*parser.AggregateExpr] sum by (notjob) (foo)'
5178 op: sum
5179 joins: []
5180 unless: []
5181 returninfo:
5182 logicalexpr: ""
5183 valueposition:
5184 start: 0
5185 end: 0
5186 returnednumber: 0
5187 alwaysreturns: false
5188 knownreturn: false
5189 isreturnbool: false
5190 position:
5191 start: 8
5192 end: 11
5193 type: aggregation
5194 fixedlabels: true
5195 isconditional: false
5196
5197---
5198
5199[TestLabelsSource/97 - 1]
5200expr: count(node_exporter_build_info) by (instance, version) != ignoring(package,version) group_left(foo) count(deb_package_version) by (instance, version, package)
5201output:
5202 - labels:
5203 "":
5204 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
5205 kind: excluded
5206 fragment:
5207 start: 32
5208 end: 35
5209 __name__:
5210 reason: Aggregation removes metric name.
5211 kind: excluded
5212 fragment:
5213 start: 0
5214 end: 54
5215 foo:
5216 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.
5217 kind: included
5218 fragment:
5219 start: 84
5220 end: 94
5221 instance:
5222 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
5223 kind: included
5224 fragment:
5225 start: 32
5226 end: 35
5227 version:
5228 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
5229 kind: included
5230 fragment:
5231 start: 32
5232 end: 35
5233 deadinfo: null
5234 returns: vector
5235 operations:
5236 - node: '[*parser.VectorSelector] node_exporter_build_info'
5237 op: ""
5238 - node: '[*parser.AggregateExpr] count by (instance, version) (node_exporter_build_info)'
5239 op: count
5240 joins:
5241 - "on": []
5242 ignoring:
5243 - package
5244 - version
5245 src:
5246 labels:
5247 "":
5248 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
5249 kind: excluded
5250 fragment:
5251 start: 127
5252 end: 130
5253 __name__:
5254 reason: Aggregation removes metric name.
5255 kind: excluded
5256 fragment:
5257 start: 100
5258 end: 158
5259 instance:
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 package:
5266 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
5267 kind: included
5268 fragment:
5269 start: 127
5270 end: 130
5271 version:
5272 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
5273 kind: included
5274 fragment:
5275 start: 127
5276 end: 130
5277 deadinfo: null
5278 returns: vector
5279 operations:
5280 - node: '[*parser.VectorSelector] deb_package_version'
5281 op: ""
5282 - node: '[*parser.AggregateExpr] count by (instance, version, package) (deb_package_version)'
5283 op: count
5284 joins: []
5285 unless: []
5286 returninfo:
5287 logicalexpr: ""
5288 valueposition:
5289 start: 0
5290 end: 0
5291 returnednumber: 0
5292 alwaysreturns: false
5293 knownreturn: false
5294 isreturnbool: false
5295 position:
5296 start: 106
5297 end: 125
5298 type: aggregation
5299 fixedlabels: true
5300 isconditional: false
5301 op: 57396
5302 depth: 0
5303 unless: []
5304 returninfo:
5305 logicalexpr: ""
5306 valueposition:
5307 start: 0
5308 end: 0
5309 returnednumber: 0
5310 alwaysreturns: false
5311 knownreturn: false
5312 isreturnbool: false
5313 position:
5314 start: 6
5315 end: 30
5316 type: aggregation
5317 fixedlabels: true
5318 isconditional: true
5319
5320---
5321
5322[TestLabelsSource/98 - 1]
5323expr: absent(foo) or absent(bar)
5324output:
5325 - labels:
5326 "":
5327 reason: |-
5328 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.
5329 You will only get any results back if the metric selector you pass doesn't match anything.
5330 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5331 This means that the only labels you can get back from absent call are the ones you pass to it.
5332 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.
5333 kind: excluded
5334 fragment:
5335 start: 0
5336 end: 6
5337 deadinfo: null
5338 returns: vector
5339 operations:
5340 - node: '[*parser.VectorSelector] foo'
5341 op: ""
5342 - node: '[*parser.Call] absent(foo)'
5343 op: absent
5344 joins: []
5345 unless: []
5346 returninfo:
5347 logicalexpr: ""
5348 valueposition:
5349 start: 0
5350 end: 0
5351 returnednumber: 0
5352 alwaysreturns: false
5353 knownreturn: false
5354 isreturnbool: false
5355 position:
5356 start: 7
5357 end: 10
5358 type: function
5359 fixedlabels: true
5360 isconditional: false
5361 - labels:
5362 "":
5363 reason: |-
5364 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
5365 You will only get any results back if the metric selector you pass doesn't match anything.
5366 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5367 This means that the only labels you can get back from absent call are the ones you pass to it.
5368 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
5369 kind: excluded
5370 fragment:
5371 start: 15
5372 end: 21
5373 deadinfo: null
5374 returns: vector
5375 operations:
5376 - node: '[*parser.VectorSelector] bar'
5377 op: ""
5378 - node: '[*parser.Call] absent(bar)'
5379 op: absent
5380 joins: []
5381 unless: []
5382 returninfo:
5383 logicalexpr: ""
5384 valueposition:
5385 start: 0
5386 end: 0
5387 returnednumber: 0
5388 alwaysreturns: false
5389 knownreturn: false
5390 isreturnbool: false
5391 position:
5392 start: 22
5393 end: 25
5394 type: function
5395 fixedlabels: true
5396 isconditional: false
5397
5398---
5399
5400[TestLabelsSource/99 - 1]
5401expr: absent_over_time(foo[5m]) or absent(bar)
5402output:
5403 - labels:
5404 "":
5405 reason: |-
5406 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.
5407 You will only get any results back if the metric selector you pass doesn't match anything.
5408 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5409 This means that the only labels you can get back from absent call are the ones you pass to it.
5410 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.
5411 kind: excluded
5412 fragment:
5413 start: 0
5414 end: 16
5415 deadinfo: null
5416 returns: vector
5417 operations:
5418 - node: '[*parser.VectorSelector] foo'
5419 op: ""
5420 - node: '[*parser.Call] absent_over_time(foo[5m])'
5421 op: absent_over_time
5422 joins: []
5423 unless: []
5424 returninfo:
5425 logicalexpr: ""
5426 valueposition:
5427 start: 0
5428 end: 0
5429 returnednumber: 0
5430 alwaysreturns: false
5431 knownreturn: false
5432 isreturnbool: false
5433 position:
5434 start: 17
5435 end: 24
5436 type: function
5437 fixedlabels: true
5438 isconditional: false
5439 - labels:
5440 "":
5441 reason: |-
5442 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.
5443 You will only get any results back if the metric selector you pass doesn't match anything.
5444 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5445 This means that the only labels you can get back from absent call are the ones you pass to it.
5446 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
5447 kind: excluded
5448 fragment:
5449 start: 29
5450 end: 35
5451 deadinfo: null
5452 returns: vector
5453 operations:
5454 - node: '[*parser.VectorSelector] bar'
5455 op: ""
5456 - node: '[*parser.Call] absent(bar)'
5457 op: absent
5458 joins: []
5459 unless: []
5460 returninfo:
5461 logicalexpr: ""
5462 valueposition:
5463 start: 0
5464 end: 0
5465 returnednumber: 0
5466 alwaysreturns: false
5467 knownreturn: false
5468 isreturnbool: false
5469 position:
5470 start: 36
5471 end: 39
5472 type: function
5473 fixedlabels: true
5474 isconditional: false
5475
5476---
5477
5478[TestLabelsSource/100 - 1]
5479expr: bar * on() group_right(cluster, env) absent(foo{job="xxx"})
5480output:
5481 - labels:
5482 "":
5483 reason: |-
5484 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.
5485 You will only get any results back if the metric selector you pass doesn't match anything.
5486 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5487 This means that the only labels you can get back from absent call are the ones you pass to it.
5488 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.
5489 kind: excluded
5490 fragment:
5491 start: 37
5492 end: 43
5493 cluster:
5494 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.
5495 kind: included
5496 fragment:
5497 start: 11
5498 end: 22
5499 env:
5500 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.
5501 kind: included
5502 fragment:
5503 start: 11
5504 end: 22
5505 job:
5506 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
5507 kind: guaranteed
5508 fragment:
5509 start: 37
5510 end: 59
5511 deadinfo: null
5512 returns: vector
5513 operations:
5514 - node: '[*parser.VectorSelector] foo{job="xxx"}'
5515 op: ""
5516 - node: '[*parser.Call] absent(foo{job="xxx"})'
5517 op: absent
5518 joins:
5519 - "on": []
5520 ignoring: []
5521 src:
5522 labels: {}
5523 deadinfo: null
5524 returns: vector
5525 operations:
5526 - node: '[*parser.VectorSelector] bar'
5527 op: ""
5528 joins: []
5529 unless: []
5530 returninfo:
5531 logicalexpr: ""
5532 valueposition:
5533 start: 0
5534 end: 0
5535 returnednumber: 0
5536 alwaysreturns: false
5537 knownreturn: false
5538 isreturnbool: false
5539 position:
5540 start: 0
5541 end: 3
5542 type: selector
5543 fixedlabels: false
5544 isconditional: false
5545 op: 57395
5546 depth: 0
5547 unless: []
5548 returninfo:
5549 logicalexpr: ""
5550 valueposition:
5551 start: 0
5552 end: 0
5553 returnednumber: 0
5554 alwaysreturns: false
5555 knownreturn: false
5556 isreturnbool: false
5557 position:
5558 start: 44
5559 end: 58
5560 type: function
5561 fixedlabels: true
5562 isconditional: false
5563
5564---
5565
5566[TestLabelsSource/101 - 1]
5567expr: bar * on() group_right() absent(foo{job="xxx"})
5568output:
5569 - labels:
5570 "":
5571 reason: |-
5572 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.
5573 You will only get any results back if the metric selector you pass doesn't match anything.
5574 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
5575 This means that the only labels you can get back from absent call are the ones you pass to it.
5576 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.
5577 kind: excluded
5578 fragment:
5579 start: 25
5580 end: 31
5581 job:
5582 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
5583 kind: guaranteed
5584 fragment:
5585 start: 25
5586 end: 47
5587 deadinfo: null
5588 returns: vector
5589 operations:
5590 - node: '[*parser.VectorSelector] foo{job="xxx"}'
5591 op: ""
5592 - node: '[*parser.Call] absent(foo{job="xxx"})'
5593 op: absent
5594 joins:
5595 - "on": []
5596 ignoring: []
5597 src:
5598 labels: {}
5599 deadinfo: null
5600 returns: vector
5601 operations:
5602 - node: '[*parser.VectorSelector] bar'
5603 op: ""
5604 joins: []
5605 unless: []
5606 returninfo:
5607 logicalexpr: ""
5608 valueposition:
5609 start: 0
5610 end: 0
5611 returnednumber: 0
5612 alwaysreturns: false
5613 knownreturn: false
5614 isreturnbool: false
5615 position:
5616 start: 0
5617 end: 3
5618 type: selector
5619 fixedlabels: false
5620 isconditional: false
5621 op: 57395
5622 depth: 0
5623 unless: []
5624 returninfo:
5625 logicalexpr: ""
5626 valueposition:
5627 start: 0
5628 end: 0
5629 returnednumber: 0
5630 alwaysreturns: false
5631 knownreturn: false
5632 isreturnbool: false
5633 position:
5634 start: 32
5635 end: 46
5636 type: function
5637 fixedlabels: true
5638 isconditional: false
5639
5640---
5641
5642[TestLabelsSource/102 - 1]
5643expr: vector(1)
5644output:
5645 - labels:
5646 "":
5647 reason: Calling `vector()` will return a vector value with no labels.
5648 kind: excluded
5649 fragment:
5650 start: 0
5651 end: 6
5652 deadinfo: null
5653 returns: vector
5654 operations:
5655 - node: '[*parser.Call] vector(1)'
5656 op: vector
5657 joins: []
5658 unless: []
5659 returninfo:
5660 logicalexpr: ""
5661 valueposition:
5662 start: 0
5663 end: 9
5664 returnednumber: 1
5665 alwaysreturns: true
5666 knownreturn: true
5667 isreturnbool: false
5668 position:
5669 start: 0
5670 end: 9
5671 type: function
5672 fixedlabels: true
5673 isconditional: false
5674
5675---
5676
5677[TestLabelsSource/103 - 1]
5678expr: vector(scalar(foo))
5679output:
5680 - labels:
5681 "":
5682 reason: Calling `vector()` will return a vector value with no labels.
5683 kind: excluded
5684 fragment:
5685 start: 0
5686 end: 6
5687 deadinfo: null
5688 returns: vector
5689 operations:
5690 - node: '[*parser.Call] vector(scalar(foo))'
5691 op: vector
5692 joins: []
5693 unless: []
5694 returninfo:
5695 logicalexpr: ""
5696 valueposition:
5697 start: 0
5698 end: 19
5699 returnednumber: 0
5700 alwaysreturns: true
5701 knownreturn: false
5702 isreturnbool: false
5703 position:
5704 start: 0
5705 end: 19
5706 type: function
5707 fixedlabels: true
5708 isconditional: false
5709
5710---
5711
5712[TestLabelsSource/104 - 1]
5713expr: vector(0.0 >= bool 0.5) == 1
5714output:
5715 - labels:
5716 "":
5717 reason: Calling `vector()` will return a vector value with no labels.
5718 kind: excluded
5719 fragment:
5720 start: 0
5721 end: 6
5722 deadinfo:
5723 reason: '`vector(0.0 >= bool 0.5) == 1` always evaluates to `0 == 1` which is not possible, so it will never return anything.'
5724 fragment:
5725 start: 0
5726 end: 24
5727 returns: vector
5728 operations:
5729 - node: '[*parser.Call] vector(0 >= bool 0.5)'
5730 op: vector
5731 joins: []
5732 unless: []
5733 returninfo:
5734 logicalexpr: ""
5735 valueposition:
5736 start: 0
5737 end: 24
5738 returnednumber: 0
5739 alwaysreturns: true
5740 knownreturn: true
5741 isreturnbool: false
5742 position:
5743 start: 0
5744 end: 24
5745 type: function
5746 fixedlabels: true
5747 isconditional: true
5748
5749---
5750
5751[TestLabelsSource/105 - 1]
5752expr: sum_over_time(foo{job="myjob"}[5m])
5753output:
5754 - labels:
5755 job:
5756 reason: Query will only return series where these labels are present.
5757 kind: guaranteed
5758 fragment:
5759 start: 0
5760 end: 35
5761 deadinfo: null
5762 returns: vector
5763 operations:
5764 - node: '[*parser.VectorSelector] foo{job="myjob"}'
5765 op: ""
5766 - node: '[*parser.Call] sum_over_time(foo{job="myjob"}[5m])'
5767 op: sum_over_time
5768 joins: []
5769 unless: []
5770 returninfo:
5771 logicalexpr: ""
5772 valueposition:
5773 start: 0
5774 end: 0
5775 returnednumber: 0
5776 alwaysreturns: false
5777 knownreturn: false
5778 isreturnbool: false
5779 position:
5780 start: 14
5781 end: 34
5782 type: function
5783 fixedlabels: false
5784 isconditional: false
5785
5786---
5787
5788[TestLabelsSource/106 - 1]
5789expr: days_in_month()
5790output:
5791 - labels:
5792 "":
5793 reason: Calling `days_in_month()` with no arguments will return an empty time series with no labels.
5794 kind: excluded
5795 fragment:
5796 start: 0
5797 end: 15
5798 deadinfo: null
5799 returns: vector
5800 operations:
5801 - node: '[*parser.Call] days_in_month()'
5802 op: days_in_month
5803 joins: []
5804 unless: []
5805 returninfo:
5806 logicalexpr: ""
5807 valueposition:
5808 start: 0
5809 end: 0
5810 returnednumber: 0
5811 alwaysreturns: true
5812 knownreturn: false
5813 isreturnbool: false
5814 position:
5815 start: 0
5816 end: 15
5817 type: function
5818 fixedlabels: true
5819 isconditional: false
5820
5821---
5822
5823[TestLabelsSource/107 - 1]
5824expr: days_in_month(foo{job="foo"})
5825output:
5826 - labels:
5827 job:
5828 reason: Query will only return series where these labels are present.
5829 kind: guaranteed
5830 fragment:
5831 start: 0
5832 end: 29
5833 deadinfo: null
5834 returns: vector
5835 operations:
5836 - node: '[*parser.VectorSelector] foo{job="foo"}'
5837 op: ""
5838 - node: '[*parser.Call] days_in_month(foo{job="foo"})'
5839 op: days_in_month
5840 joins: []
5841 unless: []
5842 returninfo:
5843 logicalexpr: ""
5844 valueposition:
5845 start: 0
5846 end: 0
5847 returnednumber: 0
5848 alwaysreturns: false
5849 knownreturn: false
5850 isreturnbool: false
5851 position:
5852 start: 14
5853 end: 28
5854 type: function
5855 fixedlabels: false
5856 isconditional: false
5857
5858---
5859
5860[TestLabelsSource/108 - 1]
5861expr: label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*")
5862output:
5863 - labels:
5864 foo:
5865 reason: This label will be added to the result by label_replace() call.
5866 kind: guaranteed
5867 fragment:
5868 start: 0
5869 end: 84
5870 job:
5871 reason: Query will only return series where these labels are present.
5872 kind: guaranteed
5873 fragment:
5874 start: 14
5875 end: 48
5876 service:
5877 reason: Query will only return series where these labels are present.
5878 kind: guaranteed
5879 fragment:
5880 start: 14
5881 end: 48
5882 deadinfo: null
5883 returns: vector
5884 operations:
5885 - node: '[*parser.VectorSelector] up{job="api-server",service="a:c"}'
5886 op: ""
5887 - node: '[*parser.Call] label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*")'
5888 op: label_replace
5889 joins: []
5890 unless: []
5891 returninfo:
5892 logicalexpr: ""
5893 valueposition:
5894 start: 0
5895 end: 0
5896 returnednumber: 0
5897 alwaysreturns: false
5898 knownreturn: false
5899 isreturnbool: false
5900 position:
5901 start: 14
5902 end: 48
5903 type: function
5904 fixedlabels: false
5905 isconditional: false
5906
5907---
5908
5909[TestLabelsSource/109 - 1]
5910expr: label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)")
5911output:
5912 - labels:
5913 "":
5914 reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results.
5915 kind: excluded
5916 fragment:
5917 start: 18
5918 end: 21
5919 __name__:
5920 reason: Aggregation removes metric name.
5921 kind: excluded
5922 fragment:
5923 start: 14
5924 end: 39
5925 cluster:
5926 reason: This label will be added to the result by label_replace() call.
5927 kind: guaranteed
5928 fragment:
5929 start: 0
5930 end: 76
5931 pod:
5932 reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results.
5933 kind: included
5934 fragment:
5935 start: 18
5936 end: 21
5937 deadinfo: null
5938 returns: vector
5939 operations:
5940 - node: '[*parser.VectorSelector] pod_status'
5941 op: ""
5942 - node: '[*parser.AggregateExpr] sum by (pod) (pod_status)'
5943 op: sum
5944 - node: '[*parser.Call] label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)")'
5945 op: label_replace
5946 joins: []
5947 unless: []
5948 returninfo:
5949 logicalexpr: ""
5950 valueposition:
5951 start: 0
5952 end: 0
5953 returnednumber: 0
5954 alwaysreturns: false
5955 knownreturn: false
5956 isreturnbool: false
5957 position:
5958 start: 14
5959 end: 43
5960 type: function
5961 fixedlabels: true
5962 isconditional: true
5963
5964---
5965
5966[TestLabelsSource/110 - 1]
5967expr: (time() - my_metric) > 5*3600
5968output:
5969 - labels: {}
5970 deadinfo: null
5971 returns: vector
5972 operations:
5973 - node: '[*parser.VectorSelector] my_metric'
5974 op: ""
5975 joins: []
5976 unless: []
5977 returninfo:
5978 logicalexpr: ""
5979 valueposition:
5980 start: 0
5981 end: 0
5982 returnednumber: 0
5983 alwaysreturns: false
5984 knownreturn: false
5985 isreturnbool: false
5986 position:
5987 start: 10
5988 end: 19
5989 type: selector
5990 fixedlabels: false
5991 isconditional: true
5992
5993---
5994
5995[TestLabelsSource/111 - 1]
5996expr: up{instance="a", job="prometheus"} * ignoring(job) up{instance="a", job="pint"}
5997output:
5998 - labels:
5999 instance:
6000 reason: Query will only return series where these labels are present.
6001 kind: guaranteed
6002 fragment:
6003 start: 0
6004 end: 34
6005 job:
6006 reason: Query is using one-to-one vector matching with `ignoring(job)`, all labels included inside `ignoring(...)` will be removed on the results.
6007 kind: excluded
6008 fragment:
6009 start: 37
6010 end: 45
6011 deadinfo: null
6012 returns: vector
6013 operations:
6014 - node: '[*parser.VectorSelector] up{instance="a",job="prometheus"}'
6015 op: ""
6016 joins:
6017 - "on": []
6018 ignoring:
6019 - job
6020 src:
6021 labels:
6022 instance:
6023 reason: Query will only return series where these labels are present.
6024 kind: guaranteed
6025 fragment:
6026 start: 51
6027 end: 79
6028 job:
6029 reason: Query will only return series where these labels are present.
6030 kind: guaranteed
6031 fragment:
6032 start: 51
6033 end: 79
6034 deadinfo: null
6035 returns: vector
6036 operations:
6037 - node: '[*parser.VectorSelector] up{instance="a",job="pint"}'
6038 op: ""
6039 joins: []
6040 unless: []
6041 returninfo:
6042 logicalexpr: ""
6043 valueposition:
6044 start: 0
6045 end: 0
6046 returnednumber: 0
6047 alwaysreturns: false
6048 knownreturn: false
6049 isreturnbool: false
6050 position:
6051 start: 51
6052 end: 79
6053 type: selector
6054 fixedlabels: false
6055 isconditional: false
6056 op: 57395
6057 depth: 0
6058 unless: []
6059 returninfo:
6060 logicalexpr: ""
6061 valueposition:
6062 start: 0
6063 end: 0
6064 returnednumber: 0
6065 alwaysreturns: false
6066 knownreturn: false
6067 isreturnbool: false
6068 position:
6069 start: 0
6070 end: 34
6071 type: selector
6072 fixedlabels: false
6073 isconditional: false
6074
6075---
6076
6077[TestLabelsSource/112 - 1]
6078expr: |4
6079 avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"})
6080 < 0.5 > 0
6081 or sum without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"})
6082 < on() count(colo_router_tier:disabled_pops:max{tier="1",router=~"edge.*"}) * 0.4 > 0
6083 or avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"})
6084 < 0.1 > 0
6085output:
6086 - labels:
6087 __name__:
6088 reason: Aggregation removes metric name.
6089 kind: excluded
6090 fragment:
6091 start: 1
6092 end: 101
6093 colo_id:
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 instance:
6100 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6101 kind: excluded
6102 fragment:
6103 start: 5
6104 end: 12
6105 router:
6106 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6107 kind: excluded
6108 fragment:
6109 start: 5
6110 end: 12
6111 deadinfo: null
6112 returns: vector
6113 operations:
6114 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"}'
6115 op: ""
6116 - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"})'
6117 op: avg
6118 joins: []
6119 unless: []
6120 returninfo:
6121 logicalexpr: ""
6122 valueposition:
6123 start: 0
6124 end: 0
6125 returnednumber: 0
6126 alwaysreturns: false
6127 knownreturn: false
6128 isreturnbool: false
6129 position:
6130 start: 41
6131 end: 100
6132 type: aggregation
6133 fixedlabels: false
6134 isconditional: true
6135 - labels:
6136 "":
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 __name__:
6143 reason: Aggregation removes metric name.
6144 kind: excluded
6145 fragment:
6146 start: 115
6147 end: 213
6148 cidr_use_case:
6149 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
6150 kind: excluded
6151 fragment:
6152 start: 216
6153 end: 218
6154 colo_id:
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 instance:
6161 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6162 kind: excluded
6163 fragment:
6164 start: 119
6165 end: 126
6166 router:
6167 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6168 kind: excluded
6169 fragment:
6170 start: 119
6171 end: 126
6172 deadinfo: null
6173 returns: vector
6174 operations:
6175 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"}'
6176 op: ""
6177 - node: '[*parser.AggregateExpr] sum without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"})'
6178 op: sum
6179 joins:
6180 - "on": []
6181 ignoring: []
6182 src:
6183 labels:
6184 "":
6185 reason: Query is using aggregation that removes all labels.
6186 kind: excluded
6187 fragment:
6188 start: 221
6189 end: 289
6190 __name__:
6191 reason: Aggregation removes metric name.
6192 kind: excluded
6193 fragment:
6194 start: 221
6195 end: 289
6196 router:
6197 reason: Query is using aggregation that removes all labels.
6198 kind: excluded
6199 fragment:
6200 start: 221
6201 end: 289
6202 tier:
6203 reason: Query is using aggregation that removes all labels.
6204 kind: excluded
6205 fragment:
6206 start: 221
6207 end: 289
6208 deadinfo: null
6209 returns: vector
6210 operations:
6211 - node: '[*parser.VectorSelector] colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"}'
6212 op: ""
6213 - node: '[*parser.AggregateExpr] count(colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"})'
6214 op: count
6215 joins: []
6216 unless: []
6217 returninfo:
6218 logicalexpr: ""
6219 valueposition:
6220 start: 0
6221 end: 0
6222 returnednumber: 0
6223 alwaysreturns: false
6224 knownreturn: false
6225 isreturnbool: false
6226 position:
6227 start: 227
6228 end: 288
6229 type: aggregation
6230 fixedlabels: true
6231 isconditional: false
6232 op: 57391
6233 depth: 0
6234 unless: []
6235 returninfo:
6236 logicalexpr: ""
6237 valueposition:
6238 start: 0
6239 end: 0
6240 returnednumber: 0
6241 alwaysreturns: false
6242 knownreturn: false
6243 isreturnbool: false
6244 position:
6245 start: 155
6246 end: 212
6247 type: aggregation
6248 fixedlabels: true
6249 isconditional: true
6250 - labels:
6251 __name__:
6252 reason: Aggregation removes metric name.
6253 kind: excluded
6254 fragment:
6255 start: 303
6256 end: 404
6257 cidr_use_case:
6258 reason: Query will only return series where these labels are present.
6259 kind: guaranteed
6260 fragment:
6261 start: 343
6262 end: 403
6263 colo_id:
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 instance:
6270 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6271 kind: excluded
6272 fragment:
6273 start: 307
6274 end: 314
6275 router:
6276 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
6277 kind: excluded
6278 fragment:
6279 start: 307
6280 end: 314
6281 deadinfo: null
6282 returns: vector
6283 operations:
6284 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"}'
6285 op: ""
6286 - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"})'
6287 op: avg
6288 joins: []
6289 unless: []
6290 returninfo:
6291 logicalexpr: ""
6292 valueposition:
6293 start: 0
6294 end: 0
6295 returnednumber: 0
6296 alwaysreturns: false
6297 knownreturn: false
6298 isreturnbool: false
6299 position:
6300 start: 343
6301 end: 403
6302 type: aggregation
6303 fixedlabels: false
6304 isconditional: true
6305
6306---
6307
6308[TestLabelsSource/113 - 1]
6309expr: label_replace(sum(foo) without(instance), "instance", "none", "", "")
6310output:
6311 - labels:
6312 __name__:
6313 reason: Aggregation removes metric name.
6314 kind: excluded
6315 fragment:
6316 start: 14
6317 end: 40
6318 instance:
6319 reason: This label will be added to the result by label_replace() call.
6320 kind: guaranteed
6321 fragment:
6322 start: 0
6323 end: 69
6324 deadinfo: null
6325 returns: vector
6326 operations:
6327 - node: '[*parser.VectorSelector] foo'
6328 op: ""
6329 - node: '[*parser.AggregateExpr] sum without (instance) (foo)'
6330 op: sum
6331 - node: '[*parser.Call] label_replace(sum without (instance) (foo), "instance", "none", "", "")'
6332 op: label_replace
6333 joins: []
6334 unless: []
6335 returninfo:
6336 logicalexpr: ""
6337 valueposition:
6338 start: 0
6339 end: 0
6340 returnednumber: 0
6341 alwaysreturns: false
6342 knownreturn: false
6343 isreturnbool: false
6344 position:
6345 start: 14
6346 end: 40
6347 type: function
6348 fixedlabels: false
6349 isconditional: false
6350
6351---
6352
6353[TestLabelsSource/114 - 1]
6354expr: |4-
6355 sum by (region, target, colo_name) (
6356 sum_over_time(probe_success{job="abc"}[5m])
6357 or
6358 vector(1)
6359 ) == 0
6360output:
6361 - labels:
6362 "":
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: excluded
6365 fragment:
6366 start: 5
6367 end: 8
6368 __name__:
6369 reason: Aggregation removes metric name.
6370 kind: excluded
6371 fragment:
6372 start: 1
6373 end: 102
6374 colo_name:
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 job:
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: excluded
6383 fragment:
6384 start: 5
6385 end: 8
6386 region:
6387 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6388 kind: included
6389 fragment:
6390 start: 5
6391 end: 8
6392 target:
6393 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6394 kind: included
6395 fragment:
6396 start: 5
6397 end: 8
6398 deadinfo: null
6399 returns: vector
6400 operations:
6401 - node: '[*parser.VectorSelector] probe_success{job="abc"}'
6402 op: ""
6403 - node: '[*parser.Call] sum_over_time(probe_success{job="abc"}[5m])'
6404 op: sum_over_time
6405 - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))'
6406 op: sum
6407 joins: []
6408 unless: []
6409 returninfo:
6410 logicalexpr: ""
6411 valueposition:
6412 start: 0
6413 end: 0
6414 returnednumber: 0
6415 alwaysreturns: false
6416 knownreturn: false
6417 isreturnbool: false
6418 position:
6419 start: 56
6420 end: 84
6421 type: aggregation
6422 fixedlabels: true
6423 isconditional: true
6424 - labels:
6425 "":
6426 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
6427 kind: excluded
6428 fragment:
6429 start: 5
6430 end: 8
6431 __name__:
6432 reason: Aggregation removes metric name.
6433 kind: excluded
6434 fragment:
6435 start: 1
6436 end: 102
6437 colo_name:
6438 reason: Calling `vector()` will return a vector value with no labels.
6439 kind: excluded
6440 fragment:
6441 start: 91
6442 end: 97
6443 region:
6444 reason: Calling `vector()` will return a vector value with no labels.
6445 kind: excluded
6446 fragment:
6447 start: 91
6448 end: 97
6449 target:
6450 reason: Calling `vector()` will return a vector value with no labels.
6451 kind: excluded
6452 fragment:
6453 start: 91
6454 end: 97
6455 deadinfo:
6456 reason: '`vector(1) == 0` always evaluates to `1 == 0` which is not possible, so it will never return anything.'
6457 fragment:
6458 start: 91
6459 end: 100
6460 returns: vector
6461 operations:
6462 - node: '[*parser.Call] vector(1)'
6463 op: vector
6464 - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))'
6465 op: sum
6466 joins: []
6467 unless: []
6468 returninfo:
6469 logicalexpr: ""
6470 valueposition:
6471 start: 91
6472 end: 100
6473 returnednumber: 1
6474 alwaysreturns: true
6475 knownreturn: true
6476 isreturnbool: false
6477 position:
6478 start: 91
6479 end: 100
6480 type: aggregation
6481 fixedlabels: true
6482 isconditional: true
6483
6484---
6485
6486[TestLabelsSource/115 - 1]
6487expr: vector(1) or foo
6488output:
6489 - labels:
6490 "":
6491 reason: Calling `vector()` will return a vector value with no labels.
6492 kind: excluded
6493 fragment:
6494 start: 0
6495 end: 6
6496 deadinfo: null
6497 returns: vector
6498 operations:
6499 - node: '[*parser.Call] vector(1)'
6500 op: vector
6501 joins: []
6502 unless: []
6503 returninfo:
6504 logicalexpr: ""
6505 valueposition:
6506 start: 0
6507 end: 9
6508 returnednumber: 1
6509 alwaysreturns: true
6510 knownreturn: true
6511 isreturnbool: false
6512 position:
6513 start: 0
6514 end: 9
6515 type: function
6516 fixedlabels: true
6517 isconditional: false
6518 - labels: {}
6519 deadinfo:
6520 reason: The left hand side always returs something and so the right hand side is never used.
6521 fragment:
6522 start: 13
6523 end: 16
6524 returns: vector
6525 operations:
6526 - node: '[*parser.VectorSelector] foo'
6527 op: ""
6528 joins: []
6529 unless: []
6530 returninfo:
6531 logicalexpr: ""
6532 valueposition:
6533 start: 0
6534 end: 0
6535 returnednumber: 0
6536 alwaysreturns: false
6537 knownreturn: false
6538 isreturnbool: false
6539 position:
6540 start: 13
6541 end: 16
6542 type: selector
6543 fixedlabels: false
6544 isconditional: false
6545
6546---
6547
6548[TestLabelsSource/116 - 1]
6549expr: vector(0) > 0
6550output:
6551 - labels:
6552 "":
6553 reason: Calling `vector()` will return a vector value with no labels.
6554 kind: excluded
6555 fragment:
6556 start: 0
6557 end: 6
6558 deadinfo:
6559 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
6560 fragment:
6561 start: 0
6562 end: 9
6563 returns: vector
6564 operations:
6565 - node: '[*parser.Call] vector(0)'
6566 op: vector
6567 joins: []
6568 unless: []
6569 returninfo:
6570 logicalexpr: ""
6571 valueposition:
6572 start: 0
6573 end: 9
6574 returnednumber: 0
6575 alwaysreturns: true
6576 knownreturn: true
6577 isreturnbool: false
6578 position:
6579 start: 0
6580 end: 9
6581 type: function
6582 fixedlabels: true
6583 isconditional: true
6584
6585---
6586
6587[TestLabelsSource/117 - 1]
6588expr: vector(0) > vector(1)
6589output:
6590 - labels:
6591 "":
6592 reason: Calling `vector()` will return a vector value with no labels.
6593 kind: excluded
6594 fragment:
6595 start: 0
6596 end: 6
6597 deadinfo:
6598 reason: '`vector(0) > vector(1)` always evaluates to `0 > 1` which is not possible, so it will never return anything.'
6599 fragment:
6600 start: 0
6601 end: 9
6602 returns: vector
6603 operations:
6604 - node: '[*parser.Call] vector(0)'
6605 op: vector
6606 joins:
6607 - "on": []
6608 ignoring: []
6609 src:
6610 labels:
6611 "":
6612 reason: Calling `vector()` will return a vector value with no labels.
6613 kind: excluded
6614 fragment:
6615 start: 12
6616 end: 18
6617 deadinfo: null
6618 returns: vector
6619 operations:
6620 - node: '[*parser.Call] vector(1)'
6621 op: vector
6622 joins: []
6623 unless: []
6624 returninfo:
6625 logicalexpr: ""
6626 valueposition:
6627 start: 12
6628 end: 21
6629 returnednumber: 1
6630 alwaysreturns: true
6631 knownreturn: true
6632 isreturnbool: false
6633 position:
6634 start: 12
6635 end: 21
6636 type: function
6637 fixedlabels: true
6638 isconditional: false
6639 op: 57388
6640 depth: 0
6641 unless: []
6642 returninfo:
6643 logicalexpr: ""
6644 valueposition:
6645 start: 0
6646 end: 9
6647 returnednumber: 0
6648 alwaysreturns: true
6649 knownreturn: true
6650 isreturnbool: false
6651 position:
6652 start: 0
6653 end: 9
6654 type: function
6655 fixedlabels: true
6656 isconditional: true
6657
6658---
6659
6660[TestLabelsSource/118 - 1]
6661expr: sum(foo or vector(0)) > 0
6662output:
6663 - labels:
6664 "":
6665 reason: Query is using aggregation that removes all labels.
6666 kind: excluded
6667 fragment:
6668 start: 0
6669 end: 3
6670 __name__:
6671 reason: Aggregation removes metric name.
6672 kind: excluded
6673 fragment:
6674 start: 0
6675 end: 21
6676 deadinfo: null
6677 returns: vector
6678 operations:
6679 - node: '[*parser.VectorSelector] foo'
6680 op: ""
6681 - node: '[*parser.AggregateExpr] sum(foo or vector(0))'
6682 op: sum
6683 joins: []
6684 unless: []
6685 returninfo:
6686 logicalexpr: ""
6687 valueposition:
6688 start: 0
6689 end: 0
6690 returnednumber: 0
6691 alwaysreturns: false
6692 knownreturn: false
6693 isreturnbool: false
6694 position:
6695 start: 4
6696 end: 7
6697 type: aggregation
6698 fixedlabels: true
6699 isconditional: true
6700 - labels:
6701 "":
6702 reason: Query is using aggregation that removes all labels.
6703 kind: excluded
6704 fragment:
6705 start: 0
6706 end: 3
6707 __name__:
6708 reason: Aggregation removes metric name.
6709 kind: excluded
6710 fragment:
6711 start: 0
6712 end: 21
6713 deadinfo:
6714 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
6715 fragment:
6716 start: 11
6717 end: 20
6718 returns: vector
6719 operations:
6720 - node: '[*parser.Call] vector(0)'
6721 op: vector
6722 - node: '[*parser.AggregateExpr] sum(foo or vector(0))'
6723 op: sum
6724 joins: []
6725 unless: []
6726 returninfo:
6727 logicalexpr: ""
6728 valueposition:
6729 start: 11
6730 end: 20
6731 returnednumber: 0
6732 alwaysreturns: true
6733 knownreturn: true
6734 isreturnbool: false
6735 position:
6736 start: 11
6737 end: 20
6738 type: aggregation
6739 fixedlabels: true
6740 isconditional: true
6741
6742---
6743
6744[TestLabelsSource/119 - 1]
6745expr: (sum(foo or vector(1)) > 0) == 2
6746output:
6747 - labels:
6748 "":
6749 reason: Query is using aggregation that removes all labels.
6750 kind: excluded
6751 fragment:
6752 start: 1
6753 end: 4
6754 __name__:
6755 reason: Aggregation removes metric name.
6756 kind: excluded
6757 fragment:
6758 start: 1
6759 end: 22
6760 deadinfo: null
6761 returns: vector
6762 operations:
6763 - node: '[*parser.VectorSelector] foo'
6764 op: ""
6765 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
6766 op: sum
6767 joins: []
6768 unless: []
6769 returninfo:
6770 logicalexpr: ""
6771 valueposition:
6772 start: 0
6773 end: 0
6774 returnednumber: 0
6775 alwaysreturns: false
6776 knownreturn: false
6777 isreturnbool: false
6778 position:
6779 start: 5
6780 end: 8
6781 type: aggregation
6782 fixedlabels: true
6783 isconditional: true
6784 - labels:
6785 "":
6786 reason: Query is using aggregation that removes all labels.
6787 kind: excluded
6788 fragment:
6789 start: 1
6790 end: 4
6791 __name__:
6792 reason: Aggregation removes metric name.
6793 kind: excluded
6794 fragment:
6795 start: 1
6796 end: 22
6797 deadinfo:
6798 reason: '`vector(1) == 2` always evaluates to `1 == 2` which is not possible, so it will never return anything.'
6799 fragment:
6800 start: 12
6801 end: 21
6802 returns: vector
6803 operations:
6804 - node: '[*parser.Call] vector(1)'
6805 op: vector
6806 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
6807 op: sum
6808 joins: []
6809 unless: []
6810 returninfo:
6811 logicalexpr: ""
6812 valueposition:
6813 start: 12
6814 end: 21
6815 returnednumber: 1
6816 alwaysreturns: true
6817 knownreturn: true
6818 isreturnbool: false
6819 position:
6820 start: 12
6821 end: 21
6822 type: aggregation
6823 fixedlabels: true
6824 isconditional: true
6825
6826---
6827
6828[TestLabelsSource/120 - 1]
6829expr: (sum(foo or vector(1)) > 0) != 2
6830output:
6831 - labels:
6832 "":
6833 reason: Query is using aggregation that removes all labels.
6834 kind: excluded
6835 fragment:
6836 start: 1
6837 end: 4
6838 __name__:
6839 reason: Aggregation removes metric name.
6840 kind: excluded
6841 fragment:
6842 start: 1
6843 end: 22
6844 deadinfo: null
6845 returns: vector
6846 operations:
6847 - node: '[*parser.VectorSelector] foo'
6848 op: ""
6849 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
6850 op: sum
6851 joins: []
6852 unless: []
6853 returninfo:
6854 logicalexpr: ""
6855 valueposition:
6856 start: 0
6857 end: 0
6858 returnednumber: 0
6859 alwaysreturns: false
6860 knownreturn: false
6861 isreturnbool: false
6862 position:
6863 start: 5
6864 end: 8
6865 type: aggregation
6866 fixedlabels: true
6867 isconditional: true
6868 - labels:
6869 "":
6870 reason: Query is using aggregation that removes all labels.
6871 kind: excluded
6872 fragment:
6873 start: 1
6874 end: 4
6875 __name__:
6876 reason: Aggregation removes metric name.
6877 kind: excluded
6878 fragment:
6879 start: 1
6880 end: 22
6881 deadinfo: null
6882 returns: vector
6883 operations:
6884 - node: '[*parser.Call] vector(1)'
6885 op: vector
6886 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
6887 op: sum
6888 joins: []
6889 unless: []
6890 returninfo:
6891 logicalexpr: ""
6892 valueposition:
6893 start: 12
6894 end: 21
6895 returnednumber: 1
6896 alwaysreturns: true
6897 knownreturn: true
6898 isreturnbool: false
6899 position:
6900 start: 12
6901 end: 21
6902 type: aggregation
6903 fixedlabels: true
6904 isconditional: true
6905
6906---
6907
6908[TestLabelsSource/121 - 1]
6909expr: (sum(foo or vector(2)) > 0) != 2
6910output:
6911 - labels:
6912 "":
6913 reason: Query is using aggregation that removes all labels.
6914 kind: excluded
6915 fragment:
6916 start: 1
6917 end: 4
6918 __name__:
6919 reason: Aggregation removes metric name.
6920 kind: excluded
6921 fragment:
6922 start: 1
6923 end: 22
6924 deadinfo: null
6925 returns: vector
6926 operations:
6927 - node: '[*parser.VectorSelector] foo'
6928 op: ""
6929 - node: '[*parser.AggregateExpr] sum(foo or vector(2))'
6930 op: sum
6931 joins: []
6932 unless: []
6933 returninfo:
6934 logicalexpr: ""
6935 valueposition:
6936 start: 0
6937 end: 0
6938 returnednumber: 0
6939 alwaysreturns: false
6940 knownreturn: false
6941 isreturnbool: false
6942 position:
6943 start: 5
6944 end: 8
6945 type: aggregation
6946 fixedlabels: true
6947 isconditional: true
6948 - labels:
6949 "":
6950 reason: Query is using aggregation that removes all labels.
6951 kind: excluded
6952 fragment:
6953 start: 1
6954 end: 4
6955 __name__:
6956 reason: Aggregation removes metric name.
6957 kind: excluded
6958 fragment:
6959 start: 1
6960 end: 22
6961 deadinfo:
6962 reason: '`vector(2) != 2` always evaluates to `2 != 2` which is not possible, so it will never return anything.'
6963 fragment:
6964 start: 12
6965 end: 21
6966 returns: vector
6967 operations:
6968 - node: '[*parser.Call] vector(2)'
6969 op: vector
6970 - node: '[*parser.AggregateExpr] sum(foo or vector(2))'
6971 op: sum
6972 joins: []
6973 unless: []
6974 returninfo:
6975 logicalexpr: ""
6976 valueposition:
6977 start: 12
6978 end: 21
6979 returnednumber: 2
6980 alwaysreturns: true
6981 knownreturn: true
6982 isreturnbool: false
6983 position:
6984 start: 12
6985 end: 21
6986 type: aggregation
6987 fixedlabels: true
6988 isconditional: true
6989
6990---
6991
6992[TestLabelsSource/122 - 1]
6993expr: |-
6994 (sum(sometimes{foo!="bar"} or vector(0)))
6995 or
6996 ((bob > 10) or sum(foo) or vector(1))
6997output:
6998 - labels:
6999 "":
7000 reason: Query is using aggregation that removes all labels.
7001 kind: excluded
7002 fragment:
7003 start: 1
7004 end: 4
7005 __name__:
7006 reason: Aggregation removes metric name.
7007 kind: excluded
7008 fragment:
7009 start: 1
7010 end: 41
7011 deadinfo: null
7012 returns: vector
7013 operations:
7014 - node: '[*parser.VectorSelector] sometimes{foo!="bar"}'
7015 op: ""
7016 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))'
7017 op: sum
7018 joins: []
7019 unless: []
7020 returninfo:
7021 logicalexpr: ""
7022 valueposition:
7023 start: 0
7024 end: 0
7025 returnednumber: 0
7026 alwaysreturns: false
7027 knownreturn: false
7028 isreturnbool: false
7029 position:
7030 start: 5
7031 end: 26
7032 type: aggregation
7033 fixedlabels: true
7034 isconditional: false
7035 - labels:
7036 "":
7037 reason: Query is using aggregation that removes all labels.
7038 kind: excluded
7039 fragment:
7040 start: 1
7041 end: 4
7042 __name__:
7043 reason: Aggregation removes metric name.
7044 kind: excluded
7045 fragment:
7046 start: 1
7047 end: 41
7048 deadinfo: null
7049 returns: vector
7050 operations:
7051 - node: '[*parser.Call] vector(0)'
7052 op: vector
7053 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))'
7054 op: sum
7055 joins: []
7056 unless: []
7057 returninfo:
7058 logicalexpr: ""
7059 valueposition:
7060 start: 30
7061 end: 39
7062 returnednumber: 0
7063 alwaysreturns: true
7064 knownreturn: true
7065 isreturnbool: false
7066 position:
7067 start: 30
7068 end: 39
7069 type: aggregation
7070 fixedlabels: true
7071 isconditional: false
7072 - labels: {}
7073 deadinfo: null
7074 returns: vector
7075 operations:
7076 - node: '[*parser.VectorSelector] bob'
7077 op: ""
7078 joins: []
7079 unless: []
7080 returninfo:
7081 logicalexpr: ""
7082 valueposition:
7083 start: 0
7084 end: 0
7085 returnednumber: 0
7086 alwaysreturns: false
7087 knownreturn: false
7088 isreturnbool: false
7089 position:
7090 start: 47
7091 end: 50
7092 type: selector
7093 fixedlabels: false
7094 isconditional: true
7095 - labels:
7096 "":
7097 reason: Query is using aggregation that removes all labels.
7098 kind: excluded
7099 fragment:
7100 start: 60
7101 end: 63
7102 __name__:
7103 reason: Aggregation removes metric name.
7104 kind: excluded
7105 fragment:
7106 start: 60
7107 end: 68
7108 deadinfo: null
7109 returns: vector
7110 operations:
7111 - node: '[*parser.VectorSelector] foo'
7112 op: ""
7113 - node: '[*parser.AggregateExpr] sum(foo)'
7114 op: sum
7115 joins: []
7116 unless: []
7117 returninfo:
7118 logicalexpr: ""
7119 valueposition:
7120 start: 0
7121 end: 0
7122 returnednumber: 0
7123 alwaysreturns: false
7124 knownreturn: false
7125 isreturnbool: false
7126 position:
7127 start: 64
7128 end: 67
7129 type: aggregation
7130 fixedlabels: true
7131 isconditional: false
7132 - labels:
7133 "":
7134 reason: Calling `vector()` will return a vector value with no labels.
7135 kind: excluded
7136 fragment:
7137 start: 72
7138 end: 78
7139 deadinfo: null
7140 returns: vector
7141 operations:
7142 - node: '[*parser.Call] vector(1)'
7143 op: vector
7144 joins: []
7145 unless: []
7146 returninfo:
7147 logicalexpr: ""
7148 valueposition:
7149 start: 72
7150 end: 81
7151 returnednumber: 1
7152 alwaysreturns: true
7153 knownreturn: true
7154 isreturnbool: false
7155 position:
7156 start: 72
7157 end: 81
7158 type: function
7159 fixedlabels: true
7160 isconditional: false
7161
7162---
7163
7164[TestLabelsSource/123 - 1]
7165expr: |4-
7166 (
7167 sum(sometimes{foo!="bar"})
7168 or
7169 vector(1)
7170 ) and (
7171 ((bob > 10) or sum(bar))
7172 or
7173 notfound > 0
7174 )
7175output:
7176 - labels:
7177 "":
7178 reason: Query is using aggregation that removes all labels.
7179 kind: excluded
7180 fragment:
7181 start: 4
7182 end: 7
7183 __name__:
7184 reason: Aggregation removes metric name.
7185 kind: excluded
7186 fragment:
7187 start: 4
7188 end: 30
7189 deadinfo: null
7190 returns: vector
7191 operations:
7192 - node: '[*parser.VectorSelector] sometimes{foo!="bar"}'
7193 op: ""
7194 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"})'
7195 op: sum
7196 joins:
7197 - "on": []
7198 ignoring: []
7199 src:
7200 labels: {}
7201 deadinfo: null
7202 returns: vector
7203 operations:
7204 - node: '[*parser.VectorSelector] bob'
7205 op: ""
7206 joins: []
7207 unless: []
7208 returninfo:
7209 logicalexpr: ""
7210 valueposition:
7211 start: 0
7212 end: 0
7213 returnednumber: 0
7214 alwaysreturns: false
7215 knownreturn: false
7216 isreturnbool: false
7217 position:
7218 start: 57
7219 end: 60
7220 type: selector
7221 fixedlabels: false
7222 isconditional: true
7223 op: 57389
7224 depth: 0
7225 - "on": []
7226 ignoring: []
7227 src:
7228 labels:
7229 "":
7230 reason: Query is using aggregation that removes all labels.
7231 kind: excluded
7232 fragment:
7233 start: 70
7234 end: 73
7235 __name__:
7236 reason: Aggregation removes metric name.
7237 kind: excluded
7238 fragment:
7239 start: 70
7240 end: 79
7241 deadinfo: null
7242 returns: vector
7243 operations:
7244 - node: '[*parser.VectorSelector] bar'
7245 op: ""
7246 - node: '[*parser.AggregateExpr] sum(bar)'
7247 op: sum
7248 joins: []
7249 unless: []
7250 returninfo:
7251 logicalexpr: ""
7252 valueposition:
7253 start: 0
7254 end: 0
7255 returnednumber: 0
7256 alwaysreturns: false
7257 knownreturn: false
7258 isreturnbool: false
7259 position:
7260 start: 74
7261 end: 77
7262 type: aggregation
7263 fixedlabels: true
7264 isconditional: false
7265 op: 57389
7266 depth: 0
7267 - "on": []
7268 ignoring: []
7269 src:
7270 labels: {}
7271 deadinfo: null
7272 returns: vector
7273 operations:
7274 - node: '[*parser.VectorSelector] notfound'
7275 op: ""
7276 joins: []
7277 unless: []
7278 returninfo:
7279 logicalexpr: ""
7280 valueposition:
7281 start: 0
7282 end: 0
7283 returnednumber: 0
7284 alwaysreturns: false
7285 knownreturn: false
7286 isreturnbool: false
7287 position:
7288 start: 85
7289 end: 93
7290 type: selector
7291 fixedlabels: false
7292 isconditional: true
7293 op: 57389
7294 depth: 0
7295 unless: []
7296 returninfo:
7297 logicalexpr: ""
7298 valueposition:
7299 start: 0
7300 end: 0
7301 returnednumber: 0
7302 alwaysreturns: false
7303 knownreturn: false
7304 isreturnbool: false
7305 position:
7306 start: 8
7307 end: 29
7308 type: aggregation
7309 fixedlabels: true
7310 isconditional: true
7311 - labels:
7312 "":
7313 reason: Calling `vector()` will return a vector value with no labels.
7314 kind: excluded
7315 fragment:
7316 start: 36
7317 end: 42
7318 deadinfo: null
7319 returns: vector
7320 operations:
7321 - node: '[*parser.Call] vector(1)'
7322 op: vector
7323 joins:
7324 - "on": []
7325 ignoring: []
7326 src:
7327 labels: {}
7328 deadinfo: null
7329 returns: vector
7330 operations:
7331 - node: '[*parser.VectorSelector] bob'
7332 op: ""
7333 joins: []
7334 unless: []
7335 returninfo:
7336 logicalexpr: ""
7337 valueposition:
7338 start: 0
7339 end: 0
7340 returnednumber: 0
7341 alwaysreturns: false
7342 knownreturn: false
7343 isreturnbool: false
7344 position:
7345 start: 57
7346 end: 60
7347 type: selector
7348 fixedlabels: false
7349 isconditional: true
7350 op: 57389
7351 depth: 0
7352 - "on": []
7353 ignoring: []
7354 src:
7355 labels:
7356 "":
7357 reason: Query is using aggregation that removes all labels.
7358 kind: excluded
7359 fragment:
7360 start: 70
7361 end: 73
7362 __name__:
7363 reason: Aggregation removes metric name.
7364 kind: excluded
7365 fragment:
7366 start: 70
7367 end: 79
7368 deadinfo: null
7369 returns: vector
7370 operations:
7371 - node: '[*parser.VectorSelector] bar'
7372 op: ""
7373 - node: '[*parser.AggregateExpr] sum(bar)'
7374 op: sum
7375 joins: []
7376 unless: []
7377 returninfo:
7378 logicalexpr: ""
7379 valueposition:
7380 start: 0
7381 end: 0
7382 returnednumber: 0
7383 alwaysreturns: false
7384 knownreturn: false
7385 isreturnbool: false
7386 position:
7387 start: 74
7388 end: 77
7389 type: aggregation
7390 fixedlabels: true
7391 isconditional: false
7392 op: 57389
7393 depth: 0
7394 - "on": []
7395 ignoring: []
7396 src:
7397 labels: {}
7398 deadinfo: null
7399 returns: vector
7400 operations:
7401 - node: '[*parser.VectorSelector] notfound'
7402 op: ""
7403 joins: []
7404 unless: []
7405 returninfo:
7406 logicalexpr: ""
7407 valueposition:
7408 start: 0
7409 end: 0
7410 returnednumber: 0
7411 alwaysreturns: false
7412 knownreturn: false
7413 isreturnbool: false
7414 position:
7415 start: 85
7416 end: 93
7417 type: selector
7418 fixedlabels: false
7419 isconditional: true
7420 op: 57389
7421 depth: 0
7422 unless: []
7423 returninfo:
7424 logicalexpr: ""
7425 valueposition:
7426 start: 36
7427 end: 45
7428 returnednumber: 1
7429 alwaysreturns: true
7430 knownreturn: true
7431 isreturnbool: false
7432 position:
7433 start: 36
7434 end: 45
7435 type: function
7436 fixedlabels: true
7437 isconditional: true
7438
7439---
7440
7441[TestLabelsSource/124 - 1]
7442expr: foo offset 5m > 5
7443output:
7444 - labels: {}
7445 deadinfo: null
7446 returns: vector
7447 operations:
7448 - node: '[*parser.VectorSelector] foo offset 5m'
7449 op: ""
7450 joins: []
7451 unless: []
7452 returninfo:
7453 logicalexpr: ""
7454 valueposition:
7455 start: 0
7456 end: 0
7457 returnednumber: 0
7458 alwaysreturns: false
7459 knownreturn: false
7460 isreturnbool: false
7461 position:
7462 start: 0
7463 end: 13
7464 type: selector
7465 fixedlabels: false
7466 isconditional: true
7467
7468---
7469
7470[TestLabelsSource/125 - 1]
7471expr: |4
7472 (rate(metric2[5m]) or vector(0)) +
7473 (rate(metric1[5m]) or vector(1)) +
7474 (rate(metric3{log_name="samplerd"}[5m]) or vector(2)) > 0
7475output:
7476 - labels: {}
7477 deadinfo: null
7478 returns: vector
7479 operations:
7480 - node: '[*parser.VectorSelector] metric2'
7481 op: ""
7482 - node: '[*parser.Call] rate(metric2[5m])'
7483 op: rate
7484 joins:
7485 - "on": []
7486 ignoring: []
7487 src:
7488 labels: {}
7489 deadinfo: null
7490 returns: vector
7491 operations:
7492 - node: '[*parser.VectorSelector] metric1'
7493 op: ""
7494 - node: '[*parser.Call] rate(metric1[5m])'
7495 op: rate
7496 joins: []
7497 unless: []
7498 returninfo:
7499 logicalexpr: ""
7500 valueposition:
7501 start: 0
7502 end: 0
7503 returnednumber: 0
7504 alwaysreturns: false
7505 knownreturn: false
7506 isreturnbool: false
7507 position:
7508 start: 42
7509 end: 53
7510 type: function
7511 fixedlabels: false
7512 isconditional: false
7513 op: 57383
7514 depth: 0
7515 - "on": []
7516 ignoring: []
7517 src:
7518 labels:
7519 "":
7520 reason: Calling `vector()` will return a vector value with no labels.
7521 kind: excluded
7522 fragment:
7523 start: 58
7524 end: 64
7525 deadinfo: null
7526 returns: vector
7527 operations:
7528 - node: '[*parser.Call] vector(1)'
7529 op: vector
7530 joins: []
7531 unless: []
7532 returninfo:
7533 logicalexpr: ""
7534 valueposition:
7535 start: 58
7536 end: 67
7537 returnednumber: 1
7538 alwaysreturns: true
7539 knownreturn: true
7540 isreturnbool: false
7541 position:
7542 start: 58
7543 end: 67
7544 type: function
7545 fixedlabels: true
7546 isconditional: false
7547 op: 57383
7548 depth: 0
7549 - "on": []
7550 ignoring: []
7551 src:
7552 labels:
7553 log_name:
7554 reason: Query will only return series where these labels are present.
7555 kind: guaranteed
7556 fragment:
7557 start: 72
7558 end: 110
7559 deadinfo: null
7560 returns: vector
7561 operations:
7562 - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}'
7563 op: ""
7564 - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])'
7565 op: rate
7566 joins: []
7567 unless: []
7568 returninfo:
7569 logicalexpr: ""
7570 valueposition:
7571 start: 0
7572 end: 0
7573 returnednumber: 0
7574 alwaysreturns: false
7575 knownreturn: false
7576 isreturnbool: false
7577 position:
7578 start: 77
7579 end: 109
7580 type: function
7581 fixedlabels: false
7582 isconditional: false
7583 op: 57383
7584 depth: 0
7585 - "on": []
7586 ignoring: []
7587 src:
7588 labels:
7589 "":
7590 reason: Calling `vector()` will return a vector value with no labels.
7591 kind: excluded
7592 fragment:
7593 start: 114
7594 end: 120
7595 deadinfo: null
7596 returns: vector
7597 operations:
7598 - node: '[*parser.Call] vector(2)'
7599 op: vector
7600 joins: []
7601 unless: []
7602 returninfo:
7603 logicalexpr: ""
7604 valueposition:
7605 start: 114
7606 end: 123
7607 returnednumber: 2
7608 alwaysreturns: true
7609 knownreturn: true
7610 isreturnbool: false
7611 position:
7612 start: 114
7613 end: 123
7614 type: function
7615 fixedlabels: true
7616 isconditional: false
7617 op: 57383
7618 depth: 0
7619 unless: []
7620 returninfo:
7621 logicalexpr: ""
7622 valueposition:
7623 start: 0
7624 end: 0
7625 returnednumber: 0
7626 alwaysreturns: false
7627 knownreturn: false
7628 isreturnbool: false
7629 position:
7630 start: 7
7631 end: 18
7632 type: function
7633 fixedlabels: false
7634 isconditional: true
7635 - labels:
7636 "":
7637 reason: Calling `vector()` will return a vector value with no labels.
7638 kind: excluded
7639 fragment:
7640 start: 23
7641 end: 29
7642 deadinfo: null
7643 returns: vector
7644 operations:
7645 - node: '[*parser.Call] vector(0)'
7646 op: vector
7647 joins:
7648 - "on": []
7649 ignoring: []
7650 src:
7651 labels: {}
7652 deadinfo: null
7653 returns: vector
7654 operations:
7655 - node: '[*parser.VectorSelector] metric1'
7656 op: ""
7657 - node: '[*parser.Call] rate(metric1[5m])'
7658 op: rate
7659 joins: []
7660 unless: []
7661 returninfo:
7662 logicalexpr: ""
7663 valueposition:
7664 start: 0
7665 end: 0
7666 returnednumber: 0
7667 alwaysreturns: false
7668 knownreturn: false
7669 isreturnbool: false
7670 position:
7671 start: 42
7672 end: 53
7673 type: function
7674 fixedlabels: false
7675 isconditional: false
7676 op: 57383
7677 depth: 0
7678 - "on": []
7679 ignoring: []
7680 src:
7681 labels:
7682 "":
7683 reason: Calling `vector()` will return a vector value with no labels.
7684 kind: excluded
7685 fragment:
7686 start: 58
7687 end: 64
7688 deadinfo: null
7689 returns: vector
7690 operations:
7691 - node: '[*parser.Call] vector(1)'
7692 op: vector
7693 joins: []
7694 unless: []
7695 returninfo:
7696 logicalexpr: ""
7697 valueposition:
7698 start: 58
7699 end: 67
7700 returnednumber: 1
7701 alwaysreturns: true
7702 knownreturn: true
7703 isreturnbool: false
7704 position:
7705 start: 58
7706 end: 67
7707 type: function
7708 fixedlabels: true
7709 isconditional: false
7710 op: 57383
7711 depth: 0
7712 - "on": []
7713 ignoring: []
7714 src:
7715 labels:
7716 log_name:
7717 reason: Query will only return series where these labels are present.
7718 kind: guaranteed
7719 fragment:
7720 start: 72
7721 end: 110
7722 deadinfo: null
7723 returns: vector
7724 operations:
7725 - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}'
7726 op: ""
7727 - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])'
7728 op: rate
7729 joins: []
7730 unless: []
7731 returninfo:
7732 logicalexpr: ""
7733 valueposition:
7734 start: 0
7735 end: 0
7736 returnednumber: 0
7737 alwaysreturns: false
7738 knownreturn: false
7739 isreturnbool: false
7740 position:
7741 start: 77
7742 end: 109
7743 type: function
7744 fixedlabels: false
7745 isconditional: false
7746 op: 57383
7747 depth: 0
7748 - "on": []
7749 ignoring: []
7750 src:
7751 labels:
7752 "":
7753 reason: Calling `vector()` will return a vector value with no labels.
7754 kind: excluded
7755 fragment:
7756 start: 114
7757 end: 120
7758 deadinfo: null
7759 returns: vector
7760 operations:
7761 - node: '[*parser.Call] vector(2)'
7762 op: vector
7763 joins: []
7764 unless: []
7765 returninfo:
7766 logicalexpr: ""
7767 valueposition:
7768 start: 114
7769 end: 123
7770 returnednumber: 2
7771 alwaysreturns: true
7772 knownreturn: true
7773 isreturnbool: false
7774 position:
7775 start: 114
7776 end: 123
7777 type: function
7778 fixedlabels: true
7779 isconditional: false
7780 op: 57383
7781 depth: 0
7782 unless: []
7783 returninfo:
7784 logicalexpr: vector(0) + vector(1) + vector(2)
7785 valueposition:
7786 start: 23
7787 end: 32
7788 returnednumber: 3
7789 alwaysreturns: true
7790 knownreturn: true
7791 isreturnbool: false
7792 position:
7793 start: 23
7794 end: 32
7795 type: function
7796 fixedlabels: true
7797 isconditional: true
7798
7799---
7800
7801[TestLabelsSource/126 - 1]
7802expr: label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)")
7803output:
7804 - labels:
7805 "":
7806 reason: Calling `vector()` will return a vector value with no labels.
7807 kind: excluded
7808 fragment:
7809 start: 14
7810 end: 20
7811 nexthop_tag:
7812 reason: This label will be added to the result by label_replace() call.
7813 kind: guaranteed
7814 fragment:
7815 start: 0
7816 end: 64
7817 deadinfo: null
7818 returns: vector
7819 operations:
7820 - node: '[*parser.Call] vector(1)'
7821 op: vector
7822 - node: '[*parser.Call] label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)")'
7823 op: label_replace
7824 joins: []
7825 unless: []
7826 returninfo:
7827 logicalexpr: ""
7828 valueposition:
7829 start: 14
7830 end: 23
7831 returnednumber: 1
7832 alwaysreturns: true
7833 knownreturn: true
7834 isreturnbool: false
7835 position:
7836 start: 14
7837 end: 23
7838 type: function
7839 fixedlabels: true
7840 isconditional: false
7841
7842---
7843
7844[TestLabelsSource/127 - 1]
7845expr: (sum(foo{job="myjob"}))
7846output:
7847 - labels:
7848 "":
7849 reason: Query is using aggregation that removes all labels.
7850 kind: excluded
7851 fragment:
7852 start: 1
7853 end: 4
7854 __name__:
7855 reason: Aggregation removes metric name.
7856 kind: excluded
7857 fragment:
7858 start: 1
7859 end: 23
7860 job:
7861 reason: Query is using aggregation that removes all labels.
7862 kind: excluded
7863 fragment:
7864 start: 1
7865 end: 4
7866 deadinfo: null
7867 returns: vector
7868 operations:
7869 - node: '[*parser.VectorSelector] foo{job="myjob"}'
7870 op: ""
7871 - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})'
7872 op: sum
7873 joins: []
7874 unless: []
7875 returninfo:
7876 logicalexpr: ""
7877 valueposition:
7878 start: 0
7879 end: 0
7880 returnednumber: 0
7881 alwaysreturns: false
7882 knownreturn: false
7883 isreturnbool: false
7884 position:
7885 start: 5
7886 end: 21
7887 type: aggregation
7888 fixedlabels: true
7889 isconditional: false
7890
7891---
7892
7893[TestLabelsSource/128 - 1]
7894expr: (-foo{job="myjob"})
7895output:
7896 - labels:
7897 job:
7898 reason: Query will only return series where these labels are present.
7899 kind: guaranteed
7900 fragment:
7901 start: 2
7902 end: 18
7903 deadinfo: null
7904 returns: vector
7905 operations:
7906 - node: '[*parser.VectorSelector] foo{job="myjob"}'
7907 op: ""
7908 joins: []
7909 unless: []
7910 returninfo:
7911 logicalexpr: ""
7912 valueposition:
7913 start: 0
7914 end: 0
7915 returnednumber: 0
7916 alwaysreturns: false
7917 knownreturn: false
7918 isreturnbool: false
7919 position:
7920 start: 2
7921 end: 18
7922 type: selector
7923 fixedlabels: false
7924 isconditional: false
7925
7926---
7927
7928[TestLabelsSource/129 - 1]
7929expr: |4-
7930 ((( group(vector(0)) ))) > 0
7931output:
7932 - labels:
7933 "":
7934 reason: Query is using aggregation that removes all labels.
7935 kind: excluded
7936 fragment:
7937 start: 5
7938 end: 23
7939 __name__:
7940 reason: Aggregation removes metric name.
7941 kind: excluded
7942 fragment:
7943 start: 5
7944 end: 23
7945 deadinfo:
7946 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
7947 fragment:
7948 start: 11
7949 end: 20
7950 returns: vector
7951 operations:
7952 - node: '[*parser.Call] vector(0)'
7953 op: vector
7954 - node: '[*parser.AggregateExpr] group(vector(0))'
7955 op: group
7956 joins: []
7957 unless: []
7958 returninfo:
7959 logicalexpr: ""
7960 valueposition:
7961 start: 11
7962 end: 20
7963 returnednumber: 0
7964 alwaysreturns: true
7965 knownreturn: true
7966 isreturnbool: false
7967 position:
7968 start: 11
7969 end: 20
7970 type: aggregation
7971 fixedlabels: true
7972 isconditional: true
7973
7974---
7975
7976[TestLabelsSource/130 - 1]
7977expr: 1 > bool 5
7978output:
7979 - labels:
7980 "":
7981 reason: This query returns a number value with no labels.
7982 kind: excluded
7983 fragment:
7984 start: 0
7985 end: 1
7986 deadinfo:
7987 reason: '`1 > 5` always evaluates to `1 > 5` and uses the `bool` modifier which means it will always return 0'
7988 fragment:
7989 start: 0
7990 end: 1
7991 returns: scalar
7992 operations: []
7993 joins: []
7994 unless: []
7995 returninfo:
7996 logicalexpr: ""
7997 valueposition:
7998 start: 0
7999 end: 1
8000 returnednumber: 1
8001 alwaysreturns: true
8002 knownreturn: true
8003 isreturnbool: true
8004 position:
8005 start: 0
8006 end: 1
8007 type: number
8008 fixedlabels: true
8009 isconditional: true
8010
8011---
8012
8013[TestLabelsSource/131 - 1]
8014expr: prometheus_ready{job="prometheus"} unless vector(0)
8015output:
8016 - labels:
8017 job:
8018 reason: Query will only return series where these labels are present.
8019 kind: guaranteed
8020 fragment:
8021 start: 0
8022 end: 34
8023 deadinfo: null
8024 returns: vector
8025 operations:
8026 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
8027 op: ""
8028 joins: []
8029 unless:
8030 - "on": []
8031 ignoring: []
8032 src:
8033 labels:
8034 "":
8035 reason: Calling `vector()` will return a vector value with no labels.
8036 kind: excluded
8037 fragment:
8038 start: 42
8039 end: 48
8040 deadinfo:
8041 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.
8042 fragment:
8043 start: 42
8044 end: 48
8045 returns: vector
8046 operations:
8047 - node: '[*parser.Call] vector(0)'
8048 op: vector
8049 joins: []
8050 unless: []
8051 returninfo:
8052 logicalexpr: ""
8053 valueposition:
8054 start: 42
8055 end: 51
8056 returnednumber: 0
8057 alwaysreturns: true
8058 knownreturn: true
8059 isreturnbool: false
8060 position:
8061 start: 42
8062 end: 51
8063 type: function
8064 fixedlabels: true
8065 isconditional: false
8066 returninfo:
8067 logicalexpr: ""
8068 valueposition:
8069 start: 0
8070 end: 0
8071 returnednumber: 0
8072 alwaysreturns: false
8073 knownreturn: false
8074 isreturnbool: false
8075 position:
8076 start: 0
8077 end: 34
8078 type: selector
8079 fixedlabels: false
8080 isconditional: false
8081
8082---
8083
8084[TestLabelsSource/132 - 1]
8085expr: prometheus_ready{job="prometheus"} unless on() vector(0)
8086output:
8087 - labels:
8088 job:
8089 reason: Query will only return series where these labels are present.
8090 kind: guaranteed
8091 fragment:
8092 start: 0
8093 end: 34
8094 deadinfo:
8095 reason: This query will never return anything because the `unless` query always returns something.
8096 fragment:
8097 start: 47
8098 end: 56
8099 returns: vector
8100 operations:
8101 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
8102 op: ""
8103 joins: []
8104 unless:
8105 - "on": []
8106 ignoring: []
8107 src:
8108 labels:
8109 "":
8110 reason: Calling `vector()` will return a vector value with no labels.
8111 kind: excluded
8112 fragment:
8113 start: 47
8114 end: 53
8115 deadinfo: null
8116 returns: vector
8117 operations:
8118 - node: '[*parser.Call] vector(0)'
8119 op: vector
8120 joins: []
8121 unless: []
8122 returninfo:
8123 logicalexpr: ""
8124 valueposition:
8125 start: 47
8126 end: 56
8127 returnednumber: 0
8128 alwaysreturns: true
8129 knownreturn: true
8130 isreturnbool: false
8131 position:
8132 start: 47
8133 end: 56
8134 type: function
8135 fixedlabels: true
8136 isconditional: false
8137 returninfo:
8138 logicalexpr: ""
8139 valueposition:
8140 start: 0
8141 end: 0
8142 returnednumber: 0
8143 alwaysreturns: false
8144 knownreturn: false
8145 isreturnbool: false
8146 position:
8147 start: 0
8148 end: 34
8149 type: selector
8150 fixedlabels: false
8151 isconditional: false
8152
8153---
8154
8155[TestLabelsSource/133 - 1]
8156expr: prometheus_ready{job="prometheus"} unless on(job) vector(0)
8157output:
8158 - labels:
8159 job:
8160 reason: Query will only return series where these labels are present.
8161 kind: guaranteed
8162 fragment:
8163 start: 0
8164 end: 34
8165 deadinfo: null
8166 returns: vector
8167 operations:
8168 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
8169 op: ""
8170 joins: []
8171 unless:
8172 - "on":
8173 - job
8174 ignoring: []
8175 src:
8176 labels:
8177 "":
8178 reason: Calling `vector()` will return a vector value with no labels.
8179 kind: excluded
8180 fragment:
8181 start: 50
8182 end: 56
8183 deadinfo:
8184 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.
8185 fragment:
8186 start: 50
8187 end: 56
8188 returns: vector
8189 operations:
8190 - node: '[*parser.Call] vector(0)'
8191 op: vector
8192 joins: []
8193 unless: []
8194 returninfo:
8195 logicalexpr: ""
8196 valueposition:
8197 start: 50
8198 end: 59
8199 returnednumber: 0
8200 alwaysreturns: true
8201 knownreturn: true
8202 isreturnbool: false
8203 position:
8204 start: 50
8205 end: 59
8206 type: function
8207 fixedlabels: true
8208 isconditional: false
8209 returninfo:
8210 logicalexpr: ""
8211 valueposition:
8212 start: 0
8213 end: 0
8214 returnednumber: 0
8215 alwaysreturns: false
8216 knownreturn: false
8217 isreturnbool: false
8218 position:
8219 start: 0
8220 end: 34
8221 type: selector
8222 fixedlabels: false
8223 isconditional: false
8224
8225---
8226
8227[TestLabelsSource/134 - 1]
8228expr: |4
8229 max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"})
8230 unless
8231 sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"})
8232 * on (instance) group_left (cluster)
8233 cf_node_role{kubernetes_role="master",role="kubernetes"}
8234output:
8235 - labels:
8236 "":
8237 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8238 kind: excluded
8239 fragment:
8240 start: 5
8241 end: 8
8242 __name__:
8243 reason: Aggregation removes metric name.
8244 kind: excluded
8245 fragment:
8246 start: 1
8247 end: 86
8248 cluster:
8249 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8250 kind: included
8251 fragment:
8252 start: 5
8253 end: 8
8254 instance:
8255 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8256 kind: included
8257 fragment:
8258 start: 5
8259 end: 8
8260 kubernetes_role:
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: 5
8265 end: 8
8266 role:
8267 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8268 kind: excluded
8269 fragment:
8270 start: 5
8271 end: 8
8272 deadinfo: null
8273 returns: vector
8274 operations:
8275 - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}'
8276 op: ""
8277 - node: '[*parser.AggregateExpr] max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"})'
8278 op: max
8279 joins: []
8280 unless:
8281 - "on": []
8282 ignoring: []
8283 src:
8284 labels:
8285 "":
8286 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8287 kind: excluded
8288 fragment:
8289 start: 99
8290 end: 102
8291 __name__:
8292 reason: Aggregation removes metric name.
8293 kind: excluded
8294 fragment:
8295 start: 95
8296 end: 202
8297 cluster:
8298 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.
8299 kind: included
8300 fragment:
8301 start: 222
8302 end: 233
8303 instance:
8304 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8305 kind: included
8306 fragment:
8307 start: 208
8308 end: 211
8309 name:
8310 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
8311 kind: excluded
8312 fragment:
8313 start: 99
8314 end: 102
8315 deadinfo: null
8316 returns: vector
8317 operations:
8318 - node: '[*parser.VectorSelector] node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"}'
8319 op: ""
8320 - node: '[*parser.AggregateExpr] sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"})'
8321 op: sum
8322 joins:
8323 - "on":
8324 - instance
8325 ignoring: []
8326 src:
8327 labels:
8328 kubernetes_role:
8329 reason: Query will only return series where these labels are present.
8330 kind: guaranteed
8331 fragment:
8332 start: 247
8333 end: 303
8334 role:
8335 reason: Query will only return series where these labels are present.
8336 kind: guaranteed
8337 fragment:
8338 start: 247
8339 end: 303
8340 deadinfo: null
8341 returns: vector
8342 operations:
8343 - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}'
8344 op: ""
8345 joins: []
8346 unless: []
8347 returninfo:
8348 logicalexpr: ""
8349 valueposition:
8350 start: 0
8351 end: 0
8352 returnednumber: 0
8353 alwaysreturns: false
8354 knownreturn: false
8355 isreturnbool: false
8356 position:
8357 start: 247
8358 end: 303
8359 type: selector
8360 fixedlabels: false
8361 isconditional: false
8362 op: 57395
8363 depth: 0
8364 unless: []
8365 returninfo:
8366 logicalexpr: ""
8367 valueposition:
8368 start: 0
8369 end: 0
8370 returnednumber: 0
8371 alwaysreturns: false
8372 knownreturn: false
8373 isreturnbool: false
8374 position:
8375 start: 132
8376 end: 201
8377 type: aggregation
8378 fixedlabels: true
8379 isconditional: false
8380 returninfo:
8381 logicalexpr: ""
8382 valueposition:
8383 start: 0
8384 end: 0
8385 returnednumber: 0
8386 alwaysreturns: false
8387 knownreturn: false
8388 isreturnbool: false
8389 position:
8390 start: 29
8391 end: 85
8392 type: aggregation
8393 fixedlabels: true
8394 isconditional: false
8395
8396---
8397
8398[TestLabelsSource/135 - 1]
8399expr: foo{a="1"} * on() bar{b="2"}
8400output:
8401 - labels:
8402 "":
8403 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
8404 kind: excluded
8405 fragment:
8406 start: 13
8407 end: 15
8408 a:
8409 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
8410 kind: excluded
8411 fragment:
8412 start: 13
8413 end: 15
8414 deadinfo: null
8415 returns: vector
8416 operations:
8417 - node: '[*parser.VectorSelector] foo{a="1"}'
8418 op: ""
8419 joins:
8420 - "on": []
8421 ignoring: []
8422 src:
8423 labels:
8424 b:
8425 reason: Query will only return series where these labels are present.
8426 kind: guaranteed
8427 fragment:
8428 start: 18
8429 end: 28
8430 deadinfo: null
8431 returns: vector
8432 operations:
8433 - node: '[*parser.VectorSelector] bar{b="2"}'
8434 op: ""
8435 joins: []
8436 unless: []
8437 returninfo:
8438 logicalexpr: ""
8439 valueposition:
8440 start: 0
8441 end: 0
8442 returnednumber: 0
8443 alwaysreturns: false
8444 knownreturn: false
8445 isreturnbool: false
8446 position:
8447 start: 18
8448 end: 28
8449 type: selector
8450 fixedlabels: false
8451 isconditional: false
8452 op: 57395
8453 depth: 0
8454 unless: []
8455 returninfo:
8456 logicalexpr: ""
8457 valueposition:
8458 start: 0
8459 end: 0
8460 returnednumber: 0
8461 alwaysreturns: false
8462 knownreturn: false
8463 isreturnbool: false
8464 position:
8465 start: 0
8466 end: 10
8467 type: selector
8468 fixedlabels: true
8469 isconditional: false
8470
8471---
8472
8473[TestLabelsSource/136 - 1]
8474expr: foo{a="1"} * on(instance) group_left(c,d) bar{b="2"}
8475output:
8476 - labels:
8477 a:
8478 reason: Query will only return series where these labels are present.
8479 kind: guaranteed
8480 fragment:
8481 start: 0
8482 end: 10
8483 c:
8484 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.
8485 kind: included
8486 fragment:
8487 start: 26
8488 end: 36
8489 d:
8490 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.
8491 kind: included
8492 fragment:
8493 start: 26
8494 end: 36
8495 instance:
8496 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8497 kind: included
8498 fragment:
8499 start: 13
8500 end: 15
8501 deadinfo: null
8502 returns: vector
8503 operations:
8504 - node: '[*parser.VectorSelector] foo{a="1"}'
8505 op: ""
8506 joins:
8507 - "on":
8508 - instance
8509 ignoring: []
8510 src:
8511 labels:
8512 b:
8513 reason: Query will only return series where these labels are present.
8514 kind: guaranteed
8515 fragment:
8516 start: 42
8517 end: 52
8518 deadinfo: null
8519 returns: vector
8520 operations:
8521 - node: '[*parser.VectorSelector] bar{b="2"}'
8522 op: ""
8523 joins: []
8524 unless: []
8525 returninfo:
8526 logicalexpr: ""
8527 valueposition:
8528 start: 0
8529 end: 0
8530 returnednumber: 0
8531 alwaysreturns: false
8532 knownreturn: false
8533 isreturnbool: false
8534 position:
8535 start: 42
8536 end: 52
8537 type: selector
8538 fixedlabels: false
8539 isconditional: false
8540 op: 57395
8541 depth: 0
8542 unless: []
8543 returninfo:
8544 logicalexpr: ""
8545 valueposition:
8546 start: 0
8547 end: 0
8548 returnednumber: 0
8549 alwaysreturns: false
8550 knownreturn: false
8551 isreturnbool: false
8552 position:
8553 start: 0
8554 end: 10
8555 type: selector
8556 fixedlabels: false
8557 isconditional: false
8558
8559---
8560
8561[TestLabelsSource/137 - 1]
8562expr: foo{a="1"} * on(instance) group_right(c,d) bar{b="2"}
8563output:
8564 - labels:
8565 b:
8566 reason: Query will only return series where these labels are present.
8567 kind: guaranteed
8568 fragment:
8569 start: 43
8570 end: 53
8571 c:
8572 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.
8573 kind: included
8574 fragment:
8575 start: 26
8576 end: 37
8577 d:
8578 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.
8579 kind: included
8580 fragment:
8581 start: 26
8582 end: 37
8583 instance:
8584 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8585 kind: included
8586 fragment:
8587 start: 13
8588 end: 15
8589 deadinfo: null
8590 returns: vector
8591 operations:
8592 - node: '[*parser.VectorSelector] bar{b="2"}'
8593 op: ""
8594 joins:
8595 - "on":
8596 - instance
8597 ignoring: []
8598 src:
8599 labels:
8600 a:
8601 reason: Query will only return series where these labels are present.
8602 kind: guaranteed
8603 fragment:
8604 start: 0
8605 end: 10
8606 deadinfo: null
8607 returns: vector
8608 operations:
8609 - node: '[*parser.VectorSelector] foo{a="1"}'
8610 op: ""
8611 joins: []
8612 unless: []
8613 returninfo:
8614 logicalexpr: ""
8615 valueposition:
8616 start: 0
8617 end: 0
8618 returnednumber: 0
8619 alwaysreturns: false
8620 knownreturn: false
8621 isreturnbool: false
8622 position:
8623 start: 0
8624 end: 10
8625 type: selector
8626 fixedlabels: false
8627 isconditional: false
8628 op: 57395
8629 depth: 0
8630 unless: []
8631 returninfo:
8632 logicalexpr: ""
8633 valueposition:
8634 start: 0
8635 end: 0
8636 returnednumber: 0
8637 alwaysreturns: false
8638 knownreturn: false
8639 isreturnbool: false
8640 position:
8641 start: 43
8642 end: 53
8643 type: selector
8644 fixedlabels: false
8645 isconditional: false
8646
8647---
8648
8649[TestLabelsSource/138 - 1]
8650expr: foo{a="1"} * on(instance) sum(bar{b="2"})
8651output:
8652 - labels:
8653 "":
8654 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
8655 kind: excluded
8656 fragment:
8657 start: 13
8658 end: 15
8659 a:
8660 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
8661 kind: excluded
8662 fragment:
8663 start: 13
8664 end: 15
8665 instance:
8666 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
8667 kind: included
8668 fragment:
8669 start: 13
8670 end: 15
8671 deadinfo: null
8672 returns: vector
8673 operations:
8674 - node: '[*parser.VectorSelector] foo{a="1"}'
8675 op: ""
8676 joins:
8677 - "on":
8678 - instance
8679 ignoring: []
8680 src:
8681 labels:
8682 "":
8683 reason: Query is using aggregation that removes all labels.
8684 kind: excluded
8685 fragment:
8686 start: 26
8687 end: 29
8688 __name__:
8689 reason: Aggregation removes metric name.
8690 kind: excluded
8691 fragment:
8692 start: 26
8693 end: 41
8694 b:
8695 reason: Query is using aggregation that removes all labels.
8696 kind: excluded
8697 fragment:
8698 start: 26
8699 end: 29
8700 deadinfo:
8701 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.
8702 fragment:
8703 start: 26
8704 end: 29
8705 returns: vector
8706 operations:
8707 - node: '[*parser.VectorSelector] bar{b="2"}'
8708 op: ""
8709 - node: '[*parser.AggregateExpr] sum(bar{b="2"})'
8710 op: sum
8711 joins: []
8712 unless: []
8713 returninfo:
8714 logicalexpr: ""
8715 valueposition:
8716 start: 0
8717 end: 0
8718 returnednumber: 0
8719 alwaysreturns: false
8720 knownreturn: false
8721 isreturnbool: false
8722 position:
8723 start: 30
8724 end: 40
8725 type: aggregation
8726 fixedlabels: true
8727 isconditional: false
8728 op: 57395
8729 depth: 0
8730 unless: []
8731 returninfo:
8732 logicalexpr: ""
8733 valueposition:
8734 start: 0
8735 end: 0
8736 returnednumber: 0
8737 alwaysreturns: false
8738 knownreturn: false
8739 isreturnbool: false
8740 position:
8741 start: 0
8742 end: 10
8743 type: selector
8744 fixedlabels: true
8745 isconditional: false
8746
8747---
8748
8749[TestLabelsSource/139 - 1]
8750expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"})
8751output:
8752 - labels:
8753 a:
8754 reason: Query will only return series where these labels are present.
8755 kind: guaranteed
8756 fragment:
8757 start: 0
8758 end: 10
8759 c:
8760 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.
8761 kind: included
8762 fragment:
8763 start: 26
8764 end: 36
8765 d:
8766 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.
8767 kind: included
8768 fragment:
8769 start: 26
8770 end: 36
8771 instance:
8772 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8773 kind: included
8774 fragment:
8775 start: 13
8776 end: 15
8777 deadinfo: null
8778 returns: vector
8779 operations:
8780 - node: '[*parser.VectorSelector] foo{a="1"}'
8781 op: ""
8782 joins:
8783 - "on":
8784 - instance
8785 ignoring: []
8786 src:
8787 labels:
8788 "":
8789 reason: Query is using aggregation that removes all labels.
8790 kind: excluded
8791 fragment:
8792 start: 42
8793 end: 45
8794 __name__:
8795 reason: Aggregation removes metric name.
8796 kind: excluded
8797 fragment:
8798 start: 42
8799 end: 57
8800 b:
8801 reason: Query is using aggregation that removes all labels.
8802 kind: excluded
8803 fragment:
8804 start: 42
8805 end: 45
8806 deadinfo:
8807 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.
8808 fragment:
8809 start: 42
8810 end: 45
8811 returns: vector
8812 operations:
8813 - node: '[*parser.VectorSelector] bar{b="2"}'
8814 op: ""
8815 - node: '[*parser.AggregateExpr] sum(bar{b="2"})'
8816 op: sum
8817 joins: []
8818 unless: []
8819 returninfo:
8820 logicalexpr: ""
8821 valueposition:
8822 start: 0
8823 end: 0
8824 returnednumber: 0
8825 alwaysreturns: false
8826 knownreturn: false
8827 isreturnbool: false
8828 position:
8829 start: 46
8830 end: 56
8831 type: aggregation
8832 fixedlabels: true
8833 isconditional: false
8834 op: 57395
8835 depth: 0
8836 unless: []
8837 returninfo:
8838 logicalexpr: ""
8839 valueposition:
8840 start: 0
8841 end: 0
8842 returnednumber: 0
8843 alwaysreturns: false
8844 knownreturn: false
8845 isreturnbool: false
8846 position:
8847 start: 0
8848 end: 10
8849 type: selector
8850 fixedlabels: false
8851 isconditional: false
8852
8853---
8854
8855[TestLabelsSource/140 - 1]
8856expr: sum(foo{a="1"}) * on(instance) group_right(c,d) bar{b="2"}
8857output:
8858 - labels:
8859 b:
8860 reason: Query will only return series where these labels are present.
8861 kind: guaranteed
8862 fragment:
8863 start: 48
8864 end: 58
8865 c:
8866 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.
8867 kind: included
8868 fragment:
8869 start: 31
8870 end: 42
8871 d:
8872 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.
8873 kind: included
8874 fragment:
8875 start: 31
8876 end: 42
8877 instance:
8878 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8879 kind: included
8880 fragment:
8881 start: 18
8882 end: 20
8883 deadinfo: null
8884 returns: vector
8885 operations:
8886 - node: '[*parser.VectorSelector] bar{b="2"}'
8887 op: ""
8888 joins:
8889 - "on":
8890 - instance
8891 ignoring: []
8892 src:
8893 labels:
8894 "":
8895 reason: Query is using aggregation that removes all labels.
8896 kind: excluded
8897 fragment:
8898 start: 0
8899 end: 3
8900 __name__:
8901 reason: Aggregation removes metric name.
8902 kind: excluded
8903 fragment:
8904 start: 0
8905 end: 15
8906 a:
8907 reason: Query is using aggregation that removes all labels.
8908 kind: excluded
8909 fragment:
8910 start: 0
8911 end: 3
8912 deadinfo:
8913 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.
8914 fragment:
8915 start: 0
8916 end: 3
8917 returns: vector
8918 operations:
8919 - node: '[*parser.VectorSelector] foo{a="1"}'
8920 op: ""
8921 - node: '[*parser.AggregateExpr] sum(foo{a="1"})'
8922 op: sum
8923 joins: []
8924 unless: []
8925 returninfo:
8926 logicalexpr: ""
8927 valueposition:
8928 start: 0
8929 end: 0
8930 returnednumber: 0
8931 alwaysreturns: false
8932 knownreturn: false
8933 isreturnbool: false
8934 position:
8935 start: 4
8936 end: 14
8937 type: aggregation
8938 fixedlabels: true
8939 isconditional: false
8940 op: 57395
8941 depth: 0
8942 unless: []
8943 returninfo:
8944 logicalexpr: ""
8945 valueposition:
8946 start: 0
8947 end: 0
8948 returnednumber: 0
8949 alwaysreturns: false
8950 knownreturn: false
8951 isreturnbool: false
8952 position:
8953 start: 48
8954 end: 58
8955 type: selector
8956 fixedlabels: false
8957 isconditional: false
8958
8959---
8960
8961[TestLabelsSource/141 - 1]
8962expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"}) without(instance)
8963output:
8964 - labels:
8965 a:
8966 reason: Query will only return series where these labels are present.
8967 kind: guaranteed
8968 fragment:
8969 start: 0
8970 end: 10
8971 c:
8972 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.
8973 kind: included
8974 fragment:
8975 start: 26
8976 end: 36
8977 d:
8978 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.
8979 kind: included
8980 fragment:
8981 start: 26
8982 end: 36
8983 instance:
8984 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
8985 kind: included
8986 fragment:
8987 start: 13
8988 end: 15
8989 deadinfo: null
8990 returns: vector
8991 operations:
8992 - node: '[*parser.VectorSelector] foo{a="1"}'
8993 op: ""
8994 joins:
8995 - "on":
8996 - instance
8997 ignoring: []
8998 src:
8999 labels:
9000 __name__:
9001 reason: Aggregation removes metric name.
9002 kind: excluded
9003 fragment:
9004 start: 42
9005 end: 75
9006 b:
9007 reason: Query will only return series where these labels are present.
9008 kind: guaranteed
9009 fragment:
9010 start: 46
9011 end: 56
9012 instance:
9013 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
9014 kind: excluded
9015 fragment:
9016 start: 58
9017 end: 65
9018 deadinfo:
9019 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.
9020 fragment:
9021 start: 58
9022 end: 65
9023 returns: vector
9024 operations:
9025 - node: '[*parser.VectorSelector] bar{b="2"}'
9026 op: ""
9027 - node: '[*parser.AggregateExpr] sum without (instance) (bar{b="2"})'
9028 op: sum
9029 joins: []
9030 unless: []
9031 returninfo:
9032 logicalexpr: ""
9033 valueposition:
9034 start: 0
9035 end: 0
9036 returnednumber: 0
9037 alwaysreturns: false
9038 knownreturn: false
9039 isreturnbool: false
9040 position:
9041 start: 46
9042 end: 56
9043 type: aggregation
9044 fixedlabels: false
9045 isconditional: false
9046 op: 57395
9047 depth: 0
9048 unless: []
9049 returninfo:
9050 logicalexpr: ""
9051 valueposition:
9052 start: 0
9053 end: 0
9054 returnednumber: 0
9055 alwaysreturns: false
9056 knownreturn: false
9057 isreturnbool: false
9058 position:
9059 start: 0
9060 end: 10
9061 type: selector
9062 fixedlabels: false
9063 isconditional: false
9064
9065---
9066
9067[TestLabelsSource/142 - 1]
9068expr: sum(foo{a="1"}) without(instance) * on(instance) group_right(c,d) bar{b="2"}
9069output:
9070 - labels:
9071 b:
9072 reason: Query will only return series where these labels are present.
9073 kind: guaranteed
9074 fragment:
9075 start: 66
9076 end: 76
9077 c:
9078 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.
9079 kind: included
9080 fragment:
9081 start: 49
9082 end: 60
9083 d:
9084 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.
9085 kind: included
9086 fragment:
9087 start: 49
9088 end: 60
9089 instance:
9090 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
9091 kind: included
9092 fragment:
9093 start: 36
9094 end: 38
9095 deadinfo: null
9096 returns: vector
9097 operations:
9098 - node: '[*parser.VectorSelector] bar{b="2"}'
9099 op: ""
9100 joins:
9101 - "on":
9102 - instance
9103 ignoring: []
9104 src:
9105 labels:
9106 __name__:
9107 reason: Aggregation removes metric name.
9108 kind: excluded
9109 fragment:
9110 start: 0
9111 end: 33
9112 a:
9113 reason: Query will only return series where these labels are present.
9114 kind: guaranteed
9115 fragment:
9116 start: 4
9117 end: 14
9118 instance:
9119 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
9120 kind: excluded
9121 fragment:
9122 start: 16
9123 end: 23
9124 deadinfo:
9125 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.
9126 fragment:
9127 start: 16
9128 end: 23
9129 returns: vector
9130 operations:
9131 - node: '[*parser.VectorSelector] foo{a="1"}'
9132 op: ""
9133 - node: '[*parser.AggregateExpr] sum without (instance) (foo{a="1"})'
9134 op: sum
9135 joins: []
9136 unless: []
9137 returninfo:
9138 logicalexpr: ""
9139 valueposition:
9140 start: 0
9141 end: 0
9142 returnednumber: 0
9143 alwaysreturns: false
9144 knownreturn: false
9145 isreturnbool: false
9146 position:
9147 start: 4
9148 end: 14
9149 type: aggregation
9150 fixedlabels: false
9151 isconditional: false
9152 op: 57395
9153 depth: 0
9154 unless: []
9155 returninfo:
9156 logicalexpr: ""
9157 valueposition:
9158 start: 0
9159 end: 0
9160 returnednumber: 0
9161 alwaysreturns: false
9162 knownreturn: false
9163 isreturnbool: false
9164 position:
9165 start: 66
9166 end: 76
9167 type: selector
9168 fixedlabels: false
9169 isconditional: false
9170
9171---
9172
9173[TestLabelsSource/143 - 1]
9174expr: |4
9175 max without (source_instance) (
9176 increase(kernel_device_io_errors_total{device!~"loop.+"}[120m]) > 3 unless on(instance, device) (
9177 increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[125m])*2 > increase(kernel_device_io_errors_total[120m])
9178 )
9179 and on(device, instance) absent(node_disk_info)
9180 ) * on(instance) group_left(group) label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)")
9181output:
9182 - labels:
9183 __name__:
9184 reason: Aggregation removes metric name.
9185 kind: excluded
9186 fragment:
9187 start: 2
9188 end: 317
9189 device:
9190 reason: Query is using many-to-many vector matching with `on(device, instance)`, labels included inside `on(...)` will be present on the results.
9191 kind: included
9192 fragment:
9193 start: 112
9194 end: 114
9195 group:
9196 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.
9197 kind: included
9198 fragment:
9199 start: 333
9200 end: 343
9201 instance:
9202 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
9203 kind: included
9204 fragment:
9205 start: 112
9206 end: 114
9207 source_instance:
9208 reason: Query is using aggregation with `without(source_instance)`, all labels included inside `without(...)` will be removed from the results.
9209 kind: excluded
9210 fragment:
9211 start: 6
9212 end: 14
9213 deadinfo: null
9214 returns: vector
9215 operations:
9216 - node: '[*parser.VectorSelector] kernel_device_io_errors_total{device!~"loop.+"}'
9217 op: ""
9218 - node: '[*parser.Call] increase(kernel_device_io_errors_total{device!~"loop.+"}[2h])'
9219 op: increase
9220 - 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))'
9221 op: max
9222 joins:
9223 - "on":
9224 - device
9225 - instance
9226 ignoring: []
9227 src:
9228 labels:
9229 "":
9230 reason: |-
9231 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.
9232 You will only get any results back if the metric selector you pass doesn't match anything.
9233 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
9234 This means that the only labels you can get back from absent call are the ones you pass to it.
9235 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.
9236 kind: excluded
9237 fragment:
9238 start: 292
9239 end: 298
9240 deadinfo:
9241 reason: |-
9242 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.
9243 You will only get any results back if the metric selector you pass doesn't match anything.
9244 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
9245 This means that the only labels you can get back from absent call are the ones you pass to it.
9246 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.
9247 fragment:
9248 start: 292
9249 end: 298
9250 returns: vector
9251 operations:
9252 - node: '[*parser.VectorSelector] node_disk_info'
9253 op: ""
9254 - node: '[*parser.Call] absent(node_disk_info)'
9255 op: absent
9256 joins: []
9257 unless: []
9258 returninfo:
9259 logicalexpr: ""
9260 valueposition:
9261 start: 0
9262 end: 0
9263 returnednumber: 0
9264 alwaysreturns: false
9265 knownreturn: false
9266 isreturnbool: false
9267 position:
9268 start: 299
9269 end: 313
9270 type: function
9271 fixedlabels: true
9272 isconditional: false
9273 op: 57389
9274 depth: 1
9275 - "on":
9276 - instance
9277 ignoring: []
9278 src:
9279 labels:
9280 instance:
9281 reason: This label will be added to the result by label_replace() call.
9282 kind: guaranteed
9283 fragment:
9284 start: 351
9285 end: 442
9286 deadinfo: null
9287 returns: vector
9288 operations:
9289 - node: '[*parser.VectorSelector] salt_highstate_runner_configured_minions'
9290 op: ""
9291 - node: '[*parser.Call] label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)")'
9292 op: label_replace
9293 joins: []
9294 unless: []
9295 returninfo:
9296 logicalexpr: ""
9297 valueposition:
9298 start: 0
9299 end: 0
9300 returnednumber: 0
9301 alwaysreturns: false
9302 knownreturn: false
9303 isreturnbool: false
9304 position:
9305 start: 365
9306 end: 405
9307 type: function
9308 fixedlabels: false
9309 isconditional: false
9310 op: 57395
9311 depth: 0
9312 unless:
9313 - "on":
9314 - instance
9315 - device
9316 ignoring: []
9317 src:
9318 labels: {}
9319 deadinfo: null
9320 returns: vector
9321 operations:
9322 - node: '[*parser.VectorSelector] kernel_device_io_soft_errors_total{device!~"loop.+"}'
9323 op: ""
9324 - node: '[*parser.Call] increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[2h5m])'
9325 op: increase
9326 joins:
9327 - "on": []
9328 ignoring: []
9329 src:
9330 labels: {}
9331 deadinfo: null
9332 returns: vector
9333 operations:
9334 - node: '[*parser.VectorSelector] kernel_device_io_errors_total'
9335 op: ""
9336 - node: '[*parser.Call] increase(kernel_device_io_errors_total[2h])'
9337 op: increase
9338 joins: []
9339 unless: []
9340 returninfo:
9341 logicalexpr: ""
9342 valueposition:
9343 start: 0
9344 end: 0
9345 returnednumber: 0
9346 alwaysreturns: false
9347 knownreturn: false
9348 isreturnbool: false
9349 position:
9350 start: 222
9351 end: 257
9352 type: function
9353 fixedlabels: false
9354 isconditional: false
9355 op: 57388
9356 depth: 0
9357 unless: []
9358 returninfo:
9359 logicalexpr: ""
9360 valueposition:
9361 start: 0
9362 end: 0
9363 returnednumber: 0
9364 alwaysreturns: false
9365 knownreturn: false
9366 isreturnbool: false
9367 position:
9368 start: 149
9369 end: 207
9370 type: function
9371 fixedlabels: false
9372 isconditional: true
9373 returninfo:
9374 logicalexpr: ""
9375 valueposition:
9376 start: 0
9377 end: 0
9378 returnednumber: 0
9379 alwaysreturns: false
9380 knownreturn: false
9381 isreturnbool: false
9382 position:
9383 start: 46
9384 end: 99
9385 type: aggregation
9386 fixedlabels: false
9387 isconditional: true
9388
9389---
9390
9391[TestLabelsSource/144 - 1]
9392expr: sum(foo{a="1"}) by(job) * on() bar{b="2"}
9393output:
9394 - labels:
9395 "":
9396 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
9397 kind: excluded
9398 fragment:
9399 start: 26
9400 end: 28
9401 __name__:
9402 reason: Aggregation removes metric name.
9403 kind: excluded
9404 fragment:
9405 start: 0
9406 end: 23
9407 a:
9408 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
9409 kind: excluded
9410 fragment:
9411 start: 16
9412 end: 18
9413 job:
9414 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
9415 kind: excluded
9416 fragment:
9417 start: 26
9418 end: 28
9419 deadinfo: null
9420 returns: vector
9421 operations:
9422 - node: '[*parser.VectorSelector] foo{a="1"}'
9423 op: ""
9424 - node: '[*parser.AggregateExpr] sum by (job) (foo{a="1"})'
9425 op: sum
9426 joins:
9427 - "on": []
9428 ignoring: []
9429 src:
9430 labels:
9431 b:
9432 reason: Query will only return series where these labels are present.
9433 kind: guaranteed
9434 fragment:
9435 start: 31
9436 end: 41
9437 deadinfo: null
9438 returns: vector
9439 operations:
9440 - node: '[*parser.VectorSelector] bar{b="2"}'
9441 op: ""
9442 joins: []
9443 unless: []
9444 returninfo:
9445 logicalexpr: ""
9446 valueposition:
9447 start: 0
9448 end: 0
9449 returnednumber: 0
9450 alwaysreturns: false
9451 knownreturn: false
9452 isreturnbool: false
9453 position:
9454 start: 31
9455 end: 41
9456 type: selector
9457 fixedlabels: false
9458 isconditional: false
9459 op: 57395
9460 depth: 0
9461 unless: []
9462 returninfo:
9463 logicalexpr: ""
9464 valueposition:
9465 start: 0
9466 end: 0
9467 returnednumber: 0
9468 alwaysreturns: false
9469 knownreturn: false
9470 isreturnbool: false
9471 position:
9472 start: 4
9473 end: 14
9474 type: aggregation
9475 fixedlabels: true
9476 isconditional: false
9477
9478---
9479
9480[TestLabelsSource/145 - 1]
9481expr: sum(sum(foo) without(job)) by(job)
9482output:
9483 - labels:
9484 "":
9485 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
9486 kind: excluded
9487 fragment:
9488 start: 27
9489 end: 29
9490 __name__:
9491 reason: Aggregation removes metric name.
9492 kind: excluded
9493 fragment:
9494 start: 0
9495 end: 34
9496 job:
9497 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
9498 kind: excluded
9499 fragment:
9500 start: 13
9501 end: 20
9502 deadinfo: null
9503 returns: vector
9504 operations:
9505 - node: '[*parser.VectorSelector] foo'
9506 op: ""
9507 - node: '[*parser.AggregateExpr] sum without (job) (foo)'
9508 op: sum
9509 - node: '[*parser.AggregateExpr] sum by (job) (sum without (job) (foo))'
9510 op: sum
9511 joins: []
9512 unless: []
9513 returninfo:
9514 logicalexpr: ""
9515 valueposition:
9516 start: 0
9517 end: 0
9518 returnednumber: 0
9519 alwaysreturns: false
9520 knownreturn: false
9521 isreturnbool: false
9522 position:
9523 start: 8
9524 end: 11
9525 type: aggregation
9526 fixedlabels: true
9527 isconditional: false
9528
9529---
9530
9531[TestLabelsSource/146 - 1]
9532expr: |4
9533 prometheus:scrape_series_added:since_gc:sum
9534 * on(prometheus) group_left()
9535 label_replace(
9536 max(max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])) by(instance)
9537 /
9538 max(max_over_time(prometheus_tsdb_head_series[2h])) by(instance),
9539 "prometheus", "$1",
9540 "instance", "(.+)"
9541 )
9542output:
9543 - labels:
9544 prometheus:
9545 reason: Query is using many-to-one vector matching with `on(prometheus)`, labels included inside `on(...)` will be present on the results.
9546 kind: included
9547 fragment:
9548 start: 47
9549 end: 49
9550 deadinfo: null
9551 returns: vector
9552 operations:
9553 - node: '[*parser.VectorSelector] prometheus:scrape_series_added:since_gc:sum'
9554 op: ""
9555 joins:
9556 - "on":
9557 - prometheus
9558 ignoring: []
9559 src:
9560 labels:
9561 "":
9562 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9563 kind: excluded
9564 fragment:
9565 start: 158
9566 end: 160
9567 __name__:
9568 reason: Aggregation removes metric name.
9569 kind: excluded
9570 fragment:
9571 start: 92
9572 end: 170
9573 instance:
9574 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9575 kind: included
9576 fragment:
9577 start: 158
9578 end: 160
9579 job:
9580 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9581 kind: excluded
9582 fragment:
9583 start: 158
9584 end: 160
9585 prometheus:
9586 reason: This label will be added to the result by label_replace() call.
9587 kind: guaranteed
9588 fragment:
9589 start: 75
9590 end: 287
9591 deadinfo: null
9592 returns: vector
9593 operations:
9594 - node: '[*parser.VectorSelector] go_memstats_alloc_bytes{job="prometheus"}'
9595 op: ""
9596 - node: '[*parser.Call] max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])'
9597 op: max_over_time
9598 - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h]))'
9599 op: max
9600 - 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", "(.+)")'
9601 op: label_replace
9602 joins:
9603 - "on": []
9604 ignoring: []
9605 src:
9606 labels:
9607 "":
9608 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9609 kind: excluded
9610 fragment:
9611 start: 229
9612 end: 231
9613 __name__:
9614 reason: Aggregation removes metric name.
9615 kind: excluded
9616 fragment:
9617 start: 177
9618 end: 241
9619 instance:
9620 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9621 kind: included
9622 fragment:
9623 start: 229
9624 end: 231
9625 deadinfo: null
9626 returns: vector
9627 operations:
9628 - node: '[*parser.VectorSelector] prometheus_tsdb_head_series'
9629 op: ""
9630 - node: '[*parser.Call] max_over_time(prometheus_tsdb_head_series[2h])'
9631 op: max_over_time
9632 - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(prometheus_tsdb_head_series[2h]))'
9633 op: max
9634 joins: []
9635 unless: []
9636 returninfo:
9637 logicalexpr: ""
9638 valueposition:
9639 start: 0
9640 end: 0
9641 returnednumber: 0
9642 alwaysreturns: false
9643 knownreturn: false
9644 isreturnbool: false
9645 position:
9646 start: 195
9647 end: 226
9648 type: aggregation
9649 fixedlabels: true
9650 isconditional: false
9651 op: 57384
9652 depth: 0
9653 unless: []
9654 returninfo:
9655 logicalexpr: ""
9656 valueposition:
9657 start: 0
9658 end: 0
9659 returnednumber: 0
9660 alwaysreturns: false
9661 knownreturn: false
9662 isreturnbool: false
9663 position:
9664 start: 92
9665 end: 241
9666 type: function
9667 fixedlabels: true
9668 isconditional: false
9669 op: 57395
9670 depth: 0
9671 unless: []
9672 returninfo:
9673 logicalexpr: ""
9674 valueposition:
9675 start: 0
9676 end: 0
9677 returnednumber: 0
9678 alwaysreturns: false
9679 knownreturn: false
9680 isreturnbool: false
9681 position:
9682 start: 1
9683 end: 44
9684 type: selector
9685 fixedlabels: false
9686 isconditional: false
9687
9688---
9689
9690[TestLabelsSource/147 - 1]
9691expr: (day_of_week() == 6 and hour() < 1) or vector(1)
9692output:
9693 - labels:
9694 "":
9695 reason: Calling `day_of_week()` with no arguments will return an empty time series with no labels.
9696 kind: excluded
9697 fragment:
9698 start: 1
9699 end: 14
9700 deadinfo: null
9701 returns: vector
9702 operations:
9703 - node: '[*parser.Call] day_of_week()'
9704 op: day_of_week
9705 joins:
9706 - "on": []
9707 ignoring: []
9708 src:
9709 labels:
9710 "":
9711 reason: Calling `hour()` with no arguments will return an empty time series with no labels.
9712 kind: excluded
9713 fragment:
9714 start: 24
9715 end: 30
9716 deadinfo: null
9717 returns: vector
9718 operations:
9719 - node: '[*parser.Call] hour()'
9720 op: hour
9721 joins: []
9722 unless: []
9723 returninfo:
9724 logicalexpr: ""
9725 valueposition:
9726 start: 0
9727 end: 0
9728 returnednumber: 0
9729 alwaysreturns: true
9730 knownreturn: false
9731 isreturnbool: false
9732 position:
9733 start: 24
9734 end: 30
9735 type: function
9736 fixedlabels: true
9737 isconditional: true
9738 op: 57389
9739 depth: 0
9740 unless: []
9741 returninfo:
9742 logicalexpr: ""
9743 valueposition:
9744 start: 0
9745 end: 0
9746 returnednumber: 0
9747 alwaysreturns: true
9748 knownreturn: false
9749 isreturnbool: false
9750 position:
9751 start: 1
9752 end: 14
9753 type: function
9754 fixedlabels: true
9755 isconditional: true
9756 - labels:
9757 "":
9758 reason: Calling `vector()` will return a vector value with no labels.
9759 kind: excluded
9760 fragment:
9761 start: 39
9762 end: 45
9763 deadinfo: null
9764 returns: vector
9765 operations:
9766 - node: '[*parser.Call] vector(1)'
9767 op: vector
9768 joins: []
9769 unless: []
9770 returninfo:
9771 logicalexpr: ""
9772 valueposition:
9773 start: 39
9774 end: 48
9775 returnednumber: 1
9776 alwaysreturns: true
9777 knownreturn: true
9778 isreturnbool: false
9779 position:
9780 start: 39
9781 end: 48
9782 type: function
9783 fixedlabels: true
9784 isconditional: false
9785
9786---
9787
9788[TestLabelsSource/148 - 1]
9789expr: |4-
9790 sum by (foo, bar) (
9791 rate(errors_total[5m])
9792 * on (instance) group_left (bob, alice)
9793 server_errors_total
9794 )
9795output:
9796 - labels:
9797 "":
9798 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9799 kind: excluded
9800 fragment:
9801 start: 5
9802 end: 8
9803 __name__:
9804 reason: Aggregation removes metric name.
9805 kind: excluded
9806 fragment:
9807 start: 1
9808 end: 115
9809 alice:
9810 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9811 kind: excluded
9812 fragment:
9813 start: 5
9814 end: 8
9815 bar:
9816 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9817 kind: included
9818 fragment:
9819 start: 5
9820 end: 8
9821 bob:
9822 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9823 kind: excluded
9824 fragment:
9825 start: 5
9826 end: 8
9827 foo:
9828 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9829 kind: included
9830 fragment:
9831 start: 5
9832 end: 8
9833 instance:
9834 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
9835 kind: excluded
9836 fragment:
9837 start: 5
9838 end: 8
9839 deadinfo: null
9840 returns: vector
9841 operations:
9842 - node: '[*parser.VectorSelector] errors_total'
9843 op: ""
9844 - node: '[*parser.Call] rate(errors_total[5m])'
9845 op: rate
9846 - node: '[*parser.AggregateExpr] sum by (foo, bar) (rate(errors_total[5m]) * on (instance) group_left (bob, alice) server_errors_total)'
9847 op: sum
9848 joins:
9849 - "on":
9850 - instance
9851 ignoring: []
9852 src:
9853 labels: {}
9854 deadinfo: null
9855 returns: vector
9856 operations:
9857 - node: '[*parser.VectorSelector] server_errors_total'
9858 op: ""
9859 joins: []
9860 unless: []
9861 returninfo:
9862 logicalexpr: ""
9863 valueposition:
9864 start: 0
9865 end: 0
9866 returnednumber: 0
9867 alwaysreturns: false
9868 knownreturn: false
9869 isreturnbool: false
9870 position:
9871 start: 94
9872 end: 113
9873 type: selector
9874 fixedlabels: false
9875 isconditional: false
9876 op: 57395
9877 depth: 1
9878 unless: []
9879 returninfo:
9880 logicalexpr: ""
9881 valueposition:
9882 start: 0
9883 end: 0
9884 returnednumber: 0
9885 alwaysreturns: false
9886 knownreturn: false
9887 isreturnbool: false
9888 position:
9889 start: 30
9890 end: 46
9891 type: aggregation
9892 fixedlabels: true
9893 isconditional: false
9894
9895---
9896
9897[TestLabelsSource/149 - 1]
9898expr: 1 - (foo or vector(0)) < 0.999
9899output:
9900 - labels: {}
9901 deadinfo: null
9902 returns: vector
9903 operations:
9904 - node: '[*parser.VectorSelector] foo'
9905 op: ""
9906 joins: []
9907 unless: []
9908 returninfo:
9909 logicalexpr: ""
9910 valueposition:
9911 start: 0
9912 end: 0
9913 returnednumber: 0
9914 alwaysreturns: false
9915 knownreturn: false
9916 isreturnbool: false
9917 position:
9918 start: 5
9919 end: 8
9920 type: selector
9921 fixedlabels: false
9922 isconditional: true
9923 - labels:
9924 "":
9925 reason: Calling `vector()` will return a vector value with no labels.
9926 kind: excluded
9927 fragment:
9928 start: 12
9929 end: 18
9930 deadinfo:
9931 reason: '`1 - vector(0) < 0.999` always evaluates to `1 < 0.999` which is not possible, so it will never return anything.'
9932 fragment:
9933 start: 12
9934 end: 21
9935 returns: vector
9936 operations:
9937 - node: '[*parser.Call] vector(0)'
9938 op: vector
9939 joins: []
9940 unless: []
9941 returninfo:
9942 logicalexpr: 1 - vector(0)
9943 valueposition:
9944 start: 0
9945 end: 1
9946 returnednumber: 1
9947 alwaysreturns: true
9948 knownreturn: true
9949 isreturnbool: false
9950 position:
9951 start: 12
9952 end: 21
9953 type: function
9954 fixedlabels: true
9955 isconditional: true
9956
9957---
9958
9959[TestLabelsSource/150 - 1]
9960expr: |4
9961 (
9962 vector(1) and month() == 2
9963 ) or vector(0)
9964output:
9965 - labels:
9966 "":
9967 reason: Calling `vector()` will return a vector value with no labels.
9968 kind: excluded
9969 fragment:
9970 start: 5
9971 end: 11
9972 deadinfo: null
9973 returns: vector
9974 operations:
9975 - node: '[*parser.Call] vector(1)'
9976 op: vector
9977 joins:
9978 - "on": []
9979 ignoring: []
9980 src:
9981 labels:
9982 "":
9983 reason: Calling `month()` with no arguments will return an empty time series with no labels.
9984 kind: excluded
9985 fragment:
9986 start: 19
9987 end: 26
9988 deadinfo: null
9989 returns: vector
9990 operations:
9991 - node: '[*parser.Call] month()'
9992 op: month
9993 joins: []
9994 unless: []
9995 returninfo:
9996 logicalexpr: ""
9997 valueposition:
9998 start: 0
9999 end: 0
10000 returnednumber: 0
10001 alwaysreturns: true
10002 knownreturn: false
10003 isreturnbool: false
10004 position:
10005 start: 19
10006 end: 26
10007 type: function
10008 fixedlabels: true
10009 isconditional: true
10010 op: 57389
10011 depth: 0
10012 unless: []
10013 returninfo:
10014 logicalexpr: ""
10015 valueposition:
10016 start: 5
10017 end: 14
10018 returnednumber: 1
10019 alwaysreturns: true
10020 knownreturn: true
10021 isreturnbool: false
10022 position:
10023 start: 5
10024 end: 14
10025 type: function
10026 fixedlabels: true
10027 isconditional: true
10028 - labels:
10029 "":
10030 reason: Calling `vector()` will return a vector value with no labels.
10031 kind: excluded
10032 fragment:
10033 start: 37
10034 end: 43
10035 deadinfo: null
10036 returns: vector
10037 operations:
10038 - node: '[*parser.Call] vector(0)'
10039 op: vector
10040 joins: []
10041 unless: []
10042 returninfo:
10043 logicalexpr: ""
10044 valueposition:
10045 start: 37
10046 end: 46
10047 returnednumber: 0
10048 alwaysreturns: true
10049 knownreturn: true
10050 isreturnbool: false
10051 position:
10052 start: 37
10053 end: 46
10054 type: function
10055 fixedlabels: true
10056 isconditional: false
10057
10058---
10059
10060[TestLabelsSource/151 - 1]
10061expr: count by (region) (stddev by (colo_name, region) (error_total))
10062output:
10063 - labels:
10064 "":
10065 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
10066 kind: excluded
10067 fragment:
10068 start: 6
10069 end: 9
10070 __name__:
10071 reason: Aggregation removes metric name.
10072 kind: excluded
10073 fragment:
10074 start: 0
10075 end: 63
10076 colo_name:
10077 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
10078 kind: excluded
10079 fragment:
10080 start: 6
10081 end: 9
10082 region:
10083 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
10084 kind: included
10085 fragment:
10086 start: 6
10087 end: 9
10088 deadinfo: null
10089 returns: vector
10090 operations:
10091 - node: '[*parser.VectorSelector] error_total'
10092 op: ""
10093 - node: '[*parser.AggregateExpr] stddev by (colo_name, region) (error_total)'
10094 op: stddev
10095 - node: '[*parser.AggregateExpr] count by (region) (stddev by (colo_name, region) (error_total))'
10096 op: count
10097 joins: []
10098 unless: []
10099 returninfo:
10100 logicalexpr: ""
10101 valueposition:
10102 start: 0
10103 end: 0
10104 returnednumber: 0
10105 alwaysreturns: false
10106 knownreturn: false
10107 isreturnbool: false
10108 position:
10109 start: 50
10110 end: 61
10111 type: aggregation
10112 fixedlabels: true
10113 isconditional: false
10114
10115---
10116
10117[TestLabelsSource/152 - 1]
10118expr: |4
10119 (
10120 avg(
10121 rate(foo_rejections[6h])
10122 or
10123 vector(0)
10124 ) by (colo_name)
10125 /
10126 (
10127 avg(
10128 rate(foo_total[6h])
10129 or
10130 vector(1)
10131 ) by (colo_name)
10132 )
10133 ) > 5
10134 *
10135 (
10136 avg(
10137 rate(foo_rejections[6h] offset 1d)
10138 or
10139 vector(0)
10140 ) by (colo_name)
10141 /
10142 avg(
10143 rate(foo_total[6h] offset 1d)
10144 or
10145 vector(1)
10146 ) by (colo_name)
10147 ) and on (colo_name) (colo_job:foo_total:rate2m or vector(0)) > 80
10148 and on (colo_name) (colo_job:foo_total:rate2m offset 1d or vector(0)) > 80
10149output:
10150 - labels:
10151 "":
10152 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10153 kind: excluded
10154 fragment:
10155 start: 64
10156 end: 67
10157 __name__:
10158 reason: Aggregation removes metric name.
10159 kind: excluded
10160 fragment:
10161 start: 5
10162 end: 78
10163 colo_name:
10164 reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10165 kind: included
10166 fragment:
10167 start: 341
10168 end: 344
10169 deadinfo: null
10170 returns: vector
10171 operations:
10172 - node: '[*parser.VectorSelector] foo_rejections'
10173 op: ""
10174 - node: '[*parser.Call] rate(foo_rejections[6h])'
10175 op: rate
10176 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))'
10177 op: avg
10178 joins:
10179 - "on": []
10180 ignoring: []
10181 src:
10182 labels:
10183 "":
10184 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10185 kind: excluded
10186 fragment:
10187 start: 147
10188 end: 150
10189 __name__:
10190 reason: Aggregation removes metric name.
10191 kind: excluded
10192 fragment:
10193 start: 91
10194 end: 161
10195 colo_name:
10196 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10197 kind: included
10198 fragment:
10199 start: 147
10200 end: 150
10201 deadinfo: null
10202 returns: vector
10203 operations:
10204 - node: '[*parser.VectorSelector] foo_total'
10205 op: ""
10206 - node: '[*parser.Call] rate(foo_total[6h])'
10207 op: rate
10208 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
10209 op: avg
10210 joins: []
10211 unless: []
10212 returninfo:
10213 logicalexpr: ""
10214 valueposition:
10215 start: 0
10216 end: 0
10217 returnednumber: 0
10218 alwaysreturns: false
10219 knownreturn: false
10220 isreturnbool: false
10221 position:
10222 start: 107
10223 end: 120
10224 type: aggregation
10225 fixedlabels: true
10226 isconditional: false
10227 op: 57384
10228 depth: 0
10229 - "on": []
10230 ignoring: []
10231 src:
10232 labels:
10233 "":
10234 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10235 kind: excluded
10236 fragment:
10237 start: 147
10238 end: 150
10239 __name__:
10240 reason: Aggregation removes metric name.
10241 kind: excluded
10242 fragment:
10243 start: 91
10244 end: 161
10245 colo_name:
10246 reason: Calling `vector()` will return a vector value with no labels.
10247 kind: excluded
10248 fragment:
10249 start: 131
10250 end: 137
10251 deadinfo: null
10252 returns: vector
10253 operations:
10254 - node: '[*parser.Call] vector(1)'
10255 op: vector
10256 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
10257 op: avg
10258 joins: []
10259 unless: []
10260 returninfo:
10261 logicalexpr: ""
10262 valueposition:
10263 start: 131
10264 end: 140
10265 returnednumber: 1
10266 alwaysreturns: true
10267 knownreturn: true
10268 isreturnbool: false
10269 position:
10270 start: 131
10271 end: 140
10272 type: aggregation
10273 fixedlabels: true
10274 isconditional: false
10275 op: 57384
10276 depth: 0
10277 - "on": []
10278 ignoring: []
10279 src:
10280 labels:
10281 "":
10282 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10283 kind: excluded
10284 fragment:
10285 start: 241
10286 end: 244
10287 __name__:
10288 reason: Aggregation removes metric name.
10289 kind: excluded
10290 fragment:
10291 start: 178
10292 end: 255
10293 colo_name:
10294 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10295 kind: included
10296 fragment:
10297 start: 241
10298 end: 244
10299 deadinfo: null
10300 returns: vector
10301 operations:
10302 - node: '[*parser.VectorSelector] foo_rejections offset 1d'
10303 op: ""
10304 - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)'
10305 op: rate
10306 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
10307 op: avg
10308 joins:
10309 - "on": []
10310 ignoring: []
10311 src:
10312 labels:
10313 "":
10314 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10315 kind: excluded
10316 fragment:
10317 start: 320
10318 end: 323
10319 __name__:
10320 reason: Aggregation removes metric name.
10321 kind: excluded
10322 fragment:
10323 start: 262
10324 end: 334
10325 colo_name:
10326 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10327 kind: included
10328 fragment:
10329 start: 320
10330 end: 323
10331 deadinfo: null
10332 returns: vector
10333 operations:
10334 - node: '[*parser.VectorSelector] foo_total offset 1d'
10335 op: ""
10336 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
10337 op: rate
10338 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10339 op: avg
10340 joins: []
10341 unless: []
10342 returninfo:
10343 logicalexpr: ""
10344 valueposition:
10345 start: 0
10346 end: 0
10347 returnednumber: 0
10348 alwaysreturns: false
10349 knownreturn: false
10350 isreturnbool: false
10351 position:
10352 start: 276
10353 end: 299
10354 type: aggregation
10355 fixedlabels: true
10356 isconditional: false
10357 op: 57384
10358 depth: 0
10359 - "on": []
10360 ignoring: []
10361 src:
10362 labels:
10363 "":
10364 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10365 kind: excluded
10366 fragment:
10367 start: 320
10368 end: 323
10369 __name__:
10370 reason: Aggregation removes metric name.
10371 kind: excluded
10372 fragment:
10373 start: 262
10374 end: 334
10375 colo_name:
10376 reason: Calling `vector()` will return a vector value with no labels.
10377 kind: excluded
10378 fragment:
10379 start: 306
10380 end: 312
10381 deadinfo: null
10382 returns: vector
10383 operations:
10384 - node: '[*parser.Call] vector(1)'
10385 op: vector
10386 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10387 op: avg
10388 joins: []
10389 unless: []
10390 returninfo:
10391 logicalexpr: ""
10392 valueposition:
10393 start: 306
10394 end: 315
10395 returnednumber: 1
10396 alwaysreturns: true
10397 knownreturn: true
10398 isreturnbool: false
10399 position:
10400 start: 306
10401 end: 315
10402 type: aggregation
10403 fixedlabels: true
10404 isconditional: false
10405 op: 57384
10406 depth: 0
10407 unless: []
10408 returninfo:
10409 logicalexpr: ""
10410 valueposition:
10411 start: 0
10412 end: 0
10413 returnednumber: 0
10414 alwaysreturns: false
10415 knownreturn: false
10416 isreturnbool: false
10417 position:
10418 start: 192
10419 end: 220
10420 type: aggregation
10421 fixedlabels: true
10422 isconditional: false
10423 op: 57388
10424 depth: 0
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: 241
10434 end: 244
10435 __name__:
10436 reason: Aggregation removes metric name.
10437 kind: excluded
10438 fragment:
10439 start: 178
10440 end: 255
10441 colo_name:
10442 reason: Calling `vector()` will return a vector value with no labels.
10443 kind: excluded
10444 fragment:
10445 start: 227
10446 end: 233
10447 deadinfo: null
10448 returns: vector
10449 operations:
10450 - node: '[*parser.Call] vector(0)'
10451 op: vector
10452 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
10453 op: avg
10454 joins:
10455 - "on": []
10456 ignoring: []
10457 src:
10458 labels:
10459 "":
10460 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10461 kind: excluded
10462 fragment:
10463 start: 320
10464 end: 323
10465 __name__:
10466 reason: Aggregation removes metric name.
10467 kind: excluded
10468 fragment:
10469 start: 262
10470 end: 334
10471 colo_name:
10472 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10473 kind: included
10474 fragment:
10475 start: 320
10476 end: 323
10477 deadinfo: null
10478 returns: vector
10479 operations:
10480 - node: '[*parser.VectorSelector] foo_total offset 1d'
10481 op: ""
10482 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
10483 op: rate
10484 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10485 op: avg
10486 joins: []
10487 unless: []
10488 returninfo:
10489 logicalexpr: ""
10490 valueposition:
10491 start: 0
10492 end: 0
10493 returnednumber: 0
10494 alwaysreturns: false
10495 knownreturn: false
10496 isreturnbool: false
10497 position:
10498 start: 276
10499 end: 299
10500 type: aggregation
10501 fixedlabels: true
10502 isconditional: false
10503 op: 57384
10504 depth: 0
10505 - "on": []
10506 ignoring: []
10507 src:
10508 labels:
10509 "":
10510 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10511 kind: excluded
10512 fragment:
10513 start: 320
10514 end: 323
10515 __name__:
10516 reason: Aggregation removes metric name.
10517 kind: excluded
10518 fragment:
10519 start: 262
10520 end: 334
10521 colo_name:
10522 reason: Calling `vector()` will return a vector value with no labels.
10523 kind: excluded
10524 fragment:
10525 start: 306
10526 end: 312
10527 deadinfo: null
10528 returns: vector
10529 operations:
10530 - node: '[*parser.Call] vector(1)'
10531 op: vector
10532 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10533 op: avg
10534 joins: []
10535 unless: []
10536 returninfo:
10537 logicalexpr: ""
10538 valueposition:
10539 start: 306
10540 end: 315
10541 returnednumber: 1
10542 alwaysreturns: true
10543 knownreturn: true
10544 isreturnbool: false
10545 position:
10546 start: 306
10547 end: 315
10548 type: aggregation
10549 fixedlabels: true
10550 isconditional: false
10551 op: 57384
10552 depth: 0
10553 unless: []
10554 returninfo:
10555 logicalexpr: 5 * vector(0) / vector(1)
10556 valueposition:
10557 start: 170
10558 end: 171
10559 returnednumber: 0
10560 alwaysreturns: true
10561 knownreturn: true
10562 isreturnbool: false
10563 position:
10564 start: 227
10565 end: 236
10566 type: aggregation
10567 fixedlabels: true
10568 isconditional: false
10569 op: 57388
10570 depth: 0
10571 - "on":
10572 - colo_name
10573 ignoring: []
10574 src:
10575 labels: {}
10576 deadinfo: null
10577 returns: vector
10578 operations:
10579 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m'
10580 op: ""
10581 joins: []
10582 unless: []
10583 returninfo:
10584 logicalexpr: ""
10585 valueposition:
10586 start: 0
10587 end: 0
10588 returnednumber: 0
10589 alwaysreturns: false
10590 knownreturn: false
10591 isreturnbool: false
10592 position:
10593 start: 357
10594 end: 382
10595 type: selector
10596 fixedlabels: false
10597 isconditional: true
10598 op: 57389
10599 depth: 0
10600 - "on":
10601 - colo_name
10602 ignoring: []
10603 src:
10604 labels:
10605 "":
10606 reason: Calling `vector()` will return a vector value with no labels.
10607 kind: excluded
10608 fragment:
10609 start: 386
10610 end: 392
10611 deadinfo:
10612 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.
10613 fragment:
10614 start: 386
10615 end: 392
10616 returns: vector
10617 operations:
10618 - node: '[*parser.Call] vector(0)'
10619 op: vector
10620 joins: []
10621 unless: []
10622 returninfo:
10623 logicalexpr: ""
10624 valueposition:
10625 start: 386
10626 end: 395
10627 returnednumber: 0
10628 alwaysreturns: true
10629 knownreturn: true
10630 isreturnbool: false
10631 position:
10632 start: 386
10633 end: 395
10634 type: function
10635 fixedlabels: true
10636 isconditional: true
10637 op: 57389
10638 depth: 0
10639 - "on":
10640 - colo_name
10641 ignoring: []
10642 src:
10643 labels: {}
10644 deadinfo: null
10645 returns: vector
10646 operations:
10647 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d'
10648 op: ""
10649 joins: []
10650 unless: []
10651 returninfo:
10652 logicalexpr: ""
10653 valueposition:
10654 start: 0
10655 end: 0
10656 returnednumber: 0
10657 alwaysreturns: false
10658 knownreturn: false
10659 isreturnbool: false
10660 position:
10661 start: 424
10662 end: 459
10663 type: selector
10664 fixedlabels: false
10665 isconditional: true
10666 op: 57389
10667 depth: 0
10668 - "on":
10669 - colo_name
10670 ignoring: []
10671 src:
10672 labels:
10673 "":
10674 reason: Calling `vector()` will return a vector value with no labels.
10675 kind: excluded
10676 fragment:
10677 start: 463
10678 end: 469
10679 deadinfo:
10680 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.
10681 fragment:
10682 start: 463
10683 end: 469
10684 returns: vector
10685 operations:
10686 - node: '[*parser.Call] vector(0)'
10687 op: vector
10688 joins: []
10689 unless: []
10690 returninfo:
10691 logicalexpr: ""
10692 valueposition:
10693 start: 463
10694 end: 472
10695 returnednumber: 0
10696 alwaysreturns: true
10697 knownreturn: true
10698 isreturnbool: false
10699 position:
10700 start: 463
10701 end: 472
10702 type: function
10703 fixedlabels: true
10704 isconditional: true
10705 op: 57389
10706 depth: 0
10707 unless: []
10708 returninfo:
10709 logicalexpr: ""
10710 valueposition:
10711 start: 0
10712 end: 0
10713 returnednumber: 0
10714 alwaysreturns: false
10715 knownreturn: false
10716 isreturnbool: false
10717 position:
10718 start: 19
10719 end: 37
10720 type: aggregation
10721 fixedlabels: true
10722 isconditional: true
10723 - labels:
10724 "":
10725 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10726 kind: excluded
10727 fragment:
10728 start: 64
10729 end: 67
10730 __name__:
10731 reason: Aggregation removes metric name.
10732 kind: excluded
10733 fragment:
10734 start: 5
10735 end: 78
10736 colo_name:
10737 reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10738 kind: included
10739 fragment:
10740 start: 341
10741 end: 344
10742 deadinfo:
10743 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.'
10744 fragment:
10745 start: 50
10746 end: 59
10747 returns: vector
10748 operations:
10749 - node: '[*parser.Call] vector(0)'
10750 op: vector
10751 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))'
10752 op: avg
10753 joins:
10754 - "on": []
10755 ignoring: []
10756 src:
10757 labels:
10758 "":
10759 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10760 kind: excluded
10761 fragment:
10762 start: 147
10763 end: 150
10764 __name__:
10765 reason: Aggregation removes metric name.
10766 kind: excluded
10767 fragment:
10768 start: 91
10769 end: 161
10770 colo_name:
10771 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10772 kind: included
10773 fragment:
10774 start: 147
10775 end: 150
10776 deadinfo: null
10777 returns: vector
10778 operations:
10779 - node: '[*parser.VectorSelector] foo_total'
10780 op: ""
10781 - node: '[*parser.Call] rate(foo_total[6h])'
10782 op: rate
10783 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
10784 op: avg
10785 joins: []
10786 unless: []
10787 returninfo:
10788 logicalexpr: ""
10789 valueposition:
10790 start: 0
10791 end: 0
10792 returnednumber: 0
10793 alwaysreturns: false
10794 knownreturn: false
10795 isreturnbool: false
10796 position:
10797 start: 107
10798 end: 120
10799 type: aggregation
10800 fixedlabels: true
10801 isconditional: false
10802 op: 57384
10803 depth: 0
10804 - "on": []
10805 ignoring: []
10806 src:
10807 labels:
10808 "":
10809 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10810 kind: excluded
10811 fragment:
10812 start: 147
10813 end: 150
10814 __name__:
10815 reason: Aggregation removes metric name.
10816 kind: excluded
10817 fragment:
10818 start: 91
10819 end: 161
10820 colo_name:
10821 reason: Calling `vector()` will return a vector value with no labels.
10822 kind: excluded
10823 fragment:
10824 start: 131
10825 end: 137
10826 deadinfo: null
10827 returns: vector
10828 operations:
10829 - node: '[*parser.Call] vector(1)'
10830 op: vector
10831 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
10832 op: avg
10833 joins: []
10834 unless: []
10835 returninfo:
10836 logicalexpr: ""
10837 valueposition:
10838 start: 131
10839 end: 140
10840 returnednumber: 1
10841 alwaysreturns: true
10842 knownreturn: true
10843 isreturnbool: false
10844 position:
10845 start: 131
10846 end: 140
10847 type: aggregation
10848 fixedlabels: true
10849 isconditional: false
10850 op: 57384
10851 depth: 0
10852 - "on": []
10853 ignoring: []
10854 src:
10855 labels:
10856 "":
10857 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10858 kind: excluded
10859 fragment:
10860 start: 241
10861 end: 244
10862 __name__:
10863 reason: Aggregation removes metric name.
10864 kind: excluded
10865 fragment:
10866 start: 178
10867 end: 255
10868 colo_name:
10869 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10870 kind: included
10871 fragment:
10872 start: 241
10873 end: 244
10874 deadinfo: null
10875 returns: vector
10876 operations:
10877 - node: '[*parser.VectorSelector] foo_rejections offset 1d'
10878 op: ""
10879 - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)'
10880 op: rate
10881 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
10882 op: avg
10883 joins:
10884 - "on": []
10885 ignoring: []
10886 src:
10887 labels:
10888 "":
10889 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10890 kind: excluded
10891 fragment:
10892 start: 320
10893 end: 323
10894 __name__:
10895 reason: Aggregation removes metric name.
10896 kind: excluded
10897 fragment:
10898 start: 262
10899 end: 334
10900 colo_name:
10901 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10902 kind: included
10903 fragment:
10904 start: 320
10905 end: 323
10906 deadinfo: null
10907 returns: vector
10908 operations:
10909 - node: '[*parser.VectorSelector] foo_total offset 1d'
10910 op: ""
10911 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
10912 op: rate
10913 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10914 op: avg
10915 joins: []
10916 unless: []
10917 returninfo:
10918 logicalexpr: ""
10919 valueposition:
10920 start: 0
10921 end: 0
10922 returnednumber: 0
10923 alwaysreturns: false
10924 knownreturn: false
10925 isreturnbool: false
10926 position:
10927 start: 276
10928 end: 299
10929 type: aggregation
10930 fixedlabels: true
10931 isconditional: false
10932 op: 57384
10933 depth: 0
10934 - "on": []
10935 ignoring: []
10936 src:
10937 labels:
10938 "":
10939 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
10940 kind: excluded
10941 fragment:
10942 start: 320
10943 end: 323
10944 __name__:
10945 reason: Aggregation removes metric name.
10946 kind: excluded
10947 fragment:
10948 start: 262
10949 end: 334
10950 colo_name:
10951 reason: Calling `vector()` will return a vector value with no labels.
10952 kind: excluded
10953 fragment:
10954 start: 306
10955 end: 312
10956 deadinfo: null
10957 returns: vector
10958 operations:
10959 - node: '[*parser.Call] vector(1)'
10960 op: vector
10961 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
10962 op: avg
10963 joins: []
10964 unless: []
10965 returninfo:
10966 logicalexpr: ""
10967 valueposition:
10968 start: 306
10969 end: 315
10970 returnednumber: 1
10971 alwaysreturns: true
10972 knownreturn: true
10973 isreturnbool: false
10974 position:
10975 start: 306
10976 end: 315
10977 type: aggregation
10978 fixedlabels: true
10979 isconditional: false
10980 op: 57384
10981 depth: 0
10982 unless: []
10983 returninfo:
10984 logicalexpr: ""
10985 valueposition:
10986 start: 0
10987 end: 0
10988 returnednumber: 0
10989 alwaysreturns: false
10990 knownreturn: false
10991 isreturnbool: false
10992 position:
10993 start: 192
10994 end: 220
10995 type: aggregation
10996 fixedlabels: true
10997 isconditional: false
10998 op: 57388
10999 depth: 0
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: 241
11009 end: 244
11010 __name__:
11011 reason: Aggregation removes metric name.
11012 kind: excluded
11013 fragment:
11014 start: 178
11015 end: 255
11016 colo_name:
11017 reason: Calling `vector()` will return a vector value with no labels.
11018 kind: excluded
11019 fragment:
11020 start: 227
11021 end: 233
11022 deadinfo: null
11023 returns: vector
11024 operations:
11025 - node: '[*parser.Call] vector(0)'
11026 op: vector
11027 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
11028 op: avg
11029 joins:
11030 - "on": []
11031 ignoring: []
11032 src:
11033 labels:
11034 "":
11035 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11036 kind: excluded
11037 fragment:
11038 start: 320
11039 end: 323
11040 __name__:
11041 reason: Aggregation removes metric name.
11042 kind: excluded
11043 fragment:
11044 start: 262
11045 end: 334
11046 colo_name:
11047 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11048 kind: included
11049 fragment:
11050 start: 320
11051 end: 323
11052 deadinfo: null
11053 returns: vector
11054 operations:
11055 - node: '[*parser.VectorSelector] foo_total offset 1d'
11056 op: ""
11057 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
11058 op: rate
11059 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
11060 op: avg
11061 joins: []
11062 unless: []
11063 returninfo:
11064 logicalexpr: ""
11065 valueposition:
11066 start: 0
11067 end: 0
11068 returnednumber: 0
11069 alwaysreturns: false
11070 knownreturn: false
11071 isreturnbool: false
11072 position:
11073 start: 276
11074 end: 299
11075 type: aggregation
11076 fixedlabels: true
11077 isconditional: false
11078 op: 57384
11079 depth: 0
11080 - "on": []
11081 ignoring: []
11082 src:
11083 labels:
11084 "":
11085 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11086 kind: excluded
11087 fragment:
11088 start: 320
11089 end: 323
11090 __name__:
11091 reason: Aggregation removes metric name.
11092 kind: excluded
11093 fragment:
11094 start: 262
11095 end: 334
11096 colo_name:
11097 reason: Calling `vector()` will return a vector value with no labels.
11098 kind: excluded
11099 fragment:
11100 start: 306
11101 end: 312
11102 deadinfo: null
11103 returns: vector
11104 operations:
11105 - node: '[*parser.Call] vector(1)'
11106 op: vector
11107 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
11108 op: avg
11109 joins: []
11110 unless: []
11111 returninfo:
11112 logicalexpr: ""
11113 valueposition:
11114 start: 306
11115 end: 315
11116 returnednumber: 1
11117 alwaysreturns: true
11118 knownreturn: true
11119 isreturnbool: false
11120 position:
11121 start: 306
11122 end: 315
11123 type: aggregation
11124 fixedlabels: true
11125 isconditional: false
11126 op: 57384
11127 depth: 0
11128 unless: []
11129 returninfo:
11130 logicalexpr: 5 * vector(0) / vector(1)
11131 valueposition:
11132 start: 170
11133 end: 171
11134 returnednumber: 0
11135 alwaysreturns: true
11136 knownreturn: true
11137 isreturnbool: false
11138 position:
11139 start: 227
11140 end: 236
11141 type: aggregation
11142 fixedlabels: true
11143 isconditional: false
11144 op: 57388
11145 depth: 0
11146 - "on":
11147 - colo_name
11148 ignoring: []
11149 src:
11150 labels: {}
11151 deadinfo: null
11152 returns: vector
11153 operations:
11154 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m'
11155 op: ""
11156 joins: []
11157 unless: []
11158 returninfo:
11159 logicalexpr: ""
11160 valueposition:
11161 start: 0
11162 end: 0
11163 returnednumber: 0
11164 alwaysreturns: false
11165 knownreturn: false
11166 isreturnbool: false
11167 position:
11168 start: 357
11169 end: 382
11170 type: selector
11171 fixedlabels: false
11172 isconditional: true
11173 op: 57389
11174 depth: 0
11175 - "on":
11176 - colo_name
11177 ignoring: []
11178 src:
11179 labels:
11180 "":
11181 reason: Calling `vector()` will return a vector value with no labels.
11182 kind: excluded
11183 fragment:
11184 start: 386
11185 end: 392
11186 deadinfo:
11187 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.
11188 fragment:
11189 start: 386
11190 end: 392
11191 returns: vector
11192 operations:
11193 - node: '[*parser.Call] vector(0)'
11194 op: vector
11195 joins: []
11196 unless: []
11197 returninfo:
11198 logicalexpr: ""
11199 valueposition:
11200 start: 386
11201 end: 395
11202 returnednumber: 0
11203 alwaysreturns: true
11204 knownreturn: true
11205 isreturnbool: false
11206 position:
11207 start: 386
11208 end: 395
11209 type: function
11210 fixedlabels: true
11211 isconditional: true
11212 op: 57389
11213 depth: 0
11214 - "on":
11215 - colo_name
11216 ignoring: []
11217 src:
11218 labels: {}
11219 deadinfo: null
11220 returns: vector
11221 operations:
11222 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d'
11223 op: ""
11224 joins: []
11225 unless: []
11226 returninfo:
11227 logicalexpr: ""
11228 valueposition:
11229 start: 0
11230 end: 0
11231 returnednumber: 0
11232 alwaysreturns: false
11233 knownreturn: false
11234 isreturnbool: false
11235 position:
11236 start: 424
11237 end: 459
11238 type: selector
11239 fixedlabels: false
11240 isconditional: true
11241 op: 57389
11242 depth: 0
11243 - "on":
11244 - colo_name
11245 ignoring: []
11246 src:
11247 labels:
11248 "":
11249 reason: Calling `vector()` will return a vector value with no labels.
11250 kind: excluded
11251 fragment:
11252 start: 463
11253 end: 469
11254 deadinfo:
11255 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.
11256 fragment:
11257 start: 463
11258 end: 469
11259 returns: vector
11260 operations:
11261 - node: '[*parser.Call] vector(0)'
11262 op: vector
11263 joins: []
11264 unless: []
11265 returninfo:
11266 logicalexpr: ""
11267 valueposition:
11268 start: 463
11269 end: 472
11270 returnednumber: 0
11271 alwaysreturns: true
11272 knownreturn: true
11273 isreturnbool: false
11274 position:
11275 start: 463
11276 end: 472
11277 type: function
11278 fixedlabels: true
11279 isconditional: true
11280 op: 57389
11281 depth: 0
11282 unless: []
11283 returninfo:
11284 logicalexpr: vector(0) / vector(1)
11285 valueposition:
11286 start: 50
11287 end: 59
11288 returnednumber: 0
11289 alwaysreturns: true
11290 knownreturn: true
11291 isreturnbool: false
11292 position:
11293 start: 50
11294 end: 59
11295 type: aggregation
11296 fixedlabels: true
11297 isconditional: true
11298
11299---
11300
11301[TestLabelsSource/153 - 1]
11302expr: sum(selector) / sum(selector offset 30m) > 5
11303output:
11304 - labels:
11305 "":
11306 reason: Query is using aggregation that removes all labels.
11307 kind: excluded
11308 fragment:
11309 start: 0
11310 end: 3
11311 __name__:
11312 reason: Aggregation removes metric name.
11313 kind: excluded
11314 fragment:
11315 start: 0
11316 end: 13
11317 deadinfo: null
11318 returns: vector
11319 operations:
11320 - node: '[*parser.VectorSelector] selector'
11321 op: ""
11322 - node: '[*parser.AggregateExpr] sum(selector)'
11323 op: sum
11324 joins:
11325 - "on": []
11326 ignoring: []
11327 src:
11328 labels:
11329 "":
11330 reason: Query is using aggregation that removes all labels.
11331 kind: excluded
11332 fragment:
11333 start: 16
11334 end: 19
11335 __name__:
11336 reason: Aggregation removes metric name.
11337 kind: excluded
11338 fragment:
11339 start: 16
11340 end: 40
11341 deadinfo: null
11342 returns: vector
11343 operations:
11344 - node: '[*parser.VectorSelector] selector offset 30m'
11345 op: ""
11346 - node: '[*parser.AggregateExpr] sum(selector offset 30m)'
11347 op: sum
11348 joins: []
11349 unless: []
11350 returninfo:
11351 logicalexpr: ""
11352 valueposition:
11353 start: 0
11354 end: 0
11355 returnednumber: 0
11356 alwaysreturns: false
11357 knownreturn: false
11358 isreturnbool: false
11359 position:
11360 start: 20
11361 end: 39
11362 type: aggregation
11363 fixedlabels: true
11364 isconditional: false
11365 op: 57384
11366 depth: 0
11367 unless: []
11368 returninfo:
11369 logicalexpr: ""
11370 valueposition:
11371 start: 0
11372 end: 0
11373 returnednumber: 0
11374 alwaysreturns: false
11375 knownreturn: false
11376 isreturnbool: false
11377 position:
11378 start: 4
11379 end: 12
11380 type: aggregation
11381 fixedlabels: true
11382 isconditional: true
11383
11384---
11385
11386[TestLabelsSource/154 - 1]
11387expr: |4-
11388 count by (dc) (
11389 max(0 < (token_expiration - time()) < (6*60*60)) by (instance)
11390 * on (instance) group_right label_replace(
11391 configured_minions, "instance", "$1", "minion", "(.+)")
11392 ) > 5
11393output:
11394 - labels:
11395 "":
11396 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
11397 kind: excluded
11398 fragment:
11399 start: 7
11400 end: 10
11401 __name__:
11402 reason: Aggregation removes metric name.
11403 kind: excluded
11404 fragment:
11405 start: 1
11406 end: 190
11407 dc:
11408 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
11409 kind: included
11410 fragment:
11411 start: 7
11412 end: 10
11413 instance:
11414 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
11415 kind: excluded
11416 fragment:
11417 start: 7
11418 end: 10
11419 deadinfo: null
11420 returns: vector
11421 operations:
11422 - node: '[*parser.VectorSelector] configured_minions'
11423 op: ""
11424 - node: '[*parser.Call] label_replace(configured_minions, "instance", "$1", "minion", "(.+)")'
11425 op: label_replace
11426 - 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", "(.+)"))'
11427 op: count
11428 joins:
11429 - "on":
11430 - instance
11431 ignoring: []
11432 src:
11433 labels:
11434 "":
11435 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
11436 kind: excluded
11437 fragment:
11438 start: 68
11439 end: 71
11440 __name__:
11441 reason: Aggregation removes metric name.
11442 kind: excluded
11443 fragment:
11444 start: 19
11445 end: 81
11446 instance:
11447 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
11448 kind: included
11449 fragment:
11450 start: 68
11451 end: 71
11452 deadinfo: null
11453 returns: vector
11454 operations:
11455 - node: '[*parser.VectorSelector] token_expiration'
11456 op: ""
11457 - node: '[*parser.AggregateExpr] max by (instance) (0 < (token_expiration - time()) < (6 * 60 * 60))'
11458 op: max
11459 joins: []
11460 unless: []
11461 returninfo:
11462 logicalexpr: ""
11463 valueposition:
11464 start: 0
11465 end: 0
11466 returnednumber: 0
11467 alwaysreturns: false
11468 knownreturn: false
11469 isreturnbool: false
11470 position:
11471 start: 28
11472 end: 44
11473 type: aggregation
11474 fixedlabels: true
11475 isconditional: true
11476 op: 57395
11477 depth: 1
11478 unless: []
11479 returninfo:
11480 logicalexpr: ""
11481 valueposition:
11482 start: 0
11483 end: 0
11484 returnednumber: 0
11485 alwaysreturns: false
11486 knownreturn: false
11487 isreturnbool: false
11488 position:
11489 start: 131
11490 end: 149
11491 type: aggregation
11492 fixedlabels: true
11493 isconditional: true
11494
11495---
11496
11497[TestLabelsSource/155 - 1]
11498expr: topk(10, prometheus_build_info*prometheus_ready)
11499output:
11500 - labels: {}
11501 deadinfo: null
11502 returns: vector
11503 operations:
11504 - node: '[*parser.VectorSelector] prometheus_build_info'
11505 op: ""
11506 - node: '[*parser.AggregateExpr] topk(10, prometheus_build_info * prometheus_ready)'
11507 op: topk
11508 joins:
11509 - "on": []
11510 ignoring: []
11511 src:
11512 labels: {}
11513 deadinfo: null
11514 returns: vector
11515 operations:
11516 - node: '[*parser.VectorSelector] prometheus_ready'
11517 op: ""
11518 joins: []
11519 unless: []
11520 returninfo:
11521 logicalexpr: ""
11522 valueposition:
11523 start: 0
11524 end: 0
11525 returnednumber: 0
11526 alwaysreturns: false
11527 knownreturn: false
11528 isreturnbool: false
11529 position:
11530 start: 31
11531 end: 47
11532 type: selector
11533 fixedlabels: false
11534 isconditional: false
11535 op: 57395
11536 depth: 1
11537 unless: []
11538 returninfo:
11539 logicalexpr: ""
11540 valueposition:
11541 start: 0
11542 end: 0
11543 returnednumber: 0
11544 alwaysreturns: false
11545 knownreturn: false
11546 isreturnbool: false
11547 position:
11548 start: 9
11549 end: 30
11550 type: aggregation
11551 fixedlabels: false
11552 isconditional: false
11553
11554---
11555
11556[TestLabelsSource/156 - 1]
11557expr: bottomk(10, prometheus_build_info*prometheus_ready)
11558output:
11559 - labels: {}
11560 deadinfo: null
11561 returns: vector
11562 operations:
11563 - node: '[*parser.VectorSelector] prometheus_build_info'
11564 op: ""
11565 - node: '[*parser.AggregateExpr] bottomk(10, prometheus_build_info * prometheus_ready)'
11566 op: bottomk
11567 joins:
11568 - "on": []
11569 ignoring: []
11570 src:
11571 labels: {}
11572 deadinfo: null
11573 returns: vector
11574 operations:
11575 - node: '[*parser.VectorSelector] prometheus_ready'
11576 op: ""
11577 joins: []
11578 unless: []
11579 returninfo:
11580 logicalexpr: ""
11581 valueposition:
11582 start: 0
11583 end: 0
11584 returnednumber: 0
11585 alwaysreturns: false
11586 knownreturn: false
11587 isreturnbool: false
11588 position:
11589 start: 34
11590 end: 50
11591 type: selector
11592 fixedlabels: false
11593 isconditional: false
11594 op: 57395
11595 depth: 1
11596 unless: []
11597 returninfo:
11598 logicalexpr: ""
11599 valueposition:
11600 start: 0
11601 end: 0
11602 returnednumber: 0
11603 alwaysreturns: false
11604 knownreturn: false
11605 isreturnbool: false
11606 position:
11607 start: 12
11608 end: 33
11609 type: aggregation
11610 fixedlabels: false
11611 isconditional: false
11612
11613---