cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.81.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

internal/parser/source/source_test.snap

14755lines · 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 returns: scalar
12 returnInfo:
13 logicalexpr: ""
14 valueposition:
15 start: 0
16 end: 1
17 returnednumber: 1
18 alwaysreturns: true
19 knownreturn: true
20 isreturnbool: false
21 position:
22 start: 0
23 end: 1
24 type: number
25 fixedLabels: true
26
27---
28
29[TestLabelsSource/2 - 1]
30expr: 1 / 5
31output:
32 - labels:
33 "":
34 reason: This query returns a number value with no labels.
35 kind: excluded
36 fragment:
37 start: 0
38 end: 1
39 returns: scalar
40 returnInfo:
41 logicalexpr: 1 / 5
42 valueposition:
43 start: 0
44 end: 1
45 returnednumber: 0.2
46 alwaysreturns: true
47 knownreturn: true
48 isreturnbool: false
49 position:
50 start: 0
51 end: 1
52 type: number
53 fixedLabels: true
54
55---
56
57[TestLabelsSource/3 - 1]
58expr: (2 ^ 5) == bool 5
59output:
60 - labels:
61 "":
62 reason: This query returns a number value with no labels.
63 kind: excluded
64 fragment:
65 start: 1
66 end: 2
67 deadInfo:
68 reason: '`2 ^ 5 == 5` always evaluates to `32 == 5` and uses the `bool` modifier which means it will always return 0'
69 fragment:
70 start: 1
71 end: 2
72 returns: scalar
73 returnInfo:
74 logicalexpr: 2 ^ 5
75 valueposition:
76 start: 1
77 end: 2
78 returnednumber: 32
79 alwaysreturns: true
80 knownreturn: true
81 isreturnbool: true
82 position:
83 start: 1
84 end: 2
85 type: number
86 fixedLabels: true
87 isConditional: true
88
89---
90
91[TestLabelsSource/4 - 1]
92expr: (2 ^ 5 + 11) % 5 <= bool 2
93output:
94 - labels:
95 "":
96 reason: This query returns a number value with no labels.
97 kind: excluded
98 fragment:
99 start: 1
100 end: 2
101 deadInfo:
102 reason: '`2 ^ 5 + 11 % 5 <= 2` always evaluates to `3 <= 2` and uses the `bool` modifier which means it will always return 0'
103 fragment:
104 start: 1
105 end: 2
106 returns: scalar
107 returnInfo:
108 logicalexpr: 2 ^ 5 + 11 % 5
109 valueposition:
110 start: 1
111 end: 2
112 returnednumber: 3
113 alwaysreturns: true
114 knownreturn: true
115 isreturnbool: true
116 position:
117 start: 1
118 end: 2
119 type: number
120 fixedLabels: true
121 isConditional: true
122
123---
124
125[TestLabelsSource/5 - 1]
126expr: (2 ^ 5 + 11) % 5 >= bool 20
127output:
128 - labels:
129 "":
130 reason: This query returns a number value with no labels.
131 kind: excluded
132 fragment:
133 start: 1
134 end: 2
135 deadInfo:
136 reason: '`2 ^ 5 + 11 % 5 >= 20` always evaluates to `3 >= 20` and uses the `bool` modifier which means it will always return 0'
137 fragment:
138 start: 1
139 end: 2
140 returns: scalar
141 returnInfo:
142 logicalexpr: 2 ^ 5 + 11 % 5
143 valueposition:
144 start: 1
145 end: 2
146 returnednumber: 3
147 alwaysreturns: true
148 knownreturn: true
149 isreturnbool: true
150 position:
151 start: 1
152 end: 2
153 type: number
154 fixedLabels: true
155 isConditional: true
156
157---
158
159[TestLabelsSource/6 - 1]
160expr: (2 ^ 5 + 11) % 5 <= bool 3
161output:
162 - labels:
163 "":
164 reason: This query returns a number value with no labels.
165 kind: excluded
166 fragment:
167 start: 1
168 end: 2
169 returns: scalar
170 returnInfo:
171 logicalexpr: 2 ^ 5 + 11 % 5
172 valueposition:
173 start: 1
174 end: 2
175 returnednumber: 3
176 alwaysreturns: true
177 knownreturn: true
178 isreturnbool: true
179 position:
180 start: 1
181 end: 2
182 type: number
183 fixedLabels: true
184 isConditional: true
185
186---
187
188[TestLabelsSource/7 - 1]
189expr: (2 ^ 5 + 11) % 5 < bool 1
190output:
191 - labels:
192 "":
193 reason: This query returns a number value with no labels.
194 kind: excluded
195 fragment:
196 start: 1
197 end: 2
198 deadInfo:
199 reason: '`2 ^ 5 + 11 % 5 < 1` always evaluates to `3 < 1` and uses the `bool` modifier which means it will always return 0'
200 fragment:
201 start: 1
202 end: 2
203 returns: scalar
204 returnInfo:
205 logicalexpr: 2 ^ 5 + 11 % 5
206 valueposition:
207 start: 1
208 end: 2
209 returnednumber: 3
210 alwaysreturns: true
211 knownreturn: true
212 isreturnbool: true
213 position:
214 start: 1
215 end: 2
216 type: number
217 fixedLabels: true
218 isConditional: true
219
220---
221
222[TestLabelsSource/8 - 1]
223expr: 20 - 15 < bool 1
224output:
225 - labels:
226 "":
227 reason: This query returns a number value with no labels.
228 kind: excluded
229 fragment:
230 start: 0
231 end: 2
232 deadInfo:
233 reason: '`20 - 15 < 1` always evaluates to `5 < 1` and uses the `bool` modifier which means it will always return 0'
234 fragment:
235 start: 0
236 end: 2
237 returns: scalar
238 returnInfo:
239 logicalexpr: 20 - 15
240 valueposition:
241 start: 0
242 end: 2
243 returnednumber: 5
244 alwaysreturns: true
245 knownreturn: true
246 isreturnbool: true
247 position:
248 start: 0
249 end: 2
250 type: number
251 fixedLabels: true
252 isConditional: true
253
254---
255
256[TestLabelsSource/9 - 1]
257expr: 2 * 5
258output:
259 - labels:
260 "":
261 reason: This query returns a number value with no labels.
262 kind: excluded
263 fragment:
264 start: 0
265 end: 1
266 returns: scalar
267 returnInfo:
268 logicalexpr: 2 * 5
269 valueposition:
270 start: 0
271 end: 1
272 returnednumber: 10
273 alwaysreturns: true
274 knownreturn: true
275 isreturnbool: false
276 position:
277 start: 0
278 end: 1
279 type: number
280 fixedLabels: true
281
282---
283
284[TestLabelsSource/10 - 1]
285expr: (foo or bar) * 5
286output:
287 - returns: vector
288 operations:
289 - node: '[*parser.VectorSelector] foo'
290 op: ""
291 position:
292 start: 1
293 end: 4
294 type: selector
295 - returns: vector
296 operations:
297 - node: '[*parser.VectorSelector] bar'
298 op: ""
299 position:
300 start: 8
301 end: 11
302 type: selector
303
304---
305
306[TestLabelsSource/11 - 1]
307expr: (foo or vector(2)) * 5
308output:
309 - returns: vector
310 operations:
311 - node: '[*parser.VectorSelector] foo'
312 op: ""
313 position:
314 start: 1
315 end: 4
316 type: selector
317 - labels:
318 "":
319 reason: Calling `vector()` will return a vector value with no labels.
320 kind: excluded
321 fragment:
322 start: 8
323 end: 14
324 returns: vector
325 operations:
326 - args:
327 - "2"
328 node: '[*parser.Call] vector(2)'
329 op: vector
330 returnInfo:
331 logicalexpr: vector(2) * 5
332 valueposition:
333 start: 8
334 end: 17
335 returnednumber: 10
336 alwaysreturns: true
337 knownreturn: true
338 isreturnbool: false
339 position:
340 start: 8
341 end: 17
342 type: function
343 fixedLabels: true
344
345---
346
347[TestLabelsSource/12 - 1]
348expr: (foo or vector(5)) * (vector(2) or bar)
349output:
350 - labels:
351 __name__:
352 reason: Binary operation between two vectors removes metric names.
353 kind: excluded
354 fragment:
355 start: 0
356 end: 39
357 returns: vector
358 operations:
359 - node: '[*parser.VectorSelector] foo'
360 op: ""
361 joins:
362 - addedlabels: []
363 depth: 0
364 ison: false
365 matchinglabels: []
366 op: '*'
367 src:
368 labels:
369 "":
370 reason: Calling `vector()` will return a vector value with no labels.
371 kind: excluded
372 fragment:
373 start: 22
374 end: 28
375 returns: vector
376 operations:
377 - args:
378 - "2"
379 node: '[*parser.Call] vector(2)'
380 op: vector
381 returnInfo:
382 logicalexpr: ""
383 valueposition:
384 start: 22
385 end: 31
386 returnednumber: 2
387 alwaysreturns: true
388 knownreturn: true
389 isreturnbool: false
390 position:
391 start: 22
392 end: 31
393 type: function
394 fixedLabels: true
395 - addedlabels: []
396 depth: 0
397 ison: false
398 matchinglabels: []
399 op: '*'
400 src:
401 deadInfo:
402 reason: The left hand side always returns something and so the right hand side is never used.
403 fragment:
404 start: 35
405 end: 38
406 returns: vector
407 operations:
408 - node: '[*parser.VectorSelector] bar'
409 op: ""
410 position:
411 start: 35
412 end: 38
413 type: selector
414 position:
415 start: 1
416 end: 4
417 type: selector
418 - labels:
419 "":
420 reason: Calling `vector()` will return a vector value with no labels.
421 kind: excluded
422 fragment:
423 start: 8
424 end: 14
425 __name__:
426 reason: Binary operation between two vectors removes metric names.
427 kind: excluded
428 fragment:
429 start: 0
430 end: 39
431 returns: vector
432 operations:
433 - args:
434 - "5"
435 node: '[*parser.Call] vector(5)'
436 op: vector
437 joins:
438 - addedlabels: []
439 depth: 0
440 ison: false
441 matchinglabels: []
442 op: '*'
443 src:
444 labels:
445 "":
446 reason: Calling `vector()` will return a vector value with no labels.
447 kind: excluded
448 fragment:
449 start: 22
450 end: 28
451 returns: vector
452 operations:
453 - args:
454 - "2"
455 node: '[*parser.Call] vector(2)'
456 op: vector
457 returnInfo:
458 logicalexpr: ""
459 valueposition:
460 start: 22
461 end: 31
462 returnednumber: 2
463 alwaysreturns: true
464 knownreturn: true
465 isreturnbool: false
466 position:
467 start: 22
468 end: 31
469 type: function
470 fixedLabels: true
471 - addedlabels: []
472 depth: 0
473 ison: false
474 matchinglabels: []
475 op: '*'
476 src:
477 deadInfo:
478 reason: The left hand side always returns something and so the right hand side is never used.
479 fragment:
480 start: 35
481 end: 38
482 returns: vector
483 operations:
484 - node: '[*parser.VectorSelector] bar'
485 op: ""
486 position:
487 start: 35
488 end: 38
489 type: selector
490 returnInfo:
491 logicalexpr: vector(5) * vector(2)
492 valueposition:
493 start: 8
494 end: 17
495 returnednumber: 10
496 alwaysreturns: true
497 knownreturn: true
498 isreturnbool: false
499 position:
500 start: 8
501 end: 17
502 type: function
503 fixedLabels: true
504
505---
506
507[TestLabelsSource/13 - 1]
508expr: 1 > bool 0
509output:
510 - labels:
511 "":
512 reason: This query returns a number value with no labels.
513 kind: excluded
514 fragment:
515 start: 0
516 end: 1
517 returns: scalar
518 returnInfo:
519 logicalexpr: ""
520 valueposition:
521 start: 0
522 end: 1
523 returnednumber: 1
524 alwaysreturns: true
525 knownreturn: true
526 isreturnbool: true
527 position:
528 start: 0
529 end: 1
530 type: number
531 fixedLabels: true
532 isConditional: true
533
534---
535
536[TestLabelsSource/14 - 1]
537expr: 20 > bool 10
538output:
539 - labels:
540 "":
541 reason: This query returns a number value with no labels.
542 kind: excluded
543 fragment:
544 start: 0
545 end: 2
546 returns: scalar
547 returnInfo:
548 logicalexpr: ""
549 valueposition:
550 start: 0
551 end: 2
552 returnednumber: 20
553 alwaysreturns: true
554 knownreturn: true
555 isreturnbool: true
556 position:
557 start: 0
558 end: 2
559 type: number
560 fixedLabels: true
561 isConditional: true
562
563---
564
565[TestLabelsSource/15 - 1]
566expr: '"test"'
567output:
568 - labels:
569 "":
570 reason: This query returns a string value with no labels.
571 kind: excluded
572 fragment:
573 start: 0
574 end: 6
575 returns: string
576 returnInfo:
577 logicalexpr: ""
578 valueposition:
579 start: 0
580 end: 0
581 returnednumber: 0
582 alwaysreturns: true
583 knownreturn: false
584 isreturnbool: false
585 position:
586 start: 0
587 end: 6
588 type: string
589 fixedLabels: true
590
591---
592
593[TestLabelsSource/16 - 1]
594expr: foo
595output:
596 - returns: vector
597 operations:
598 - node: '[*parser.VectorSelector] foo'
599 op: ""
600 position:
601 start: 0
602 end: 3
603 type: selector
604
605---
606
607[TestLabelsSource/17 - 1]
608expr: (foo > 1) > bool 1
609output:
610 - returns: vector
611 operations:
612 - node: '[*parser.VectorSelector] foo'
613 op: ""
614 position:
615 start: 1
616 end: 4
617 type: selector
618 isConditional: true
619
620---
621
622[TestLabelsSource/18 - 1]
623expr: foo > bool 5
624output:
625 - returns: vector
626 operations:
627 - node: '[*parser.VectorSelector] foo'
628 op: ""
629 returnInfo:
630 logicalexpr: ""
631 valueposition:
632 start: 0
633 end: 0
634 returnednumber: 0
635 alwaysreturns: false
636 knownreturn: false
637 isreturnbool: true
638 position:
639 start: 0
640 end: 3
641 type: selector
642 isConditional: true
643
644---
645
646[TestLabelsSource/19 - 1]
647expr: foo > bool 5 == 1
648output:
649 - returns: vector
650 operations:
651 - node: '[*parser.VectorSelector] foo'
652 op: ""
653 position:
654 start: 0
655 end: 3
656 type: selector
657 isConditional: true
658
659---
660
661[TestLabelsSource/20 - 1]
662expr: foo > bool bar
663output:
664 - labels:
665 __name__:
666 reason: Binary operation between two vectors removes metric names.
667 kind: excluded
668 fragment:
669 start: 0
670 end: 14
671 returns: vector
672 operations:
673 - node: '[*parser.VectorSelector] foo'
674 op: ""
675 joins:
676 - addedlabels: []
677 depth: 0
678 ison: false
679 matchinglabels: []
680 op: '>'
681 src:
682 returns: vector
683 operations:
684 - node: '[*parser.VectorSelector] bar'
685 op: ""
686 position:
687 start: 11
688 end: 14
689 type: selector
690 returnInfo:
691 logicalexpr: ""
692 valueposition:
693 start: 0
694 end: 0
695 returnednumber: 0
696 alwaysreturns: false
697 knownreturn: false
698 isreturnbool: true
699 position:
700 start: 0
701 end: 3
702 type: selector
703 isConditional: true
704
705---
706
707[TestLabelsSource/21 - 1]
708expr: (foo > bool bar) == 0
709output:
710 - labels:
711 __name__:
712 reason: Binary operation between two vectors removes metric names.
713 kind: excluded
714 fragment:
715 start: 1
716 end: 15
717 returns: vector
718 operations:
719 - node: '[*parser.VectorSelector] foo'
720 op: ""
721 joins:
722 - addedlabels: []
723 depth: 0
724 ison: false
725 matchinglabels: []
726 op: '>'
727 src:
728 returns: vector
729 operations:
730 - node: '[*parser.VectorSelector] bar'
731 op: ""
732 position:
733 start: 12
734 end: 15
735 type: selector
736 position:
737 start: 1
738 end: 4
739 type: selector
740 isConditional: true
741
742---
743
744[TestLabelsSource/22 - 1]
745expr: foo > bool on(instance) bar
746output:
747 - labels:
748 "":
749 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
750 kind: excluded
751 fragment:
752 start: 11
753 end: 23
754 __name__:
755 reason: Binary operation between two vectors removes metric names.
756 kind: excluded
757 fragment:
758 start: 0
759 end: 27
760 instance:
761 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
762 kind: included
763 fragment:
764 start: 14
765 end: 22
766 returns: vector
767 operations:
768 - node: '[*parser.VectorSelector] foo'
769 op: ""
770 joins:
771 - addedlabels: []
772 depth: 0
773 ison: true
774 matchinglabels:
775 - instance
776 op: '>'
777 src:
778 returns: vector
779 operations:
780 - node: '[*parser.VectorSelector] bar'
781 op: ""
782 position:
783 start: 24
784 end: 27
785 type: selector
786 usedLabels:
787 - instance
788 returnInfo:
789 logicalexpr: ""
790 valueposition:
791 start: 0
792 end: 0
793 returnednumber: 0
794 alwaysreturns: false
795 knownreturn: false
796 isreturnbool: true
797 position:
798 start: 0
799 end: 3
800 type: selector
801 fixedLabels: true
802 isConditional: true
803
804---
805
806[TestLabelsSource/23 - 1]
807expr: (foo > bool on(instance) bar) == 1
808output:
809 - labels:
810 "":
811 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
812 kind: excluded
813 fragment:
814 start: 12
815 end: 24
816 __name__:
817 reason: Binary operation between two vectors removes metric names.
818 kind: excluded
819 fragment:
820 start: 1
821 end: 28
822 instance:
823 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
824 kind: included
825 fragment:
826 start: 15
827 end: 23
828 returns: vector
829 operations:
830 - node: '[*parser.VectorSelector] foo'
831 op: ""
832 joins:
833 - addedlabels: []
834 depth: 0
835 ison: true
836 matchinglabels:
837 - instance
838 op: '>'
839 src:
840 returns: vector
841 operations:
842 - node: '[*parser.VectorSelector] bar'
843 op: ""
844 position:
845 start: 25
846 end: 28
847 type: selector
848 usedLabels:
849 - instance
850 position:
851 start: 1
852 end: 4
853 type: selector
854 fixedLabels: true
855 isConditional: true
856
857---
858
859[TestLabelsSource/24 - 1]
860expr: foo > bool on(instance) group_left(version) bar
861output:
862 - labels:
863 __name__:
864 reason: Binary operation between two vectors removes metric names.
865 kind: excluded
866 fragment:
867 start: 0
868 end: 47
869 instance:
870 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
871 kind: included
872 fragment:
873 start: 14
874 end: 22
875 version:
876 reason: Query is using `group_left(version)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
877 kind: included
878 fragment:
879 start: 35
880 end: 42
881 returns: vector
882 operations:
883 - node: '[*parser.VectorSelector] foo'
884 op: ""
885 joins:
886 - addedlabels:
887 - version
888 depth: 0
889 ison: true
890 matchinglabels:
891 - instance
892 op: '>'
893 src:
894 returns: vector
895 operations:
896 - node: '[*parser.VectorSelector] bar'
897 op: ""
898 position:
899 start: 44
900 end: 47
901 type: selector
902 usedLabels:
903 - instance
904 returnInfo:
905 logicalexpr: ""
906 valueposition:
907 start: 0
908 end: 0
909 returnednumber: 0
910 alwaysreturns: false
911 knownreturn: false
912 isreturnbool: true
913 position:
914 start: 0
915 end: 3
916 type: selector
917 isConditional: true
918
919---
920
921[TestLabelsSource/25 - 1]
922expr: bar > bool on(instance) group_right(version) foo
923output:
924 - labels:
925 __name__:
926 reason: Binary operation between two vectors removes metric names.
927 kind: excluded
928 fragment:
929 start: 0
930 end: 48
931 instance:
932 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
933 kind: included
934 fragment:
935 start: 14
936 end: 22
937 version:
938 reason: Query is using `group_right(version)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
939 kind: included
940 fragment:
941 start: 36
942 end: 43
943 returns: vector
944 operations:
945 - node: '[*parser.VectorSelector] foo'
946 op: ""
947 joins:
948 - addedlabels:
949 - version
950 depth: 0
951 ison: true
952 matchinglabels:
953 - instance
954 op: '>'
955 src:
956 returns: vector
957 operations:
958 - node: '[*parser.VectorSelector] bar'
959 op: ""
960 position:
961 start: 0
962 end: 3
963 type: selector
964 usedLabels:
965 - instance
966 returnInfo:
967 logicalexpr: ""
968 valueposition:
969 start: 0
970 end: 0
971 returnednumber: 0
972 alwaysreturns: false
973 knownreturn: false
974 isreturnbool: true
975 position:
976 start: 45
977 end: 48
978 type: selector
979 isConditional: true
980
981---
982
983[TestLabelsSource/26 - 1]
984expr: foo and bar > bool 0
985output:
986 - returns: vector
987 operations:
988 - node: '[*parser.VectorSelector] foo'
989 op: ""
990 joins:
991 - addedlabels: []
992 depth: 0
993 ison: false
994 matchinglabels: []
995 op: and
996 src:
997 returns: vector
998 operations:
999 - node: '[*parser.VectorSelector] bar'
1000 op: ""
1001 returnInfo:
1002 logicalexpr: ""
1003 valueposition:
1004 start: 0
1005 end: 0
1006 returnednumber: 0
1007 alwaysreturns: false
1008 knownreturn: false
1009 isreturnbool: true
1010 position:
1011 start: 8
1012 end: 11
1013 type: selector
1014 isConditional: true
1015 position:
1016 start: 0
1017 end: 3
1018 type: selector
1019 isConditional: true
1020
1021---
1022
1023[TestLabelsSource/27 - 1]
1024expr: foo offset 5m
1025output:
1026 - returns: vector
1027 operations:
1028 - node: '[*parser.VectorSelector] foo offset 5m'
1029 op: ""
1030 position:
1031 start: 0
1032 end: 13
1033 type: selector
1034
1035---
1036
1037[TestLabelsSource/28 - 1]
1038expr: foo{job="bar"}
1039output:
1040 - labels:
1041 job:
1042 reason: Query will only return series where these labels are present.
1043 kind: guaranteed
1044 fragment:
1045 start: 0
1046 end: 14
1047 returns: vector
1048 operations:
1049 - node: '[*parser.VectorSelector] foo{job="bar"}'
1050 op: ""
1051 position:
1052 start: 0
1053 end: 14
1054 type: selector
1055
1056---
1057
1058[TestLabelsSource/29 - 1]
1059expr: foo{job=""}
1060output:
1061 - labels:
1062 job:
1063 reason: Query uses `{job=""}` selector which will filter out any time series with the `job` label set.
1064 kind: excluded
1065 fragment:
1066 start: 0
1067 end: 11
1068 returns: vector
1069 operations:
1070 - node: '[*parser.VectorSelector] foo{job=""}'
1071 op: ""
1072 position:
1073 start: 0
1074 end: 11
1075 type: selector
1076
1077---
1078
1079[TestLabelsSource/30 - 1]
1080expr: foo{job="bar"} or bar{job="foo"}
1081output:
1082 - labels:
1083 job:
1084 reason: Query will only return series where these labels are present.
1085 kind: guaranteed
1086 fragment:
1087 start: 0
1088 end: 14
1089 returns: vector
1090 operations:
1091 - node: '[*parser.VectorSelector] foo{job="bar"}'
1092 op: ""
1093 usedLabels:
1094 - job
1095 position:
1096 start: 0
1097 end: 14
1098 type: selector
1099 - labels:
1100 job:
1101 reason: Query will only return series where these labels are present.
1102 kind: guaranteed
1103 fragment:
1104 start: 18
1105 end: 32
1106 returns: vector
1107 operations:
1108 - node: '[*parser.VectorSelector] bar{job="foo"}'
1109 op: ""
1110 position:
1111 start: 18
1112 end: 32
1113 type: selector
1114
1115---
1116
1117[TestLabelsSource/31 - 1]
1118expr: foo{a="bar"} or bar{b="foo"}
1119output:
1120 - labels:
1121 a:
1122 reason: Query will only return series where these labels are present.
1123 kind: guaranteed
1124 fragment:
1125 start: 0
1126 end: 12
1127 returns: vector
1128 operations:
1129 - node: '[*parser.VectorSelector] foo{a="bar"}'
1130 op: ""
1131 usedLabels:
1132 - a
1133 position:
1134 start: 0
1135 end: 12
1136 type: selector
1137 - labels:
1138 b:
1139 reason: Query will only return series where these labels are present.
1140 kind: guaranteed
1141 fragment:
1142 start: 16
1143 end: 28
1144 returns: vector
1145 operations:
1146 - node: '[*parser.VectorSelector] bar{b="foo"}'
1147 op: ""
1148 position:
1149 start: 16
1150 end: 28
1151 type: selector
1152
1153---
1154
1155[TestLabelsSource/32 - 1]
1156expr: foo[5m]
1157output:
1158 - returns: matrix
1159 operations:
1160 - node: '[*parser.VectorSelector] foo'
1161 op: ""
1162 position:
1163 start: 0
1164 end: 3
1165 type: selector
1166
1167---
1168
1169[TestLabelsSource/33 - 1]
1170expr: prometheus_build_info[2m:1m]
1171output:
1172 - returns: vector
1173 operations:
1174 - node: '[*parser.VectorSelector] prometheus_build_info'
1175 op: ""
1176 position:
1177 start: 0
1178 end: 21
1179 type: selector
1180
1181---
1182
1183[TestLabelsSource/34 - 1]
1184expr: deriv(rate(distance_covered_meters_total[1m])[5m:1m])
1185output:
1186 - returns: vector
1187 operations:
1188 - node: '[*parser.VectorSelector] distance_covered_meters_total'
1189 op: ""
1190 - node: '[*parser.Call] rate(distance_covered_meters_total[1m])'
1191 op: rate
1192 - node: '[*parser.Call] deriv(rate(distance_covered_meters_total[1m])[5m:1m])'
1193 op: deriv
1194 position:
1195 start: 6
1196 end: 52
1197 type: function
1198
1199---
1200
1201[TestLabelsSource/35 - 1]
1202expr: foo - 1
1203output:
1204 - returns: vector
1205 operations:
1206 - node: '[*parser.VectorSelector] foo'
1207 op: ""
1208 position:
1209 start: 0
1210 end: 3
1211 type: selector
1212
1213---
1214
1215[TestLabelsSource/36 - 1]
1216expr: foo / 5
1217output:
1218 - returns: vector
1219 operations:
1220 - node: '[*parser.VectorSelector] foo'
1221 op: ""
1222 position:
1223 start: 0
1224 end: 3
1225 type: selector
1226
1227---
1228
1229[TestLabelsSource/37 - 1]
1230expr: -foo
1231output:
1232 - returns: vector
1233 operations:
1234 - node: '[*parser.VectorSelector] foo'
1235 op: ""
1236 position:
1237 start: 1
1238 end: 4
1239 type: selector
1240
1241---
1242
1243[TestLabelsSource/38 - 1]
1244expr: sum(foo{job="myjob"})
1245output:
1246 - labels:
1247 "":
1248 reason: Query is using aggregation that removes all labels.
1249 kind: excluded
1250 fragment:
1251 start: 0
1252 end: 3
1253 __name__:
1254 reason: Aggregation removes metric name.
1255 kind: excluded
1256 fragment:
1257 start: 0
1258 end: 21
1259 job:
1260 reason: Query is using aggregation that removes all labels.
1261 kind: excluded
1262 fragment:
1263 start: 0
1264 end: 3
1265 returns: vector
1266 operations:
1267 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1268 op: ""
1269 - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})'
1270 op: sum
1271 position:
1272 start: 4
1273 end: 20
1274 type: aggregation
1275 fixedLabels: true
1276
1277---
1278
1279[TestLabelsSource/39 - 1]
1280expr: sum(count(foo{job="myjob"}) by(instance))
1281output:
1282 - labels:
1283 "":
1284 reason: Query is using aggregation that removes all labels.
1285 kind: excluded
1286 fragment:
1287 start: 0
1288 end: 3
1289 __name__:
1290 reason: Aggregation removes metric name.
1291 kind: excluded
1292 fragment:
1293 start: 0
1294 end: 41
1295 instance:
1296 reason: Query is using aggregation that removes all labels.
1297 kind: excluded
1298 fragment:
1299 start: 0
1300 end: 3
1301 job:
1302 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
1303 kind: excluded
1304 fragment:
1305 start: 28
1306 end: 40
1307 returns: vector
1308 operations:
1309 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1310 op: ""
1311 - node: '[*parser.AggregateExpr] count by (instance) (foo{job="myjob"})'
1312 op: count
1313 - node: '[*parser.AggregateExpr] sum(count by (instance) (foo{job="myjob"}))'
1314 op: sum
1315 position:
1316 start: 10
1317 end: 26
1318 type: aggregation
1319 fixedLabels: true
1320
1321---
1322
1323[TestLabelsSource/40 - 1]
1324expr: sum(foo{job="myjob"}) > 20
1325output:
1326 - labels:
1327 "":
1328 reason: Query is using aggregation that removes all labels.
1329 kind: excluded
1330 fragment:
1331 start: 0
1332 end: 3
1333 __name__:
1334 reason: Aggregation removes metric name.
1335 kind: excluded
1336 fragment:
1337 start: 0
1338 end: 21
1339 job:
1340 reason: Query is using aggregation that removes all labels.
1341 kind: excluded
1342 fragment:
1343 start: 0
1344 end: 3
1345 returns: vector
1346 operations:
1347 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1348 op: ""
1349 - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})'
1350 op: sum
1351 position:
1352 start: 4
1353 end: 20
1354 type: aggregation
1355 fixedLabels: true
1356 isConditional: true
1357
1358---
1359
1360[TestLabelsSource/41 - 1]
1361expr: sum(foo{job="myjob"}) without(job)
1362output:
1363 - labels:
1364 __name__:
1365 reason: Aggregation removes metric name.
1366 kind: excluded
1367 fragment:
1368 start: 0
1369 end: 34
1370 job:
1371 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
1372 kind: excluded
1373 fragment:
1374 start: 30
1375 end: 33
1376 returns: vector
1377 operations:
1378 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1379 op: ""
1380 - node: '[*parser.AggregateExpr] sum without (job) (foo{job="myjob"})'
1381 op: sum
1382 position:
1383 start: 4
1384 end: 20
1385 type: aggregation
1386
1387---
1388
1389[TestLabelsSource/42 - 1]
1390expr: sum(foo) by(job)
1391output:
1392 - labels:
1393 "":
1394 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1395 kind: excluded
1396 fragment:
1397 start: 9
1398 end: 11
1399 __name__:
1400 reason: Aggregation removes metric name.
1401 kind: excluded
1402 fragment:
1403 start: 0
1404 end: 16
1405 job:
1406 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1407 kind: included
1408 fragment:
1409 start: 12
1410 end: 15
1411 returns: vector
1412 operations:
1413 - node: '[*parser.VectorSelector] foo'
1414 op: ""
1415 - node: '[*parser.AggregateExpr] sum by (job) (foo)'
1416 op: sum
1417 usedLabels:
1418 - job
1419 position:
1420 start: 4
1421 end: 7
1422 type: aggregation
1423 fixedLabels: true
1424
1425---
1426
1427[TestLabelsSource/43 - 1]
1428expr: sum(foo{job="myjob"}) by(job)
1429output:
1430 - labels:
1431 "":
1432 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1433 kind: excluded
1434 fragment:
1435 start: 22
1436 end: 24
1437 __name__:
1438 reason: Aggregation removes metric name.
1439 kind: excluded
1440 fragment:
1441 start: 0
1442 end: 29
1443 job:
1444 reason: Query will only return series where these labels are present.
1445 kind: guaranteed
1446 fragment:
1447 start: 4
1448 end: 20
1449 returns: vector
1450 operations:
1451 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1452 op: ""
1453 - node: '[*parser.AggregateExpr] sum by (job) (foo{job="myjob"})'
1454 op: sum
1455 usedLabels:
1456 - job
1457 position:
1458 start: 4
1459 end: 20
1460 type: aggregation
1461 fixedLabels: true
1462
1463---
1464
1465[TestLabelsSource/44 - 1]
1466expr: abs(foo{job="myjob"} offset 5m)
1467output:
1468 - labels:
1469 job:
1470 reason: Query will only return series where these labels are present.
1471 kind: guaranteed
1472 fragment:
1473 start: 0
1474 end: 31
1475 returns: vector
1476 operations:
1477 - node: '[*parser.VectorSelector] foo{job="myjob"} offset 5m'
1478 op: ""
1479 - node: '[*parser.Call] abs(foo{job="myjob"} offset 5m)'
1480 op: abs
1481 position:
1482 start: 4
1483 end: 30
1484 type: function
1485
1486---
1487
1488[TestLabelsSource/45 - 1]
1489expr: abs(foo{job="myjob"} or bar{cluster="dev"})
1490output:
1491 - labels:
1492 job:
1493 reason: Query will only return series where these labels are present.
1494 kind: guaranteed
1495 fragment:
1496 start: 0
1497 end: 43
1498 returns: vector
1499 operations:
1500 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1501 op: ""
1502 - node: '[*parser.Call] abs(foo{job="myjob"} or bar{cluster="dev"})'
1503 op: abs
1504 usedLabels:
1505 - job
1506 position:
1507 start: 4
1508 end: 42
1509 type: function
1510 - labels:
1511 cluster:
1512 reason: Query will only return series where these labels are present.
1513 kind: guaranteed
1514 fragment:
1515 start: 0
1516 end: 43
1517 returns: vector
1518 operations:
1519 - node: '[*parser.VectorSelector] bar{cluster="dev"}'
1520 op: ""
1521 - node: '[*parser.Call] abs(foo{job="myjob"} or bar{cluster="dev"})'
1522 op: abs
1523 position:
1524 start: 4
1525 end: 42
1526 type: function
1527
1528---
1529
1530[TestLabelsSource/46 - 1]
1531expr: sum(foo{job="myjob"} or bar{cluster="dev"}) without(instance)
1532output:
1533 - labels:
1534 __name__:
1535 reason: Aggregation removes metric name.
1536 kind: excluded
1537 fragment:
1538 start: 0
1539 end: 61
1540 instance:
1541 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
1542 kind: excluded
1543 fragment:
1544 start: 52
1545 end: 60
1546 job:
1547 reason: Query will only return series where these labels are present.
1548 kind: guaranteed
1549 fragment:
1550 start: 4
1551 end: 20
1552 returns: vector
1553 operations:
1554 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1555 op: ""
1556 - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"} or bar{cluster="dev"})'
1557 op: sum
1558 usedLabels:
1559 - job
1560 position:
1561 start: 4
1562 end: 20
1563 type: aggregation
1564 - labels:
1565 __name__:
1566 reason: Aggregation removes metric name.
1567 kind: excluded
1568 fragment:
1569 start: 0
1570 end: 61
1571 cluster:
1572 reason: Query will only return series where these labels are present.
1573 kind: guaranteed
1574 fragment:
1575 start: 24
1576 end: 42
1577 instance:
1578 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
1579 kind: excluded
1580 fragment:
1581 start: 52
1582 end: 60
1583 returns: vector
1584 operations:
1585 - node: '[*parser.VectorSelector] bar{cluster="dev"}'
1586 op: ""
1587 - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"} or bar{cluster="dev"})'
1588 op: sum
1589 position:
1590 start: 24
1591 end: 42
1592 type: aggregation
1593
1594---
1595
1596[TestLabelsSource/47 - 1]
1597expr: sum(foo{job="myjob"}) without(instance)
1598output:
1599 - labels:
1600 __name__:
1601 reason: Aggregation removes metric name.
1602 kind: excluded
1603 fragment:
1604 start: 0
1605 end: 39
1606 instance:
1607 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
1608 kind: excluded
1609 fragment:
1610 start: 30
1611 end: 38
1612 job:
1613 reason: Query will only return series where these labels are present.
1614 kind: guaranteed
1615 fragment:
1616 start: 4
1617 end: 20
1618 returns: vector
1619 operations:
1620 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1621 op: ""
1622 - node: '[*parser.AggregateExpr] sum without (instance) (foo{job="myjob"})'
1623 op: sum
1624 position:
1625 start: 4
1626 end: 20
1627 type: aggregation
1628
1629---
1630
1631[TestLabelsSource/48 - 1]
1632expr: min(foo{job="myjob"}) / max(foo{job="myjob"})
1633output:
1634 - labels:
1635 "":
1636 reason: Query is using aggregation that removes all labels.
1637 kind: excluded
1638 fragment:
1639 start: 0
1640 end: 3
1641 __name__:
1642 reason: Binary operation between two vectors removes metric names.
1643 kind: excluded
1644 fragment:
1645 start: 0
1646 end: 45
1647 job:
1648 reason: Query is using aggregation that removes all labels.
1649 kind: excluded
1650 fragment:
1651 start: 0
1652 end: 3
1653 returns: vector
1654 operations:
1655 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1656 op: ""
1657 - node: '[*parser.AggregateExpr] min(foo{job="myjob"})'
1658 op: min
1659 joins:
1660 - addedlabels: []
1661 depth: 0
1662 ison: false
1663 matchinglabels: []
1664 op: /
1665 src:
1666 labels:
1667 "":
1668 reason: Query is using aggregation that removes all labels.
1669 kind: excluded
1670 fragment:
1671 start: 24
1672 end: 27
1673 __name__:
1674 reason: Aggregation removes metric name.
1675 kind: excluded
1676 fragment:
1677 start: 24
1678 end: 45
1679 job:
1680 reason: Query is using aggregation that removes all labels.
1681 kind: excluded
1682 fragment:
1683 start: 24
1684 end: 27
1685 returns: vector
1686 operations:
1687 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1688 op: ""
1689 - node: '[*parser.AggregateExpr] max(foo{job="myjob"})'
1690 op: max
1691 position:
1692 start: 28
1693 end: 44
1694 type: aggregation
1695 fixedLabels: true
1696 position:
1697 start: 4
1698 end: 20
1699 type: aggregation
1700 fixedLabels: true
1701
1702---
1703
1704[TestLabelsSource/49 - 1]
1705expr: max(foo{job="myjob"}) / min(foo{job="myjob"})
1706output:
1707 - labels:
1708 "":
1709 reason: Query is using aggregation that removes all labels.
1710 kind: excluded
1711 fragment:
1712 start: 0
1713 end: 3
1714 __name__:
1715 reason: Binary operation between two vectors removes metric names.
1716 kind: excluded
1717 fragment:
1718 start: 0
1719 end: 45
1720 job:
1721 reason: Query is using aggregation that removes all labels.
1722 kind: excluded
1723 fragment:
1724 start: 0
1725 end: 3
1726 returns: vector
1727 operations:
1728 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1729 op: ""
1730 - node: '[*parser.AggregateExpr] max(foo{job="myjob"})'
1731 op: max
1732 joins:
1733 - addedlabels: []
1734 depth: 0
1735 ison: false
1736 matchinglabels: []
1737 op: /
1738 src:
1739 labels:
1740 "":
1741 reason: Query is using aggregation that removes all labels.
1742 kind: excluded
1743 fragment:
1744 start: 24
1745 end: 27
1746 __name__:
1747 reason: Aggregation removes metric name.
1748 kind: excluded
1749 fragment:
1750 start: 24
1751 end: 45
1752 job:
1753 reason: Query is using aggregation that removes all labels.
1754 kind: excluded
1755 fragment:
1756 start: 24
1757 end: 27
1758 returns: vector
1759 operations:
1760 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1761 op: ""
1762 - node: '[*parser.AggregateExpr] min(foo{job="myjob"})'
1763 op: min
1764 position:
1765 start: 28
1766 end: 44
1767 type: aggregation
1768 fixedLabels: true
1769 position:
1770 start: 4
1771 end: 20
1772 type: aggregation
1773 fixedLabels: true
1774
1775---
1776
1777[TestLabelsSource/50 - 1]
1778expr: avg(foo{job="myjob"}) by(job)
1779output:
1780 - labels:
1781 "":
1782 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1783 kind: excluded
1784 fragment:
1785 start: 22
1786 end: 24
1787 __name__:
1788 reason: Aggregation removes metric name.
1789 kind: excluded
1790 fragment:
1791 start: 0
1792 end: 29
1793 job:
1794 reason: Query will only return series where these labels are present.
1795 kind: guaranteed
1796 fragment:
1797 start: 4
1798 end: 20
1799 returns: vector
1800 operations:
1801 - node: '[*parser.VectorSelector] foo{job="myjob"}'
1802 op: ""
1803 - node: '[*parser.AggregateExpr] avg by (job) (foo{job="myjob"})'
1804 op: avg
1805 usedLabels:
1806 - job
1807 position:
1808 start: 4
1809 end: 20
1810 type: aggregation
1811 fixedLabels: true
1812
1813---
1814
1815[TestLabelsSource/51 - 1]
1816expr: group(foo) by(job)
1817output:
1818 - labels:
1819 "":
1820 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1821 kind: excluded
1822 fragment:
1823 start: 11
1824 end: 13
1825 __name__:
1826 reason: Aggregation removes metric name.
1827 kind: excluded
1828 fragment:
1829 start: 0
1830 end: 18
1831 job:
1832 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
1833 kind: included
1834 fragment:
1835 start: 14
1836 end: 17
1837 returns: vector
1838 operations:
1839 - node: '[*parser.VectorSelector] foo'
1840 op: ""
1841 - node: '[*parser.AggregateExpr] group by (job) (foo)'
1842 op: group
1843 usedLabels:
1844 - job
1845 position:
1846 start: 6
1847 end: 9
1848 type: aggregation
1849 fixedLabels: true
1850
1851---
1852
1853[TestLabelsSource/52 - 1]
1854expr: stddev(rate(foo[5m]))
1855output:
1856 - labels:
1857 "":
1858 reason: Query is using aggregation that removes all labels.
1859 kind: excluded
1860 fragment:
1861 start: 0
1862 end: 6
1863 __name__:
1864 reason: Aggregation removes metric name.
1865 kind: excluded
1866 fragment:
1867 start: 0
1868 end: 21
1869 returns: vector
1870 operations:
1871 - node: '[*parser.VectorSelector] foo'
1872 op: ""
1873 - node: '[*parser.Call] rate(foo[5m])'
1874 op: rate
1875 - node: '[*parser.AggregateExpr] stddev(rate(foo[5m]))'
1876 op: stddev
1877 position:
1878 start: 12
1879 end: 19
1880 type: aggregation
1881 fixedLabels: true
1882
1883---
1884
1885[TestLabelsSource/53 - 1]
1886expr: stdvar(rate(foo[5m]))
1887output:
1888 - labels:
1889 "":
1890 reason: Query is using aggregation that removes all labels.
1891 kind: excluded
1892 fragment:
1893 start: 0
1894 end: 6
1895 __name__:
1896 reason: Aggregation removes metric name.
1897 kind: excluded
1898 fragment:
1899 start: 0
1900 end: 21
1901 returns: vector
1902 operations:
1903 - node: '[*parser.VectorSelector] foo'
1904 op: ""
1905 - node: '[*parser.Call] rate(foo[5m])'
1906 op: rate
1907 - node: '[*parser.AggregateExpr] stdvar(rate(foo[5m]))'
1908 op: stdvar
1909 position:
1910 start: 12
1911 end: 19
1912 type: aggregation
1913 fixedLabels: true
1914
1915---
1916
1917[TestLabelsSource/54 - 1]
1918expr: stddev_over_time(foo[5m])
1919output:
1920 - returns: vector
1921 operations:
1922 - node: '[*parser.VectorSelector] foo'
1923 op: ""
1924 - node: '[*parser.Call] stddev_over_time(foo[5m])'
1925 op: stddev_over_time
1926 position:
1927 start: 17
1928 end: 24
1929 type: function
1930
1931---
1932
1933[TestLabelsSource/55 - 1]
1934expr: stdvar_over_time(foo[5m])
1935output:
1936 - returns: vector
1937 operations:
1938 - node: '[*parser.VectorSelector] foo'
1939 op: ""
1940 - node: '[*parser.Call] stdvar_over_time(foo[5m])'
1941 op: stdvar_over_time
1942 position:
1943 start: 17
1944 end: 24
1945 type: function
1946
1947---
1948
1949[TestLabelsSource/56 - 1]
1950expr: quantile(0.9, rate(foo[5m]))
1951output:
1952 - labels:
1953 "":
1954 reason: Query is using aggregation that removes all labels.
1955 kind: excluded
1956 fragment:
1957 start: 0
1958 end: 8
1959 __name__:
1960 reason: Aggregation removes metric name.
1961 kind: excluded
1962 fragment:
1963 start: 0
1964 end: 28
1965 returns: vector
1966 operations:
1967 - node: '[*parser.VectorSelector] foo'
1968 op: ""
1969 - node: '[*parser.Call] rate(foo[5m])'
1970 op: rate
1971 - args:
1972 - "0.9"
1973 node: '[*parser.AggregateExpr] quantile(0.9, rate(foo[5m]))'
1974 op: quantile
1975 position:
1976 start: 19
1977 end: 26
1978 type: aggregation
1979 fixedLabels: true
1980
1981---
1982
1983[TestLabelsSource/57 - 1]
1984expr: count_values("version", build_version)
1985output:
1986 - labels:
1987 "":
1988 reason: Query is using aggregation that removes all labels.
1989 kind: excluded
1990 fragment:
1991 start: 0
1992 end: 12
1993 __name__:
1994 reason: Aggregation removes metric name.
1995 kind: excluded
1996 fragment:
1997 start: 0
1998 end: 38
1999 version:
2000 reason: This label will be added to the results by the count_values() call.
2001 kind: guaranteed
2002 fragment:
2003 start: 0
2004 end: 38
2005 returns: vector
2006 operations:
2007 - node: '[*parser.VectorSelector] build_version'
2008 op: ""
2009 - args:
2010 - '"version"'
2011 node: '[*parser.AggregateExpr] count_values("version", build_version)'
2012 op: count_values
2013 position:
2014 start: 24
2015 end: 37
2016 type: aggregation
2017 fixedLabels: true
2018
2019---
2020
2021[TestLabelsSource/58 - 1]
2022expr: count_values("version", build_version) without(job)
2023output:
2024 - labels:
2025 __name__:
2026 reason: Aggregation removes metric name.
2027 kind: excluded
2028 fragment:
2029 start: 0
2030 end: 51
2031 job:
2032 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
2033 kind: excluded
2034 fragment:
2035 start: 47
2036 end: 50
2037 version:
2038 reason: This label will be added to the results by the count_values() call.
2039 kind: guaranteed
2040 fragment:
2041 start: 0
2042 end: 51
2043 returns: vector
2044 operations:
2045 - node: '[*parser.VectorSelector] build_version'
2046 op: ""
2047 - args:
2048 - '"version"'
2049 node: '[*parser.AggregateExpr] count_values without (job) ("version", build_version)'
2050 op: count_values
2051 position:
2052 start: 24
2053 end: 37
2054 type: aggregation
2055
2056---
2057
2058[TestLabelsSource/59 - 1]
2059expr: count_values("version", build_version{job="foo"}) without(job)
2060output:
2061 - labels:
2062 __name__:
2063 reason: Aggregation removes metric name.
2064 kind: excluded
2065 fragment:
2066 start: 0
2067 end: 62
2068 job:
2069 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
2070 kind: excluded
2071 fragment:
2072 start: 58
2073 end: 61
2074 version:
2075 reason: This label will be added to the results by the count_values() call.
2076 kind: guaranteed
2077 fragment:
2078 start: 0
2079 end: 62
2080 returns: vector
2081 operations:
2082 - node: '[*parser.VectorSelector] build_version{job="foo"}'
2083 op: ""
2084 - args:
2085 - '"version"'
2086 node: '[*parser.AggregateExpr] count_values without (job) ("version", build_version{job="foo"})'
2087 op: count_values
2088 position:
2089 start: 24
2090 end: 48
2091 type: aggregation
2092
2093---
2094
2095[TestLabelsSource/60 - 1]
2096expr: count_values("version", build_version) by(job)
2097output:
2098 - labels:
2099 "":
2100 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
2101 kind: excluded
2102 fragment:
2103 start: 39
2104 end: 41
2105 __name__:
2106 reason: Aggregation removes metric name.
2107 kind: excluded
2108 fragment:
2109 start: 0
2110 end: 46
2111 job:
2112 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
2113 kind: included
2114 fragment:
2115 start: 42
2116 end: 45
2117 version:
2118 reason: This label will be added to the results by the count_values() call.
2119 kind: guaranteed
2120 fragment:
2121 start: 0
2122 end: 46
2123 returns: vector
2124 operations:
2125 - node: '[*parser.VectorSelector] build_version'
2126 op: ""
2127 - args:
2128 - '"version"'
2129 node: '[*parser.AggregateExpr] count_values by (job) ("version", build_version)'
2130 op: count_values
2131 usedLabels:
2132 - job
2133 position:
2134 start: 24
2135 end: 37
2136 type: aggregation
2137 fixedLabels: true
2138
2139---
2140
2141[TestLabelsSource/61 - 1]
2142expr: topk(10, foo{job="myjob"}) > 10
2143output:
2144 - labels:
2145 job:
2146 reason: Query will only return series where these labels are present.
2147 kind: guaranteed
2148 fragment:
2149 start: 9
2150 end: 25
2151 returns: vector
2152 operations:
2153 - node: '[*parser.VectorSelector] foo{job="myjob"}'
2154 op: ""
2155 - args:
2156 - "10"
2157 node: '[*parser.AggregateExpr] topk(10, foo{job="myjob"})'
2158 op: topk
2159 position:
2160 start: 9
2161 end: 25
2162 type: aggregation
2163 isConditional: true
2164
2165---
2166
2167[TestLabelsSource/62 - 1]
2168expr: topk(10, foo or bar)
2169output:
2170 - returns: vector
2171 operations:
2172 - node: '[*parser.VectorSelector] foo'
2173 op: ""
2174 - args:
2175 - "10"
2176 node: '[*parser.AggregateExpr] topk(10, foo or bar)'
2177 op: topk
2178 position:
2179 start: 9
2180 end: 12
2181 type: aggregation
2182 - returns: vector
2183 operations:
2184 - node: '[*parser.VectorSelector] bar'
2185 op: ""
2186 - args:
2187 - "10"
2188 node: '[*parser.AggregateExpr] topk(10, foo or bar)'
2189 op: topk
2190 position:
2191 start: 16
2192 end: 19
2193 type: aggregation
2194
2195---
2196
2197[TestLabelsSource/63 - 1]
2198expr: rate(foo[10m])
2199output:
2200 - returns: vector
2201 operations:
2202 - node: '[*parser.VectorSelector] foo'
2203 op: ""
2204 - node: '[*parser.Call] rate(foo[10m])'
2205 op: rate
2206 position:
2207 start: 5
2208 end: 13
2209 type: function
2210
2211---
2212
2213[TestLabelsSource/64 - 1]
2214expr: sum(rate(foo[10m])) without(instance)
2215output:
2216 - labels:
2217 __name__:
2218 reason: Aggregation removes metric name.
2219 kind: excluded
2220 fragment:
2221 start: 0
2222 end: 37
2223 instance:
2224 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
2225 kind: excluded
2226 fragment:
2227 start: 28
2228 end: 36
2229 returns: vector
2230 operations:
2231 - node: '[*parser.VectorSelector] foo'
2232 op: ""
2233 - node: '[*parser.Call] rate(foo[10m])'
2234 op: rate
2235 - node: '[*parser.AggregateExpr] sum without (instance) (rate(foo[10m]))'
2236 op: sum
2237 position:
2238 start: 9
2239 end: 17
2240 type: aggregation
2241
2242---
2243
2244[TestLabelsSource/65 - 1]
2245expr: foo{job="foo"} / bar
2246output:
2247 - labels:
2248 __name__:
2249 reason: Binary operation between two vectors removes metric names.
2250 kind: excluded
2251 fragment:
2252 start: 0
2253 end: 20
2254 job:
2255 reason: Query will only return series where these labels are present.
2256 kind: guaranteed
2257 fragment:
2258 start: 0
2259 end: 14
2260 returns: vector
2261 operations:
2262 - node: '[*parser.VectorSelector] foo{job="foo"}'
2263 op: ""
2264 joins:
2265 - addedlabels: []
2266 depth: 0
2267 ison: false
2268 matchinglabels: []
2269 op: /
2270 src:
2271 returns: vector
2272 operations:
2273 - node: '[*parser.VectorSelector] bar'
2274 op: ""
2275 position:
2276 start: 17
2277 end: 20
2278 type: selector
2279 usedLabels:
2280 - job
2281 position:
2282 start: 0
2283 end: 14
2284 type: selector
2285
2286---
2287
2288[TestLabelsSource/66 - 1]
2289expr: foo{job="foo"} * on(instance) bar
2290output:
2291 - labels:
2292 "":
2293 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
2294 kind: excluded
2295 fragment:
2296 start: 17
2297 end: 29
2298 __name__:
2299 reason: Binary operation between two vectors removes metric names.
2300 kind: excluded
2301 fragment:
2302 start: 0
2303 end: 33
2304 instance:
2305 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
2306 kind: included
2307 fragment:
2308 start: 20
2309 end: 28
2310 job:
2311 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
2312 kind: excluded
2313 fragment:
2314 start: 17
2315 end: 29
2316 returns: vector
2317 operations:
2318 - node: '[*parser.VectorSelector] foo{job="foo"}'
2319 op: ""
2320 joins:
2321 - addedlabels: []
2322 depth: 0
2323 ison: true
2324 matchinglabels:
2325 - instance
2326 op: '*'
2327 src:
2328 returns: vector
2329 operations:
2330 - node: '[*parser.VectorSelector] bar'
2331 op: ""
2332 position:
2333 start: 30
2334 end: 33
2335 type: selector
2336 usedLabels:
2337 - instance
2338 position:
2339 start: 0
2340 end: 14
2341 type: selector
2342 fixedLabels: true
2343
2344---
2345
2346[TestLabelsSource/67 - 1]
2347expr: foo{job="foo"} * on(instance) group_left(bar) bar
2348output:
2349 - labels:
2350 __name__:
2351 reason: Binary operation between two vectors removes metric names.
2352 kind: excluded
2353 fragment:
2354 start: 0
2355 end: 49
2356 bar:
2357 reason: Query is using `group_left(bar)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
2358 kind: included
2359 fragment:
2360 start: 41
2361 end: 44
2362 instance:
2363 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
2364 kind: included
2365 fragment:
2366 start: 20
2367 end: 28
2368 job:
2369 reason: Query will only return series where these labels are present.
2370 kind: guaranteed
2371 fragment:
2372 start: 0
2373 end: 14
2374 returns: vector
2375 operations:
2376 - node: '[*parser.VectorSelector] foo{job="foo"}'
2377 op: ""
2378 joins:
2379 - addedlabels:
2380 - bar
2381 depth: 0
2382 ison: true
2383 matchinglabels:
2384 - instance
2385 op: '*'
2386 src:
2387 returns: vector
2388 operations:
2389 - node: '[*parser.VectorSelector] bar'
2390 op: ""
2391 position:
2392 start: 46
2393 end: 49
2394 type: selector
2395 usedLabels:
2396 - instance
2397 position:
2398 start: 0
2399 end: 14
2400 type: selector
2401
2402---
2403
2404[TestLabelsSource/68 - 1]
2405expr: foo{job="foo"} * on(instance) group_left(cluster) bar{cluster="bar", ignored="true"}
2406output:
2407 - labels:
2408 __name__:
2409 reason: Binary operation between two vectors removes metric names.
2410 kind: excluded
2411 fragment:
2412 start: 0
2413 end: 84
2414 cluster:
2415 reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
2416 kind: included
2417 fragment:
2418 start: 41
2419 end: 48
2420 instance:
2421 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
2422 kind: included
2423 fragment:
2424 start: 20
2425 end: 28
2426 job:
2427 reason: Query will only return series where these labels are present.
2428 kind: guaranteed
2429 fragment:
2430 start: 0
2431 end: 14
2432 returns: vector
2433 operations:
2434 - node: '[*parser.VectorSelector] foo{job="foo"}'
2435 op: ""
2436 joins:
2437 - addedlabels:
2438 - cluster
2439 depth: 0
2440 ison: true
2441 matchinglabels:
2442 - instance
2443 op: '*'
2444 src:
2445 labels:
2446 cluster:
2447 reason: Query will only return series where these labels are present.
2448 kind: guaranteed
2449 fragment:
2450 start: 50
2451 end: 84
2452 ignored:
2453 reason: Query will only return series where these labels are present.
2454 kind: guaranteed
2455 fragment:
2456 start: 50
2457 end: 84
2458 returns: vector
2459 operations:
2460 - node: '[*parser.VectorSelector] bar{cluster="bar",ignored="true"}'
2461 op: ""
2462 position:
2463 start: 50
2464 end: 84
2465 type: selector
2466 usedLabels:
2467 - instance
2468 position:
2469 start: 0
2470 end: 14
2471 type: selector
2472
2473---
2474
2475[TestLabelsSource/69 - 1]
2476expr: foo{job="foo", ignored="true"} * on(instance) group_right(job) bar{cluster="bar"}
2477output:
2478 - labels:
2479 __name__:
2480 reason: Binary operation between two vectors removes metric names.
2481 kind: excluded
2482 fragment:
2483 start: 0
2484 end: 81
2485 cluster:
2486 reason: Query will only return series where these labels are present.
2487 kind: guaranteed
2488 fragment:
2489 start: 63
2490 end: 81
2491 instance:
2492 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
2493 kind: included
2494 fragment:
2495 start: 36
2496 end: 44
2497 job:
2498 reason: Query is using `group_right(job)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
2499 kind: included
2500 fragment:
2501 start: 58
2502 end: 61
2503 returns: vector
2504 operations:
2505 - node: '[*parser.VectorSelector] bar{cluster="bar"}'
2506 op: ""
2507 joins:
2508 - addedlabels:
2509 - job
2510 depth: 0
2511 ison: true
2512 matchinglabels:
2513 - instance
2514 op: '*'
2515 src:
2516 labels:
2517 ignored:
2518 reason: Query will only return series where these labels are present.
2519 kind: guaranteed
2520 fragment:
2521 start: 0
2522 end: 30
2523 job:
2524 reason: Query will only return series where these labels are present.
2525 kind: guaranteed
2526 fragment:
2527 start: 0
2528 end: 30
2529 returns: vector
2530 operations:
2531 - node: '[*parser.VectorSelector] foo{ignored="true",job="foo"}'
2532 op: ""
2533 position:
2534 start: 0
2535 end: 30
2536 type: selector
2537 usedLabels:
2538 - instance
2539 position:
2540 start: 63
2541 end: 81
2542 type: selector
2543
2544---
2545
2546[TestLabelsSource/70 - 1]
2547expr: count(foo / bar)
2548output:
2549 - labels:
2550 "":
2551 reason: Query is using aggregation that removes all labels.
2552 kind: excluded
2553 fragment:
2554 start: 0
2555 end: 5
2556 __name__:
2557 reason: Aggregation removes metric name.
2558 kind: excluded
2559 fragment:
2560 start: 0
2561 end: 16
2562 returns: vector
2563 operations:
2564 - node: '[*parser.VectorSelector] foo'
2565 op: ""
2566 - node: '[*parser.AggregateExpr] count(foo / bar)'
2567 op: count
2568 joins:
2569 - addedlabels: []
2570 depth: 1
2571 ison: false
2572 matchinglabels: []
2573 op: /
2574 src:
2575 returns: vector
2576 operations:
2577 - node: '[*parser.VectorSelector] bar'
2578 op: ""
2579 position:
2580 start: 12
2581 end: 15
2582 type: selector
2583 position:
2584 start: 6
2585 end: 9
2586 type: aggregation
2587 fixedLabels: true
2588
2589---
2590
2591[TestLabelsSource/71 - 1]
2592expr: count(up{job="a"} / on () up{job="b"})
2593output:
2594 - labels:
2595 "":
2596 reason: Query is using aggregation that removes all labels.
2597 kind: excluded
2598 fragment:
2599 start: 0
2600 end: 5
2601 __name__:
2602 reason: Aggregation removes metric name.
2603 kind: excluded
2604 fragment:
2605 start: 0
2606 end: 38
2607 job:
2608 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
2609 kind: excluded
2610 fragment:
2611 start: 20
2612 end: 25
2613 returns: vector
2614 operations:
2615 - node: '[*parser.VectorSelector] up{job="a"}'
2616 op: ""
2617 - node: '[*parser.AggregateExpr] count(up{job="a"} / on () up{job="b"})'
2618 op: count
2619 joins:
2620 - addedlabels: []
2621 depth: 1
2622 ison: true
2623 matchinglabels: []
2624 op: /
2625 src:
2626 labels:
2627 job:
2628 reason: Query will only return series where these labels are present.
2629 kind: guaranteed
2630 fragment:
2631 start: 26
2632 end: 37
2633 returns: vector
2634 operations:
2635 - node: '[*parser.VectorSelector] up{job="b"}'
2636 op: ""
2637 position:
2638 start: 26
2639 end: 37
2640 type: selector
2641 position:
2642 start: 6
2643 end: 17
2644 type: aggregation
2645 fixedLabels: true
2646
2647---
2648
2649[TestLabelsSource/72 - 1]
2650expr: count(up{job="a"} / on (env) up{job="b"})
2651output:
2652 - labels:
2653 "":
2654 reason: Query is using aggregation that removes all labels.
2655 kind: excluded
2656 fragment:
2657 start: 0
2658 end: 5
2659 __name__:
2660 reason: Aggregation removes metric name.
2661 kind: excluded
2662 fragment:
2663 start: 0
2664 end: 41
2665 env:
2666 reason: Query is using aggregation that removes all labels.
2667 kind: excluded
2668 fragment:
2669 start: 0
2670 end: 5
2671 job:
2672 reason: Query is using one-to-one vector matching with `on(env)`, only labels included inside `on(...)` will be present on the results.
2673 kind: excluded
2674 fragment:
2675 start: 20
2676 end: 28
2677 returns: vector
2678 operations:
2679 - node: '[*parser.VectorSelector] up{job="a"}'
2680 op: ""
2681 - node: '[*parser.AggregateExpr] count(up{job="a"} / on (env) up{job="b"})'
2682 op: count
2683 joins:
2684 - addedlabels: []
2685 depth: 1
2686 ison: true
2687 matchinglabels:
2688 - env
2689 op: /
2690 src:
2691 labels:
2692 job:
2693 reason: Query will only return series where these labels are present.
2694 kind: guaranteed
2695 fragment:
2696 start: 29
2697 end: 40
2698 returns: vector
2699 operations:
2700 - node: '[*parser.VectorSelector] up{job="b"}'
2701 op: ""
2702 position:
2703 start: 29
2704 end: 40
2705 type: selector
2706 position:
2707 start: 6
2708 end: 17
2709 type: aggregation
2710 fixedLabels: true
2711
2712---
2713
2714[TestLabelsSource/73 - 1]
2715expr: foo{job="foo", instance="1"} and bar
2716output:
2717 - labels:
2718 instance:
2719 reason: Query will only return series where these labels are present.
2720 kind: guaranteed
2721 fragment:
2722 start: 0
2723 end: 28
2724 job:
2725 reason: Query will only return series where these labels are present.
2726 kind: guaranteed
2727 fragment:
2728 start: 0
2729 end: 28
2730 returns: vector
2731 operations:
2732 - node: '[*parser.VectorSelector] foo{instance="1",job="foo"}'
2733 op: ""
2734 joins:
2735 - addedlabels: []
2736 depth: 0
2737 ison: false
2738 matchinglabels: []
2739 op: and
2740 src:
2741 returns: vector
2742 operations:
2743 - node: '[*parser.VectorSelector] bar'
2744 op: ""
2745 position:
2746 start: 33
2747 end: 36
2748 type: selector
2749 usedLabels:
2750 - instance
2751 - job
2752 position:
2753 start: 0
2754 end: 28
2755 type: selector
2756
2757---
2758
2759[TestLabelsSource/74 - 1]
2760expr: foo{job="foo", instance="1"} and on(cluster) bar
2761output:
2762 - labels:
2763 cluster:
2764 reason: Query is using many-to-many vector matching with `on(cluster)`, labels included inside `on(...)` will be present on the results if matched time series have them.
2765 kind: included
2766 fragment:
2767 start: 36
2768 end: 43
2769 instance:
2770 reason: Query will only return series where these labels are present.
2771 kind: guaranteed
2772 fragment:
2773 start: 0
2774 end: 28
2775 job:
2776 reason: Query will only return series where these labels are present.
2777 kind: guaranteed
2778 fragment:
2779 start: 0
2780 end: 28
2781 returns: vector
2782 operations:
2783 - node: '[*parser.VectorSelector] foo{instance="1",job="foo"}'
2784 op: ""
2785 joins:
2786 - addedlabels: []
2787 depth: 0
2788 ison: true
2789 matchinglabels:
2790 - cluster
2791 op: and
2792 src:
2793 returns: vector
2794 operations:
2795 - node: '[*parser.VectorSelector] bar'
2796 op: ""
2797 position:
2798 start: 45
2799 end: 48
2800 type: selector
2801 usedLabels:
2802 - cluster
2803 position:
2804 start: 0
2805 end: 28
2806 type: selector
2807
2808---
2809
2810[TestLabelsSource/75 - 1]
2811expr: topk(10, foo)
2812output:
2813 - returns: vector
2814 operations:
2815 - node: '[*parser.VectorSelector] foo'
2816 op: ""
2817 - args:
2818 - "10"
2819 node: '[*parser.AggregateExpr] topk(10, foo)'
2820 op: topk
2821 position:
2822 start: 9
2823 end: 12
2824 type: aggregation
2825
2826---
2827
2828[TestLabelsSource/76 - 1]
2829expr: topk(10, foo) without(cluster)
2830output:
2831 - returns: vector
2832 operations:
2833 - node: '[*parser.VectorSelector] foo'
2834 op: ""
2835 - args:
2836 - "10"
2837 node: '[*parser.AggregateExpr] topk without (cluster) (10, foo)'
2838 op: topk
2839 position:
2840 start: 9
2841 end: 12
2842 type: aggregation
2843
2844---
2845
2846[TestLabelsSource/77 - 1]
2847expr: topk(10, foo) by(cluster)
2848output:
2849 - returns: vector
2850 operations:
2851 - node: '[*parser.VectorSelector] foo'
2852 op: ""
2853 - args:
2854 - "10"
2855 node: '[*parser.AggregateExpr] topk by (cluster) (10, foo)'
2856 op: topk
2857 position:
2858 start: 9
2859 end: 12
2860 type: aggregation
2861
2862---
2863
2864[TestLabelsSource/78 - 1]
2865expr: bottomk(10, sum(rate(foo[5m])) without(job))
2866output:
2867 - labels:
2868 __name__:
2869 reason: Aggregation removes metric name.
2870 kind: excluded
2871 fragment:
2872 start: 12
2873 end: 43
2874 job:
2875 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
2876 kind: excluded
2877 fragment:
2878 start: 39
2879 end: 42
2880 returns: vector
2881 operations:
2882 - node: '[*parser.VectorSelector] foo'
2883 op: ""
2884 - node: '[*parser.Call] rate(foo[5m])'
2885 op: rate
2886 - node: '[*parser.AggregateExpr] sum without (job) (rate(foo[5m]))'
2887 op: sum
2888 - args:
2889 - "10"
2890 node: '[*parser.AggregateExpr] bottomk(10, sum without (job) (rate(foo[5m])))'
2891 op: bottomk
2892 position:
2893 start: 21
2894 end: 28
2895 type: aggregation
2896
2897---
2898
2899[TestLabelsSource/79 - 1]
2900expr: foo or bar
2901output:
2902 - returns: vector
2903 operations:
2904 - node: '[*parser.VectorSelector] foo'
2905 op: ""
2906 position:
2907 start: 0
2908 end: 3
2909 type: selector
2910 - returns: vector
2911 operations:
2912 - node: '[*parser.VectorSelector] bar'
2913 op: ""
2914 position:
2915 start: 7
2916 end: 10
2917 type: selector
2918
2919---
2920
2921[TestLabelsSource/80 - 1]
2922expr: foo or bar or baz
2923output:
2924 - returns: vector
2925 operations:
2926 - node: '[*parser.VectorSelector] foo'
2927 op: ""
2928 position:
2929 start: 0
2930 end: 3
2931 type: selector
2932 - returns: vector
2933 operations:
2934 - node: '[*parser.VectorSelector] bar'
2935 op: ""
2936 position:
2937 start: 7
2938 end: 10
2939 type: selector
2940 - returns: vector
2941 operations:
2942 - node: '[*parser.VectorSelector] baz'
2943 op: ""
2944 position:
2945 start: 14
2946 end: 17
2947 type: selector
2948
2949---
2950
2951[TestLabelsSource/81 - 1]
2952expr: (foo or bar) or baz
2953output:
2954 - returns: vector
2955 operations:
2956 - node: '[*parser.VectorSelector] foo'
2957 op: ""
2958 position:
2959 start: 1
2960 end: 4
2961 type: selector
2962 - returns: vector
2963 operations:
2964 - node: '[*parser.VectorSelector] bar'
2965 op: ""
2966 position:
2967 start: 8
2968 end: 11
2969 type: selector
2970 - returns: vector
2971 operations:
2972 - node: '[*parser.VectorSelector] baz'
2973 op: ""
2974 position:
2975 start: 16
2976 end: 19
2977 type: selector
2978
2979---
2980
2981[TestLabelsSource/82 - 1]
2982expr: foo unless bar
2983output:
2984 - returns: vector
2985 operations:
2986 - node: '[*parser.VectorSelector] foo'
2987 op: ""
2988 unless:
2989 - matchinglabels: []
2990 src:
2991 returns: vector
2992 operations:
2993 - node: '[*parser.VectorSelector] bar'
2994 op: ""
2995 position:
2996 start: 11
2997 end: 14
2998 type: selector
2999 ison: false
3000 position:
3001 start: 0
3002 end: 3
3003 type: selector
3004
3005---
3006
3007[TestLabelsSource/83 - 1]
3008expr: foo unless bar > 5
3009output:
3010 - returns: vector
3011 operations:
3012 - node: '[*parser.VectorSelector] foo'
3013 op: ""
3014 unless:
3015 - matchinglabels: []
3016 src:
3017 returns: vector
3018 operations:
3019 - node: '[*parser.VectorSelector] bar'
3020 op: ""
3021 position:
3022 start: 11
3023 end: 14
3024 type: selector
3025 isConditional: true
3026 ison: false
3027 position:
3028 start: 0
3029 end: 3
3030 type: selector
3031
3032---
3033
3034[TestLabelsSource/84 - 1]
3035expr: foo unless bar unless baz
3036output:
3037 - returns: vector
3038 operations:
3039 - node: '[*parser.VectorSelector] foo'
3040 op: ""
3041 unless:
3042 - matchinglabels: []
3043 src:
3044 returns: vector
3045 operations:
3046 - node: '[*parser.VectorSelector] bar'
3047 op: ""
3048 position:
3049 start: 11
3050 end: 14
3051 type: selector
3052 ison: false
3053 - matchinglabels: []
3054 src:
3055 returns: vector
3056 operations:
3057 - node: '[*parser.VectorSelector] baz'
3058 op: ""
3059 position:
3060 start: 22
3061 end: 25
3062 type: selector
3063 ison: false
3064 position:
3065 start: 0
3066 end: 3
3067 type: selector
3068
3069---
3070
3071[TestLabelsSource/85 - 1]
3072expr: count(sum(up{job="foo", cluster="dev"}) by(job, cluster) == 0) without(job, cluster)
3073output:
3074 - labels:
3075 "":
3076 reason: Query is using aggregation with `by(job, cluster)`, only labels included inside `by(...)` will be present on the results.
3077 kind: excluded
3078 fragment:
3079 start: 40
3080 end: 42
3081 __name__:
3082 reason: Aggregation removes metric name.
3083 kind: excluded
3084 fragment:
3085 start: 0
3086 end: 84
3087 cluster:
3088 reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results.
3089 kind: excluded
3090 fragment:
3091 start: 76
3092 end: 83
3093 job:
3094 reason: Query is using aggregation with `without(job, cluster)`, all labels included inside `without(...)` will be removed from the results.
3095 kind: excluded
3096 fragment:
3097 start: 71
3098 end: 74
3099 returns: vector
3100 operations:
3101 - node: '[*parser.VectorSelector] up{cluster="dev",job="foo"}'
3102 op: ""
3103 - node: '[*parser.AggregateExpr] sum by (job, cluster) (up{cluster="dev",job="foo"})'
3104 op: sum
3105 - node: '[*parser.AggregateExpr] count without (job, cluster) (sum by (job, cluster) (up{cluster="dev",job="foo"}) == 0)'
3106 op: count
3107 position:
3108 start: 10
3109 end: 38
3110 type: aggregation
3111 fixedLabels: true
3112 isConditional: true
3113
3114---
3115
3116[TestLabelsSource/86 - 1]
3117expr: year()
3118output:
3119 - labels:
3120 "":
3121 reason: Calling `year()` with no arguments will return an empty time series with no labels.
3122 kind: excluded
3123 fragment:
3124 start: 0
3125 end: 6
3126 returns: vector
3127 operations:
3128 - node: '[*parser.Call] year()'
3129 op: year
3130 returnInfo:
3131 logicalexpr: ""
3132 valueposition:
3133 start: 0
3134 end: 0
3135 returnednumber: 0
3136 alwaysreturns: true
3137 knownreturn: false
3138 isreturnbool: false
3139 position:
3140 start: 0
3141 end: 6
3142 type: function
3143 fixedLabels: true
3144
3145---
3146
3147[TestLabelsSource/87 - 1]
3148expr: year(foo)
3149output:
3150 - returns: vector
3151 operations:
3152 - node: '[*parser.VectorSelector] foo'
3153 op: ""
3154 - node: '[*parser.Call] year(foo)'
3155 op: year
3156 position:
3157 start: 5
3158 end: 8
3159 type: function
3160
3161---
3162
3163[TestLabelsSource/88 - 1]
3164expr: label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")
3165output:
3166 - labels:
3167 foo:
3168 reason: This label will be added to the result by label_join() call.
3169 kind: guaranteed
3170 fragment:
3171 start: 0
3172 end: 95
3173 job:
3174 reason: Query will only return series where these labels are present.
3175 kind: guaranteed
3176 fragment:
3177 start: 11
3178 end: 58
3179 src1:
3180 reason: Query will only return series where these labels are present.
3181 kind: guaranteed
3182 fragment:
3183 start: 11
3184 end: 58
3185 src2:
3186 reason: Query will only return series where these labels are present.
3187 kind: guaranteed
3188 fragment:
3189 start: 11
3190 end: 58
3191 src3:
3192 reason: Query will only return series where these labels are present.
3193 kind: guaranteed
3194 fragment:
3195 start: 11
3196 end: 58
3197 returns: vector
3198 operations:
3199 - node: '[*parser.VectorSelector] up{job="api-server",src1="a",src2="b",src3="c"}'
3200 op: ""
3201 - args:
3202 - '"foo"'
3203 - '","'
3204 - '"src1"'
3205 - '"src2"'
3206 - '"src3"'
3207 node: '[*parser.Call] label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")'
3208 op: label_join
3209 usedLabels:
3210 - src1
3211 - src2
3212 - src3
3213 position:
3214 start: 11
3215 end: 58
3216 type: function
3217
3218---
3219
3220[TestLabelsSource/89 - 1]
3221expr: |4-
3222
3223 (
3224 sum(foo:sum > 0) without(notify)
3225 * on(job) group_left(notify)
3226 job:notify
3227 )
3228 and on(job)
3229 sum(foo:count) by(job) > 20
3230output:
3231 - labels:
3232 __name__:
3233 reason: Binary operation between two vectors removes metric names.
3234 kind: excluded
3235 fragment:
3236 start: 4
3237 end: 78
3238 job:
3239 reason: Query is using many-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results if matched time series have them.
3240 kind: included
3241 fragment:
3242 start: 111
3243 end: 114
3244 notify:
3245 reason: Query is using `group_left(notify)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
3246 kind: included
3247 fragment:
3248 start: 59
3249 end: 65
3250 returns: vector
3251 operations:
3252 - node: '[*parser.VectorSelector] foo:sum'
3253 op: ""
3254 - node: '[*parser.AggregateExpr] sum without (notify) (foo:sum > 0)'
3255 op: sum
3256 joins:
3257 - addedlabels:
3258 - notify
3259 depth: 0
3260 ison: true
3261 matchinglabels:
3262 - job
3263 op: '*'
3264 src:
3265 returns: vector
3266 operations:
3267 - node: '[*parser.VectorSelector] job:notify'
3268 op: ""
3269 position:
3270 start: 68
3271 end: 78
3272 type: selector
3273 - addedlabels: []
3274 depth: 0
3275 ison: true
3276 matchinglabels:
3277 - job
3278 op: and
3279 src:
3280 labels:
3281 "":
3282 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
3283 kind: excluded
3284 fragment:
3285 start: 108
3286 end: 110
3287 __name__:
3288 reason: Aggregation removes metric name.
3289 kind: excluded
3290 fragment:
3291 start: 93
3292 end: 115
3293 job:
3294 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
3295 kind: included
3296 fragment:
3297 start: 111
3298 end: 114
3299 returns: vector
3300 operations:
3301 - node: '[*parser.VectorSelector] foo:count'
3302 op: ""
3303 - node: '[*parser.AggregateExpr] sum by (job) (foo:count)'
3304 op: sum
3305 usedLabels:
3306 - job
3307 position:
3308 start: 97
3309 end: 106
3310 type: aggregation
3311 fixedLabels: true
3312 isConditional: true
3313 usedLabels:
3314 - job
3315 position:
3316 start: 8
3317 end: 15
3318 type: aggregation
3319 isConditional: true
3320
3321---
3322
3323[TestLabelsSource/90 - 1]
3324expr: container_file_descriptors / on (instance, app_name) container_ulimits_soft{ulimit="max_open_files"}
3325output:
3326 - labels:
3327 "":
3328 reason: Query is using one-to-one vector matching with `on(instance, app_name)`, only labels included inside `on(...)` will be present on the results.
3329 kind: excluded
3330 fragment:
3331 start: 29
3332 end: 52
3333 __name__:
3334 reason: Binary operation between two vectors removes metric names.
3335 kind: excluded
3336 fragment:
3337 start: 0
3338 end: 100
3339 app_name:
3340 reason: Query is using one-to-one vector matching with `on(instance, app_name)`, only labels included inside `on(...)` will be present on the results.
3341 kind: included
3342 fragment:
3343 start: 43
3344 end: 51
3345 instance:
3346 reason: Query is using one-to-one vector matching with `on(instance, app_name)`, only labels included inside `on(...)` will be present on the results.
3347 kind: included
3348 fragment:
3349 start: 33
3350 end: 41
3351 returns: vector
3352 operations:
3353 - node: '[*parser.VectorSelector] container_file_descriptors'
3354 op: ""
3355 joins:
3356 - addedlabels: []
3357 depth: 0
3358 ison: true
3359 matchinglabels:
3360 - instance
3361 - app_name
3362 op: /
3363 src:
3364 labels:
3365 ulimit:
3366 reason: Query will only return series where these labels are present.
3367 kind: guaranteed
3368 fragment:
3369 start: 53
3370 end: 100
3371 returns: vector
3372 operations:
3373 - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}'
3374 op: ""
3375 position:
3376 start: 53
3377 end: 100
3378 type: selector
3379 usedLabels:
3380 - instance
3381 - app_name
3382 position:
3383 start: 0
3384 end: 26
3385 type: selector
3386 fixedLabels: true
3387
3388---
3389
3390[TestLabelsSource/91 - 1]
3391expr: container_file_descriptors / on (instance, app_name) group_left() container_ulimits_soft{ulimit="max_open_files"}
3392output:
3393 - labels:
3394 __name__:
3395 reason: Binary operation between two vectors removes metric names.
3396 kind: excluded
3397 fragment:
3398 start: 0
3399 end: 113
3400 app_name:
3401 reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results.
3402 kind: included
3403 fragment:
3404 start: 43
3405 end: 51
3406 instance:
3407 reason: Query is using many-to-one vector matching with `on(instance, app_name)`, labels included inside `on(...)` will be present on the results.
3408 kind: included
3409 fragment:
3410 start: 33
3411 end: 41
3412 returns: vector
3413 operations:
3414 - node: '[*parser.VectorSelector] container_file_descriptors'
3415 op: ""
3416 joins:
3417 - addedlabels: []
3418 depth: 0
3419 ison: true
3420 matchinglabels:
3421 - instance
3422 - app_name
3423 op: /
3424 src:
3425 labels:
3426 ulimit:
3427 reason: Query will only return series where these labels are present.
3428 kind: guaranteed
3429 fragment:
3430 start: 66
3431 end: 113
3432 returns: vector
3433 operations:
3434 - node: '[*parser.VectorSelector] container_ulimits_soft{ulimit="max_open_files"}'
3435 op: ""
3436 position:
3437 start: 66
3438 end: 113
3439 type: selector
3440 usedLabels:
3441 - instance
3442 - app_name
3443 position:
3444 start: 0
3445 end: 26
3446 type: selector
3447
3448---
3449
3450[TestLabelsSource/92 - 1]
3451expr: absent(foo{job="bar"})
3452output:
3453 - labels:
3454 "":
3455 reason: |-
3456 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3457 You will only get any results back if the metric selector you pass doesn't match anything.
3458 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3459 This means that the only labels you can get back from absent call are the ones you pass to it.
3460 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3461 kind: excluded
3462 fragment:
3463 start: 0
3464 end: 6
3465 job:
3466 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
3467 kind: guaranteed
3468 fragment:
3469 start: 0
3470 end: 22
3471 returns: vector
3472 operations:
3473 - node: '[*parser.VectorSelector] foo{job="bar"}'
3474 op: ""
3475 - node: '[*parser.Call] absent(foo{job="bar"})'
3476 op: absent
3477 usedLabels:
3478 - job
3479 position:
3480 start: 7
3481 end: 21
3482 type: function
3483 fixedLabels: true
3484
3485---
3486
3487[TestLabelsSource/93 - 1]
3488expr: absent(foo{job="bar", cluster!="dev", instance=~".+", env="prod"})
3489output:
3490 - labels:
3491 "":
3492 reason: |-
3493 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3494 You will only get any results back if the metric selector you pass doesn't match anything.
3495 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3496 This means that the only labels you can get back from absent call are the ones you pass to it.
3497 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3498 kind: excluded
3499 fragment:
3500 start: 0
3501 end: 6
3502 env:
3503 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
3504 kind: guaranteed
3505 fragment:
3506 start: 0
3507 end: 66
3508 instance:
3509 reason: |-
3510 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3511 You will only get any results back if the metric selector you pass doesn't match anything.
3512 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3513 This means that the only labels you can get back from absent call are the ones you pass to it.
3514 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3515 kind: excluded
3516 fragment:
3517 start: 0
3518 end: 6
3519 job:
3520 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
3521 kind: guaranteed
3522 fragment:
3523 start: 0
3524 end: 66
3525 returns: vector
3526 operations:
3527 - node: '[*parser.VectorSelector] foo{cluster!="dev",env="prod",instance=~".+",job="bar"}'
3528 op: ""
3529 - node: '[*parser.Call] absent(foo{cluster!="dev",env="prod",instance=~".+",job="bar"})'
3530 op: absent
3531 usedLabels:
3532 - job
3533 - env
3534 position:
3535 start: 7
3536 end: 65
3537 type: function
3538 fixedLabels: true
3539
3540---
3541
3542[TestLabelsSource/94 - 1]
3543expr: absent(sum(foo) by(job, instance))
3544output:
3545 - labels:
3546 "":
3547 reason: |-
3548 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3549 You will only get any results back if the metric selector you pass doesn't match anything.
3550 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3551 This means that the only labels you can get back from absent call are the ones you pass to it.
3552 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3553 kind: excluded
3554 fragment:
3555 start: 0
3556 end: 6
3557 __name__:
3558 reason: Aggregation removes metric name.
3559 kind: excluded
3560 fragment:
3561 start: 7
3562 end: 33
3563 instance:
3564 reason: |-
3565 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3566 You will only get any results back if the metric selector you pass doesn't match anything.
3567 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3568 This means that the only labels you can get back from absent call are the ones you pass to it.
3569 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3570 kind: excluded
3571 fragment:
3572 start: 0
3573 end: 6
3574 job:
3575 reason: |-
3576 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3577 You will only get any results back if the metric selector you pass doesn't match anything.
3578 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3579 This means that the only labels you can get back from absent call are the ones you pass to it.
3580 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3581 kind: excluded
3582 fragment:
3583 start: 0
3584 end: 6
3585 returns: vector
3586 operations:
3587 - node: '[*parser.VectorSelector] foo'
3588 op: ""
3589 - node: '[*parser.AggregateExpr] sum by (job, instance) (foo)'
3590 op: sum
3591 - node: '[*parser.Call] absent(sum by (job, instance) (foo))'
3592 op: absent
3593 position:
3594 start: 7
3595 end: 33
3596 type: function
3597 fixedLabels: true
3598
3599---
3600
3601[TestLabelsSource/95 - 1]
3602expr: absent(foo{job="prometheus", xxx="1"}) AND on(job) prometheus_build_info
3603output:
3604 - labels:
3605 "":
3606 reason: |-
3607 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3608 You will only get any results back if the metric selector you pass doesn't match anything.
3609 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3610 This means that the only labels you can get back from absent call are the ones you pass to it.
3611 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3612 kind: excluded
3613 fragment:
3614 start: 0
3615 end: 6
3616 job:
3617 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
3618 kind: guaranteed
3619 fragment:
3620 start: 0
3621 end: 38
3622 xxx:
3623 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
3624 kind: guaranteed
3625 fragment:
3626 start: 0
3627 end: 38
3628 returns: vector
3629 operations:
3630 - node: '[*parser.VectorSelector] foo{job="prometheus",xxx="1"}'
3631 op: ""
3632 - node: '[*parser.Call] absent(foo{job="prometheus",xxx="1"})'
3633 op: absent
3634 joins:
3635 - addedlabels: []
3636 depth: 0
3637 ison: true
3638 matchinglabels:
3639 - job
3640 op: and
3641 src:
3642 returns: vector
3643 operations:
3644 - node: '[*parser.VectorSelector] prometheus_build_info'
3645 op: ""
3646 position:
3647 start: 51
3648 end: 72
3649 type: selector
3650 usedLabels:
3651 - job
3652 - xxx
3653 position:
3654 start: 7
3655 end: 37
3656 type: function
3657 fixedLabels: true
3658
3659---
3660
3661[TestLabelsSource/96 - 1]
3662expr: 1 + sum(foo) by(notjob)
3663output:
3664 - labels:
3665 "":
3666 reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results.
3667 kind: excluded
3668 fragment:
3669 start: 13
3670 end: 15
3671 __name__:
3672 reason: Aggregation removes metric name.
3673 kind: excluded
3674 fragment:
3675 start: 4
3676 end: 23
3677 notjob:
3678 reason: Query is using aggregation with `by(notjob)`, only labels included inside `by(...)` will be present on the results.
3679 kind: included
3680 fragment:
3681 start: 16
3682 end: 22
3683 returns: vector
3684 operations:
3685 - node: '[*parser.VectorSelector] foo'
3686 op: ""
3687 - node: '[*parser.AggregateExpr] sum by (notjob) (foo)'
3688 op: sum
3689 usedLabels:
3690 - notjob
3691 position:
3692 start: 8
3693 end: 11
3694 type: aggregation
3695 fixedLabels: true
3696
3697---
3698
3699[TestLabelsSource/97 - 1]
3700expr: count(node_exporter_build_info) by (instance, version) != ignoring(package,version) group_left(foo) count(deb_package_version) by (instance, version, package)
3701output:
3702 - labels:
3703 "":
3704 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
3705 kind: excluded
3706 fragment:
3707 start: 32
3708 end: 35
3709 __name__:
3710 reason: Binary operation between two vectors removes metric names.
3711 kind: excluded
3712 fragment:
3713 start: 0
3714 end: 158
3715 foo:
3716 reason: Query is using `group_left(foo)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
3717 kind: included
3718 fragment:
3719 start: 95
3720 end: 98
3721 instance:
3722 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
3723 kind: included
3724 fragment:
3725 start: 36
3726 end: 44
3727 version:
3728 reason: Query is using aggregation with `by(instance, version)`, only labels included inside `by(...)` will be present on the results.
3729 kind: included
3730 fragment:
3731 start: 46
3732 end: 53
3733 returns: vector
3734 operations:
3735 - node: '[*parser.VectorSelector] node_exporter_build_info'
3736 op: ""
3737 - node: '[*parser.AggregateExpr] count by (instance, version) (node_exporter_build_info)'
3738 op: count
3739 joins:
3740 - addedlabels:
3741 - foo
3742 depth: 0
3743 ison: false
3744 matchinglabels:
3745 - package
3746 - version
3747 op: '!='
3748 src:
3749 labels:
3750 "":
3751 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
3752 kind: excluded
3753 fragment:
3754 start: 127
3755 end: 130
3756 __name__:
3757 reason: Aggregation removes metric name.
3758 kind: excluded
3759 fragment:
3760 start: 100
3761 end: 158
3762 instance:
3763 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
3764 kind: included
3765 fragment:
3766 start: 131
3767 end: 139
3768 package:
3769 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
3770 kind: included
3771 fragment:
3772 start: 150
3773 end: 157
3774 version:
3775 reason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
3776 kind: included
3777 fragment:
3778 start: 141
3779 end: 148
3780 deadLabels:
3781 - name: foo
3782 reason: You can't use `foo` because this label is not possible here.
3783 labelreason: Query is using aggregation with `by(instance, version, package)`, only labels included inside `by(...)` will be present on the results.
3784 usagefragment:
3785 start: 95
3786 end: 98
3787 labelfragment:
3788 start: 127
3789 end: 130
3790 kind: 0
3791 returns: vector
3792 operations:
3793 - node: '[*parser.VectorSelector] deb_package_version'
3794 op: ""
3795 - node: '[*parser.AggregateExpr] count by (instance, version, package) (deb_package_version)'
3796 op: count
3797 usedLabels:
3798 - instance
3799 - version
3800 - package
3801 position:
3802 start: 106
3803 end: 125
3804 type: aggregation
3805 fixedLabels: true
3806 usedLabels:
3807 - instance
3808 - version
3809 - foo
3810 position:
3811 start: 6
3812 end: 30
3813 type: aggregation
3814 fixedLabels: true
3815 isConditional: true
3816
3817---
3818
3819[TestLabelsSource/98 - 1]
3820expr: absent(foo) or absent(bar)
3821output:
3822 - labels:
3823 "":
3824 reason: |-
3825 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3826 You will only get any results back if the metric selector you pass doesn't match anything.
3827 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3828 This means that the only labels you can get back from absent call are the ones you pass to it.
3829 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3830 kind: excluded
3831 fragment:
3832 start: 0
3833 end: 6
3834 returns: vector
3835 operations:
3836 - node: '[*parser.VectorSelector] foo'
3837 op: ""
3838 - node: '[*parser.Call] absent(foo)'
3839 op: absent
3840 position:
3841 start: 7
3842 end: 10
3843 type: function
3844 fixedLabels: true
3845 - labels:
3846 "":
3847 reason: |-
3848 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3849 You will only get any results back if the metric selector you pass doesn't match anything.
3850 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3851 This means that the only labels you can get back from absent call are the ones you pass to it.
3852 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3853 kind: excluded
3854 fragment:
3855 start: 15
3856 end: 21
3857 returns: vector
3858 operations:
3859 - node: '[*parser.VectorSelector] bar'
3860 op: ""
3861 - node: '[*parser.Call] absent(bar)'
3862 op: absent
3863 position:
3864 start: 22
3865 end: 25
3866 type: function
3867 fixedLabels: true
3868
3869---
3870
3871[TestLabelsSource/99 - 1]
3872expr: absent(vector(1))
3873output:
3874 - labels:
3875 "":
3876 reason: |-
3877 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3878 You will only get any results back if the metric selector you pass doesn't match anything.
3879 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3880 This means that the only labels you can get back from absent call are the ones you pass to it.
3881 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3882 kind: excluded
3883 fragment:
3884 start: 0
3885 end: 6
3886 returns: vector
3887 operations:
3888 - args:
3889 - "1"
3890 node: '[*parser.Call] vector(1)'
3891 op: vector
3892 - node: '[*parser.Call] absent(vector(1))'
3893 op: absent
3894 returnInfo:
3895 logicalexpr: ""
3896 valueposition:
3897 start: 7
3898 end: 16
3899 returnednumber: 1
3900 alwaysreturns: true
3901 knownreturn: true
3902 isreturnbool: false
3903 position:
3904 start: 7
3905 end: 16
3906 type: function
3907 fixedLabels: true
3908
3909---
3910
3911[TestLabelsSource/100 - 1]
3912expr: absent_over_time(foo[5m]) or absent(bar)
3913output:
3914 - labels:
3915 "":
3916 reason: |-
3917 The [absent_over_time()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent_over_time) function is used to check if provided query doesn't match any time series.
3918 You will only get any results back if the metric selector you pass doesn't match anything.
3919 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3920 This means that the only labels you can get back from absent call are the ones you pass to it.
3921 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3922 kind: excluded
3923 fragment:
3924 start: 0
3925 end: 16
3926 returns: vector
3927 operations:
3928 - node: '[*parser.VectorSelector] foo'
3929 op: ""
3930 - node: '[*parser.Call] absent_over_time(foo[5m])'
3931 op: absent_over_time
3932 position:
3933 start: 17
3934 end: 24
3935 type: function
3936 fixedLabels: true
3937 - labels:
3938 "":
3939 reason: |-
3940 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3941 You will only get any results back if the metric selector you pass doesn't match anything.
3942 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3943 This means that the only labels you can get back from absent call are the ones you pass to it.
3944 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3945 kind: excluded
3946 fragment:
3947 start: 29
3948 end: 35
3949 returns: vector
3950 operations:
3951 - node: '[*parser.VectorSelector] bar'
3952 op: ""
3953 - node: '[*parser.Call] absent(bar)'
3954 op: absent
3955 position:
3956 start: 36
3957 end: 39
3958 type: function
3959 fixedLabels: true
3960
3961---
3962
3963[TestLabelsSource/101 - 1]
3964expr: bar * on() group_right(cluster, env) absent(foo{job="xxx"})
3965output:
3966 - labels:
3967 "":
3968 reason: |-
3969 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
3970 You will only get any results back if the metric selector you pass doesn't match anything.
3971 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
3972 This means that the only labels you can get back from absent call are the ones you pass to it.
3973 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
3974 kind: excluded
3975 fragment:
3976 start: 37
3977 end: 43
3978 __name__:
3979 reason: Binary operation between two vectors removes metric names.
3980 kind: excluded
3981 fragment:
3982 start: 0
3983 end: 59
3984 cluster:
3985 reason: Query is using `group_right(cluster, env)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
3986 kind: included
3987 fragment:
3988 start: 23
3989 end: 30
3990 env:
3991 reason: Query is using `group_right(cluster, env)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
3992 kind: included
3993 fragment:
3994 start: 32
3995 end: 35
3996 job:
3997 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
3998 kind: guaranteed
3999 fragment:
4000 start: 37
4001 end: 59
4002 returns: vector
4003 operations:
4004 - node: '[*parser.VectorSelector] foo{job="xxx"}'
4005 op: ""
4006 - node: '[*parser.Call] absent(foo{job="xxx"})'
4007 op: absent
4008 joins:
4009 - addedlabels:
4010 - cluster
4011 - env
4012 depth: 0
4013 ison: true
4014 matchinglabels: []
4015 op: '*'
4016 src:
4017 returns: vector
4018 operations:
4019 - node: '[*parser.VectorSelector] bar'
4020 op: ""
4021 position:
4022 start: 0
4023 end: 3
4024 type: selector
4025 usedLabels:
4026 - job
4027 position:
4028 start: 44
4029 end: 58
4030 type: function
4031 fixedLabels: true
4032
4033---
4034
4035[TestLabelsSource/102 - 1]
4036expr: bar * on() group_right() absent(foo{job="xxx"})
4037output:
4038 - labels:
4039 "":
4040 reason: |-
4041 The [absent()](https://prometheus.io/docs/prometheus/latest/querying/functions/#absent) function is used to check if provided query doesn't match any time series.
4042 You will only get any results back if the metric selector you pass doesn't match anything.
4043 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
4044 This means that the only labels you can get back from absent call are the ones you pass to it.
4045 If you're hoping to get instance specific labels this way and alert when some target is down then that won't work, use the `up` metric instead.
4046 kind: excluded
4047 fragment:
4048 start: 25
4049 end: 31
4050 __name__:
4051 reason: Binary operation between two vectors removes metric names.
4052 kind: excluded
4053 fragment:
4054 start: 0
4055 end: 47
4056 job:
4057 reason: All labels passed to absent() call will be present on the results if the query doesn't match anything.
4058 kind: guaranteed
4059 fragment:
4060 start: 25
4061 end: 47
4062 returns: vector
4063 operations:
4064 - node: '[*parser.VectorSelector] foo{job="xxx"}'
4065 op: ""
4066 - node: '[*parser.Call] absent(foo{job="xxx"})'
4067 op: absent
4068 joins:
4069 - addedlabels: []
4070 depth: 0
4071 ison: true
4072 matchinglabels: []
4073 op: '*'
4074 src:
4075 returns: vector
4076 operations:
4077 - node: '[*parser.VectorSelector] bar'
4078 op: ""
4079 position:
4080 start: 0
4081 end: 3
4082 type: selector
4083 usedLabels:
4084 - job
4085 position:
4086 start: 32
4087 end: 46
4088 type: function
4089 fixedLabels: true
4090
4091---
4092
4093[TestLabelsSource/103 - 1]
4094expr: vector(1)
4095output:
4096 - labels:
4097 "":
4098 reason: Calling `vector()` will return a vector value with no labels.
4099 kind: excluded
4100 fragment:
4101 start: 0
4102 end: 6
4103 returns: vector
4104 operations:
4105 - args:
4106 - "1"
4107 node: '[*parser.Call] vector(1)'
4108 op: vector
4109 returnInfo:
4110 logicalexpr: ""
4111 valueposition:
4112 start: 0
4113 end: 9
4114 returnednumber: 1
4115 alwaysreturns: true
4116 knownreturn: true
4117 isreturnbool: false
4118 position:
4119 start: 0
4120 end: 9
4121 type: function
4122 fixedLabels: true
4123
4124---
4125
4126[TestLabelsSource/104 - 1]
4127expr: vector(scalar(foo))
4128output:
4129 - labels:
4130 "":
4131 reason: Calling `vector()` will return a vector value with no labels.
4132 kind: excluded
4133 fragment:
4134 start: 0
4135 end: 6
4136 returns: vector
4137 operations:
4138 - args:
4139 - scalar(foo)
4140 node: '[*parser.Call] vector(scalar(foo))'
4141 op: vector
4142 returnInfo:
4143 logicalexpr: ""
4144 valueposition:
4145 start: 0
4146 end: 19
4147 returnednumber: 0
4148 alwaysreturns: true
4149 knownreturn: false
4150 isreturnbool: false
4151 position:
4152 start: 0
4153 end: 19
4154 type: function
4155 fixedLabels: true
4156
4157---
4158
4159[TestLabelsSource/105 - 1]
4160expr: vector(0.0 >= bool 0.5) == 1
4161output:
4162 - labels:
4163 "":
4164 reason: Calling `vector()` will return a vector value with no labels.
4165 kind: excluded
4166 fragment:
4167 start: 0
4168 end: 6
4169 deadInfo:
4170 reason: '`vector(0.0 >= bool 0.5) == 1` always evaluates to `0 == 1` which is not possible, so it will never return anything.'
4171 fragment:
4172 start: 0
4173 end: 24
4174 returns: vector
4175 operations:
4176 - args:
4177 - 0 >= bool 0.5
4178 node: '[*parser.Call] vector(0 >= bool 0.5)'
4179 op: vector
4180 returnInfo:
4181 logicalexpr: ""
4182 valueposition:
4183 start: 0
4184 end: 24
4185 returnednumber: 0
4186 alwaysreturns: true
4187 knownreturn: true
4188 isreturnbool: false
4189 position:
4190 start: 0
4191 end: 24
4192 type: function
4193 fixedLabels: true
4194 isConditional: true
4195
4196---
4197
4198[TestLabelsSource/106 - 1]
4199expr: sum_over_time(foo{job="myjob"}[5m])
4200output:
4201 - labels:
4202 job:
4203 reason: Query will only return series where these labels are present.
4204 kind: guaranteed
4205 fragment:
4206 start: 0
4207 end: 35
4208 returns: vector
4209 operations:
4210 - node: '[*parser.VectorSelector] foo{job="myjob"}'
4211 op: ""
4212 - node: '[*parser.Call] sum_over_time(foo{job="myjob"}[5m])'
4213 op: sum_over_time
4214 position:
4215 start: 14
4216 end: 34
4217 type: function
4218
4219---
4220
4221[TestLabelsSource/107 - 1]
4222expr: days_in_month()
4223output:
4224 - labels:
4225 "":
4226 reason: Calling `days_in_month()` with no arguments will return an empty time series with no labels.
4227 kind: excluded
4228 fragment:
4229 start: 0
4230 end: 15
4231 returns: vector
4232 operations:
4233 - node: '[*parser.Call] days_in_month()'
4234 op: days_in_month
4235 returnInfo:
4236 logicalexpr: ""
4237 valueposition:
4238 start: 0
4239 end: 0
4240 returnednumber: 0
4241 alwaysreturns: true
4242 knownreturn: false
4243 isreturnbool: false
4244 position:
4245 start: 0
4246 end: 15
4247 type: function
4248 fixedLabels: true
4249
4250---
4251
4252[TestLabelsSource/108 - 1]
4253expr: days_in_month(foo{job="foo"})
4254output:
4255 - labels:
4256 job:
4257 reason: Query will only return series where these labels are present.
4258 kind: guaranteed
4259 fragment:
4260 start: 0
4261 end: 29
4262 returns: vector
4263 operations:
4264 - node: '[*parser.VectorSelector] foo{job="foo"}'
4265 op: ""
4266 - node: '[*parser.Call] days_in_month(foo{job="foo"})'
4267 op: days_in_month
4268 position:
4269 start: 14
4270 end: 28
4271 type: function
4272
4273---
4274
4275[TestLabelsSource/109 - 1]
4276expr: label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*")
4277output:
4278 - labels:
4279 foo:
4280 reason: This label will be added to the result by label_replace() call.
4281 kind: guaranteed
4282 fragment:
4283 start: 0
4284 end: 84
4285 job:
4286 reason: Query will only return series where these labels are present.
4287 kind: guaranteed
4288 fragment:
4289 start: 14
4290 end: 48
4291 service:
4292 reason: Query will only return series where these labels are present.
4293 kind: guaranteed
4294 fragment:
4295 start: 14
4296 end: 48
4297 returns: vector
4298 operations:
4299 - node: '[*parser.VectorSelector] up{job="api-server",service="a:c"}'
4300 op: ""
4301 - args:
4302 - '"foo"'
4303 - '"$1"'
4304 - '"service"'
4305 - '"(.*):.*"'
4306 node: '[*parser.Call] label_replace(up{job="api-server",service="a:c"}, "foo", "$1", "service", "(.*):.*")'
4307 op: label_replace
4308 usedLabels:
4309 - service
4310 position:
4311 start: 14
4312 end: 48
4313 type: function
4314
4315---
4316
4317[TestLabelsSource/110 - 1]
4318expr: label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)")
4319output:
4320 - labels:
4321 "":
4322 reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results.
4323 kind: excluded
4324 fragment:
4325 start: 18
4326 end: 21
4327 __name__:
4328 reason: Aggregation removes metric name.
4329 kind: excluded
4330 fragment:
4331 start: 14
4332 end: 39
4333 cluster:
4334 reason: This label will be added to the result by label_replace() call.
4335 kind: guaranteed
4336 fragment:
4337 start: 0
4338 end: 76
4339 pod:
4340 reason: Query is using aggregation with `by(pod)`, only labels included inside `by(...)` will be present on the results.
4341 kind: included
4342 fragment:
4343 start: 22
4344 end: 25
4345 returns: vector
4346 operations:
4347 - node: '[*parser.VectorSelector] pod_status'
4348 op: ""
4349 - node: '[*parser.AggregateExpr] sum by (pod) (pod_status)'
4350 op: sum
4351 - args:
4352 - '"cluster"'
4353 - '"$1"'
4354 - '"pod"'
4355 - '"(.*)"'
4356 node: '[*parser.Call] label_replace(sum by (pod) (pod_status) > 0, "cluster", "$1", "pod", "(.*)")'
4357 op: label_replace
4358 usedLabels:
4359 - pod
4360 position:
4361 start: 14
4362 end: 43
4363 type: function
4364 fixedLabels: true
4365 isConditional: true
4366
4367---
4368
4369[TestLabelsSource/111 - 1]
4370expr: (time() - my_metric) > 5*3600
4371output:
4372 - returns: vector
4373 operations:
4374 - node: '[*parser.VectorSelector] my_metric'
4375 op: ""
4376 position:
4377 start: 10
4378 end: 19
4379 type: selector
4380 isConditional: true
4381
4382---
4383
4384[TestLabelsSource/112 - 1]
4385expr: up{instance="a", job="prometheus"} * ignoring(job) up{instance="a", job="pint"}
4386output:
4387 - labels:
4388 __name__:
4389 reason: Binary operation between two vectors removes metric names.
4390 kind: excluded
4391 fragment:
4392 start: 0
4393 end: 79
4394 instance:
4395 reason: Query will only return series where these labels are present.
4396 kind: guaranteed
4397 fragment:
4398 start: 0
4399 end: 34
4400 job:
4401 reason: Query is using one-to-one vector matching with `ignoring(job)`, all labels included inside `ignoring(...)` will be removed on the results.
4402 kind: excluded
4403 fragment:
4404 start: 46
4405 end: 49
4406 returns: vector
4407 operations:
4408 - node: '[*parser.VectorSelector] up{instance="a",job="prometheus"}'
4409 op: ""
4410 joins:
4411 - addedlabels: []
4412 depth: 0
4413 ison: false
4414 matchinglabels:
4415 - job
4416 op: '*'
4417 src:
4418 labels:
4419 instance:
4420 reason: Query will only return series where these labels are present.
4421 kind: guaranteed
4422 fragment:
4423 start: 51
4424 end: 79
4425 job:
4426 reason: Query will only return series where these labels are present.
4427 kind: guaranteed
4428 fragment:
4429 start: 51
4430 end: 79
4431 returns: vector
4432 operations:
4433 - node: '[*parser.VectorSelector] up{instance="a",job="pint"}'
4434 op: ""
4435 position:
4436 start: 51
4437 end: 79
4438 type: selector
4439 usedLabels:
4440 - instance
4441 position:
4442 start: 0
4443 end: 34
4444 type: selector
4445
4446---
4447
4448[TestLabelsSource/113 - 1]
4449expr: |4
4450
4451 avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"})
4452 < 0.5 > 0
4453 or sum without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"})
4454 < on() count(colo_router_tier:disabled_pops:max{tier="1",router=~"edge.*"}) * 0.4 > 0
4455 or avg without(router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"})
4456 < 0.1 > 0
4457output:
4458 - labels:
4459 __name__:
4460 reason: Aggregation removes metric name.
4461 kind: excluded
4462 fragment:
4463 start: 1
4464 end: 101
4465 colo_id:
4466 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4467 kind: excluded
4468 fragment:
4469 start: 21
4470 end: 28
4471 instance:
4472 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4473 kind: excluded
4474 fragment:
4475 start: 30
4476 end: 38
4477 router:
4478 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4479 kind: excluded
4480 fragment:
4481 start: 13
4482 end: 19
4483 returns: vector
4484 operations:
4485 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"}'
4486 op: ""
4487 - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case!~".*offpeak.*"})'
4488 op: avg
4489 position:
4490 start: 41
4491 end: 100
4492 type: aggregation
4493 isConditional: true
4494 - labels:
4495 "":
4496 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
4497 kind: excluded
4498 fragment:
4499 start: 216
4500 end: 220
4501 __name__:
4502 reason: Binary operation between two vectors removes metric names.
4503 kind: excluded
4504 fragment:
4505 start: 115
4506 end: 295
4507 cidr_use_case:
4508 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
4509 kind: excluded
4510 fragment:
4511 start: 216
4512 end: 220
4513 colo_id:
4514 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4515 kind: excluded
4516 fragment:
4517 start: 135
4518 end: 142
4519 instance:
4520 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4521 kind: excluded
4522 fragment:
4523 start: 144
4524 end: 152
4525 router:
4526 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4527 kind: excluded
4528 fragment:
4529 start: 127
4530 end: 133
4531 returns: vector
4532 operations:
4533 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"}'
4534 op: ""
4535 - node: '[*parser.AggregateExpr] sum without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*tier1.*"})'
4536 op: sum
4537 joins:
4538 - addedlabels: []
4539 depth: 0
4540 ison: true
4541 matchinglabels: []
4542 op: <
4543 src:
4544 labels:
4545 "":
4546 reason: Query is using aggregation that removes all labels.
4547 kind: excluded
4548 fragment:
4549 start: 221
4550 end: 226
4551 __name__:
4552 reason: Aggregation removes metric name.
4553 kind: excluded
4554 fragment:
4555 start: 221
4556 end: 289
4557 router:
4558 reason: Query is using aggregation that removes all labels.
4559 kind: excluded
4560 fragment:
4561 start: 221
4562 end: 226
4563 tier:
4564 reason: Query is using aggregation that removes all labels.
4565 kind: excluded
4566 fragment:
4567 start: 221
4568 end: 226
4569 returns: vector
4570 operations:
4571 - node: '[*parser.VectorSelector] colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"}'
4572 op: ""
4573 - node: '[*parser.AggregateExpr] count(colo_router_tier:disabled_pops:max{router=~"edge.*",tier="1"})'
4574 op: count
4575 position:
4576 start: 227
4577 end: 288
4578 type: aggregation
4579 fixedLabels: true
4580 position:
4581 start: 155
4582 end: 212
4583 type: aggregation
4584 fixedLabels: true
4585 isConditional: true
4586 - labels:
4587 __name__:
4588 reason: Aggregation removes metric name.
4589 kind: excluded
4590 fragment:
4591 start: 303
4592 end: 404
4593 cidr_use_case:
4594 reason: Query will only return series where these labels are present.
4595 kind: guaranteed
4596 fragment:
4597 start: 343
4598 end: 403
4599 colo_id:
4600 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4601 kind: excluded
4602 fragment:
4603 start: 323
4604 end: 330
4605 instance:
4606 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4607 kind: excluded
4608 fragment:
4609 start: 332
4610 end: 340
4611 router:
4612 reason: Query is using aggregation with `without(router, colo_id, instance)`, all labels included inside `without(...)` will be removed from the results.
4613 kind: excluded
4614 fragment:
4615 start: 315
4616 end: 321
4617 returns: vector
4618 operations:
4619 - node: '[*parser.VectorSelector] router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"}'
4620 op: ""
4621 - node: '[*parser.AggregateExpr] avg without (router, colo_id, instance) (router_anycast_prefix_enabled{cidr_use_case=~".*regional.*"})'
4622 op: avg
4623 position:
4624 start: 343
4625 end: 403
4626 type: aggregation
4627 isConditional: true
4628
4629---
4630
4631[TestLabelsSource/114 - 1]
4632expr: label_replace(sum(foo) without(instance), "instance", "none", "", "")
4633output:
4634 - labels:
4635 __name__:
4636 reason: Aggregation removes metric name.
4637 kind: excluded
4638 fragment:
4639 start: 14
4640 end: 40
4641 instance:
4642 reason: This label will be added to the result by label_replace() call.
4643 kind: guaranteed
4644 fragment:
4645 start: 0
4646 end: 69
4647 returns: vector
4648 operations:
4649 - node: '[*parser.VectorSelector] foo'
4650 op: ""
4651 - node: '[*parser.AggregateExpr] sum without (instance) (foo)'
4652 op: sum
4653 - args:
4654 - '"instance"'
4655 - '"none"'
4656 - '""'
4657 - '""'
4658 node: '[*parser.Call] label_replace(sum without (instance) (foo), "instance", "none", "", "")'
4659 op: label_replace
4660 usedLabels:
4661 - ""
4662 position:
4663 start: 14
4664 end: 40
4665 type: function
4666
4667---
4668
4669[TestLabelsSource/115 - 1]
4670expr: |4-
4671
4672 sum by (region, target, colo_name) (
4673 sum_over_time(probe_success{job="abc"}[5m])
4674 or
4675 vector(1)
4676 ) == 0
4677output:
4678 - labels:
4679 "":
4680 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
4681 kind: excluded
4682 fragment:
4683 start: 5
4684 end: 8
4685 __name__:
4686 reason: Aggregation removes metric name.
4687 kind: excluded
4688 fragment:
4689 start: 1
4690 end: 102
4691 colo_name:
4692 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
4693 kind: included
4694 fragment:
4695 start: 25
4696 end: 34
4697 job:
4698 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
4699 kind: excluded
4700 fragment:
4701 start: 5
4702 end: 35
4703 region:
4704 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
4705 kind: included
4706 fragment:
4707 start: 9
4708 end: 15
4709 target:
4710 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
4711 kind: included
4712 fragment:
4713 start: 17
4714 end: 23
4715 returns: vector
4716 operations:
4717 - node: '[*parser.VectorSelector] probe_success{job="abc"}'
4718 op: ""
4719 - node: '[*parser.Call] sum_over_time(probe_success{job="abc"}[5m])'
4720 op: sum_over_time
4721 - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))'
4722 op: sum
4723 usedLabels:
4724 - region
4725 - target
4726 - colo_name
4727 position:
4728 start: 56
4729 end: 84
4730 type: aggregation
4731 fixedLabels: true
4732 isConditional: true
4733 - labels:
4734 "":
4735 reason: Query is using aggregation with `by(region, target, colo_name)`, only labels included inside `by(...)` will be present on the results.
4736 kind: excluded
4737 fragment:
4738 start: 5
4739 end: 8
4740 __name__:
4741 reason: Aggregation removes metric name.
4742 kind: excluded
4743 fragment:
4744 start: 1
4745 end: 102
4746 colo_name:
4747 reason: Calling `vector()` will return a vector value with no labels.
4748 kind: excluded
4749 fragment:
4750 start: 91
4751 end: 97
4752 region:
4753 reason: Calling `vector()` will return a vector value with no labels.
4754 kind: excluded
4755 fragment:
4756 start: 91
4757 end: 97
4758 target:
4759 reason: Calling `vector()` will return a vector value with no labels.
4760 kind: excluded
4761 fragment:
4762 start: 91
4763 end: 97
4764 deadInfo:
4765 reason: '`vector(1) == 0` always evaluates to `1 == 0` which is not possible, so it will never return anything.'
4766 fragment:
4767 start: 91
4768 end: 100
4769 deadLabels:
4770 - name: region
4771 reason: You can't use `region` because this label is not possible here.
4772 labelreason: Calling `vector()` will return a vector value with no labels.
4773 usagefragment:
4774 start: 9
4775 end: 15
4776 labelfragment:
4777 start: 91
4778 end: 97
4779 kind: 0
4780 - name: target
4781 reason: You can't use `target` because this label is not possible here.
4782 labelreason: Calling `vector()` will return a vector value with no labels.
4783 usagefragment:
4784 start: 17
4785 end: 23
4786 labelfragment:
4787 start: 91
4788 end: 97
4789 kind: 0
4790 - name: colo_name
4791 reason: You can't use `colo_name` because this label is not possible here.
4792 labelreason: Calling `vector()` will return a vector value with no labels.
4793 usagefragment:
4794 start: 25
4795 end: 34
4796 labelfragment:
4797 start: 91
4798 end: 97
4799 kind: 0
4800 returns: vector
4801 operations:
4802 - args:
4803 - "1"
4804 node: '[*parser.Call] vector(1)'
4805 op: vector
4806 - node: '[*parser.AggregateExpr] sum by (region, target, colo_name) (sum_over_time(probe_success{job="abc"}[5m]) or vector(1))'
4807 op: sum
4808 usedLabels:
4809 - region
4810 - target
4811 - colo_name
4812 returnInfo:
4813 logicalexpr: ""
4814 valueposition:
4815 start: 91
4816 end: 100
4817 returnednumber: 1
4818 alwaysreturns: true
4819 knownreturn: true
4820 isreturnbool: false
4821 position:
4822 start: 91
4823 end: 100
4824 type: aggregation
4825 fixedLabels: true
4826 isConditional: true
4827
4828---
4829
4830[TestLabelsSource/116 - 1]
4831expr: vector(1) or foo
4832output:
4833 - labels:
4834 "":
4835 reason: Calling `vector()` will return a vector value with no labels.
4836 kind: excluded
4837 fragment:
4838 start: 0
4839 end: 6
4840 returns: vector
4841 operations:
4842 - args:
4843 - "1"
4844 node: '[*parser.Call] vector(1)'
4845 op: vector
4846 returnInfo:
4847 logicalexpr: ""
4848 valueposition:
4849 start: 0
4850 end: 9
4851 returnednumber: 1
4852 alwaysreturns: true
4853 knownreturn: true
4854 isreturnbool: false
4855 position:
4856 start: 0
4857 end: 9
4858 type: function
4859 fixedLabels: true
4860 - deadInfo:
4861 reason: The left hand side always returns something and so the right hand side is never used.
4862 fragment:
4863 start: 13
4864 end: 16
4865 returns: vector
4866 operations:
4867 - node: '[*parser.VectorSelector] foo'
4868 op: ""
4869 position:
4870 start: 13
4871 end: 16
4872 type: selector
4873
4874---
4875
4876[TestLabelsSource/117 - 1]
4877expr: vector(0) > 0
4878output:
4879 - labels:
4880 "":
4881 reason: Calling `vector()` will return a vector value with no labels.
4882 kind: excluded
4883 fragment:
4884 start: 0
4885 end: 6
4886 deadInfo:
4887 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
4888 fragment:
4889 start: 0
4890 end: 9
4891 returns: vector
4892 operations:
4893 - args:
4894 - "0"
4895 node: '[*parser.Call] vector(0)'
4896 op: vector
4897 returnInfo:
4898 logicalexpr: ""
4899 valueposition:
4900 start: 0
4901 end: 9
4902 returnednumber: 0
4903 alwaysreturns: true
4904 knownreturn: true
4905 isreturnbool: false
4906 position:
4907 start: 0
4908 end: 9
4909 type: function
4910 fixedLabels: true
4911 isConditional: true
4912
4913---
4914
4915[TestLabelsSource/118 - 1]
4916expr: vector(0) > vector(1)
4917output:
4918 - labels:
4919 "":
4920 reason: Calling `vector()` will return a vector value with no labels.
4921 kind: excluded
4922 fragment:
4923 start: 0
4924 end: 6
4925 __name__:
4926 reason: Binary operation between two vectors removes metric names.
4927 kind: excluded
4928 fragment:
4929 start: 0
4930 end: 21
4931 deadInfo:
4932 reason: '`vector(0) > vector(1)` always evaluates to `0 > 1` which is not possible, so it will never return anything.'
4933 fragment:
4934 start: 0
4935 end: 9
4936 returns: vector
4937 operations:
4938 - args:
4939 - "0"
4940 node: '[*parser.Call] vector(0)'
4941 op: vector
4942 joins:
4943 - addedlabels: []
4944 depth: 0
4945 ison: false
4946 matchinglabels: []
4947 op: '>'
4948 src:
4949 labels:
4950 "":
4951 reason: Calling `vector()` will return a vector value with no labels.
4952 kind: excluded
4953 fragment:
4954 start: 12
4955 end: 18
4956 returns: vector
4957 operations:
4958 - args:
4959 - "1"
4960 node: '[*parser.Call] vector(1)'
4961 op: vector
4962 returnInfo:
4963 logicalexpr: ""
4964 valueposition:
4965 start: 12
4966 end: 21
4967 returnednumber: 1
4968 alwaysreturns: true
4969 knownreturn: true
4970 isreturnbool: false
4971 position:
4972 start: 12
4973 end: 21
4974 type: function
4975 fixedLabels: true
4976 returnInfo:
4977 logicalexpr: ""
4978 valueposition:
4979 start: 0
4980 end: 9
4981 returnednumber: 0
4982 alwaysreturns: true
4983 knownreturn: true
4984 isreturnbool: false
4985 position:
4986 start: 0
4987 end: 9
4988 type: function
4989 fixedLabels: true
4990 isConditional: true
4991
4992---
4993
4994[TestLabelsSource/119 - 1]
4995expr: sum(foo or vector(0)) > 0
4996output:
4997 - labels:
4998 "":
4999 reason: Query is using aggregation that removes all labels.
5000 kind: excluded
5001 fragment:
5002 start: 0
5003 end: 3
5004 __name__:
5005 reason: Aggregation removes metric name.
5006 kind: excluded
5007 fragment:
5008 start: 0
5009 end: 21
5010 returns: vector
5011 operations:
5012 - node: '[*parser.VectorSelector] foo'
5013 op: ""
5014 - node: '[*parser.AggregateExpr] sum(foo or vector(0))'
5015 op: sum
5016 position:
5017 start: 4
5018 end: 7
5019 type: aggregation
5020 fixedLabels: true
5021 isConditional: true
5022 - labels:
5023 "":
5024 reason: Query is using aggregation that removes all labels.
5025 kind: excluded
5026 fragment:
5027 start: 0
5028 end: 3
5029 __name__:
5030 reason: Aggregation removes metric name.
5031 kind: excluded
5032 fragment:
5033 start: 0
5034 end: 21
5035 deadInfo:
5036 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
5037 fragment:
5038 start: 11
5039 end: 20
5040 returns: vector
5041 operations:
5042 - args:
5043 - "0"
5044 node: '[*parser.Call] vector(0)'
5045 op: vector
5046 - node: '[*parser.AggregateExpr] sum(foo or vector(0))'
5047 op: sum
5048 returnInfo:
5049 logicalexpr: ""
5050 valueposition:
5051 start: 11
5052 end: 20
5053 returnednumber: 0
5054 alwaysreturns: true
5055 knownreturn: true
5056 isreturnbool: false
5057 position:
5058 start: 11
5059 end: 20
5060 type: aggregation
5061 fixedLabels: true
5062 isConditional: true
5063
5064---
5065
5066[TestLabelsSource/120 - 1]
5067expr: (sum(foo or vector(1)) > 0) == 2
5068output:
5069 - labels:
5070 "":
5071 reason: Query is using aggregation that removes all labels.
5072 kind: excluded
5073 fragment:
5074 start: 1
5075 end: 4
5076 __name__:
5077 reason: Aggregation removes metric name.
5078 kind: excluded
5079 fragment:
5080 start: 1
5081 end: 22
5082 returns: vector
5083 operations:
5084 - node: '[*parser.VectorSelector] foo'
5085 op: ""
5086 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
5087 op: sum
5088 position:
5089 start: 5
5090 end: 8
5091 type: aggregation
5092 fixedLabels: true
5093 isConditional: true
5094 - labels:
5095 "":
5096 reason: Query is using aggregation that removes all labels.
5097 kind: excluded
5098 fragment:
5099 start: 1
5100 end: 4
5101 __name__:
5102 reason: Aggregation removes metric name.
5103 kind: excluded
5104 fragment:
5105 start: 1
5106 end: 22
5107 deadInfo:
5108 reason: '`vector(1) == 2` always evaluates to `1 == 2` which is not possible, so it will never return anything.'
5109 fragment:
5110 start: 12
5111 end: 21
5112 returns: vector
5113 operations:
5114 - args:
5115 - "1"
5116 node: '[*parser.Call] vector(1)'
5117 op: vector
5118 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
5119 op: sum
5120 returnInfo:
5121 logicalexpr: ""
5122 valueposition:
5123 start: 12
5124 end: 21
5125 returnednumber: 1
5126 alwaysreturns: true
5127 knownreturn: true
5128 isreturnbool: false
5129 position:
5130 start: 12
5131 end: 21
5132 type: aggregation
5133 fixedLabels: true
5134 isConditional: true
5135
5136---
5137
5138[TestLabelsSource/121 - 1]
5139expr: (sum(foo or vector(1)) > 0) != 2
5140output:
5141 - labels:
5142 "":
5143 reason: Query is using aggregation that removes all labels.
5144 kind: excluded
5145 fragment:
5146 start: 1
5147 end: 4
5148 __name__:
5149 reason: Aggregation removes metric name.
5150 kind: excluded
5151 fragment:
5152 start: 1
5153 end: 22
5154 returns: vector
5155 operations:
5156 - node: '[*parser.VectorSelector] foo'
5157 op: ""
5158 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
5159 op: sum
5160 position:
5161 start: 5
5162 end: 8
5163 type: aggregation
5164 fixedLabels: true
5165 isConditional: true
5166 - labels:
5167 "":
5168 reason: Query is using aggregation that removes all labels.
5169 kind: excluded
5170 fragment:
5171 start: 1
5172 end: 4
5173 __name__:
5174 reason: Aggregation removes metric name.
5175 kind: excluded
5176 fragment:
5177 start: 1
5178 end: 22
5179 returns: vector
5180 operations:
5181 - args:
5182 - "1"
5183 node: '[*parser.Call] vector(1)'
5184 op: vector
5185 - node: '[*parser.AggregateExpr] sum(foo or vector(1))'
5186 op: sum
5187 returnInfo:
5188 logicalexpr: ""
5189 valueposition:
5190 start: 12
5191 end: 21
5192 returnednumber: 1
5193 alwaysreturns: true
5194 knownreturn: true
5195 isreturnbool: false
5196 position:
5197 start: 12
5198 end: 21
5199 type: aggregation
5200 fixedLabels: true
5201 isConditional: true
5202
5203---
5204
5205[TestLabelsSource/122 - 1]
5206expr: (sum(foo or vector(2)) > 0) != 2
5207output:
5208 - labels:
5209 "":
5210 reason: Query is using aggregation that removes all labels.
5211 kind: excluded
5212 fragment:
5213 start: 1
5214 end: 4
5215 __name__:
5216 reason: Aggregation removes metric name.
5217 kind: excluded
5218 fragment:
5219 start: 1
5220 end: 22
5221 returns: vector
5222 operations:
5223 - node: '[*parser.VectorSelector] foo'
5224 op: ""
5225 - node: '[*parser.AggregateExpr] sum(foo or vector(2))'
5226 op: sum
5227 position:
5228 start: 5
5229 end: 8
5230 type: aggregation
5231 fixedLabels: true
5232 isConditional: true
5233 - labels:
5234 "":
5235 reason: Query is using aggregation that removes all labels.
5236 kind: excluded
5237 fragment:
5238 start: 1
5239 end: 4
5240 __name__:
5241 reason: Aggregation removes metric name.
5242 kind: excluded
5243 fragment:
5244 start: 1
5245 end: 22
5246 deadInfo:
5247 reason: '`vector(2) != 2` always evaluates to `2 != 2` which is not possible, so it will never return anything.'
5248 fragment:
5249 start: 12
5250 end: 21
5251 returns: vector
5252 operations:
5253 - args:
5254 - "2"
5255 node: '[*parser.Call] vector(2)'
5256 op: vector
5257 - node: '[*parser.AggregateExpr] sum(foo or vector(2))'
5258 op: sum
5259 returnInfo:
5260 logicalexpr: ""
5261 valueposition:
5262 start: 12
5263 end: 21
5264 returnednumber: 2
5265 alwaysreturns: true
5266 knownreturn: true
5267 isreturnbool: false
5268 position:
5269 start: 12
5270 end: 21
5271 type: aggregation
5272 fixedLabels: true
5273 isConditional: true
5274
5275---
5276
5277[TestLabelsSource/123 - 1]
5278expr: |-
5279 (sum(sometimes{foo!="bar"} or vector(0)))
5280 or
5281 ((bob > 10) or sum(foo) or vector(1))
5282output:
5283 - labels:
5284 "":
5285 reason: Query is using aggregation that removes all labels.
5286 kind: excluded
5287 fragment:
5288 start: 1
5289 end: 4
5290 __name__:
5291 reason: Aggregation removes metric name.
5292 kind: excluded
5293 fragment:
5294 start: 1
5295 end: 40
5296 returns: vector
5297 operations:
5298 - node: '[*parser.VectorSelector] sometimes{foo!="bar"}'
5299 op: ""
5300 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))'
5301 op: sum
5302 position:
5303 start: 5
5304 end: 26
5305 type: aggregation
5306 fixedLabels: true
5307 - labels:
5308 "":
5309 reason: Query is using aggregation that removes all labels.
5310 kind: excluded
5311 fragment:
5312 start: 1
5313 end: 4
5314 __name__:
5315 reason: Aggregation removes metric name.
5316 kind: excluded
5317 fragment:
5318 start: 1
5319 end: 40
5320 returns: vector
5321 operations:
5322 - args:
5323 - "0"
5324 node: '[*parser.Call] vector(0)'
5325 op: vector
5326 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"} or vector(0))'
5327 op: sum
5328 returnInfo:
5329 logicalexpr: ""
5330 valueposition:
5331 start: 30
5332 end: 39
5333 returnednumber: 0
5334 alwaysreturns: true
5335 knownreturn: true
5336 isreturnbool: false
5337 position:
5338 start: 30
5339 end: 39
5340 type: aggregation
5341 fixedLabels: true
5342 - returns: vector
5343 operations:
5344 - node: '[*parser.VectorSelector] bob'
5345 op: ""
5346 position:
5347 start: 47
5348 end: 50
5349 type: selector
5350 isConditional: true
5351 - labels:
5352 "":
5353 reason: Query is using aggregation that removes all labels.
5354 kind: excluded
5355 fragment:
5356 start: 60
5357 end: 63
5358 __name__:
5359 reason: Aggregation removes metric name.
5360 kind: excluded
5361 fragment:
5362 start: 60
5363 end: 68
5364 returns: vector
5365 operations:
5366 - node: '[*parser.VectorSelector] foo'
5367 op: ""
5368 - node: '[*parser.AggregateExpr] sum(foo)'
5369 op: sum
5370 position:
5371 start: 64
5372 end: 67
5373 type: aggregation
5374 fixedLabels: true
5375 - labels:
5376 "":
5377 reason: Calling `vector()` will return a vector value with no labels.
5378 kind: excluded
5379 fragment:
5380 start: 72
5381 end: 78
5382 returns: vector
5383 operations:
5384 - args:
5385 - "1"
5386 node: '[*parser.Call] vector(1)'
5387 op: vector
5388 returnInfo:
5389 logicalexpr: ""
5390 valueposition:
5391 start: 72
5392 end: 81
5393 returnednumber: 1
5394 alwaysreturns: true
5395 knownreturn: true
5396 isreturnbool: false
5397 position:
5398 start: 72
5399 end: 81
5400 type: function
5401 fixedLabels: true
5402
5403---
5404
5405[TestLabelsSource/124 - 1]
5406expr: |4-
5407
5408 (
5409 sum(sometimes{foo!="bar"})
5410 or
5411 vector(1)
5412 ) and (
5413 ((bob > 10) or sum(bar))
5414 or
5415 notfound > 0
5416 )
5417output:
5418 - labels:
5419 "":
5420 reason: Query is using aggregation that removes all labels.
5421 kind: excluded
5422 fragment:
5423 start: 4
5424 end: 7
5425 __name__:
5426 reason: Aggregation removes metric name.
5427 kind: excluded
5428 fragment:
5429 start: 4
5430 end: 30
5431 returns: vector
5432 operations:
5433 - node: '[*parser.VectorSelector] sometimes{foo!="bar"}'
5434 op: ""
5435 - node: '[*parser.AggregateExpr] sum(sometimes{foo!="bar"})'
5436 op: sum
5437 joins:
5438 - addedlabels: []
5439 depth: 0
5440 ison: false
5441 matchinglabels: []
5442 op: and
5443 src:
5444 returns: vector
5445 operations:
5446 - node: '[*parser.VectorSelector] bob'
5447 op: ""
5448 position:
5449 start: 57
5450 end: 60
5451 type: selector
5452 isConditional: true
5453 - addedlabels: []
5454 depth: 0
5455 ison: false
5456 matchinglabels: []
5457 op: and
5458 src:
5459 labels:
5460 "":
5461 reason: Query is using aggregation that removes all labels.
5462 kind: excluded
5463 fragment:
5464 start: 70
5465 end: 73
5466 __name__:
5467 reason: Aggregation removes metric name.
5468 kind: excluded
5469 fragment:
5470 start: 70
5471 end: 78
5472 returns: vector
5473 operations:
5474 - node: '[*parser.VectorSelector] bar'
5475 op: ""
5476 - node: '[*parser.AggregateExpr] sum(bar)'
5477 op: sum
5478 position:
5479 start: 74
5480 end: 77
5481 type: aggregation
5482 fixedLabels: true
5483 - addedlabels: []
5484 depth: 0
5485 ison: false
5486 matchinglabels: []
5487 op: and
5488 src:
5489 returns: vector
5490 operations:
5491 - node: '[*parser.VectorSelector] notfound'
5492 op: ""
5493 position:
5494 start: 85
5495 end: 93
5496 type: selector
5497 isConditional: true
5498 position:
5499 start: 8
5500 end: 29
5501 type: aggregation
5502 fixedLabels: true
5503 isConditional: true
5504 - labels:
5505 "":
5506 reason: Calling `vector()` will return a vector value with no labels.
5507 kind: excluded
5508 fragment:
5509 start: 36
5510 end: 42
5511 returns: vector
5512 operations:
5513 - args:
5514 - "1"
5515 node: '[*parser.Call] vector(1)'
5516 op: vector
5517 joins:
5518 - addedlabels: []
5519 depth: 0
5520 ison: false
5521 matchinglabels: []
5522 op: and
5523 src:
5524 returns: vector
5525 operations:
5526 - node: '[*parser.VectorSelector] bob'
5527 op: ""
5528 position:
5529 start: 57
5530 end: 60
5531 type: selector
5532 isConditional: true
5533 - addedlabels: []
5534 depth: 0
5535 ison: false
5536 matchinglabels: []
5537 op: and
5538 src:
5539 labels:
5540 "":
5541 reason: Query is using aggregation that removes all labels.
5542 kind: excluded
5543 fragment:
5544 start: 70
5545 end: 73
5546 __name__:
5547 reason: Aggregation removes metric name.
5548 kind: excluded
5549 fragment:
5550 start: 70
5551 end: 78
5552 returns: vector
5553 operations:
5554 - node: '[*parser.VectorSelector] bar'
5555 op: ""
5556 - node: '[*parser.AggregateExpr] sum(bar)'
5557 op: sum
5558 position:
5559 start: 74
5560 end: 77
5561 type: aggregation
5562 fixedLabels: true
5563 - addedlabels: []
5564 depth: 0
5565 ison: false
5566 matchinglabels: []
5567 op: and
5568 src:
5569 returns: vector
5570 operations:
5571 - node: '[*parser.VectorSelector] notfound'
5572 op: ""
5573 position:
5574 start: 85
5575 end: 93
5576 type: selector
5577 isConditional: true
5578 returnInfo:
5579 logicalexpr: ""
5580 valueposition:
5581 start: 36
5582 end: 45
5583 returnednumber: 1
5584 alwaysreturns: true
5585 knownreturn: true
5586 isreturnbool: false
5587 position:
5588 start: 36
5589 end: 45
5590 type: function
5591 fixedLabels: true
5592 isConditional: true
5593
5594---
5595
5596[TestLabelsSource/125 - 1]
5597expr: foo offset 5m > 5
5598output:
5599 - returns: vector
5600 operations:
5601 - node: '[*parser.VectorSelector] foo offset 5m'
5602 op: ""
5603 position:
5604 start: 0
5605 end: 13
5606 type: selector
5607 isConditional: true
5608
5609---
5610
5611[TestLabelsSource/126 - 1]
5612expr: |4
5613
5614 (rate(metric2[5m]) or vector(0)) +
5615 (rate(metric1[5m]) or vector(1)) +
5616 (rate(metric3{log_name="samplerd"}[5m]) or vector(2)) > 0
5617output:
5618 - labels:
5619 __name__:
5620 reason: Binary operation between two vectors removes metric names.
5621 kind: excluded
5622 fragment:
5623 start: 1
5624 end: 124
5625 returns: vector
5626 operations:
5627 - node: '[*parser.VectorSelector] metric2'
5628 op: ""
5629 - node: '[*parser.Call] rate(metric2[5m])'
5630 op: rate
5631 joins:
5632 - addedlabels: []
5633 depth: 0
5634 ison: false
5635 matchinglabels: []
5636 op: +
5637 src:
5638 returns: vector
5639 operations:
5640 - node: '[*parser.VectorSelector] metric1'
5641 op: ""
5642 - node: '[*parser.Call] rate(metric1[5m])'
5643 op: rate
5644 position:
5645 start: 42
5646 end: 53
5647 type: function
5648 - addedlabels: []
5649 depth: 0
5650 ison: false
5651 matchinglabels: []
5652 op: +
5653 src:
5654 labels:
5655 "":
5656 reason: Calling `vector()` will return a vector value with no labels.
5657 kind: excluded
5658 fragment:
5659 start: 58
5660 end: 64
5661 returns: vector
5662 operations:
5663 - args:
5664 - "1"
5665 node: '[*parser.Call] vector(1)'
5666 op: vector
5667 returnInfo:
5668 logicalexpr: ""
5669 valueposition:
5670 start: 58
5671 end: 67
5672 returnednumber: 1
5673 alwaysreturns: true
5674 knownreturn: true
5675 isreturnbool: false
5676 position:
5677 start: 58
5678 end: 67
5679 type: function
5680 fixedLabels: true
5681 - addedlabels: []
5682 depth: 0
5683 ison: false
5684 matchinglabels: []
5685 op: +
5686 src:
5687 labels:
5688 log_name:
5689 reason: Query will only return series where these labels are present.
5690 kind: guaranteed
5691 fragment:
5692 start: 72
5693 end: 110
5694 returns: vector
5695 operations:
5696 - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}'
5697 op: ""
5698 - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])'
5699 op: rate
5700 usedLabels:
5701 - log_name
5702 position:
5703 start: 77
5704 end: 109
5705 type: function
5706 - addedlabels: []
5707 depth: 0
5708 ison: false
5709 matchinglabels: []
5710 op: +
5711 src:
5712 labels:
5713 "":
5714 reason: Calling `vector()` will return a vector value with no labels.
5715 kind: excluded
5716 fragment:
5717 start: 114
5718 end: 120
5719 returns: vector
5720 operations:
5721 - args:
5722 - "2"
5723 node: '[*parser.Call] vector(2)'
5724 op: vector
5725 returnInfo:
5726 logicalexpr: ""
5727 valueposition:
5728 start: 114
5729 end: 123
5730 returnednumber: 2
5731 alwaysreturns: true
5732 knownreturn: true
5733 isreturnbool: false
5734 position:
5735 start: 114
5736 end: 123
5737 type: function
5738 fixedLabels: true
5739 position:
5740 start: 7
5741 end: 18
5742 type: function
5743 isConditional: true
5744 - labels:
5745 "":
5746 reason: Calling `vector()` will return a vector value with no labels.
5747 kind: excluded
5748 fragment:
5749 start: 23
5750 end: 29
5751 __name__:
5752 reason: Binary operation between two vectors removes metric names.
5753 kind: excluded
5754 fragment:
5755 start: 1
5756 end: 124
5757 returns: vector
5758 operations:
5759 - args:
5760 - "0"
5761 node: '[*parser.Call] vector(0)'
5762 op: vector
5763 joins:
5764 - addedlabels: []
5765 depth: 0
5766 ison: false
5767 matchinglabels: []
5768 op: +
5769 src:
5770 returns: vector
5771 operations:
5772 - node: '[*parser.VectorSelector] metric1'
5773 op: ""
5774 - node: '[*parser.Call] rate(metric1[5m])'
5775 op: rate
5776 position:
5777 start: 42
5778 end: 53
5779 type: function
5780 - addedlabels: []
5781 depth: 0
5782 ison: false
5783 matchinglabels: []
5784 op: +
5785 src:
5786 labels:
5787 "":
5788 reason: Calling `vector()` will return a vector value with no labels.
5789 kind: excluded
5790 fragment:
5791 start: 58
5792 end: 64
5793 returns: vector
5794 operations:
5795 - args:
5796 - "1"
5797 node: '[*parser.Call] vector(1)'
5798 op: vector
5799 returnInfo:
5800 logicalexpr: ""
5801 valueposition:
5802 start: 58
5803 end: 67
5804 returnednumber: 1
5805 alwaysreturns: true
5806 knownreturn: true
5807 isreturnbool: false
5808 position:
5809 start: 58
5810 end: 67
5811 type: function
5812 fixedLabels: true
5813 - addedlabels: []
5814 depth: 0
5815 ison: false
5816 matchinglabels: []
5817 op: +
5818 src:
5819 labels:
5820 log_name:
5821 reason: Query will only return series where these labels are present.
5822 kind: guaranteed
5823 fragment:
5824 start: 72
5825 end: 110
5826 returns: vector
5827 operations:
5828 - node: '[*parser.VectorSelector] metric3{log_name="samplerd"}'
5829 op: ""
5830 - node: '[*parser.Call] rate(metric3{log_name="samplerd"}[5m])'
5831 op: rate
5832 usedLabels:
5833 - log_name
5834 position:
5835 start: 77
5836 end: 109
5837 type: function
5838 - addedlabels: []
5839 depth: 0
5840 ison: false
5841 matchinglabels: []
5842 op: +
5843 src:
5844 labels:
5845 "":
5846 reason: Calling `vector()` will return a vector value with no labels.
5847 kind: excluded
5848 fragment:
5849 start: 114
5850 end: 120
5851 returns: vector
5852 operations:
5853 - args:
5854 - "2"
5855 node: '[*parser.Call] vector(2)'
5856 op: vector
5857 returnInfo:
5858 logicalexpr: ""
5859 valueposition:
5860 start: 114
5861 end: 123
5862 returnednumber: 2
5863 alwaysreturns: true
5864 knownreturn: true
5865 isreturnbool: false
5866 position:
5867 start: 114
5868 end: 123
5869 type: function
5870 fixedLabels: true
5871 returnInfo:
5872 logicalexpr: vector(0) + vector(1) + vector(2)
5873 valueposition:
5874 start: 23
5875 end: 32
5876 returnednumber: 3
5877 alwaysreturns: true
5878 knownreturn: true
5879 isreturnbool: false
5880 position:
5881 start: 23
5882 end: 32
5883 type: function
5884 fixedLabels: true
5885 isConditional: true
5886
5887---
5888
5889[TestLabelsSource/127 - 1]
5890expr: label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)")
5891output:
5892 - labels:
5893 "":
5894 reason: Calling `vector()` will return a vector value with no labels.
5895 kind: excluded
5896 fragment:
5897 start: 14
5898 end: 20
5899 nexthop_tag:
5900 reason: This label will be added to the result by label_replace() call.
5901 kind: guaranteed
5902 fragment:
5903 start: 0
5904 end: 64
5905 returns: vector
5906 operations:
5907 - args:
5908 - "1"
5909 node: '[*parser.Call] vector(1)'
5910 op: vector
5911 - args:
5912 - '"nexthop_tag"'
5913 - '"$1"'
5914 - '"nexthop"'
5915 - '"(.+)"'
5916 node: '[*parser.Call] label_replace(vector(1), "nexthop_tag", "$1", "nexthop", "(.+)")'
5917 op: label_replace
5918 usedLabels:
5919 - nexthop
5920 returnInfo:
5921 logicalexpr: ""
5922 valueposition:
5923 start: 14
5924 end: 23
5925 returnednumber: 1
5926 alwaysreturns: true
5927 knownreturn: true
5928 isreturnbool: false
5929 position:
5930 start: 14
5931 end: 23
5932 type: function
5933 fixedLabels: true
5934
5935---
5936
5937[TestLabelsSource/128 - 1]
5938expr: (sum(foo{job="myjob"}))
5939output:
5940 - labels:
5941 "":
5942 reason: Query is using aggregation that removes all labels.
5943 kind: excluded
5944 fragment:
5945 start: 1
5946 end: 4
5947 __name__:
5948 reason: Aggregation removes metric name.
5949 kind: excluded
5950 fragment:
5951 start: 1
5952 end: 22
5953 job:
5954 reason: Query is using aggregation that removes all labels.
5955 kind: excluded
5956 fragment:
5957 start: 1
5958 end: 4
5959 returns: vector
5960 operations:
5961 - node: '[*parser.VectorSelector] foo{job="myjob"}'
5962 op: ""
5963 - node: '[*parser.AggregateExpr] sum(foo{job="myjob"})'
5964 op: sum
5965 position:
5966 start: 5
5967 end: 21
5968 type: aggregation
5969 fixedLabels: true
5970
5971---
5972
5973[TestLabelsSource/129 - 1]
5974expr: (-foo{job="myjob"})
5975output:
5976 - labels:
5977 job:
5978 reason: Query will only return series where these labels are present.
5979 kind: guaranteed
5980 fragment:
5981 start: 2
5982 end: 18
5983 returns: vector
5984 operations:
5985 - node: '[*parser.VectorSelector] foo{job="myjob"}'
5986 op: ""
5987 position:
5988 start: 2
5989 end: 18
5990 type: selector
5991
5992---
5993
5994[TestLabelsSource/130 - 1]
5995expr: |4-
5996
5997 ((( group(vector(0)) ))) > 0
5998output:
5999 - labels:
6000 "":
6001 reason: Query is using aggregation that removes all labels.
6002 kind: excluded
6003 fragment:
6004 start: 5
6005 end: 10
6006 __name__:
6007 reason: Aggregation removes metric name.
6008 kind: excluded
6009 fragment:
6010 start: 5
6011 end: 21
6012 deadInfo:
6013 reason: '`vector(0) > 0` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
6014 fragment:
6015 start: 11
6016 end: 20
6017 returns: vector
6018 operations:
6019 - args:
6020 - "0"
6021 node: '[*parser.Call] vector(0)'
6022 op: vector
6023 - node: '[*parser.AggregateExpr] group(vector(0))'
6024 op: group
6025 returnInfo:
6026 logicalexpr: ""
6027 valueposition:
6028 start: 11
6029 end: 20
6030 returnednumber: 0
6031 alwaysreturns: true
6032 knownreturn: true
6033 isreturnbool: false
6034 position:
6035 start: 11
6036 end: 20
6037 type: aggregation
6038 fixedLabels: true
6039 isConditional: true
6040
6041---
6042
6043[TestLabelsSource/131 - 1]
6044expr: 1 > bool 5
6045output:
6046 - labels:
6047 "":
6048 reason: This query returns a number value with no labels.
6049 kind: excluded
6050 fragment:
6051 start: 0
6052 end: 1
6053 deadInfo:
6054 reason: '`1 > 5` always evaluates to `1 > 5` and uses the `bool` modifier which means it will always return 0'
6055 fragment:
6056 start: 0
6057 end: 1
6058 returns: scalar
6059 returnInfo:
6060 logicalexpr: ""
6061 valueposition:
6062 start: 0
6063 end: 1
6064 returnednumber: 1
6065 alwaysreturns: true
6066 knownreturn: true
6067 isreturnbool: true
6068 position:
6069 start: 0
6070 end: 1
6071 type: number
6072 fixedLabels: true
6073 isConditional: true
6074
6075---
6076
6077[TestLabelsSource/132 - 1]
6078expr: prometheus_ready{job="prometheus"} unless vector(0)
6079output:
6080 - labels:
6081 job:
6082 reason: Query will only return series where these labels are present.
6083 kind: guaranteed
6084 fragment:
6085 start: 0
6086 end: 34
6087 returns: vector
6088 operations:
6089 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
6090 op: ""
6091 unless:
6092 - matchinglabels: []
6093 src:
6094 labels:
6095 "":
6096 reason: Calling `vector()` will return a vector value with no labels.
6097 kind: excluded
6098 fragment:
6099 start: 42
6100 end: 48
6101 deadInfo:
6102 reason: The right hand side will never be matched because it doesn't have the `job` label while the left hand side will. Calling `vector()` will return a vector value with no labels.
6103 fragment:
6104 start: 42
6105 end: 48
6106 returns: vector
6107 operations:
6108 - args:
6109 - "0"
6110 node: '[*parser.Call] vector(0)'
6111 op: vector
6112 returnInfo:
6113 logicalexpr: ""
6114 valueposition:
6115 start: 42
6116 end: 51
6117 returnednumber: 0
6118 alwaysreturns: true
6119 knownreturn: true
6120 isreturnbool: false
6121 position:
6122 start: 42
6123 end: 51
6124 type: function
6125 fixedLabels: true
6126 ison: false
6127 usedLabels:
6128 - job
6129 position:
6130 start: 0
6131 end: 34
6132 type: selector
6133
6134---
6135
6136[TestLabelsSource/133 - 1]
6137expr: prometheus_ready{job="prometheus"} unless on() vector(0)
6138output:
6139 - labels:
6140 job:
6141 reason: Query will only return series where these labels are present.
6142 kind: guaranteed
6143 fragment:
6144 start: 0
6145 end: 34
6146 deadInfo:
6147 reason: This query will never return anything because the `unless` query always returns something.
6148 fragment:
6149 start: 47
6150 end: 56
6151 returns: vector
6152 operations:
6153 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
6154 op: ""
6155 unless:
6156 - matchinglabels: []
6157 src:
6158 labels:
6159 "":
6160 reason: Calling `vector()` will return a vector value with no labels.
6161 kind: excluded
6162 fragment:
6163 start: 47
6164 end: 53
6165 returns: vector
6166 operations:
6167 - args:
6168 - "0"
6169 node: '[*parser.Call] vector(0)'
6170 op: vector
6171 returnInfo:
6172 logicalexpr: ""
6173 valueposition:
6174 start: 47
6175 end: 56
6176 returnednumber: 0
6177 alwaysreturns: true
6178 knownreturn: true
6179 isreturnbool: false
6180 position:
6181 start: 47
6182 end: 56
6183 type: function
6184 fixedLabels: true
6185 ison: true
6186 position:
6187 start: 0
6188 end: 34
6189 type: selector
6190
6191---
6192
6193[TestLabelsSource/134 - 1]
6194expr: prometheus_ready{job="prometheus"} unless on(job) vector(0)
6195output:
6196 - labels:
6197 job:
6198 reason: Query will only return series where these labels are present.
6199 kind: guaranteed
6200 fragment:
6201 start: 0
6202 end: 34
6203 returns: vector
6204 operations:
6205 - node: '[*parser.VectorSelector] prometheus_ready{job="prometheus"}'
6206 op: ""
6207 unless:
6208 - matchinglabels:
6209 - job
6210 src:
6211 labels:
6212 "":
6213 reason: Calling `vector()` will return a vector value with no labels.
6214 kind: excluded
6215 fragment:
6216 start: 50
6217 end: 56
6218 deadInfo:
6219 reason: The right hand side will never be matched because it doesn't have the `job` label from `on(...)`. Calling `vector()` will return a vector value with no labels.
6220 fragment:
6221 start: 50
6222 end: 56
6223 returns: vector
6224 operations:
6225 - args:
6226 - "0"
6227 node: '[*parser.Call] vector(0)'
6228 op: vector
6229 returnInfo:
6230 logicalexpr: ""
6231 valueposition:
6232 start: 50
6233 end: 59
6234 returnednumber: 0
6235 alwaysreturns: true
6236 knownreturn: true
6237 isreturnbool: false
6238 position:
6239 start: 50
6240 end: 59
6241 type: function
6242 fixedLabels: true
6243 ison: true
6244 usedLabels:
6245 - job
6246 position:
6247 start: 0
6248 end: 34
6249 type: selector
6250
6251---
6252
6253[TestLabelsSource/135 - 1]
6254expr: |4
6255
6256 max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"})
6257 unless
6258 sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"})
6259 * on (instance) group_left (cluster)
6260 cf_node_role{kubernetes_role="master",role="kubernetes"}
6261output:
6262 - labels:
6263 "":
6264 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
6265 kind: excluded
6266 fragment:
6267 start: 5
6268 end: 8
6269 __name__:
6270 reason: Aggregation removes metric name.
6271 kind: excluded
6272 fragment:
6273 start: 1
6274 end: 86
6275 cluster:
6276 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
6277 kind: included
6278 fragment:
6279 start: 19
6280 end: 26
6281 instance:
6282 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
6283 kind: included
6284 fragment:
6285 start: 9
6286 end: 17
6287 kubernetes_role:
6288 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
6289 kind: excluded
6290 fragment:
6291 start: 5
6292 end: 27
6293 role:
6294 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
6295 kind: excluded
6296 fragment:
6297 start: 5
6298 end: 27
6299 returns: vector
6300 operations:
6301 - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}'
6302 op: ""
6303 - node: '[*parser.AggregateExpr] max by (instance, cluster) (cf_node_role{kubernetes_role="master",role="kubernetes"})'
6304 op: max
6305 unless:
6306 - matchinglabels: []
6307 src:
6308 labels:
6309 "":
6310 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
6311 kind: excluded
6312 fragment:
6313 start: 99
6314 end: 102
6315 __name__:
6316 reason: Binary operation between two vectors removes metric names.
6317 kind: excluded
6318 fragment:
6319 start: 95
6320 end: 303
6321 cluster:
6322 reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
6323 kind: included
6324 fragment:
6325 start: 234
6326 end: 241
6327 instance:
6328 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
6329 kind: included
6330 fragment:
6331 start: 212
6332 end: 220
6333 name:
6334 reason: Query is using aggregation with `by(instance, cluster)`, only labels included inside `by(...)` will be present on the results.
6335 kind: excluded
6336 fragment:
6337 start: 99
6338 end: 121
6339 returns: vector
6340 operations:
6341 - node: '[*parser.VectorSelector] node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"}'
6342 op: ""
6343 - node: '[*parser.AggregateExpr] sum by (instance, cluster) (time() - node_systemd_timer_last_trigger_seconds{name=~"etcd-defrag-.*.timer"})'
6344 op: sum
6345 joins:
6346 - addedlabels:
6347 - cluster
6348 depth: 0
6349 ison: true
6350 matchinglabels:
6351 - instance
6352 op: '*'
6353 src:
6354 labels:
6355 kubernetes_role:
6356 reason: Query will only return series where these labels are present.
6357 kind: guaranteed
6358 fragment:
6359 start: 247
6360 end: 303
6361 role:
6362 reason: Query will only return series where these labels are present.
6363 kind: guaranteed
6364 fragment:
6365 start: 247
6366 end: 303
6367 returns: vector
6368 operations:
6369 - node: '[*parser.VectorSelector] cf_node_role{kubernetes_role="master",role="kubernetes"}'
6370 op: ""
6371 position:
6372 start: 247
6373 end: 303
6374 type: selector
6375 usedLabels:
6376 - instance
6377 - cluster
6378 position:
6379 start: 132
6380 end: 201
6381 type: aggregation
6382 fixedLabels: true
6383 ison: false
6384 usedLabels:
6385 - instance
6386 - cluster
6387 position:
6388 start: 29
6389 end: 85
6390 type: aggregation
6391 fixedLabels: true
6392
6393---
6394
6395[TestLabelsSource/136 - 1]
6396expr: foo{a="1"} * on() bar{b="2"}
6397output:
6398 - labels:
6399 "":
6400 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
6401 kind: excluded
6402 fragment:
6403 start: 13
6404 end: 17
6405 __name__:
6406 reason: Binary operation between two vectors removes metric names.
6407 kind: excluded
6408 fragment:
6409 start: 0
6410 end: 28
6411 a:
6412 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
6413 kind: excluded
6414 fragment:
6415 start: 13
6416 end: 17
6417 returns: vector
6418 operations:
6419 - node: '[*parser.VectorSelector] foo{a="1"}'
6420 op: ""
6421 joins:
6422 - addedlabels: []
6423 depth: 0
6424 ison: true
6425 matchinglabels: []
6426 op: '*'
6427 src:
6428 labels:
6429 b:
6430 reason: Query will only return series where these labels are present.
6431 kind: guaranteed
6432 fragment:
6433 start: 18
6434 end: 28
6435 returns: vector
6436 operations:
6437 - node: '[*parser.VectorSelector] bar{b="2"}'
6438 op: ""
6439 position:
6440 start: 18
6441 end: 28
6442 type: selector
6443 position:
6444 start: 0
6445 end: 10
6446 type: selector
6447 fixedLabels: true
6448
6449---
6450
6451[TestLabelsSource/137 - 1]
6452expr: foo{a="1"} * on(instance) group_left(c,d) bar{b="2"}
6453output:
6454 - labels:
6455 __name__:
6456 reason: Binary operation between two vectors removes metric names.
6457 kind: excluded
6458 fragment:
6459 start: 0
6460 end: 52
6461 a:
6462 reason: Query will only return series where these labels are present.
6463 kind: guaranteed
6464 fragment:
6465 start: 0
6466 end: 10
6467 c:
6468 reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
6469 kind: included
6470 fragment:
6471 start: 37
6472 end: 38
6473 d:
6474 reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
6475 kind: included
6476 fragment:
6477 start: 39
6478 end: 40
6479 instance:
6480 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
6481 kind: included
6482 fragment:
6483 start: 16
6484 end: 24
6485 returns: vector
6486 operations:
6487 - node: '[*parser.VectorSelector] foo{a="1"}'
6488 op: ""
6489 joins:
6490 - addedlabels:
6491 - c
6492 - d
6493 depth: 0
6494 ison: true
6495 matchinglabels:
6496 - instance
6497 op: '*'
6498 src:
6499 labels:
6500 b:
6501 reason: Query will only return series where these labels are present.
6502 kind: guaranteed
6503 fragment:
6504 start: 42
6505 end: 52
6506 returns: vector
6507 operations:
6508 - node: '[*parser.VectorSelector] bar{b="2"}'
6509 op: ""
6510 position:
6511 start: 42
6512 end: 52
6513 type: selector
6514 usedLabels:
6515 - instance
6516 position:
6517 start: 0
6518 end: 10
6519 type: selector
6520
6521---
6522
6523[TestLabelsSource/138 - 1]
6524expr: foo{a="1"} * on(instance) group_right(c,d) bar{b="2"}
6525output:
6526 - labels:
6527 __name__:
6528 reason: Binary operation between two vectors removes metric names.
6529 kind: excluded
6530 fragment:
6531 start: 0
6532 end: 53
6533 b:
6534 reason: Query will only return series where these labels are present.
6535 kind: guaranteed
6536 fragment:
6537 start: 43
6538 end: 53
6539 c:
6540 reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
6541 kind: included
6542 fragment:
6543 start: 38
6544 end: 39
6545 d:
6546 reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
6547 kind: included
6548 fragment:
6549 start: 40
6550 end: 41
6551 instance:
6552 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
6553 kind: included
6554 fragment:
6555 start: 16
6556 end: 24
6557 returns: vector
6558 operations:
6559 - node: '[*parser.VectorSelector] bar{b="2"}'
6560 op: ""
6561 joins:
6562 - addedlabels:
6563 - c
6564 - d
6565 depth: 0
6566 ison: true
6567 matchinglabels:
6568 - instance
6569 op: '*'
6570 src:
6571 labels:
6572 a:
6573 reason: Query will only return series where these labels are present.
6574 kind: guaranteed
6575 fragment:
6576 start: 0
6577 end: 10
6578 returns: vector
6579 operations:
6580 - node: '[*parser.VectorSelector] foo{a="1"}'
6581 op: ""
6582 position:
6583 start: 0
6584 end: 10
6585 type: selector
6586 usedLabels:
6587 - instance
6588 position:
6589 start: 43
6590 end: 53
6591 type: selector
6592
6593---
6594
6595[TestLabelsSource/139 - 1]
6596expr: foo{a="1"} * on(instance) sum(bar{b="2"})
6597output:
6598 - labels:
6599 "":
6600 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
6601 kind: excluded
6602 fragment:
6603 start: 13
6604 end: 25
6605 __name__:
6606 reason: Binary operation between two vectors removes metric names.
6607 kind: excluded
6608 fragment:
6609 start: 0
6610 end: 41
6611 a:
6612 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
6613 kind: excluded
6614 fragment:
6615 start: 13
6616 end: 25
6617 instance:
6618 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
6619 kind: included
6620 fragment:
6621 start: 16
6622 end: 24
6623 returns: vector
6624 operations:
6625 - node: '[*parser.VectorSelector] foo{a="1"}'
6626 op: ""
6627 joins:
6628 - addedlabels: []
6629 depth: 0
6630 ison: true
6631 matchinglabels:
6632 - instance
6633 op: '*'
6634 src:
6635 labels:
6636 "":
6637 reason: Query is using aggregation that removes all labels.
6638 kind: excluded
6639 fragment:
6640 start: 26
6641 end: 29
6642 __name__:
6643 reason: Aggregation removes metric name.
6644 kind: excluded
6645 fragment:
6646 start: 26
6647 end: 41
6648 b:
6649 reason: Query is using aggregation that removes all labels.
6650 kind: excluded
6651 fragment:
6652 start: 26
6653 end: 29
6654 deadInfo:
6655 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.
6656 fragment:
6657 start: 26
6658 end: 29
6659 returns: vector
6660 operations:
6661 - node: '[*parser.VectorSelector] bar{b="2"}'
6662 op: ""
6663 - node: '[*parser.AggregateExpr] sum(bar{b="2"})'
6664 op: sum
6665 position:
6666 start: 30
6667 end: 40
6668 type: aggregation
6669 fixedLabels: true
6670 usedLabels:
6671 - instance
6672 position:
6673 start: 0
6674 end: 10
6675 type: selector
6676 fixedLabels: true
6677
6678---
6679
6680[TestLabelsSource/140 - 1]
6681expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"})
6682output:
6683 - labels:
6684 __name__:
6685 reason: Binary operation between two vectors removes metric names.
6686 kind: excluded
6687 fragment:
6688 start: 0
6689 end: 57
6690 a:
6691 reason: Query will only return series where these labels are present.
6692 kind: guaranteed
6693 fragment:
6694 start: 0
6695 end: 10
6696 c:
6697 reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
6698 kind: included
6699 fragment:
6700 start: 37
6701 end: 38
6702 d:
6703 reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
6704 kind: included
6705 fragment:
6706 start: 39
6707 end: 40
6708 instance:
6709 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
6710 kind: included
6711 fragment:
6712 start: 16
6713 end: 24
6714 returns: vector
6715 operations:
6716 - node: '[*parser.VectorSelector] foo{a="1"}'
6717 op: ""
6718 joins:
6719 - addedlabels:
6720 - c
6721 - d
6722 depth: 0
6723 ison: true
6724 matchinglabels:
6725 - instance
6726 op: '*'
6727 src:
6728 labels:
6729 "":
6730 reason: Query is using aggregation that removes all labels.
6731 kind: excluded
6732 fragment:
6733 start: 42
6734 end: 45
6735 __name__:
6736 reason: Aggregation removes metric name.
6737 kind: excluded
6738 fragment:
6739 start: 42
6740 end: 57
6741 b:
6742 reason: Query is using aggregation that removes all labels.
6743 kind: excluded
6744 fragment:
6745 start: 42
6746 end: 45
6747 deadInfo:
6748 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.
6749 fragment:
6750 start: 42
6751 end: 45
6752 deadLabels:
6753 - name: c
6754 reason: You can't use `c` because this label is not possible here.
6755 labelreason: Query is using aggregation that removes all labels.
6756 usagefragment:
6757 start: 37
6758 end: 38
6759 labelfragment:
6760 start: 42
6761 end: 45
6762 kind: 0
6763 - name: d
6764 reason: You can't use `d` because this label is not possible here.
6765 labelreason: Query is using aggregation that removes all labels.
6766 usagefragment:
6767 start: 39
6768 end: 40
6769 labelfragment:
6770 start: 42
6771 end: 45
6772 kind: 0
6773 returns: vector
6774 operations:
6775 - node: '[*parser.VectorSelector] bar{b="2"}'
6776 op: ""
6777 - node: '[*parser.AggregateExpr] sum(bar{b="2"})'
6778 op: sum
6779 position:
6780 start: 46
6781 end: 56
6782 type: aggregation
6783 fixedLabels: true
6784 usedLabels:
6785 - instance
6786 position:
6787 start: 0
6788 end: 10
6789 type: selector
6790
6791---
6792
6793[TestLabelsSource/141 - 1]
6794expr: sum(foo{a="1"}) * on(instance) group_right(c,d) bar{b="2"}
6795output:
6796 - labels:
6797 __name__:
6798 reason: Binary operation between two vectors removes metric names.
6799 kind: excluded
6800 fragment:
6801 start: 0
6802 end: 58
6803 b:
6804 reason: Query will only return series where these labels are present.
6805 kind: guaranteed
6806 fragment:
6807 start: 48
6808 end: 58
6809 c:
6810 reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
6811 kind: included
6812 fragment:
6813 start: 43
6814 end: 44
6815 d:
6816 reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
6817 kind: included
6818 fragment:
6819 start: 45
6820 end: 46
6821 instance:
6822 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
6823 kind: included
6824 fragment:
6825 start: 21
6826 end: 29
6827 returns: vector
6828 operations:
6829 - node: '[*parser.VectorSelector] bar{b="2"}'
6830 op: ""
6831 joins:
6832 - addedlabels:
6833 - c
6834 - d
6835 depth: 0
6836 ison: true
6837 matchinglabels:
6838 - instance
6839 op: '*'
6840 src:
6841 labels:
6842 "":
6843 reason: Query is using aggregation that removes all labels.
6844 kind: excluded
6845 fragment:
6846 start: 0
6847 end: 3
6848 __name__:
6849 reason: Aggregation removes metric name.
6850 kind: excluded
6851 fragment:
6852 start: 0
6853 end: 15
6854 a:
6855 reason: Query is using aggregation that removes all labels.
6856 kind: excluded
6857 fragment:
6858 start: 0
6859 end: 3
6860 deadInfo:
6861 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.
6862 fragment:
6863 start: 0
6864 end: 3
6865 deadLabels:
6866 - name: c
6867 reason: You can't use `c` because this label is not possible here.
6868 labelreason: Query is using aggregation that removes all labels.
6869 usagefragment:
6870 start: 43
6871 end: 44
6872 labelfragment:
6873 start: 0
6874 end: 3
6875 kind: 0
6876 - name: d
6877 reason: You can't use `d` because this label is not possible here.
6878 labelreason: Query is using aggregation that removes all labels.
6879 usagefragment:
6880 start: 45
6881 end: 46
6882 labelfragment:
6883 start: 0
6884 end: 3
6885 kind: 0
6886 returns: vector
6887 operations:
6888 - node: '[*parser.VectorSelector] foo{a="1"}'
6889 op: ""
6890 - node: '[*parser.AggregateExpr] sum(foo{a="1"})'
6891 op: sum
6892 position:
6893 start: 4
6894 end: 14
6895 type: aggregation
6896 fixedLabels: true
6897 usedLabels:
6898 - instance
6899 position:
6900 start: 48
6901 end: 58
6902 type: selector
6903
6904---
6905
6906[TestLabelsSource/142 - 1]
6907expr: foo{a="1"} * on(instance) group_left(c,d) sum(bar{b="2"}) without(instance)
6908output:
6909 - labels:
6910 __name__:
6911 reason: Binary operation between two vectors removes metric names.
6912 kind: excluded
6913 fragment:
6914 start: 0
6915 end: 75
6916 a:
6917 reason: Query will only return series where these labels are present.
6918 kind: guaranteed
6919 fragment:
6920 start: 0
6921 end: 10
6922 c:
6923 reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
6924 kind: included
6925 fragment:
6926 start: 37
6927 end: 38
6928 d:
6929 reason: Query is using `group_left(c, d)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
6930 kind: included
6931 fragment:
6932 start: 39
6933 end: 40
6934 instance:
6935 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
6936 kind: included
6937 fragment:
6938 start: 16
6939 end: 24
6940 returns: vector
6941 operations:
6942 - node: '[*parser.VectorSelector] foo{a="1"}'
6943 op: ""
6944 joins:
6945 - addedlabels:
6946 - c
6947 - d
6948 depth: 0
6949 ison: true
6950 matchinglabels:
6951 - instance
6952 op: '*'
6953 src:
6954 labels:
6955 __name__:
6956 reason: Aggregation removes metric name.
6957 kind: excluded
6958 fragment:
6959 start: 42
6960 end: 75
6961 b:
6962 reason: Query will only return series where these labels are present.
6963 kind: guaranteed
6964 fragment:
6965 start: 46
6966 end: 56
6967 instance:
6968 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
6969 kind: excluded
6970 fragment:
6971 start: 66
6972 end: 74
6973 deadInfo:
6974 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.
6975 fragment:
6976 start: 66
6977 end: 74
6978 returns: vector
6979 operations:
6980 - node: '[*parser.VectorSelector] bar{b="2"}'
6981 op: ""
6982 - node: '[*parser.AggregateExpr] sum without (instance) (bar{b="2"})'
6983 op: sum
6984 position:
6985 start: 46
6986 end: 56
6987 type: aggregation
6988 usedLabels:
6989 - instance
6990 position:
6991 start: 0
6992 end: 10
6993 type: selector
6994
6995---
6996
6997[TestLabelsSource/143 - 1]
6998expr: sum(foo{a="1"}) without(instance) * on(instance) group_right(c,d) bar{b="2"}
6999output:
7000 - labels:
7001 __name__:
7002 reason: Binary operation between two vectors removes metric names.
7003 kind: excluded
7004 fragment:
7005 start: 0
7006 end: 76
7007 b:
7008 reason: Query will only return series where these labels are present.
7009 kind: guaranteed
7010 fragment:
7011 start: 66
7012 end: 76
7013 c:
7014 reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
7015 kind: included
7016 fragment:
7017 start: 61
7018 end: 62
7019 d:
7020 reason: Query is using `group_right(c, d)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
7021 kind: included
7022 fragment:
7023 start: 63
7024 end: 64
7025 instance:
7026 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
7027 kind: included
7028 fragment:
7029 start: 39
7030 end: 47
7031 returns: vector
7032 operations:
7033 - node: '[*parser.VectorSelector] bar{b="2"}'
7034 op: ""
7035 joins:
7036 - addedlabels:
7037 - c
7038 - d
7039 depth: 0
7040 ison: true
7041 matchinglabels:
7042 - instance
7043 op: '*'
7044 src:
7045 labels:
7046 __name__:
7047 reason: Aggregation removes metric name.
7048 kind: excluded
7049 fragment:
7050 start: 0
7051 end: 33
7052 a:
7053 reason: Query will only return series where these labels are present.
7054 kind: guaranteed
7055 fragment:
7056 start: 4
7057 end: 14
7058 instance:
7059 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
7060 kind: excluded
7061 fragment:
7062 start: 24
7063 end: 32
7064 deadInfo:
7065 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.
7066 fragment:
7067 start: 24
7068 end: 32
7069 returns: vector
7070 operations:
7071 - node: '[*parser.VectorSelector] foo{a="1"}'
7072 op: ""
7073 - node: '[*parser.AggregateExpr] sum without (instance) (foo{a="1"})'
7074 op: sum
7075 position:
7076 start: 4
7077 end: 14
7078 type: aggregation
7079 usedLabels:
7080 - instance
7081 position:
7082 start: 66
7083 end: 76
7084 type: selector
7085
7086---
7087
7088[TestLabelsSource/144 - 1]
7089expr: |4
7090
7091 max without (source_instance) (
7092 increase(kernel_device_io_errors_total{device!~"loop.+"}[120m]) > 3 unless on(instance, device) (
7093 increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[125m])*2 > increase(kernel_device_io_errors_total[120m])
7094 )
7095 and on(device, instance) absent(node_disk_info)
7096 ) * on(instance) group_left(group) label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)")
7097output:
7098 - labels:
7099 __name__:
7100 reason: Binary operation between two vectors removes metric names.
7101 kind: excluded
7102 fragment:
7103 start: 2
7104 end: 442
7105 device:
7106 reason: Query is using many-to-many vector matching with `on(device, instance)`, labels included inside `on(...)` will be present on the results if matched time series have them.
7107 kind: included
7108 fragment:
7109 start: 274
7110 end: 280
7111 group:
7112 reason: Query is using `group_left(group)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
7113 kind: included
7114 fragment:
7115 start: 344
7116 end: 349
7117 instance:
7118 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
7119 kind: included
7120 fragment:
7121 start: 323
7122 end: 331
7123 source_instance:
7124 reason: Query is using aggregation with `without(source_instance)`, all labels included inside `without(...)` will be removed from the results.
7125 kind: excluded
7126 fragment:
7127 start: 15
7128 end: 30
7129 returns: vector
7130 operations:
7131 - node: '[*parser.VectorSelector] kernel_device_io_errors_total{device!~"loop.+"}'
7132 op: ""
7133 - node: '[*parser.Call] increase(kernel_device_io_errors_total{device!~"loop.+"}[2h])'
7134 op: increase
7135 - node: '[*parser.AggregateExpr] max without (source_instance) (increase(kernel_device_io_errors_total{device!~"loop.+"}[2h]) > 3 unless on (instance, device) (increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[2h5m]) * 2 > increase(kernel_device_io_errors_total[2h])) and on (device, instance) absent(node_disk_info))'
7136 op: max
7137 joins:
7138 - addedlabels: []
7139 depth: 1
7140 ison: true
7141 matchinglabels:
7142 - device
7143 - instance
7144 op: and
7145 src:
7146 labels:
7147 "":
7148 reason: |-
7149 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.
7150 You will only get any results back if the metric selector you pass doesn't match anything.
7151 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
7152 This means that the only labels you can get back from absent call are the ones you pass to it.
7153 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.
7154 kind: excluded
7155 fragment:
7156 start: 292
7157 end: 298
7158 deadInfo:
7159 reason: |-
7160 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.
7161 You will only get any results back if the metric selector you pass doesn't match anything.
7162 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
7163 This means that the only labels you can get back from absent call are the ones you pass to it.
7164 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.
7165 fragment:
7166 start: 292
7167 end: 298
7168 returns: vector
7169 operations:
7170 - node: '[*parser.VectorSelector] node_disk_info'
7171 op: ""
7172 - node: '[*parser.Call] absent(node_disk_info)'
7173 op: absent
7174 position:
7175 start: 299
7176 end: 313
7177 type: function
7178 fixedLabels: true
7179 - addedlabels:
7180 - group
7181 depth: 0
7182 ison: true
7183 matchinglabels:
7184 - instance
7185 op: '*'
7186 src:
7187 labels:
7188 instance:
7189 reason: This label will be added to the result by label_replace() call.
7190 kind: guaranteed
7191 fragment:
7192 start: 351
7193 end: 442
7194 returns: vector
7195 operations:
7196 - node: '[*parser.VectorSelector] salt_highstate_runner_configured_minions'
7197 op: ""
7198 - args:
7199 - '"instance"'
7200 - '"$1"'
7201 - '"minion"'
7202 - '"(.+)"'
7203 node: '[*parser.Call] label_replace(salt_highstate_runner_configured_minions, "instance", "$1", "minion", "(.+)")'
7204 op: label_replace
7205 usedLabels:
7206 - minion
7207 position:
7208 start: 365
7209 end: 405
7210 type: function
7211 unless:
7212 - matchinglabels:
7213 - instance
7214 - device
7215 src:
7216 labels:
7217 __name__:
7218 reason: Binary operation between two vectors removes metric names.
7219 kind: excluded
7220 fragment:
7221 start: 140
7222 end: 258
7223 returns: vector
7224 operations:
7225 - node: '[*parser.VectorSelector] kernel_device_io_soft_errors_total{device!~"loop.+"}'
7226 op: ""
7227 - node: '[*parser.Call] increase(kernel_device_io_soft_errors_total{device!~"loop.+"}[2h5m])'
7228 op: increase
7229 joins:
7230 - addedlabels: []
7231 depth: 0
7232 ison: false
7233 matchinglabels: []
7234 op: '>'
7235 src:
7236 returns: vector
7237 operations:
7238 - node: '[*parser.VectorSelector] kernel_device_io_errors_total'
7239 op: ""
7240 - node: '[*parser.Call] increase(kernel_device_io_errors_total[2h])'
7241 op: increase
7242 position:
7243 start: 222
7244 end: 257
7245 type: function
7246 position:
7247 start: 149
7248 end: 207
7249 type: function
7250 isConditional: true
7251 ison: true
7252 usedLabels:
7253 - instance
7254 - device
7255 position:
7256 start: 46
7257 end: 99
7258 type: aggregation
7259 isConditional: true
7260
7261---
7262
7263[TestLabelsSource/145 - 1]
7264expr: sum(foo{a="1"}) by(job) * on() bar{b="2"}
7265output:
7266 - labels:
7267 "":
7268 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
7269 kind: excluded
7270 fragment:
7271 start: 26
7272 end: 30
7273 __name__:
7274 reason: Binary operation between two vectors removes metric names.
7275 kind: excluded
7276 fragment:
7277 start: 0
7278 end: 41
7279 a:
7280 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
7281 kind: excluded
7282 fragment:
7283 start: 16
7284 end: 23
7285 job:
7286 reason: Query is using one-to-one vector matching with `on()`, only labels included inside `on(...)` will be present on the results.
7287 kind: excluded
7288 fragment:
7289 start: 26
7290 end: 30
7291 returns: vector
7292 operations:
7293 - node: '[*parser.VectorSelector] foo{a="1"}'
7294 op: ""
7295 - node: '[*parser.AggregateExpr] sum by (job) (foo{a="1"})'
7296 op: sum
7297 joins:
7298 - addedlabels: []
7299 depth: 0
7300 ison: true
7301 matchinglabels: []
7302 op: '*'
7303 src:
7304 labels:
7305 b:
7306 reason: Query will only return series where these labels are present.
7307 kind: guaranteed
7308 fragment:
7309 start: 31
7310 end: 41
7311 returns: vector
7312 operations:
7313 - node: '[*parser.VectorSelector] bar{b="2"}'
7314 op: ""
7315 position:
7316 start: 31
7317 end: 41
7318 type: selector
7319 position:
7320 start: 4
7321 end: 14
7322 type: aggregation
7323 fixedLabels: true
7324
7325---
7326
7327[TestLabelsSource/146 - 1]
7328expr: sum(sum(foo) without(job)) by(job)
7329output:
7330 - labels:
7331 "":
7332 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
7333 kind: excluded
7334 fragment:
7335 start: 27
7336 end: 29
7337 __name__:
7338 reason: Aggregation removes metric name.
7339 kind: excluded
7340 fragment:
7341 start: 0
7342 end: 34
7343 job:
7344 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
7345 kind: excluded
7346 fragment:
7347 start: 21
7348 end: 24
7349 deadLabels:
7350 - name: job
7351 reason: You can't use `job` because this label is not possible here.
7352 labelreason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
7353 usagefragment:
7354 start: 30
7355 end: 33
7356 labelfragment:
7357 start: 21
7358 end: 24
7359 kind: 0
7360 returns: vector
7361 operations:
7362 - node: '[*parser.VectorSelector] foo'
7363 op: ""
7364 - node: '[*parser.AggregateExpr] sum without (job) (foo)'
7365 op: sum
7366 - node: '[*parser.AggregateExpr] sum by (job) (sum without (job) (foo))'
7367 op: sum
7368 usedLabels:
7369 - job
7370 position:
7371 start: 8
7372 end: 11
7373 type: aggregation
7374 fixedLabels: true
7375
7376---
7377
7378[TestLabelsSource/147 - 1]
7379expr: |4
7380
7381 prometheus:scrape_series_added:since_gc:sum
7382 * on(prometheus) group_left()
7383 label_replace(
7384 max(max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])) by(instance)
7385 /
7386 max(max_over_time(prometheus_tsdb_head_series[2h])) by(instance),
7387 "prometheus", "$1",
7388 "instance", "(.+)"
7389 )
7390output:
7391 - labels:
7392 __name__:
7393 reason: Binary operation between two vectors removes metric names.
7394 kind: excluded
7395 fragment:
7396 start: 1
7397 end: 287
7398 prometheus:
7399 reason: Query is using many-to-one vector matching with `on(prometheus)`, labels included inside `on(...)` will be present on the results.
7400 kind: included
7401 fragment:
7402 start: 50
7403 end: 60
7404 returns: vector
7405 operations:
7406 - node: '[*parser.VectorSelector] prometheus:scrape_series_added:since_gc:sum'
7407 op: ""
7408 joins:
7409 - addedlabels: []
7410 depth: 0
7411 ison: true
7412 matchinglabels:
7413 - prometheus
7414 op: '*'
7415 src:
7416 labels:
7417 "":
7418 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
7419 kind: excluded
7420 fragment:
7421 start: 158
7422 end: 160
7423 __name__:
7424 reason: Binary operation between two vectors removes metric names.
7425 kind: excluded
7426 fragment:
7427 start: 92
7428 end: 241
7429 instance:
7430 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
7431 kind: included
7432 fragment:
7433 start: 161
7434 end: 169
7435 job:
7436 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
7437 kind: excluded
7438 fragment:
7439 start: 158
7440 end: 170
7441 prometheus:
7442 reason: This label will be added to the result by label_replace() call.
7443 kind: guaranteed
7444 fragment:
7445 start: 75
7446 end: 287
7447 returns: vector
7448 operations:
7449 - node: '[*parser.VectorSelector] go_memstats_alloc_bytes{job="prometheus"}'
7450 op: ""
7451 - node: '[*parser.Call] max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h])'
7452 op: max_over_time
7453 - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(go_memstats_alloc_bytes{job="prometheus"}[2h]))'
7454 op: max
7455 - args:
7456 - '"prometheus"'
7457 - '"$1"'
7458 - '"instance"'
7459 - '"(.+)"'
7460 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", "(.+)")'
7461 op: label_replace
7462 joins:
7463 - addedlabels: []
7464 depth: 0
7465 ison: false
7466 matchinglabels: []
7467 op: /
7468 src:
7469 labels:
7470 "":
7471 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
7472 kind: excluded
7473 fragment:
7474 start: 229
7475 end: 231
7476 __name__:
7477 reason: Aggregation removes metric name.
7478 kind: excluded
7479 fragment:
7480 start: 177
7481 end: 241
7482 instance:
7483 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
7484 kind: included
7485 fragment:
7486 start: 232
7487 end: 240
7488 returns: vector
7489 operations:
7490 - node: '[*parser.VectorSelector] prometheus_tsdb_head_series'
7491 op: ""
7492 - node: '[*parser.Call] max_over_time(prometheus_tsdb_head_series[2h])'
7493 op: max_over_time
7494 - node: '[*parser.AggregateExpr] max by (instance) (max_over_time(prometheus_tsdb_head_series[2h]))'
7495 op: max
7496 usedLabels:
7497 - instance
7498 position:
7499 start: 195
7500 end: 226
7501 type: aggregation
7502 fixedLabels: true
7503 usedLabels:
7504 - instance
7505 position:
7506 start: 92
7507 end: 241
7508 type: function
7509 fixedLabels: true
7510 usedLabels:
7511 - prometheus
7512 position:
7513 start: 1
7514 end: 44
7515 type: selector
7516
7517---
7518
7519[TestLabelsSource/148 - 1]
7520expr: (day_of_week() == 6 and hour() < 1) or vector(1)
7521output:
7522 - labels:
7523 "":
7524 reason: Calling `day_of_week()` with no arguments will return an empty time series with no labels.
7525 kind: excluded
7526 fragment:
7527 start: 1
7528 end: 14
7529 returns: vector
7530 operations:
7531 - node: '[*parser.Call] day_of_week()'
7532 op: day_of_week
7533 joins:
7534 - addedlabels: []
7535 depth: 0
7536 ison: false
7537 matchinglabels: []
7538 op: and
7539 src:
7540 labels:
7541 "":
7542 reason: Calling `hour()` with no arguments will return an empty time series with no labels.
7543 kind: excluded
7544 fragment:
7545 start: 24
7546 end: 30
7547 returns: vector
7548 operations:
7549 - node: '[*parser.Call] hour()'
7550 op: hour
7551 returnInfo:
7552 logicalexpr: ""
7553 valueposition:
7554 start: 0
7555 end: 0
7556 returnednumber: 0
7557 alwaysreturns: true
7558 knownreturn: false
7559 isreturnbool: false
7560 position:
7561 start: 24
7562 end: 30
7563 type: function
7564 fixedLabels: true
7565 isConditional: true
7566 returnInfo:
7567 logicalexpr: ""
7568 valueposition:
7569 start: 0
7570 end: 0
7571 returnednumber: 0
7572 alwaysreturns: true
7573 knownreturn: false
7574 isreturnbool: false
7575 position:
7576 start: 1
7577 end: 14
7578 type: function
7579 fixedLabels: true
7580 isConditional: true
7581 - labels:
7582 "":
7583 reason: Calling `vector()` will return a vector value with no labels.
7584 kind: excluded
7585 fragment:
7586 start: 39
7587 end: 45
7588 returns: vector
7589 operations:
7590 - args:
7591 - "1"
7592 node: '[*parser.Call] vector(1)'
7593 op: vector
7594 returnInfo:
7595 logicalexpr: ""
7596 valueposition:
7597 start: 39
7598 end: 48
7599 returnednumber: 1
7600 alwaysreturns: true
7601 knownreturn: true
7602 isreturnbool: false
7603 position:
7604 start: 39
7605 end: 48
7606 type: function
7607 fixedLabels: true
7608
7609---
7610
7611[TestLabelsSource/149 - 1]
7612expr: |4-
7613
7614 sum by (foo, bar) (
7615 rate(errors_total[5m])
7616 * on (instance) group_left (bob, alice)
7617 server_errors_total
7618 )
7619output:
7620 - labels:
7621 "":
7622 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
7623 kind: excluded
7624 fragment:
7625 start: 5
7626 end: 8
7627 __name__:
7628 reason: Aggregation removes metric name.
7629 kind: excluded
7630 fragment:
7631 start: 1
7632 end: 115
7633 alice:
7634 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
7635 kind: excluded
7636 fragment:
7637 start: 5
7638 end: 18
7639 bar:
7640 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
7641 kind: included
7642 fragment:
7643 start: 14
7644 end: 17
7645 bob:
7646 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
7647 kind: excluded
7648 fragment:
7649 start: 5
7650 end: 18
7651 foo:
7652 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
7653 kind: included
7654 fragment:
7655 start: 9
7656 end: 12
7657 instance:
7658 reason: Query is using aggregation with `by(foo, bar)`, only labels included inside `by(...)` will be present on the results.
7659 kind: excluded
7660 fragment:
7661 start: 5
7662 end: 18
7663 deadLabels:
7664 - name: bob
7665 reason: Previously joined label `bob` is being removed from the results.
7666 labelreason: Query is using `group_left(bob, alice)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
7667 usagefragment:
7668 start: 5
7669 end: 18
7670 labelfragment:
7671 start: 78
7672 end: 81
7673 kind: 3
7674 - name: alice
7675 reason: Previously joined label `alice` is being removed from the results.
7676 labelreason: Query is using `group_left(bob, alice)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
7677 usagefragment:
7678 start: 5
7679 end: 18
7680 labelfragment:
7681 start: 83
7682 end: 88
7683 kind: 3
7684 returns: vector
7685 operations:
7686 - node: '[*parser.VectorSelector] errors_total'
7687 op: ""
7688 - node: '[*parser.Call] rate(errors_total[5m])'
7689 op: rate
7690 - node: '[*parser.AggregateExpr] sum by (foo, bar) (rate(errors_total[5m]) * on (instance) group_left (bob, alice) server_errors_total)'
7691 op: sum
7692 joins:
7693 - addedlabels:
7694 - bob
7695 - alice
7696 depth: 1
7697 ison: true
7698 matchinglabels:
7699 - instance
7700 op: '*'
7701 src:
7702 returns: vector
7703 operations:
7704 - node: '[*parser.VectorSelector] server_errors_total'
7705 op: ""
7706 position:
7707 start: 94
7708 end: 113
7709 type: selector
7710 usedLabels:
7711 - foo
7712 - bar
7713 position:
7714 start: 30
7715 end: 46
7716 type: aggregation
7717 fixedLabels: true
7718
7719---
7720
7721[TestLabelsSource/150 - 1]
7722expr: 1 - (foo or vector(0)) < 0.999
7723output:
7724 - returns: vector
7725 operations:
7726 - node: '[*parser.VectorSelector] foo'
7727 op: ""
7728 position:
7729 start: 5
7730 end: 8
7731 type: selector
7732 isConditional: true
7733 - labels:
7734 "":
7735 reason: Calling `vector()` will return a vector value with no labels.
7736 kind: excluded
7737 fragment:
7738 start: 12
7739 end: 18
7740 deadInfo:
7741 reason: '`1 - vector(0) < 0.999` always evaluates to `1 < 0.999` which is not possible, so it will never return anything.'
7742 fragment:
7743 start: 12
7744 end: 21
7745 returns: vector
7746 operations:
7747 - args:
7748 - "0"
7749 node: '[*parser.Call] vector(0)'
7750 op: vector
7751 returnInfo:
7752 logicalexpr: 1 - vector(0)
7753 valueposition:
7754 start: 0
7755 end: 1
7756 returnednumber: 1
7757 alwaysreturns: true
7758 knownreturn: true
7759 isreturnbool: false
7760 position:
7761 start: 12
7762 end: 21
7763 type: function
7764 fixedLabels: true
7765 isConditional: true
7766
7767---
7768
7769[TestLabelsSource/151 - 1]
7770expr: |4
7771
7772 (
7773 vector(1) and month() == 2
7774 ) or vector(0)
7775output:
7776 - labels:
7777 "":
7778 reason: Calling `vector()` will return a vector value with no labels.
7779 kind: excluded
7780 fragment:
7781 start: 5
7782 end: 11
7783 returns: vector
7784 operations:
7785 - args:
7786 - "1"
7787 node: '[*parser.Call] vector(1)'
7788 op: vector
7789 joins:
7790 - addedlabels: []
7791 depth: 0
7792 ison: false
7793 matchinglabels: []
7794 op: and
7795 src:
7796 labels:
7797 "":
7798 reason: Calling `month()` with no arguments will return an empty time series with no labels.
7799 kind: excluded
7800 fragment:
7801 start: 19
7802 end: 26
7803 returns: vector
7804 operations:
7805 - node: '[*parser.Call] month()'
7806 op: month
7807 returnInfo:
7808 logicalexpr: ""
7809 valueposition:
7810 start: 0
7811 end: 0
7812 returnednumber: 0
7813 alwaysreturns: true
7814 knownreturn: false
7815 isreturnbool: false
7816 position:
7817 start: 19
7818 end: 26
7819 type: function
7820 fixedLabels: true
7821 isConditional: true
7822 returnInfo:
7823 logicalexpr: ""
7824 valueposition:
7825 start: 5
7826 end: 14
7827 returnednumber: 1
7828 alwaysreturns: true
7829 knownreturn: true
7830 isreturnbool: false
7831 position:
7832 start: 5
7833 end: 14
7834 type: function
7835 fixedLabels: true
7836 isConditional: true
7837 - labels:
7838 "":
7839 reason: Calling `vector()` will return a vector value with no labels.
7840 kind: excluded
7841 fragment:
7842 start: 37
7843 end: 43
7844 returns: vector
7845 operations:
7846 - args:
7847 - "0"
7848 node: '[*parser.Call] vector(0)'
7849 op: vector
7850 returnInfo:
7851 logicalexpr: ""
7852 valueposition:
7853 start: 37
7854 end: 46
7855 returnednumber: 0
7856 alwaysreturns: true
7857 knownreturn: true
7858 isreturnbool: false
7859 position:
7860 start: 37
7861 end: 46
7862 type: function
7863 fixedLabels: true
7864
7865---
7866
7867[TestLabelsSource/152 - 1]
7868expr: count by (region) (stddev by (colo_name, region) (error_total))
7869output:
7870 - labels:
7871 "":
7872 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
7873 kind: excluded
7874 fragment:
7875 start: 6
7876 end: 9
7877 __name__:
7878 reason: Aggregation removes metric name.
7879 kind: excluded
7880 fragment:
7881 start: 0
7882 end: 63
7883 colo_name:
7884 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
7885 kind: excluded
7886 fragment:
7887 start: 6
7888 end: 17
7889 region:
7890 reason: Query is using aggregation with `by(region)`, only labels included inside `by(...)` will be present on the results.
7891 kind: included
7892 fragment:
7893 start: 10
7894 end: 16
7895 returns: vector
7896 operations:
7897 - node: '[*parser.VectorSelector] error_total'
7898 op: ""
7899 - node: '[*parser.AggregateExpr] stddev by (colo_name, region) (error_total)'
7900 op: stddev
7901 - node: '[*parser.AggregateExpr] count by (region) (stddev by (colo_name, region) (error_total))'
7902 op: count
7903 usedLabels:
7904 - region
7905 position:
7906 start: 50
7907 end: 61
7908 type: aggregation
7909 fixedLabels: true
7910
7911---
7912
7913[TestLabelsSource/153 - 1]
7914expr: |4
7915
7916 (
7917 avg(
7918 rate(foo_rejections[6h])
7919 or
7920 vector(0)
7921 ) by (colo_name)
7922 /
7923 (
7924 avg(
7925 rate(foo_total[6h])
7926 or
7927 vector(1)
7928 ) by (colo_name)
7929 )
7930 ) > 5
7931 *
7932 (
7933 avg(
7934 rate(foo_rejections[6h] offset 1d)
7935 or
7936 vector(0)
7937 ) by (colo_name)
7938 /
7939 avg(
7940 rate(foo_total[6h] offset 1d)
7941 or
7942 vector(1)
7943 ) by (colo_name)
7944 ) and on (colo_name) (colo_job:foo_total:rate2m or vector(0)) > 80
7945 and on (colo_name) (colo_job:foo_total:rate2m offset 1d or vector(0)) > 80
7946output:
7947 - labels:
7948 "":
7949 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
7950 kind: excluded
7951 fragment:
7952 start: 64
7953 end: 67
7954 __name__:
7955 reason: Binary operation between two vectors removes metric names.
7956 kind: excluded
7957 fragment:
7958 start: 1
7959 end: 336
7960 colo_name:
7961 reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results if matched time series have them.
7962 kind: included
7963 fragment:
7964 start: 412
7965 end: 421
7966 returns: vector
7967 operations:
7968 - node: '[*parser.VectorSelector] foo_rejections'
7969 op: ""
7970 - node: '[*parser.Call] rate(foo_rejections[6h])'
7971 op: rate
7972 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))'
7973 op: avg
7974 joins:
7975 - addedlabels: []
7976 depth: 0
7977 ison: false
7978 matchinglabels: []
7979 op: /
7980 src:
7981 labels:
7982 "":
7983 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
7984 kind: excluded
7985 fragment:
7986 start: 147
7987 end: 150
7988 __name__:
7989 reason: Aggregation removes metric name.
7990 kind: excluded
7991 fragment:
7992 start: 91
7993 end: 161
7994 colo_name:
7995 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
7996 kind: included
7997 fragment:
7998 start: 151
7999 end: 160
8000 returns: vector
8001 operations:
8002 - node: '[*parser.VectorSelector] foo_total'
8003 op: ""
8004 - node: '[*parser.Call] rate(foo_total[6h])'
8005 op: rate
8006 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
8007 op: avg
8008 usedLabels:
8009 - colo_name
8010 position:
8011 start: 107
8012 end: 120
8013 type: aggregation
8014 fixedLabels: true
8015 - addedlabels: []
8016 depth: 0
8017 ison: false
8018 matchinglabels: []
8019 op: /
8020 src:
8021 labels:
8022 "":
8023 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8024 kind: excluded
8025 fragment:
8026 start: 147
8027 end: 150
8028 __name__:
8029 reason: Aggregation removes metric name.
8030 kind: excluded
8031 fragment:
8032 start: 91
8033 end: 161
8034 colo_name:
8035 reason: Calling `vector()` will return a vector value with no labels.
8036 kind: excluded
8037 fragment:
8038 start: 131
8039 end: 137
8040 deadLabels:
8041 - name: colo_name
8042 reason: You can't use `colo_name` because this label is not possible here.
8043 labelreason: Calling `vector()` will return a vector value with no labels.
8044 usagefragment:
8045 start: 151
8046 end: 160
8047 labelfragment:
8048 start: 131
8049 end: 137
8050 kind: 0
8051 returns: vector
8052 operations:
8053 - args:
8054 - "1"
8055 node: '[*parser.Call] vector(1)'
8056 op: vector
8057 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
8058 op: avg
8059 usedLabels:
8060 - colo_name
8061 returnInfo:
8062 logicalexpr: ""
8063 valueposition:
8064 start: 131
8065 end: 140
8066 returnednumber: 1
8067 alwaysreturns: true
8068 knownreturn: true
8069 isreturnbool: false
8070 position:
8071 start: 131
8072 end: 140
8073 type: aggregation
8074 fixedLabels: true
8075 - addedlabels: []
8076 depth: 0
8077 ison: false
8078 matchinglabels: []
8079 op: '>'
8080 src:
8081 labels:
8082 "":
8083 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8084 kind: excluded
8085 fragment:
8086 start: 241
8087 end: 244
8088 __name__:
8089 reason: Binary operation between two vectors removes metric names.
8090 kind: excluded
8091 fragment:
8092 start: 178
8093 end: 334
8094 colo_name:
8095 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8096 kind: included
8097 fragment:
8098 start: 245
8099 end: 254
8100 returns: vector
8101 operations:
8102 - node: '[*parser.VectorSelector] foo_rejections offset 1d'
8103 op: ""
8104 - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)'
8105 op: rate
8106 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
8107 op: avg
8108 joins:
8109 - addedlabels: []
8110 depth: 0
8111 ison: false
8112 matchinglabels: []
8113 op: /
8114 src:
8115 labels:
8116 "":
8117 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8118 kind: excluded
8119 fragment:
8120 start: 320
8121 end: 323
8122 __name__:
8123 reason: Aggregation removes metric name.
8124 kind: excluded
8125 fragment:
8126 start: 262
8127 end: 334
8128 colo_name:
8129 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8130 kind: included
8131 fragment:
8132 start: 324
8133 end: 333
8134 returns: vector
8135 operations:
8136 - node: '[*parser.VectorSelector] foo_total offset 1d'
8137 op: ""
8138 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
8139 op: rate
8140 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
8141 op: avg
8142 usedLabels:
8143 - colo_name
8144 position:
8145 start: 276
8146 end: 299
8147 type: aggregation
8148 fixedLabels: true
8149 - addedlabels: []
8150 depth: 0
8151 ison: false
8152 matchinglabels: []
8153 op: /
8154 src:
8155 labels:
8156 "":
8157 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8158 kind: excluded
8159 fragment:
8160 start: 320
8161 end: 323
8162 __name__:
8163 reason: Aggregation removes metric name.
8164 kind: excluded
8165 fragment:
8166 start: 262
8167 end: 334
8168 colo_name:
8169 reason: Calling `vector()` will return a vector value with no labels.
8170 kind: excluded
8171 fragment:
8172 start: 306
8173 end: 312
8174 deadLabels:
8175 - name: colo_name
8176 reason: You can't use `colo_name` because this label is not possible here.
8177 labelreason: Calling `vector()` will return a vector value with no labels.
8178 usagefragment:
8179 start: 324
8180 end: 333
8181 labelfragment:
8182 start: 306
8183 end: 312
8184 kind: 0
8185 returns: vector
8186 operations:
8187 - args:
8188 - "1"
8189 node: '[*parser.Call] vector(1)'
8190 op: vector
8191 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
8192 op: avg
8193 usedLabels:
8194 - colo_name
8195 returnInfo:
8196 logicalexpr: ""
8197 valueposition:
8198 start: 306
8199 end: 315
8200 returnednumber: 1
8201 alwaysreturns: true
8202 knownreturn: true
8203 isreturnbool: false
8204 position:
8205 start: 306
8206 end: 315
8207 type: aggregation
8208 fixedLabels: true
8209 usedLabels:
8210 - colo_name
8211 position:
8212 start: 192
8213 end: 220
8214 type: aggregation
8215 fixedLabels: true
8216 - addedlabels: []
8217 depth: 0
8218 ison: false
8219 matchinglabels: []
8220 op: '>'
8221 src:
8222 labels:
8223 "":
8224 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8225 kind: excluded
8226 fragment:
8227 start: 241
8228 end: 244
8229 __name__:
8230 reason: Binary operation between two vectors removes metric names.
8231 kind: excluded
8232 fragment:
8233 start: 178
8234 end: 334
8235 colo_name:
8236 reason: Calling `vector()` will return a vector value with no labels.
8237 kind: excluded
8238 fragment:
8239 start: 227
8240 end: 233
8241 deadLabels:
8242 - name: colo_name
8243 reason: You can't use `colo_name` because this label is not possible here.
8244 labelreason: Calling `vector()` will return a vector value with no labels.
8245 usagefragment:
8246 start: 245
8247 end: 254
8248 labelfragment:
8249 start: 227
8250 end: 233
8251 kind: 0
8252 returns: vector
8253 operations:
8254 - args:
8255 - "0"
8256 node: '[*parser.Call] vector(0)'
8257 op: vector
8258 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
8259 op: avg
8260 joins:
8261 - addedlabels: []
8262 depth: 0
8263 ison: false
8264 matchinglabels: []
8265 op: /
8266 src:
8267 labels:
8268 "":
8269 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8270 kind: excluded
8271 fragment:
8272 start: 320
8273 end: 323
8274 __name__:
8275 reason: Aggregation removes metric name.
8276 kind: excluded
8277 fragment:
8278 start: 262
8279 end: 334
8280 colo_name:
8281 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8282 kind: included
8283 fragment:
8284 start: 324
8285 end: 333
8286 returns: vector
8287 operations:
8288 - node: '[*parser.VectorSelector] foo_total offset 1d'
8289 op: ""
8290 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
8291 op: rate
8292 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
8293 op: avg
8294 usedLabels:
8295 - colo_name
8296 position:
8297 start: 276
8298 end: 299
8299 type: aggregation
8300 fixedLabels: true
8301 - addedlabels: []
8302 depth: 0
8303 ison: false
8304 matchinglabels: []
8305 op: /
8306 src:
8307 labels:
8308 "":
8309 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8310 kind: excluded
8311 fragment:
8312 start: 320
8313 end: 323
8314 __name__:
8315 reason: Aggregation removes metric name.
8316 kind: excluded
8317 fragment:
8318 start: 262
8319 end: 334
8320 colo_name:
8321 reason: Calling `vector()` will return a vector value with no labels.
8322 kind: excluded
8323 fragment:
8324 start: 306
8325 end: 312
8326 deadLabels:
8327 - name: colo_name
8328 reason: You can't use `colo_name` because this label is not possible here.
8329 labelreason: Calling `vector()` will return a vector value with no labels.
8330 usagefragment:
8331 start: 324
8332 end: 333
8333 labelfragment:
8334 start: 306
8335 end: 312
8336 kind: 0
8337 returns: vector
8338 operations:
8339 - args:
8340 - "1"
8341 node: '[*parser.Call] vector(1)'
8342 op: vector
8343 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
8344 op: avg
8345 usedLabels:
8346 - colo_name
8347 returnInfo:
8348 logicalexpr: ""
8349 valueposition:
8350 start: 306
8351 end: 315
8352 returnednumber: 1
8353 alwaysreturns: true
8354 knownreturn: true
8355 isreturnbool: false
8356 position:
8357 start: 306
8358 end: 315
8359 type: aggregation
8360 fixedLabels: true
8361 usedLabels:
8362 - colo_name
8363 returnInfo:
8364 logicalexpr: 5 * vector(0) / vector(1)
8365 valueposition:
8366 start: 170
8367 end: 171
8368 returnednumber: 0
8369 alwaysreturns: true
8370 knownreturn: true
8371 isreturnbool: false
8372 position:
8373 start: 227
8374 end: 236
8375 type: aggregation
8376 fixedLabels: true
8377 - addedlabels: []
8378 depth: 0
8379 ison: true
8380 matchinglabels:
8381 - colo_name
8382 op: and
8383 src:
8384 returns: vector
8385 operations:
8386 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m'
8387 op: ""
8388 position:
8389 start: 357
8390 end: 382
8391 type: selector
8392 isConditional: true
8393 - addedlabels: []
8394 depth: 0
8395 ison: true
8396 matchinglabels:
8397 - colo_name
8398 op: and
8399 src:
8400 labels:
8401 "":
8402 reason: Calling `vector()` will return a vector value with no labels.
8403 kind: excluded
8404 fragment:
8405 start: 386
8406 end: 392
8407 deadInfo:
8408 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.
8409 fragment:
8410 start: 386
8411 end: 392
8412 returns: vector
8413 operations:
8414 - args:
8415 - "0"
8416 node: '[*parser.Call] vector(0)'
8417 op: vector
8418 returnInfo:
8419 logicalexpr: ""
8420 valueposition:
8421 start: 386
8422 end: 395
8423 returnednumber: 0
8424 alwaysreturns: true
8425 knownreturn: true
8426 isreturnbool: false
8427 position:
8428 start: 386
8429 end: 395
8430 type: function
8431 fixedLabels: true
8432 isConditional: true
8433 - addedlabels: []
8434 depth: 0
8435 ison: true
8436 matchinglabels:
8437 - colo_name
8438 op: and
8439 src:
8440 returns: vector
8441 operations:
8442 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d'
8443 op: ""
8444 position:
8445 start: 424
8446 end: 459
8447 type: selector
8448 isConditional: true
8449 - addedlabels: []
8450 depth: 0
8451 ison: true
8452 matchinglabels:
8453 - colo_name
8454 op: and
8455 src:
8456 labels:
8457 "":
8458 reason: Calling `vector()` will return a vector value with no labels.
8459 kind: excluded
8460 fragment:
8461 start: 463
8462 end: 469
8463 deadInfo:
8464 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.
8465 fragment:
8466 start: 463
8467 end: 469
8468 returns: vector
8469 operations:
8470 - args:
8471 - "0"
8472 node: '[*parser.Call] vector(0)'
8473 op: vector
8474 returnInfo:
8475 logicalexpr: ""
8476 valueposition:
8477 start: 463
8478 end: 472
8479 returnednumber: 0
8480 alwaysreturns: true
8481 knownreturn: true
8482 isreturnbool: false
8483 position:
8484 start: 463
8485 end: 472
8486 type: function
8487 fixedLabels: true
8488 isConditional: true
8489 usedLabels:
8490 - colo_name
8491 position:
8492 start: 19
8493 end: 37
8494 type: aggregation
8495 fixedLabels: true
8496 isConditional: true
8497 - labels:
8498 "":
8499 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8500 kind: excluded
8501 fragment:
8502 start: 64
8503 end: 67
8504 __name__:
8505 reason: Binary operation between two vectors removes metric names.
8506 kind: excluded
8507 fragment:
8508 start: 1
8509 end: 336
8510 colo_name:
8511 reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results if matched time series have them.
8512 kind: included
8513 fragment:
8514 start: 412
8515 end: 421
8516 deadInfo:
8517 reason: '`vector(0) / vector(1) > 5 * vector(0) / vector(1)` always evaluates to `0 > 0` which is not possible, so it will never return anything.'
8518 fragment:
8519 start: 50
8520 end: 59
8521 deadLabels:
8522 - name: colo_name
8523 reason: You can't use `colo_name` because this label is not possible here.
8524 labelreason: Calling `vector()` will return a vector value with no labels.
8525 usagefragment:
8526 start: 68
8527 end: 77
8528 labelfragment:
8529 start: 50
8530 end: 56
8531 kind: 0
8532 - name: colo_name
8533 reason: You can't use `colo_name` because this label is not possible here.
8534 labelreason: Calling `vector()` will return a vector value with no labels.
8535 usagefragment:
8536 start: 345
8537 end: 354
8538 labelfragment:
8539 start: 50
8540 end: 56
8541 kind: 0
8542 returns: vector
8543 operations:
8544 - args:
8545 - "0"
8546 node: '[*parser.Call] vector(0)'
8547 op: vector
8548 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h]) or vector(0))'
8549 op: avg
8550 joins:
8551 - addedlabels: []
8552 depth: 0
8553 ison: false
8554 matchinglabels: []
8555 op: /
8556 src:
8557 labels:
8558 "":
8559 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8560 kind: excluded
8561 fragment:
8562 start: 147
8563 end: 150
8564 __name__:
8565 reason: Aggregation removes metric name.
8566 kind: excluded
8567 fragment:
8568 start: 91
8569 end: 161
8570 colo_name:
8571 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8572 kind: included
8573 fragment:
8574 start: 151
8575 end: 160
8576 returns: vector
8577 operations:
8578 - node: '[*parser.VectorSelector] foo_total'
8579 op: ""
8580 - node: '[*parser.Call] rate(foo_total[6h])'
8581 op: rate
8582 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
8583 op: avg
8584 usedLabels:
8585 - colo_name
8586 position:
8587 start: 107
8588 end: 120
8589 type: aggregation
8590 fixedLabels: true
8591 - addedlabels: []
8592 depth: 0
8593 ison: false
8594 matchinglabels: []
8595 op: /
8596 src:
8597 labels:
8598 "":
8599 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8600 kind: excluded
8601 fragment:
8602 start: 147
8603 end: 150
8604 __name__:
8605 reason: Aggregation removes metric name.
8606 kind: excluded
8607 fragment:
8608 start: 91
8609 end: 161
8610 colo_name:
8611 reason: Calling `vector()` will return a vector value with no labels.
8612 kind: excluded
8613 fragment:
8614 start: 131
8615 end: 137
8616 deadLabels:
8617 - name: colo_name
8618 reason: You can't use `colo_name` because this label is not possible here.
8619 labelreason: Calling `vector()` will return a vector value with no labels.
8620 usagefragment:
8621 start: 151
8622 end: 160
8623 labelfragment:
8624 start: 131
8625 end: 137
8626 kind: 0
8627 returns: vector
8628 operations:
8629 - args:
8630 - "1"
8631 node: '[*parser.Call] vector(1)'
8632 op: vector
8633 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h]) or vector(1))'
8634 op: avg
8635 usedLabels:
8636 - colo_name
8637 returnInfo:
8638 logicalexpr: ""
8639 valueposition:
8640 start: 131
8641 end: 140
8642 returnednumber: 1
8643 alwaysreturns: true
8644 knownreturn: true
8645 isreturnbool: false
8646 position:
8647 start: 131
8648 end: 140
8649 type: aggregation
8650 fixedLabels: true
8651 - addedlabels: []
8652 depth: 0
8653 ison: false
8654 matchinglabels: []
8655 op: '>'
8656 src:
8657 labels:
8658 "":
8659 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8660 kind: excluded
8661 fragment:
8662 start: 241
8663 end: 244
8664 __name__:
8665 reason: Binary operation between two vectors removes metric names.
8666 kind: excluded
8667 fragment:
8668 start: 178
8669 end: 334
8670 colo_name:
8671 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8672 kind: included
8673 fragment:
8674 start: 245
8675 end: 254
8676 returns: vector
8677 operations:
8678 - node: '[*parser.VectorSelector] foo_rejections offset 1d'
8679 op: ""
8680 - node: '[*parser.Call] rate(foo_rejections[6h] offset 1d)'
8681 op: rate
8682 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
8683 op: avg
8684 joins:
8685 - addedlabels: []
8686 depth: 0
8687 ison: false
8688 matchinglabels: []
8689 op: /
8690 src:
8691 labels:
8692 "":
8693 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8694 kind: excluded
8695 fragment:
8696 start: 320
8697 end: 323
8698 __name__:
8699 reason: Aggregation removes metric name.
8700 kind: excluded
8701 fragment:
8702 start: 262
8703 end: 334
8704 colo_name:
8705 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8706 kind: included
8707 fragment:
8708 start: 324
8709 end: 333
8710 returns: vector
8711 operations:
8712 - node: '[*parser.VectorSelector] foo_total offset 1d'
8713 op: ""
8714 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
8715 op: rate
8716 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
8717 op: avg
8718 usedLabels:
8719 - colo_name
8720 position:
8721 start: 276
8722 end: 299
8723 type: aggregation
8724 fixedLabels: true
8725 - addedlabels: []
8726 depth: 0
8727 ison: false
8728 matchinglabels: []
8729 op: /
8730 src:
8731 labels:
8732 "":
8733 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8734 kind: excluded
8735 fragment:
8736 start: 320
8737 end: 323
8738 __name__:
8739 reason: Aggregation removes metric name.
8740 kind: excluded
8741 fragment:
8742 start: 262
8743 end: 334
8744 colo_name:
8745 reason: Calling `vector()` will return a vector value with no labels.
8746 kind: excluded
8747 fragment:
8748 start: 306
8749 end: 312
8750 deadLabels:
8751 - name: colo_name
8752 reason: You can't use `colo_name` because this label is not possible here.
8753 labelreason: Calling `vector()` will return a vector value with no labels.
8754 usagefragment:
8755 start: 324
8756 end: 333
8757 labelfragment:
8758 start: 306
8759 end: 312
8760 kind: 0
8761 returns: vector
8762 operations:
8763 - args:
8764 - "1"
8765 node: '[*parser.Call] vector(1)'
8766 op: vector
8767 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
8768 op: avg
8769 usedLabels:
8770 - colo_name
8771 returnInfo:
8772 logicalexpr: ""
8773 valueposition:
8774 start: 306
8775 end: 315
8776 returnednumber: 1
8777 alwaysreturns: true
8778 knownreturn: true
8779 isreturnbool: false
8780 position:
8781 start: 306
8782 end: 315
8783 type: aggregation
8784 fixedLabels: true
8785 usedLabels:
8786 - colo_name
8787 position:
8788 start: 192
8789 end: 220
8790 type: aggregation
8791 fixedLabels: true
8792 - addedlabels: []
8793 depth: 0
8794 ison: false
8795 matchinglabels: []
8796 op: '>'
8797 src:
8798 labels:
8799 "":
8800 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8801 kind: excluded
8802 fragment:
8803 start: 241
8804 end: 244
8805 __name__:
8806 reason: Binary operation between two vectors removes metric names.
8807 kind: excluded
8808 fragment:
8809 start: 178
8810 end: 334
8811 colo_name:
8812 reason: Calling `vector()` will return a vector value with no labels.
8813 kind: excluded
8814 fragment:
8815 start: 227
8816 end: 233
8817 deadLabels:
8818 - name: colo_name
8819 reason: You can't use `colo_name` because this label is not possible here.
8820 labelreason: Calling `vector()` will return a vector value with no labels.
8821 usagefragment:
8822 start: 245
8823 end: 254
8824 labelfragment:
8825 start: 227
8826 end: 233
8827 kind: 0
8828 returns: vector
8829 operations:
8830 - args:
8831 - "0"
8832 node: '[*parser.Call] vector(0)'
8833 op: vector
8834 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_rejections[6h] offset 1d) or vector(0))'
8835 op: avg
8836 joins:
8837 - addedlabels: []
8838 depth: 0
8839 ison: false
8840 matchinglabels: []
8841 op: /
8842 src:
8843 labels:
8844 "":
8845 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8846 kind: excluded
8847 fragment:
8848 start: 320
8849 end: 323
8850 __name__:
8851 reason: Aggregation removes metric name.
8852 kind: excluded
8853 fragment:
8854 start: 262
8855 end: 334
8856 colo_name:
8857 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8858 kind: included
8859 fragment:
8860 start: 324
8861 end: 333
8862 returns: vector
8863 operations:
8864 - node: '[*parser.VectorSelector] foo_total offset 1d'
8865 op: ""
8866 - node: '[*parser.Call] rate(foo_total[6h] offset 1d)'
8867 op: rate
8868 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
8869 op: avg
8870 usedLabels:
8871 - colo_name
8872 position:
8873 start: 276
8874 end: 299
8875 type: aggregation
8876 fixedLabels: true
8877 - addedlabels: []
8878 depth: 0
8879 ison: false
8880 matchinglabels: []
8881 op: /
8882 src:
8883 labels:
8884 "":
8885 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
8886 kind: excluded
8887 fragment:
8888 start: 320
8889 end: 323
8890 __name__:
8891 reason: Aggregation removes metric name.
8892 kind: excluded
8893 fragment:
8894 start: 262
8895 end: 334
8896 colo_name:
8897 reason: Calling `vector()` will return a vector value with no labels.
8898 kind: excluded
8899 fragment:
8900 start: 306
8901 end: 312
8902 deadLabels:
8903 - name: colo_name
8904 reason: You can't use `colo_name` because this label is not possible here.
8905 labelreason: Calling `vector()` will return a vector value with no labels.
8906 usagefragment:
8907 start: 324
8908 end: 333
8909 labelfragment:
8910 start: 306
8911 end: 312
8912 kind: 0
8913 returns: vector
8914 operations:
8915 - args:
8916 - "1"
8917 node: '[*parser.Call] vector(1)'
8918 op: vector
8919 - node: '[*parser.AggregateExpr] avg by (colo_name) (rate(foo_total[6h] offset 1d) or vector(1))'
8920 op: avg
8921 usedLabels:
8922 - colo_name
8923 returnInfo:
8924 logicalexpr: ""
8925 valueposition:
8926 start: 306
8927 end: 315
8928 returnednumber: 1
8929 alwaysreturns: true
8930 knownreturn: true
8931 isreturnbool: false
8932 position:
8933 start: 306
8934 end: 315
8935 type: aggregation
8936 fixedLabels: true
8937 usedLabels:
8938 - colo_name
8939 returnInfo:
8940 logicalexpr: 5 * vector(0) / vector(1)
8941 valueposition:
8942 start: 170
8943 end: 171
8944 returnednumber: 0
8945 alwaysreturns: true
8946 knownreturn: true
8947 isreturnbool: false
8948 position:
8949 start: 227
8950 end: 236
8951 type: aggregation
8952 fixedLabels: true
8953 - addedlabels: []
8954 depth: 0
8955 ison: true
8956 matchinglabels:
8957 - colo_name
8958 op: and
8959 src:
8960 returns: vector
8961 operations:
8962 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m'
8963 op: ""
8964 position:
8965 start: 357
8966 end: 382
8967 type: selector
8968 isConditional: true
8969 - addedlabels: []
8970 depth: 0
8971 ison: true
8972 matchinglabels:
8973 - colo_name
8974 op: and
8975 src:
8976 labels:
8977 "":
8978 reason: Calling `vector()` will return a vector value with no labels.
8979 kind: excluded
8980 fragment:
8981 start: 386
8982 end: 392
8983 deadInfo:
8984 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.
8985 fragment:
8986 start: 386
8987 end: 392
8988 returns: vector
8989 operations:
8990 - args:
8991 - "0"
8992 node: '[*parser.Call] vector(0)'
8993 op: vector
8994 returnInfo:
8995 logicalexpr: ""
8996 valueposition:
8997 start: 386
8998 end: 395
8999 returnednumber: 0
9000 alwaysreturns: true
9001 knownreturn: true
9002 isreturnbool: false
9003 position:
9004 start: 386
9005 end: 395
9006 type: function
9007 fixedLabels: true
9008 isConditional: true
9009 - addedlabels: []
9010 depth: 0
9011 ison: true
9012 matchinglabels:
9013 - colo_name
9014 op: and
9015 src:
9016 returns: vector
9017 operations:
9018 - node: '[*parser.VectorSelector] colo_job:foo_total:rate2m offset 1d'
9019 op: ""
9020 position:
9021 start: 424
9022 end: 459
9023 type: selector
9024 isConditional: true
9025 - addedlabels: []
9026 depth: 0
9027 ison: true
9028 matchinglabels:
9029 - colo_name
9030 op: and
9031 src:
9032 labels:
9033 "":
9034 reason: Calling `vector()` will return a vector value with no labels.
9035 kind: excluded
9036 fragment:
9037 start: 463
9038 end: 469
9039 deadInfo:
9040 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.
9041 fragment:
9042 start: 463
9043 end: 469
9044 returns: vector
9045 operations:
9046 - args:
9047 - "0"
9048 node: '[*parser.Call] vector(0)'
9049 op: vector
9050 returnInfo:
9051 logicalexpr: ""
9052 valueposition:
9053 start: 463
9054 end: 472
9055 returnednumber: 0
9056 alwaysreturns: true
9057 knownreturn: true
9058 isreturnbool: false
9059 position:
9060 start: 463
9061 end: 472
9062 type: function
9063 fixedLabels: true
9064 isConditional: true
9065 usedLabels:
9066 - colo_name
9067 returnInfo:
9068 logicalexpr: vector(0) / vector(1)
9069 valueposition:
9070 start: 50
9071 end: 59
9072 returnednumber: 0
9073 alwaysreturns: true
9074 knownreturn: true
9075 isreturnbool: false
9076 position:
9077 start: 50
9078 end: 59
9079 type: aggregation
9080 fixedLabels: true
9081 isConditional: true
9082
9083---
9084
9085[TestLabelsSource/154 - 1]
9086expr: sum(selector) / sum(selector offset 30m) > 5
9087output:
9088 - labels:
9089 "":
9090 reason: Query is using aggregation that removes all labels.
9091 kind: excluded
9092 fragment:
9093 start: 0
9094 end: 3
9095 __name__:
9096 reason: Binary operation between two vectors removes metric names.
9097 kind: excluded
9098 fragment:
9099 start: 0
9100 end: 40
9101 returns: vector
9102 operations:
9103 - node: '[*parser.VectorSelector] selector'
9104 op: ""
9105 - node: '[*parser.AggregateExpr] sum(selector)'
9106 op: sum
9107 joins:
9108 - addedlabels: []
9109 depth: 0
9110 ison: false
9111 matchinglabels: []
9112 op: /
9113 src:
9114 labels:
9115 "":
9116 reason: Query is using aggregation that removes all labels.
9117 kind: excluded
9118 fragment:
9119 start: 16
9120 end: 19
9121 __name__:
9122 reason: Aggregation removes metric name.
9123 kind: excluded
9124 fragment:
9125 start: 16
9126 end: 40
9127 returns: vector
9128 operations:
9129 - node: '[*parser.VectorSelector] selector offset 30m'
9130 op: ""
9131 - node: '[*parser.AggregateExpr] sum(selector offset 30m)'
9132 op: sum
9133 position:
9134 start: 20
9135 end: 39
9136 type: aggregation
9137 fixedLabels: true
9138 position:
9139 start: 4
9140 end: 12
9141 type: aggregation
9142 fixedLabels: true
9143 isConditional: true
9144
9145---
9146
9147[TestLabelsSource/155 - 1]
9148expr: |4-
9149
9150 count by (dc) (
9151 max(0 < (token_expiration - time()) < (6*60*60)) by (instance)
9152 * on (instance) group_right label_replace(
9153 configured_minions, "instance", "$1", "minion", "(.+)")
9154 ) > 5
9155output:
9156 - labels:
9157 "":
9158 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
9159 kind: excluded
9160 fragment:
9161 start: 7
9162 end: 10
9163 __name__:
9164 reason: Aggregation removes metric name.
9165 kind: excluded
9166 fragment:
9167 start: 1
9168 end: 190
9169 dc:
9170 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
9171 kind: included
9172 fragment:
9173 start: 11
9174 end: 13
9175 instance:
9176 reason: Query is using aggregation with `by(dc)`, only labels included inside `by(...)` will be present on the results.
9177 kind: excluded
9178 fragment:
9179 start: 7
9180 end: 14
9181 returns: vector
9182 operations:
9183 - node: '[*parser.VectorSelector] configured_minions'
9184 op: ""
9185 - args:
9186 - '"instance"'
9187 - '"$1"'
9188 - '"minion"'
9189 - '"(.+)"'
9190 node: '[*parser.Call] label_replace(configured_minions, "instance", "$1", "minion", "(.+)")'
9191 op: label_replace
9192 - node: '[*parser.AggregateExpr] count by (dc) (max by (instance) (0 < (token_expiration - time()) < (6 * 60 * 60)) * on (instance) group_right () label_replace(configured_minions, "instance", "$1", "minion", "(.+)"))'
9193 op: count
9194 joins:
9195 - addedlabels: []
9196 depth: 1
9197 ison: true
9198 matchinglabels:
9199 - instance
9200 op: '*'
9201 src:
9202 labels:
9203 "":
9204 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9205 kind: excluded
9206 fragment:
9207 start: 68
9208 end: 71
9209 __name__:
9210 reason: Aggregation removes metric name.
9211 kind: excluded
9212 fragment:
9213 start: 19
9214 end: 81
9215 instance:
9216 reason: Query is using aggregation with `by(instance)`, only labels included inside `by(...)` will be present on the results.
9217 kind: included
9218 fragment:
9219 start: 72
9220 end: 80
9221 returns: vector
9222 operations:
9223 - node: '[*parser.VectorSelector] token_expiration'
9224 op: ""
9225 - node: '[*parser.AggregateExpr] max by (instance) (0 < (token_expiration - time()) < (6 * 60 * 60))'
9226 op: max
9227 usedLabels:
9228 - instance
9229 position:
9230 start: 28
9231 end: 44
9232 type: aggregation
9233 fixedLabels: true
9234 isConditional: true
9235 usedLabels:
9236 - dc
9237 position:
9238 start: 131
9239 end: 149
9240 type: aggregation
9241 fixedLabels: true
9242 isConditional: true
9243
9244---
9245
9246[TestLabelsSource/156 - 1]
9247expr: topk(10, prometheus_build_info*prometheus_ready)
9248output:
9249 - labels:
9250 __name__:
9251 reason: Binary operation between two vectors removes metric names.
9252 kind: excluded
9253 fragment:
9254 start: 9
9255 end: 47
9256 returns: vector
9257 operations:
9258 - node: '[*parser.VectorSelector] prometheus_build_info'
9259 op: ""
9260 - args:
9261 - "10"
9262 node: '[*parser.AggregateExpr] topk(10, prometheus_build_info * prometheus_ready)'
9263 op: topk
9264 joins:
9265 - addedlabels: []
9266 depth: 1
9267 ison: false
9268 matchinglabels: []
9269 op: '*'
9270 src:
9271 returns: vector
9272 operations:
9273 - node: '[*parser.VectorSelector] prometheus_ready'
9274 op: ""
9275 position:
9276 start: 31
9277 end: 47
9278 type: selector
9279 position:
9280 start: 9
9281 end: 30
9282 type: aggregation
9283
9284---
9285
9286[TestLabelsSource/157 - 1]
9287expr: bottomk(10, prometheus_build_info*prometheus_ready)
9288output:
9289 - labels:
9290 __name__:
9291 reason: Binary operation between two vectors removes metric names.
9292 kind: excluded
9293 fragment:
9294 start: 12
9295 end: 50
9296 returns: vector
9297 operations:
9298 - node: '[*parser.VectorSelector] prometheus_build_info'
9299 op: ""
9300 - args:
9301 - "10"
9302 node: '[*parser.AggregateExpr] bottomk(10, prometheus_build_info * prometheus_ready)'
9303 op: bottomk
9304 joins:
9305 - addedlabels: []
9306 depth: 1
9307 ison: false
9308 matchinglabels: []
9309 op: '*'
9310 src:
9311 returns: vector
9312 operations:
9313 - node: '[*parser.VectorSelector] prometheus_ready'
9314 op: ""
9315 position:
9316 start: 34
9317 end: 50
9318 type: selector
9319 position:
9320 start: 12
9321 end: 33
9322 type: aggregation
9323
9324---
9325
9326[TestLabelsSource/158 - 1]
9327expr: histogram_fraction(0, 0.1, metric)
9328output:
9329 - returns: vector
9330 operations:
9331 - node: '[*parser.VectorSelector] metric'
9332 op: ""
9333 - args:
9334 - "0"
9335 - "0.1"
9336 node: '[*parser.Call] histogram_fraction(0, 0.1, metric)'
9337 op: histogram_fraction
9338 position:
9339 start: 27
9340 end: 33
9341 type: function
9342
9343---
9344
9345[TestLabelsSource/159 - 1]
9346expr: 'foo * foo '
9347output:
9348 - labels:
9349 __name__:
9350 reason: Binary operation between two vectors removes metric names.
9351 kind: excluded
9352 fragment:
9353 start: 0
9354 end: 9
9355 returns: vector
9356 operations:
9357 - node: '[*parser.VectorSelector] foo'
9358 op: ""
9359 joins:
9360 - addedlabels: []
9361 depth: 0
9362 ison: false
9363 matchinglabels: []
9364 op: '*'
9365 src:
9366 returns: vector
9367 operations:
9368 - node: '[*parser.VectorSelector] foo'
9369 op: ""
9370 position:
9371 start: 6
9372 end: 9
9373 type: selector
9374 position:
9375 start: 0
9376 end: 3
9377 type: selector
9378
9379---
9380
9381[TestLabelsSource/160 - 1]
9382expr: 'foo + on(__name__, job) foo '
9383output:
9384 - labels:
9385 "":
9386 reason: Query is using one-to-one vector matching with `on(__name__, job)`, only labels included inside `on(...)` will be present on the results.
9387 kind: excluded
9388 fragment:
9389 start: 6
9390 end: 23
9391 __name__:
9392 reason: Binary operation between two vectors removes metric names.
9393 kind: excluded
9394 fragment:
9395 start: 0
9396 end: 27
9397 job:
9398 reason: Query is using one-to-one vector matching with `on(__name__, job)`, only labels included inside `on(...)` will be present on the results.
9399 kind: included
9400 fragment:
9401 start: 19
9402 end: 22
9403 returns: vector
9404 operations:
9405 - node: '[*parser.VectorSelector] foo'
9406 op: ""
9407 joins:
9408 - addedlabels: []
9409 depth: 0
9410 ison: true
9411 matchinglabels:
9412 - __name__
9413 - job
9414 op: +
9415 src:
9416 returns: vector
9417 operations:
9418 - node: '[*parser.VectorSelector] foo'
9419 op: ""
9420 position:
9421 start: 24
9422 end: 27
9423 type: selector
9424 usedLabels:
9425 - job
9426 position:
9427 start: 0
9428 end: 3
9429 type: selector
9430 fixedLabels: true
9431
9432---
9433
9434[TestLabelsSource/161 - 1]
9435expr: 'foo + on(__name__, job) group_left foo '
9436output:
9437 - labels:
9438 __name__:
9439 reason: Binary operation between two vectors removes metric names.
9440 kind: excluded
9441 fragment:
9442 start: 0
9443 end: 38
9444 job:
9445 reason: Query is using many-to-one vector matching with `on(__name__, job)`, labels included inside `on(...)` will be present on the results.
9446 kind: included
9447 fragment:
9448 start: 19
9449 end: 22
9450 returns: vector
9451 operations:
9452 - node: '[*parser.VectorSelector] foo'
9453 op: ""
9454 joins:
9455 - addedlabels: []
9456 depth: 0
9457 ison: true
9458 matchinglabels:
9459 - __name__
9460 - job
9461 op: +
9462 src:
9463 returns: vector
9464 operations:
9465 - node: '[*parser.VectorSelector] foo'
9466 op: ""
9467 position:
9468 start: 35
9469 end: 38
9470 type: selector
9471 usedLabels:
9472 - job
9473 position:
9474 start: 0
9475 end: 3
9476 type: selector
9477
9478---
9479
9480[TestLabelsSource/162 - 1]
9481expr: 'foo + on(__name__, job) group_right foo '
9482output:
9483 - labels:
9484 __name__:
9485 reason: Binary operation between two vectors removes metric names.
9486 kind: excluded
9487 fragment:
9488 start: 0
9489 end: 39
9490 job:
9491 reason: Query is using one-to-many vector matching with `on(__name__, job)`, labels included inside `on(...)` will be present on the results.
9492 kind: included
9493 fragment:
9494 start: 19
9495 end: 22
9496 returns: vector
9497 operations:
9498 - node: '[*parser.VectorSelector] foo'
9499 op: ""
9500 joins:
9501 - addedlabels: []
9502 depth: 0
9503 ison: true
9504 matchinglabels:
9505 - __name__
9506 - job
9507 op: +
9508 src:
9509 returns: vector
9510 operations:
9511 - node: '[*parser.VectorSelector] foo'
9512 op: ""
9513 position:
9514 start: 0
9515 end: 3
9516 type: selector
9517 usedLabels:
9518 - job
9519 position:
9520 start: 36
9521 end: 39
9522 type: selector
9523
9524---
9525
9526[TestLabelsSource/163 - 1]
9527expr: |-
9528 group by (env, cluster) (
9529 up{env="prod", job="foo"} and on (instance) (services_enabled == 999)
9530 )
9531output:
9532 - labels:
9533 "":
9534 reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results.
9535 kind: excluded
9536 fragment:
9537 start: 6
9538 end: 9
9539 __name__:
9540 reason: Aggregation removes metric name.
9541 kind: excluded
9542 fragment:
9543 start: 0
9544 end: 104
9545 cluster:
9546 reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results.
9547 kind: included
9548 fragment:
9549 start: 15
9550 end: 22
9551 env:
9552 reason: Query will only return series where these labels are present.
9553 kind: guaranteed
9554 fragment:
9555 start: 32
9556 end: 57
9557 instance:
9558 reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results.
9559 kind: excluded
9560 fragment:
9561 start: 6
9562 end: 23
9563 job:
9564 reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results.
9565 kind: excluded
9566 fragment:
9567 start: 6
9568 end: 23
9569 returns: vector
9570 operations:
9571 - node: '[*parser.VectorSelector] up{env="prod",job="foo"}'
9572 op: ""
9573 - node: '[*parser.AggregateExpr] group by (env, cluster) (up{env="prod",job="foo"} and on (instance) (services_enabled == 999))'
9574 op: group
9575 joins:
9576 - addedlabels: []
9577 depth: 1
9578 ison: true
9579 matchinglabels:
9580 - instance
9581 op: and
9582 src:
9583 returns: vector
9584 operations:
9585 - node: '[*parser.VectorSelector] services_enabled'
9586 op: ""
9587 position:
9588 start: 77
9589 end: 93
9590 type: selector
9591 isConditional: true
9592 usedLabels:
9593 - env
9594 - cluster
9595 position:
9596 start: 32
9597 end: 57
9598 type: aggregation
9599 fixedLabels: true
9600 isConditional: true
9601
9602---
9603
9604[TestLabelsSource/164 - 1]
9605expr: |-
9606 group by (env, cluster) (
9607 up{env="prod", job="foo"} * on (instance) (services_enabled == 999)
9608 )
9609output:
9610 - labels:
9611 "":
9612 reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results.
9613 kind: excluded
9614 fragment:
9615 start: 6
9616 end: 9
9617 __name__:
9618 reason: Aggregation removes metric name.
9619 kind: excluded
9620 fragment:
9621 start: 0
9622 end: 102
9623 cluster:
9624 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
9625 kind: excluded
9626 fragment:
9627 start: 60
9628 end: 73
9629 env:
9630 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
9631 kind: excluded
9632 fragment:
9633 start: 60
9634 end: 73
9635 instance:
9636 reason: Query is using aggregation with `by(env, cluster)`, only labels included inside `by(...)` will be present on the results.
9637 kind: excluded
9638 fragment:
9639 start: 6
9640 end: 23
9641 job:
9642 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
9643 kind: excluded
9644 fragment:
9645 start: 60
9646 end: 73
9647 deadLabels:
9648 - name: env
9649 reason: You can't use `env` because this label is not possible here.
9650 labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
9651 usagefragment:
9652 start: 10
9653 end: 13
9654 labelfragment:
9655 start: 60
9656 end: 73
9657 kind: 0
9658 - name: cluster
9659 reason: You can't use `cluster` because this label is not possible here.
9660 labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
9661 usagefragment:
9662 start: 15
9663 end: 22
9664 labelfragment:
9665 start: 60
9666 end: 73
9667 kind: 0
9668 returns: vector
9669 operations:
9670 - node: '[*parser.VectorSelector] up{env="prod",job="foo"}'
9671 op: ""
9672 - node: '[*parser.AggregateExpr] group by (env, cluster) (up{env="prod",job="foo"} * on (instance) (services_enabled == 999))'
9673 op: group
9674 joins:
9675 - addedlabels: []
9676 depth: 1
9677 ison: true
9678 matchinglabels:
9679 - instance
9680 op: '*'
9681 src:
9682 returns: vector
9683 operations:
9684 - node: '[*parser.VectorSelector] services_enabled'
9685 op: ""
9686 position:
9687 start: 75
9688 end: 91
9689 type: selector
9690 isConditional: true
9691 usedLabels:
9692 - env
9693 - cluster
9694 position:
9695 start: 32
9696 end: 57
9697 type: aggregation
9698 fixedLabels: true
9699
9700---
9701
9702[TestLabelsSource/165 - 1]
9703expr: foo / on(instance) sum(bar)
9704output:
9705 - labels:
9706 "":
9707 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
9708 kind: excluded
9709 fragment:
9710 start: 6
9711 end: 18
9712 __name__:
9713 reason: Binary operation between two vectors removes metric names.
9714 kind: excluded
9715 fragment:
9716 start: 0
9717 end: 27
9718 instance:
9719 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
9720 kind: included
9721 fragment:
9722 start: 9
9723 end: 17
9724 returns: vector
9725 operations:
9726 - node: '[*parser.VectorSelector] foo'
9727 op: ""
9728 joins:
9729 - addedlabels: []
9730 depth: 0
9731 ison: true
9732 matchinglabels:
9733 - instance
9734 op: /
9735 src:
9736 labels:
9737 "":
9738 reason: Query is using aggregation that removes all labels.
9739 kind: excluded
9740 fragment:
9741 start: 19
9742 end: 22
9743 __name__:
9744 reason: Aggregation removes metric name.
9745 kind: excluded
9746 fragment:
9747 start: 19
9748 end: 27
9749 deadInfo:
9750 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.
9751 fragment:
9752 start: 19
9753 end: 22
9754 returns: vector
9755 operations:
9756 - node: '[*parser.VectorSelector] bar'
9757 op: ""
9758 - node: '[*parser.AggregateExpr] sum(bar)'
9759 op: sum
9760 position:
9761 start: 23
9762 end: 26
9763 type: aggregation
9764 fixedLabels: true
9765 usedLabels:
9766 - instance
9767 position:
9768 start: 0
9769 end: 3
9770 type: selector
9771 fixedLabels: true
9772
9773---
9774
9775[TestLabelsSource/166 - 1]
9776expr: foo / on(instance) group_left(cluster) sum(bar)
9777output:
9778 - labels:
9779 __name__:
9780 reason: Binary operation between two vectors removes metric names.
9781 kind: excluded
9782 fragment:
9783 start: 0
9784 end: 47
9785 cluster:
9786 reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
9787 kind: included
9788 fragment:
9789 start: 30
9790 end: 37
9791 instance:
9792 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
9793 kind: included
9794 fragment:
9795 start: 9
9796 end: 17
9797 returns: vector
9798 operations:
9799 - node: '[*parser.VectorSelector] foo'
9800 op: ""
9801 joins:
9802 - addedlabels:
9803 - cluster
9804 depth: 0
9805 ison: true
9806 matchinglabels:
9807 - instance
9808 op: /
9809 src:
9810 labels:
9811 "":
9812 reason: Query is using aggregation that removes all labels.
9813 kind: excluded
9814 fragment:
9815 start: 39
9816 end: 42
9817 __name__:
9818 reason: Aggregation removes metric name.
9819 kind: excluded
9820 fragment:
9821 start: 39
9822 end: 47
9823 deadInfo:
9824 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.
9825 fragment:
9826 start: 39
9827 end: 42
9828 deadLabels:
9829 - name: cluster
9830 reason: You can't use `cluster` because this label is not possible here.
9831 labelreason: Query is using aggregation that removes all labels.
9832 usagefragment:
9833 start: 30
9834 end: 37
9835 labelfragment:
9836 start: 39
9837 end: 42
9838 kind: 0
9839 returns: vector
9840 operations:
9841 - node: '[*parser.VectorSelector] bar'
9842 op: ""
9843 - node: '[*parser.AggregateExpr] sum(bar)'
9844 op: sum
9845 position:
9846 start: 43
9847 end: 46
9848 type: aggregation
9849 fixedLabels: true
9850 usedLabels:
9851 - instance
9852 position:
9853 start: 0
9854 end: 3
9855 type: selector
9856
9857---
9858
9859[TestLabelsSource/167 - 1]
9860expr: sum(bar) / on(instance) group_right(cluster) foo
9861output:
9862 - labels:
9863 __name__:
9864 reason: Binary operation between two vectors removes metric names.
9865 kind: excluded
9866 fragment:
9867 start: 0
9868 end: 48
9869 cluster:
9870 reason: Query is using `group_right(cluster)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
9871 kind: included
9872 fragment:
9873 start: 36
9874 end: 43
9875 instance:
9876 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
9877 kind: included
9878 fragment:
9879 start: 14
9880 end: 22
9881 returns: vector
9882 operations:
9883 - node: '[*parser.VectorSelector] foo'
9884 op: ""
9885 joins:
9886 - addedlabels:
9887 - cluster
9888 depth: 0
9889 ison: true
9890 matchinglabels:
9891 - instance
9892 op: /
9893 src:
9894 labels:
9895 "":
9896 reason: Query is using aggregation that removes all labels.
9897 kind: excluded
9898 fragment:
9899 start: 0
9900 end: 3
9901 __name__:
9902 reason: Aggregation removes metric name.
9903 kind: excluded
9904 fragment:
9905 start: 0
9906 end: 8
9907 deadInfo:
9908 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.
9909 fragment:
9910 start: 0
9911 end: 3
9912 deadLabels:
9913 - name: cluster
9914 reason: You can't use `cluster` because this label is not possible here.
9915 labelreason: Query is using aggregation that removes all labels.
9916 usagefragment:
9917 start: 36
9918 end: 43
9919 labelfragment:
9920 start: 0
9921 end: 3
9922 kind: 0
9923 returns: vector
9924 operations:
9925 - node: '[*parser.VectorSelector] bar'
9926 op: ""
9927 - node: '[*parser.AggregateExpr] sum(bar)'
9928 op: sum
9929 position:
9930 start: 4
9931 end: 7
9932 type: aggregation
9933 fixedLabels: true
9934 usedLabels:
9935 - instance
9936 position:
9937 start: 45
9938 end: 48
9939 type: selector
9940
9941---
9942
9943[TestLabelsSource/168 - 1]
9944expr: sum(bar) * on(cluster) sum(foo)
9945output:
9946 - labels:
9947 "":
9948 reason: Query is using one-to-one vector matching with `on(cluster)`, only labels included inside `on(...)` will be present on the results.
9949 kind: excluded
9950 fragment:
9951 start: 11
9952 end: 22
9953 __name__:
9954 reason: Binary operation between two vectors removes metric names.
9955 kind: excluded
9956 fragment:
9957 start: 0
9958 end: 31
9959 cluster:
9960 reason: Query is using aggregation that removes all labels.
9961 kind: excluded
9962 fragment:
9963 start: 0
9964 end: 3
9965 deadLabels:
9966 - name: cluster
9967 reason: You can't use `cluster` because this label is not possible here.
9968 labelreason: Query is using aggregation that removes all labels.
9969 usagefragment:
9970 start: 14
9971 end: 21
9972 labelfragment:
9973 start: 0
9974 end: 3
9975 kind: 0
9976 returns: vector
9977 operations:
9978 - node: '[*parser.VectorSelector] bar'
9979 op: ""
9980 - node: '[*parser.AggregateExpr] sum(bar)'
9981 op: sum
9982 joins:
9983 - addedlabels: []
9984 depth: 0
9985 ison: true
9986 matchinglabels:
9987 - cluster
9988 op: '*'
9989 src:
9990 labels:
9991 "":
9992 reason: Query is using aggregation that removes all labels.
9993 kind: excluded
9994 fragment:
9995 start: 23
9996 end: 26
9997 __name__:
9998 reason: Aggregation removes metric name.
9999 kind: excluded
10000 fragment:
10001 start: 23
10002 end: 31
10003 returns: vector
10004 operations:
10005 - node: '[*parser.VectorSelector] foo'
10006 op: ""
10007 - node: '[*parser.AggregateExpr] sum(foo)'
10008 op: sum
10009 position:
10010 start: 27
10011 end: 30
10012 type: aggregation
10013 fixedLabels: true
10014 usedLabels:
10015 - cluster
10016 position:
10017 start: 4
10018 end: 7
10019 type: aggregation
10020 fixedLabels: true
10021
10022---
10023
10024[TestLabelsSource/169 - 1]
10025expr: |4-
10026
10027 group by (colo_name, instance, tier, animal, brand, sliver, pop_name) (
10028 up{node_status="v", job="node_exporter"}
10029 and on (instance) (metal_services_enabled == 999)
10030 * on (colo_name) group_left(tier, animal, brand, pop_name) colo_metadata{colo_status="v"}
10031 * on (instance) group_left (sliver) sliver_metadata{node_status="v"}
10032 )
10033output:
10034 - labels:
10035 "":
10036 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10037 kind: excluded
10038 fragment:
10039 start: 7
10040 end: 10
10041 __name__:
10042 reason: Aggregation removes metric name.
10043 kind: excluded
10044 fragment:
10045 start: 1
10046 end: 332
10047 animal:
10048 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10049 kind: included
10050 fragment:
10051 start: 38
10052 end: 44
10053 brand:
10054 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10055 kind: included
10056 fragment:
10057 start: 46
10058 end: 51
10059 colo_name:
10060 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10061 kind: included
10062 fragment:
10063 start: 11
10064 end: 20
10065 instance:
10066 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10067 kind: included
10068 fragment:
10069 start: 22
10070 end: 30
10071 job:
10072 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10073 kind: excluded
10074 fragment:
10075 start: 7
10076 end: 70
10077 node_status:
10078 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10079 kind: excluded
10080 fragment:
10081 start: 7
10082 end: 70
10083 pop_name:
10084 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10085 kind: included
10086 fragment:
10087 start: 61
10088 end: 69
10089 sliver:
10090 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10091 kind: included
10092 fragment:
10093 start: 53
10094 end: 59
10095 tier:
10096 reason: Query is using aggregation with `by(colo_name, instance, tier, animal, brand, sliver, pop_name)`, only labels included inside `by(...)` will be present on the results.
10097 kind: included
10098 fragment:
10099 start: 32
10100 end: 36
10101 deadLabels:
10102 - name: tier
10103 reason: This binary operation prevents previously joined label `tier` from being added to the results.
10104 labelreason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10105 usagefragment:
10106 start: 118
10107 end: 121
10108 labelfragment:
10109 start: 198
10110 end: 202
10111 kind: 1
10112 - name: animal
10113 reason: This binary operation prevents previously joined label `animal` from being added to the results.
10114 labelreason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10115 usagefragment:
10116 start: 118
10117 end: 121
10118 labelfragment:
10119 start: 204
10120 end: 210
10121 kind: 1
10122 - name: brand
10123 reason: This binary operation prevents previously joined label `brand` from being added to the results.
10124 labelreason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10125 usagefragment:
10126 start: 118
10127 end: 121
10128 labelfragment:
10129 start: 212
10130 end: 217
10131 kind: 1
10132 - name: pop_name
10133 reason: This binary operation prevents previously joined label `pop_name` from being added to the results.
10134 labelreason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10135 usagefragment:
10136 start: 118
10137 end: 121
10138 labelfragment:
10139 start: 219
10140 end: 227
10141 kind: 1
10142 - name: sliver
10143 reason: This binary operation prevents previously joined label `sliver` from being added to the results.
10144 labelreason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10145 usagefragment:
10146 start: 118
10147 end: 121
10148 labelfragment:
10149 start: 290
10150 end: 296
10151 kind: 1
10152 returns: vector
10153 operations:
10154 - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}'
10155 op: ""
10156 - node: '[*parser.AggregateExpr] group by (colo_name, instance, tier, animal, brand, sliver, pop_name) (up{job="node_exporter",node_status="v"} and on (instance) (metal_services_enabled == 999) * on (colo_name) group_left (tier, animal, brand, pop_name) colo_metadata{colo_status="v"} * on (instance) group_left (sliver) sliver_metadata{node_status="v"})'
10157 op: group
10158 joins:
10159 - addedlabels: []
10160 depth: 1
10161 ison: true
10162 matchinglabels:
10163 - instance
10164 op: and
10165 src:
10166 labels:
10167 __name__:
10168 reason: Binary operation between two vectors removes metric names.
10169 kind: excluded
10170 fragment:
10171 start: 136
10172 end: 330
10173 animal:
10174 reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10175 kind: included
10176 fragment:
10177 start: 204
10178 end: 210
10179 brand:
10180 reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10181 kind: included
10182 fragment:
10183 start: 212
10184 end: 217
10185 colo_name:
10186 reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10187 kind: included
10188 fragment:
10189 start: 176
10190 end: 185
10191 instance:
10192 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
10193 kind: included
10194 fragment:
10195 start: 268
10196 end: 276
10197 pop_name:
10198 reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10199 kind: included
10200 fragment:
10201 start: 219
10202 end: 227
10203 sliver:
10204 reason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10205 kind: included
10206 fragment:
10207 start: 290
10208 end: 296
10209 tier:
10210 reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10211 kind: included
10212 fragment:
10213 start: 198
10214 end: 202
10215 returns: vector
10216 operations:
10217 - node: '[*parser.VectorSelector] metal_services_enabled'
10218 op: ""
10219 joins:
10220 - addedlabels:
10221 - tier
10222 - animal
10223 - brand
10224 - pop_name
10225 depth: 0
10226 ison: true
10227 matchinglabels:
10228 - colo_name
10229 op: '*'
10230 src:
10231 labels:
10232 colo_status:
10233 reason: Query will only return series where these labels are present.
10234 kind: guaranteed
10235 fragment:
10236 start: 229
10237 end: 259
10238 returns: vector
10239 operations:
10240 - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}'
10241 op: ""
10242 position:
10243 start: 229
10244 end: 259
10245 type: selector
10246 - addedlabels:
10247 - sliver
10248 depth: 0
10249 ison: true
10250 matchinglabels:
10251 - instance
10252 op: '*'
10253 src:
10254 labels:
10255 node_status:
10256 reason: Query will only return series where these labels are present.
10257 kind: guaranteed
10258 fragment:
10259 start: 298
10260 end: 330
10261 returns: vector
10262 operations:
10263 - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}'
10264 op: ""
10265 position:
10266 start: 298
10267 end: 330
10268 type: selector
10269 usedLabels:
10270 - colo_name
10271 - instance
10272 position:
10273 start: 137
10274 end: 159
10275 type: selector
10276 isConditional: true
10277 usedLabels:
10278 - instance
10279 - colo_name
10280 - tier
10281 - animal
10282 - brand
10283 - sliver
10284 - pop_name
10285 position:
10286 start: 75
10287 end: 115
10288 type: aggregation
10289 fixedLabels: true
10290 isConditional: true
10291
10292---
10293
10294[TestLabelsSource/170 - 1]
10295expr: |4
10296
10297 up{node_status="v", job="node_exporter"}
10298 * on (colo_name) group_left(tier) colo_metadata{colo_status="v"}
10299 * on (instance) group_left (sliver) sliver_metadata{node_status="v"}
10300output:
10301 - labels:
10302 __name__:
10303 reason: Binary operation between two vectors removes metric names.
10304 kind: excluded
10305 fragment:
10306 start: 1
10307 end: 175
10308 colo_name:
10309 reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10310 kind: included
10311 fragment:
10312 start: 48
10313 end: 57
10314 instance:
10315 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
10316 kind: included
10317 fragment:
10318 start: 113
10319 end: 121
10320 job:
10321 reason: Query will only return series where these labels are present.
10322 kind: guaranteed
10323 fragment:
10324 start: 1
10325 end: 41
10326 node_status:
10327 reason: Query will only return series where these labels are present.
10328 kind: guaranteed
10329 fragment:
10330 start: 1
10331 end: 41
10332 sliver:
10333 reason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10334 kind: included
10335 fragment:
10336 start: 135
10337 end: 141
10338 tier:
10339 reason: Query is using `group_left(tier)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10340 kind: included
10341 fragment:
10342 start: 70
10343 end: 74
10344 returns: vector
10345 operations:
10346 - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}'
10347 op: ""
10348 joins:
10349 - addedlabels:
10350 - tier
10351 depth: 0
10352 ison: true
10353 matchinglabels:
10354 - colo_name
10355 op: '*'
10356 src:
10357 labels:
10358 colo_status:
10359 reason: Query will only return series where these labels are present.
10360 kind: guaranteed
10361 fragment:
10362 start: 76
10363 end: 106
10364 returns: vector
10365 operations:
10366 - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}'
10367 op: ""
10368 position:
10369 start: 76
10370 end: 106
10371 type: selector
10372 - addedlabels:
10373 - sliver
10374 depth: 0
10375 ison: true
10376 matchinglabels:
10377 - instance
10378 op: '*'
10379 src:
10380 labels:
10381 node_status:
10382 reason: Query will only return series where these labels are present.
10383 kind: guaranteed
10384 fragment:
10385 start: 143
10386 end: 175
10387 returns: vector
10388 operations:
10389 - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}'
10390 op: ""
10391 position:
10392 start: 143
10393 end: 175
10394 type: selector
10395 usedLabels:
10396 - colo_name
10397 - instance
10398 position:
10399 start: 1
10400 end: 41
10401 type: selector
10402
10403---
10404
10405[TestLabelsSource/171 - 1]
10406expr: |4
10407
10408 up{node_status="v", job="node_exporter"}
10409 and on (colo_name) colo_metadata{colo_status="v"}
10410 * on (instance) group_left (sliver) sliver_metadata{node_status="v"}
10411output:
10412 - labels:
10413 colo_name:
10414 reason: Query is using many-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results if matched time series have them.
10415 kind: included
10416 fragment:
10417 start: 50
10418 end: 59
10419 job:
10420 reason: Query will only return series where these labels are present.
10421 kind: guaranteed
10422 fragment:
10423 start: 1
10424 end: 41
10425 node_status:
10426 reason: Query will only return series where these labels are present.
10427 kind: guaranteed
10428 fragment:
10429 start: 1
10430 end: 41
10431 deadLabels:
10432 - name: sliver
10433 reason: This binary operation prevents previously joined label `sliver` from being added to the results.
10434 labelreason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10435 usagefragment:
10436 start: 42
10437 end: 45
10438 labelfragment:
10439 start: 120
10440 end: 126
10441 kind: 1
10442 returns: vector
10443 operations:
10444 - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}'
10445 op: ""
10446 joins:
10447 - addedlabels: []
10448 depth: 0
10449 ison: true
10450 matchinglabels:
10451 - colo_name
10452 op: and
10453 src:
10454 labels:
10455 __name__:
10456 reason: Binary operation between two vectors removes metric names.
10457 kind: excluded
10458 fragment:
10459 start: 61
10460 end: 160
10461 colo_status:
10462 reason: Query will only return series where these labels are present.
10463 kind: guaranteed
10464 fragment:
10465 start: 61
10466 end: 91
10467 instance:
10468 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
10469 kind: included
10470 fragment:
10471 start: 98
10472 end: 106
10473 sliver:
10474 reason: Query is using `group_left(sliver)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10475 kind: included
10476 fragment:
10477 start: 120
10478 end: 126
10479 returns: vector
10480 operations:
10481 - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}'
10482 op: ""
10483 joins:
10484 - addedlabels:
10485 - sliver
10486 depth: 0
10487 ison: true
10488 matchinglabels:
10489 - instance
10490 op: '*'
10491 src:
10492 labels:
10493 node_status:
10494 reason: Query will only return series where these labels are present.
10495 kind: guaranteed
10496 fragment:
10497 start: 128
10498 end: 160
10499 returns: vector
10500 operations:
10501 - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}'
10502 op: ""
10503 position:
10504 start: 128
10505 end: 160
10506 type: selector
10507 usedLabels:
10508 - instance
10509 position:
10510 start: 61
10511 end: 91
10512 type: selector
10513 usedLabels:
10514 - colo_name
10515 position:
10516 start: 1
10517 end: 41
10518 type: selector
10519
10520---
10521
10522[TestLabelsSource/172 - 1]
10523expr: |4
10524
10525 colo_metadata{colo_status="v"} * on (colo_name) group_right(tier, animal, brand, pop_name)
10526 sliver_metadata{node_status="v"} * on (instance) group_right (sliver)
10527 (metal_services_enabled == 999) * on (instance)
10528 up{node_status="v", job="node_exporter"}
10529output:
10530 - labels:
10531 "":
10532 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
10533 kind: excluded
10534 fragment:
10535 start: 1
10536 end: 250
10537 __name__:
10538 reason: Binary operation between two vectors removes metric names.
10539 kind: excluded
10540 fragment:
10541 start: 1
10542 end: 250
10543 instance:
10544 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
10545 kind: included
10546 fragment:
10547 start: 200
10548 end: 208
10549 sliver:
10550 reason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
10551 kind: excluded
10552 fragment:
10553 start: 1
10554 end: 250
10555 deadLabels:
10556 - name: tier
10557 reason: This binary operation prevents previously joined label `tier` from being added to the results.
10558 labelreason: ""
10559 usagefragment:
10560 start: 125
10561 end: 126
10562 labelfragment:
10563 start: 125
10564 end: 126
10565 kind: 1
10566 - name: animal
10567 reason: This binary operation prevents previously joined label `animal` from being added to the results.
10568 labelreason: ""
10569 usagefragment:
10570 start: 125
10571 end: 126
10572 labelfragment:
10573 start: 125
10574 end: 126
10575 kind: 1
10576 - name: brand
10577 reason: This binary operation prevents previously joined label `brand` from being added to the results.
10578 labelreason: ""
10579 usagefragment:
10580 start: 125
10581 end: 126
10582 labelfragment:
10583 start: 125
10584 end: 126
10585 kind: 1
10586 - name: pop_name
10587 reason: This binary operation prevents previously joined label `pop_name` from being added to the results.
10588 labelreason: ""
10589 usagefragment:
10590 start: 125
10591 end: 126
10592 labelfragment:
10593 start: 125
10594 end: 126
10595 kind: 1
10596 - name: sliver
10597 reason: This binary operation prevents previously joined label `sliver` from being added to the results.
10598 labelreason: Query is using one-to-one vector matching with `on(instance)`, only labels included inside `on(...)` will be present on the results.
10599 usagefragment:
10600 start: 194
10601 end: 195
10602 labelfragment:
10603 start: 1
10604 end: 250
10605 kind: 1
10606 returns: vector
10607 operations:
10608 - node: '[*parser.VectorSelector] metal_services_enabled'
10609 op: ""
10610 joins:
10611 - addedlabels:
10612 - sliver
10613 depth: 0
10614 ison: true
10615 matchinglabels:
10616 - instance
10617 op: '*'
10618 src:
10619 labels:
10620 __name__:
10621 reason: Binary operation between two vectors removes metric names.
10622 kind: excluded
10623 fragment:
10624 start: 1
10625 end: 124
10626 animal:
10627 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10628 kind: included
10629 fragment:
10630 start: 67
10631 end: 73
10632 brand:
10633 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10634 kind: included
10635 fragment:
10636 start: 75
10637 end: 80
10638 colo_name:
10639 reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10640 kind: included
10641 fragment:
10642 start: 38
10643 end: 47
10644 node_status:
10645 reason: Query will only return series where these labels are present.
10646 kind: guaranteed
10647 fragment:
10648 start: 92
10649 end: 124
10650 pop_name:
10651 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10652 kind: included
10653 fragment:
10654 start: 82
10655 end: 90
10656 tier:
10657 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10658 kind: included
10659 fragment:
10660 start: 61
10661 end: 65
10662 returns: vector
10663 operations:
10664 - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}'
10665 op: ""
10666 joins:
10667 - addedlabels:
10668 - tier
10669 - animal
10670 - brand
10671 - pop_name
10672 depth: 0
10673 ison: true
10674 matchinglabels:
10675 - colo_name
10676 op: '*'
10677 src:
10678 labels:
10679 colo_status:
10680 reason: Query will only return series where these labels are present.
10681 kind: guaranteed
10682 fragment:
10683 start: 1
10684 end: 31
10685 returns: vector
10686 operations:
10687 - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}'
10688 op: ""
10689 position:
10690 start: 1
10691 end: 31
10692 type: selector
10693 usedLabels:
10694 - colo_name
10695 position:
10696 start: 92
10697 end: 124
10698 type: selector
10699 - addedlabels: []
10700 depth: 0
10701 ison: true
10702 matchinglabels:
10703 - instance
10704 op: '*'
10705 src:
10706 labels:
10707 job:
10708 reason: Query will only return series where these labels are present.
10709 kind: guaranteed
10710 fragment:
10711 start: 210
10712 end: 250
10713 node_status:
10714 reason: Query will only return series where these labels are present.
10715 kind: guaranteed
10716 fragment:
10717 start: 210
10718 end: 250
10719 returns: vector
10720 operations:
10721 - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}'
10722 op: ""
10723 position:
10724 start: 210
10725 end: 250
10726 type: selector
10727 usedLabels:
10728 - instance
10729 position:
10730 start: 163
10731 end: 185
10732 type: selector
10733 fixedLabels: true
10734 isConditional: true
10735
10736---
10737
10738[TestLabelsSource/173 - 1]
10739expr: |4
10740
10741 colo_metadata{colo_status="v"} * on (colo_name) group_right(tier, animal, brand, pop_name)
10742 sliver_metadata{node_status="v"} * on (instance) group_right (sliver)
10743 (metal_services_enabled == 999) * on (instance) group_right()
10744 up{node_status="v", job="node_exporter"}
10745output:
10746 - labels:
10747 __name__:
10748 reason: Binary operation between two vectors removes metric names.
10749 kind: excluded
10750 fragment:
10751 start: 1
10752 end: 264
10753 instance:
10754 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
10755 kind: included
10756 fragment:
10757 start: 200
10758 end: 208
10759 job:
10760 reason: Query will only return series where these labels are present.
10761 kind: guaranteed
10762 fragment:
10763 start: 224
10764 end: 264
10765 node_status:
10766 reason: Query will only return series where these labels are present.
10767 kind: guaranteed
10768 fragment:
10769 start: 224
10770 end: 264
10771 deadLabels:
10772 - name: sliver
10773 reason: This binary operation prevents previously joined label `sliver` from being added to the results.
10774 labelreason: ""
10775 usagefragment:
10776 start: 194
10777 end: 195
10778 labelfragment:
10779 start: 194
10780 end: 195
10781 kind: 1
10782 returns: vector
10783 operations:
10784 - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}'
10785 op: ""
10786 joins:
10787 - addedlabels: []
10788 depth: 0
10789 ison: true
10790 matchinglabels:
10791 - instance
10792 op: '*'
10793 src:
10794 labels:
10795 __name__:
10796 reason: Binary operation between two vectors removes metric names.
10797 kind: excluded
10798 fragment:
10799 start: 1
10800 end: 193
10801 instance:
10802 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
10803 kind: included
10804 fragment:
10805 start: 131
10806 end: 139
10807 sliver:
10808 reason: Query is using `group_right(sliver)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10809 kind: included
10810 fragment:
10811 start: 154
10812 end: 160
10813 deadLabels:
10814 - name: tier
10815 reason: This binary operation prevents previously joined label `tier` from being added to the results.
10816 labelreason: ""
10817 usagefragment:
10818 start: 125
10819 end: 126
10820 labelfragment:
10821 start: 125
10822 end: 126
10823 kind: 1
10824 - name: animal
10825 reason: This binary operation prevents previously joined label `animal` from being added to the results.
10826 labelreason: ""
10827 usagefragment:
10828 start: 125
10829 end: 126
10830 labelfragment:
10831 start: 125
10832 end: 126
10833 kind: 1
10834 - name: brand
10835 reason: This binary operation prevents previously joined label `brand` from being added to the results.
10836 labelreason: ""
10837 usagefragment:
10838 start: 125
10839 end: 126
10840 labelfragment:
10841 start: 125
10842 end: 126
10843 kind: 1
10844 - name: pop_name
10845 reason: This binary operation prevents previously joined label `pop_name` from being added to the results.
10846 labelreason: ""
10847 usagefragment:
10848 start: 125
10849 end: 126
10850 labelfragment:
10851 start: 125
10852 end: 126
10853 kind: 1
10854 returns: vector
10855 operations:
10856 - node: '[*parser.VectorSelector] metal_services_enabled'
10857 op: ""
10858 joins:
10859 - addedlabels:
10860 - sliver
10861 depth: 0
10862 ison: true
10863 matchinglabels:
10864 - instance
10865 op: '*'
10866 src:
10867 labels:
10868 __name__:
10869 reason: Binary operation between two vectors removes metric names.
10870 kind: excluded
10871 fragment:
10872 start: 1
10873 end: 124
10874 animal:
10875 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10876 kind: included
10877 fragment:
10878 start: 67
10879 end: 73
10880 brand:
10881 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10882 kind: included
10883 fragment:
10884 start: 75
10885 end: 80
10886 colo_name:
10887 reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10888 kind: included
10889 fragment:
10890 start: 38
10891 end: 47
10892 node_status:
10893 reason: Query will only return series where these labels are present.
10894 kind: guaranteed
10895 fragment:
10896 start: 92
10897 end: 124
10898 pop_name:
10899 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10900 kind: included
10901 fragment:
10902 start: 82
10903 end: 90
10904 tier:
10905 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
10906 kind: included
10907 fragment:
10908 start: 61
10909 end: 65
10910 returns: vector
10911 operations:
10912 - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}'
10913 op: ""
10914 joins:
10915 - addedlabels:
10916 - tier
10917 - animal
10918 - brand
10919 - pop_name
10920 depth: 0
10921 ison: true
10922 matchinglabels:
10923 - colo_name
10924 op: '*'
10925 src:
10926 labels:
10927 colo_status:
10928 reason: Query will only return series where these labels are present.
10929 kind: guaranteed
10930 fragment:
10931 start: 1
10932 end: 31
10933 returns: vector
10934 operations:
10935 - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}'
10936 op: ""
10937 position:
10938 start: 1
10939 end: 31
10940 type: selector
10941 usedLabels:
10942 - colo_name
10943 position:
10944 start: 92
10945 end: 124
10946 type: selector
10947 usedLabels:
10948 - instance
10949 position:
10950 start: 163
10951 end: 185
10952 type: selector
10953 isConditional: true
10954 usedLabels:
10955 - instance
10956 position:
10957 start: 224
10958 end: 264
10959 type: selector
10960
10961---
10962
10963[TestLabelsSource/174 - 1]
10964expr: |4
10965
10966 sliver_metadata{node_status="v"} * on (instance) group_right (sliver)
10967 (metal_services_enabled == 999) * on (colo_name) group_left(tier, animal, brand, pop_name)
10968 colo_metadata{colo_status="v"}
10969output:
10970 - labels:
10971 __name__:
10972 reason: Binary operation between two vectors removes metric names.
10973 kind: excluded
10974 fragment:
10975 start: 1
10976 end: 192
10977 animal:
10978 reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10979 kind: included
10980 fragment:
10981 start: 137
10982 end: 143
10983 brand:
10984 reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
10985 kind: included
10986 fragment:
10987 start: 145
10988 end: 150
10989 colo_name:
10990 reason: Query is using many-to-one vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
10991 kind: included
10992 fragment:
10993 start: 109
10994 end: 118
10995 instance:
10996 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
10997 kind: included
10998 fragment:
10999 start: 40
11000 end: 48
11001 pop_name:
11002 reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
11003 kind: included
11004 fragment:
11005 start: 152
11006 end: 160
11007 sliver:
11008 reason: Query is using `group_right(sliver)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11009 kind: included
11010 fragment:
11011 start: 63
11012 end: 69
11013 tier:
11014 reason: Query is using `group_left(tier, animal, brand, pop_name)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
11015 kind: included
11016 fragment:
11017 start: 131
11018 end: 135
11019 returns: vector
11020 operations:
11021 - node: '[*parser.VectorSelector] metal_services_enabled'
11022 op: ""
11023 joins:
11024 - addedlabels:
11025 - sliver
11026 depth: 0
11027 ison: true
11028 matchinglabels:
11029 - instance
11030 op: '*'
11031 src:
11032 labels:
11033 node_status:
11034 reason: Query will only return series where these labels are present.
11035 kind: guaranteed
11036 fragment:
11037 start: 1
11038 end: 33
11039 returns: vector
11040 operations:
11041 - node: '[*parser.VectorSelector] sliver_metadata{node_status="v"}'
11042 op: ""
11043 position:
11044 start: 1
11045 end: 33
11046 type: selector
11047 - addedlabels:
11048 - tier
11049 - animal
11050 - brand
11051 - pop_name
11052 depth: 0
11053 ison: true
11054 matchinglabels:
11055 - colo_name
11056 op: '*'
11057 src:
11058 labels:
11059 colo_status:
11060 reason: Query will only return series where these labels are present.
11061 kind: guaranteed
11062 fragment:
11063 start: 162
11064 end: 192
11065 returns: vector
11066 operations:
11067 - node: '[*parser.VectorSelector] colo_metadata{colo_status="v"}'
11068 op: ""
11069 position:
11070 start: 162
11071 end: 192
11072 type: selector
11073 usedLabels:
11074 - instance
11075 - colo_name
11076 position:
11077 start: 72
11078 end: 94
11079 type: selector
11080 isConditional: true
11081
11082---
11083
11084[TestLabelsSource/175 - 1]
11085expr: |4
11086
11087 colo_metadata * on (colo_name) group_right(tier, animal, brand, pop_name)
11088 sliver_metadata * on (instance) group_right (sliver)
11089 metal_services_enabled
11090output:
11091 - labels:
11092 __name__:
11093 reason: Binary operation between two vectors removes metric names.
11094 kind: excluded
11095 fragment:
11096 start: 1
11097 end: 150
11098 instance:
11099 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
11100 kind: included
11101 fragment:
11102 start: 97
11103 end: 105
11104 sliver:
11105 reason: Query is using `group_right(sliver)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11106 kind: included
11107 fragment:
11108 start: 120
11109 end: 126
11110 deadLabels:
11111 - name: tier
11112 reason: This binary operation prevents previously joined label `tier` from being added to the results.
11113 labelreason: ""
11114 usagefragment:
11115 start: 91
11116 end: 92
11117 labelfragment:
11118 start: 91
11119 end: 92
11120 kind: 1
11121 - name: animal
11122 reason: This binary operation prevents previously joined label `animal` from being added to the results.
11123 labelreason: ""
11124 usagefragment:
11125 start: 91
11126 end: 92
11127 labelfragment:
11128 start: 91
11129 end: 92
11130 kind: 1
11131 - name: brand
11132 reason: This binary operation prevents previously joined label `brand` from being added to the results.
11133 labelreason: ""
11134 usagefragment:
11135 start: 91
11136 end: 92
11137 labelfragment:
11138 start: 91
11139 end: 92
11140 kind: 1
11141 - name: pop_name
11142 reason: This binary operation prevents previously joined label `pop_name` from being added to the results.
11143 labelreason: ""
11144 usagefragment:
11145 start: 91
11146 end: 92
11147 labelfragment:
11148 start: 91
11149 end: 92
11150 kind: 1
11151 returns: vector
11152 operations:
11153 - node: '[*parser.VectorSelector] metal_services_enabled'
11154 op: ""
11155 joins:
11156 - addedlabels:
11157 - sliver
11158 depth: 0
11159 ison: true
11160 matchinglabels:
11161 - instance
11162 op: '*'
11163 src:
11164 labels:
11165 __name__:
11166 reason: Binary operation between two vectors removes metric names.
11167 kind: excluded
11168 fragment:
11169 start: 1
11170 end: 90
11171 animal:
11172 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11173 kind: included
11174 fragment:
11175 start: 50
11176 end: 56
11177 brand:
11178 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11179 kind: included
11180 fragment:
11181 start: 58
11182 end: 63
11183 colo_name:
11184 reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
11185 kind: included
11186 fragment:
11187 start: 21
11188 end: 30
11189 pop_name:
11190 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11191 kind: included
11192 fragment:
11193 start: 65
11194 end: 73
11195 tier:
11196 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11197 kind: included
11198 fragment:
11199 start: 44
11200 end: 48
11201 returns: vector
11202 operations:
11203 - node: '[*parser.VectorSelector] sliver_metadata'
11204 op: ""
11205 joins:
11206 - addedlabels:
11207 - tier
11208 - animal
11209 - brand
11210 - pop_name
11211 depth: 0
11212 ison: true
11213 matchinglabels:
11214 - colo_name
11215 op: '*'
11216 src:
11217 returns: vector
11218 operations:
11219 - node: '[*parser.VectorSelector] colo_metadata'
11220 op: ""
11221 position:
11222 start: 1
11223 end: 14
11224 type: selector
11225 usedLabels:
11226 - colo_name
11227 position:
11228 start: 75
11229 end: 90
11230 type: selector
11231 usedLabels:
11232 - instance
11233 position:
11234 start: 128
11235 end: 150
11236 type: selector
11237
11238---
11239
11240[TestLabelsSource/176 - 1]
11241expr: |4
11242
11243 colo_metadata * on (colo_name) group_right(tier, animal, brand, pop_name)
11244 (
11245 sliver_metadata * on (instance) group_right (sliver)
11246 metal_services_enabled
11247 )
11248output:
11249 - labels:
11250 __name__:
11251 reason: Binary operation between two vectors removes metric names.
11252 kind: excluded
11253 fragment:
11254 start: 1
11255 end: 162
11256 animal:
11257 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11258 kind: included
11259 fragment:
11260 start: 50
11261 end: 56
11262 brand:
11263 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11264 kind: included
11265 fragment:
11266 start: 58
11267 end: 63
11268 colo_name:
11269 reason: Query is using one-to-many vector matching with `on(colo_name)`, labels included inside `on(...)` will be present on the results.
11270 kind: included
11271 fragment:
11272 start: 21
11273 end: 30
11274 instance:
11275 reason: Query is using one-to-many vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
11276 kind: included
11277 fragment:
11278 start: 103
11279 end: 111
11280 pop_name:
11281 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11282 kind: included
11283 fragment:
11284 start: 65
11285 end: 73
11286 sliver:
11287 reason: Query is using `group_right(sliver)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11288 kind: included
11289 fragment:
11290 start: 126
11291 end: 132
11292 tier:
11293 reason: Query is using `group_right(tier, animal, brand, pop_name)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11294 kind: included
11295 fragment:
11296 start: 44
11297 end: 48
11298 returns: vector
11299 operations:
11300 - node: '[*parser.VectorSelector] metal_services_enabled'
11301 op: ""
11302 joins:
11303 - addedlabels:
11304 - sliver
11305 depth: 0
11306 ison: true
11307 matchinglabels:
11308 - instance
11309 op: '*'
11310 src:
11311 returns: vector
11312 operations:
11313 - node: '[*parser.VectorSelector] sliver_metadata'
11314 op: ""
11315 position:
11316 start: 81
11317 end: 96
11318 type: selector
11319 - addedlabels:
11320 - tier
11321 - animal
11322 - brand
11323 - pop_name
11324 depth: 0
11325 ison: true
11326 matchinglabels:
11327 - colo_name
11328 op: '*'
11329 src:
11330 returns: vector
11331 operations:
11332 - node: '[*parser.VectorSelector] colo_metadata'
11333 op: ""
11334 position:
11335 start: 1
11336 end: 14
11337 type: selector
11338 usedLabels:
11339 - instance
11340 - colo_name
11341 position:
11342 start: 138
11343 end: 160
11344 type: selector
11345
11346---
11347
11348[TestLabelsSource/177 - 1]
11349expr: |4
11350
11351 up{node_status="v", job="node_exporter"}
11352 * on(instance) group_left(node_status) sliver_metadata
11353output:
11354 - labels:
11355 __name__:
11356 reason: Binary operation between two vectors removes metric names.
11357 kind: excluded
11358 fragment:
11359 start: 1
11360 end: 96
11361 instance:
11362 reason: Query is using many-to-one vector matching with `on(instance)`, labels included inside `on(...)` will be present on the results.
11363 kind: included
11364 fragment:
11365 start: 47
11366 end: 55
11367 job:
11368 reason: Query will only return series where these labels are present.
11369 kind: guaranteed
11370 fragment:
11371 start: 1
11372 end: 41
11373 node_status:
11374 reason: Query will only return series where these labels are present.
11375 kind: guaranteed
11376 fragment:
11377 start: 1
11378 end: 41
11379 deadLabels:
11380 - name: node_status
11381 reason: Query is trying to join the `node_status` label that is already present on the other side of the query.
11382 labelreason: Query will only return series where these labels are present.
11383 usagefragment:
11384 start: 68
11385 end: 79
11386 labelfragment:
11387 start: 1
11388 end: 41
11389 kind: 2
11390 returns: vector
11391 operations:
11392 - node: '[*parser.VectorSelector] up{job="node_exporter",node_status="v"}'
11393 op: ""
11394 joins:
11395 - addedlabels:
11396 - node_status
11397 depth: 0
11398 ison: true
11399 matchinglabels:
11400 - instance
11401 op: '*'
11402 src:
11403 returns: vector
11404 operations:
11405 - node: '[*parser.VectorSelector] sliver_metadata'
11406 op: ""
11407 position:
11408 start: 81
11409 end: 96
11410 type: selector
11411 usedLabels:
11412 - instance
11413 position:
11414 start: 1
11415 end: 41
11416 type: selector
11417
11418---
11419
11420[TestLabelsSource/178 - 1]
11421expr: services_enabled{job=""}
11422output:
11423 - labels:
11424 job:
11425 reason: Query uses `{job=""}` selector which will filter out any time series with the `job` label set.
11426 kind: excluded
11427 fragment:
11428 start: 0
11429 end: 24
11430 returns: vector
11431 operations:
11432 - node: '[*parser.VectorSelector] services_enabled{job=""}'
11433 op: ""
11434 position:
11435 start: 0
11436 end: 24
11437 type: selector
11438
11439---
11440
11441[TestLabelsSource/179 - 1]
11442expr: |4
11443
11444 group by (cluster, namespace, workload, workload_type, pod) (
11445 label_join(
11446 label_join(
11447 group by (cluster, namespace, job_name, pod) (
11448 label_join(
11449 kube_pod_owner{job="kube-state-metrics", owner_kind="Job"}
11450 , "job_name", "", "owner_name")
11451 )
11452 * on (cluster, namespace, job_name) group_left(owner_kind, owner_name)
11453 group by (cluster, namespace, job_name, owner_kind, owner_name) (
11454 kube_job_owner{job="kube-state-metrics", owner_kind!="Pod", owner_kind!=""}
11455 )
11456 , "workload", "", "owner_name")
11457 , "workload_type", "", "owner_kind")
11458 )
11459output:
11460 - labels:
11461 "":
11462 reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results.
11463 kind: excluded
11464 fragment:
11465 start: 7
11466 end: 10
11467 __name__:
11468 reason: Aggregation removes metric name.
11469 kind: excluded
11470 fragment:
11471 start: 1
11472 end: 600
11473 cluster:
11474 reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results.
11475 kind: included
11476 fragment:
11477 start: 11
11478 end: 18
11479 job:
11480 reason: Query is using aggregation with `by(cluster, namespace, job_name, pod)`, only labels included inside `by(...)` will be present on the results.
11481 kind: excluded
11482 fragment:
11483 start: 105
11484 end: 143
11485 job_name:
11486 reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results.
11487 kind: excluded
11488 fragment:
11489 start: 7
11490 end: 60
11491 namespace:
11492 reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results.
11493 kind: included
11494 fragment:
11495 start: 20
11496 end: 29
11497 owner_kind:
11498 reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results.
11499 kind: excluded
11500 fragment:
11501 start: 7
11502 end: 60
11503 owner_name:
11504 reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results.
11505 kind: excluded
11506 fragment:
11507 start: 7
11508 end: 60
11509 pod:
11510 reason: Query is using aggregation with `by(cluster, namespace, workload, workload_type, pod)`, only labels included inside `by(...)` will be present on the results.
11511 kind: included
11512 fragment:
11513 start: 56
11514 end: 59
11515 workload:
11516 reason: This label will be added to the result by label_join() call.
11517 kind: guaranteed
11518 fragment:
11519 start: 81
11520 end: 559
11521 workload_type:
11522 reason: This label will be added to the result by label_join() call.
11523 kind: guaranteed
11524 fragment:
11525 start: 65
11526 end: 598
11527 returns: vector
11528 operations:
11529 - node: '[*parser.VectorSelector] kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}'
11530 op: ""
11531 - args:
11532 - '"job_name"'
11533 - '""'
11534 - '"owner_name"'
11535 node: '[*parser.Call] label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name")'
11536 op: label_join
11537 - node: '[*parser.AggregateExpr] group by (cluster, namespace, job_name, pod) (label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name"))'
11538 op: group
11539 - args:
11540 - '"workload"'
11541 - '""'
11542 - '"owner_name"'
11543 node: '[*parser.Call] label_join(group by (cluster, namespace, job_name, pod) (label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name")) * on (cluster, namespace, job_name) group_left (owner_kind, owner_name) group by (cluster, namespace, job_name, owner_kind, owner_name) (kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"}), "workload", "", "owner_name")'
11544 op: label_join
11545 - args:
11546 - '"workload_type"'
11547 - '""'
11548 - '"owner_kind"'
11549 node: '[*parser.Call] label_join(label_join(group by (cluster, namespace, job_name, pod) (label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name")) * on (cluster, namespace, job_name) group_left (owner_kind, owner_name) group by (cluster, namespace, job_name, owner_kind, owner_name) (kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"}), "workload", "", "owner_name"), "workload_type", "", "owner_kind")'
11550 op: label_join
11551 - node: '[*parser.AggregateExpr] group by (cluster, namespace, workload, workload_type, pod) (label_join(label_join(group by (cluster, namespace, job_name, pod) (label_join(kube_pod_owner{job="kube-state-metrics",owner_kind="Job"}, "job_name", "", "owner_name")) * on (cluster, namespace, job_name) group_left (owner_kind, owner_name) group by (cluster, namespace, job_name, owner_kind, owner_name) (kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"}), "workload", "", "owner_name"), "workload_type", "", "owner_kind"))'
11552 op: group
11553 joins:
11554 - addedlabels:
11555 - owner_kind
11556 - owner_name
11557 depth: 1
11558 ison: true
11559 matchinglabels:
11560 - cluster
11561 - namespace
11562 - job_name
11563 op: '*'
11564 src:
11565 labels:
11566 "":
11567 reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results.
11568 kind: excluded
11569 fragment:
11570 start: 372
11571 end: 375
11572 __name__:
11573 reason: Aggregation removes metric name.
11574 kind: excluded
11575 fragment:
11576 start: 366
11577 end: 523
11578 cluster:
11579 reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results.
11580 kind: included
11581 fragment:
11582 start: 376
11583 end: 383
11584 job:
11585 reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results.
11586 kind: excluded
11587 fragment:
11588 start: 372
11589 end: 429
11590 job_name:
11591 reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results.
11592 kind: included
11593 fragment:
11594 start: 396
11595 end: 404
11596 namespace:
11597 reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results.
11598 kind: included
11599 fragment:
11600 start: 385
11601 end: 394
11602 owner_kind:
11603 reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results.
11604 kind: included
11605 fragment:
11606 start: 406
11607 end: 416
11608 owner_name:
11609 reason: Query is using aggregation with `by(cluster, namespace, job_name, owner_kind, owner_name)`, only labels included inside `by(...)` will be present on the results.
11610 kind: included
11611 fragment:
11612 start: 418
11613 end: 428
11614 returns: vector
11615 operations:
11616 - node: '[*parser.VectorSelector] kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"}'
11617 op: ""
11618 - node: '[*parser.AggregateExpr] group by (cluster, namespace, job_name, owner_kind, owner_name) (kube_job_owner{job="kube-state-metrics",owner_kind!="",owner_kind!="Pod"})'
11619 op: group
11620 usedLabels:
11621 - cluster
11622 - namespace
11623 - job_name
11624 - owner_kind
11625 - owner_name
11626 position:
11627 start: 440
11628 end: 515
11629 type: aggregation
11630 fixedLabels: true
11631 usedLabels:
11632 - cluster
11633 - namespace
11634 - pod
11635 - workload
11636 - workload_type
11637 position:
11638 start: 81
11639 end: 559
11640 type: aggregation
11641 fixedLabels: true
11642
11643---
11644
11645[TestLabelsSource/180 - 1]
11646expr: foo{job="xxx"} + on(job) group_right(instance) bar{}
11647output:
11648 - labels:
11649 __name__:
11650 reason: Binary operation between two vectors removes metric names.
11651 kind: excluded
11652 fragment:
11653 start: 0
11654 end: 52
11655 instance:
11656 reason: Query is using `group_right(instance)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11657 kind: included
11658 fragment:
11659 start: 37
11660 end: 45
11661 job:
11662 reason: Query is using one-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
11663 kind: included
11664 fragment:
11665 start: 20
11666 end: 23
11667 returns: vector
11668 operations:
11669 - node: '[*parser.VectorSelector] bar'
11670 op: ""
11671 joins:
11672 - addedlabels:
11673 - instance
11674 depth: 0
11675 ison: true
11676 matchinglabels:
11677 - job
11678 op: +
11679 src:
11680 labels:
11681 job:
11682 reason: Query will only return series where these labels are present.
11683 kind: guaranteed
11684 fragment:
11685 start: 0
11686 end: 14
11687 returns: vector
11688 operations:
11689 - node: '[*parser.VectorSelector] foo{job="xxx"}'
11690 op: ""
11691 position:
11692 start: 0
11693 end: 14
11694 type: selector
11695 usedLabels:
11696 - job
11697 position:
11698 start: 47
11699 end: 52
11700 type: selector
11701
11702---
11703
11704[TestLabelsSource/181 - 1]
11705expr: foo{job="xxx"} + ignoring(job) group_right(instance) bar{job="zzz"}
11706output:
11707 - labels:
11708 __name__:
11709 reason: Binary operation between two vectors removes metric names.
11710 kind: excluded
11711 fragment:
11712 start: 0
11713 end: 67
11714 instance:
11715 reason: Query is using `group_right(instance)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
11716 kind: included
11717 fragment:
11718 start: 43
11719 end: 51
11720 job:
11721 reason: Query will only return series where these labels are present.
11722 kind: guaranteed
11723 fragment:
11724 start: 53
11725 end: 67
11726 returns: vector
11727 operations:
11728 - node: '[*parser.VectorSelector] bar{job="zzz"}'
11729 op: ""
11730 joins:
11731 - addedlabels:
11732 - instance
11733 depth: 0
11734 ison: false
11735 matchinglabels:
11736 - job
11737 op: +
11738 src:
11739 labels:
11740 job:
11741 reason: Query will only return series where these labels are present.
11742 kind: guaranteed
11743 fragment:
11744 start: 0
11745 end: 14
11746 returns: vector
11747 operations:
11748 - node: '[*parser.VectorSelector] foo{job="xxx"}'
11749 op: ""
11750 position:
11751 start: 0
11752 end: 14
11753 type: selector
11754 usedLabels:
11755 - instance
11756 position:
11757 start: 53
11758 end: 67
11759 type: selector
11760
11761---
11762
11763[TestLabelsSource/182 - 1]
11764expr: foo or ignoring(job) bar
11765output:
11766 - returns: vector
11767 operations:
11768 - node: '[*parser.VectorSelector] foo'
11769 op: ""
11770 position:
11771 start: 0
11772 end: 3
11773 type: selector
11774 - returns: vector
11775 operations:
11776 - node: '[*parser.VectorSelector] bar'
11777 op: ""
11778 position:
11779 start: 21
11780 end: 24
11781 type: selector
11782
11783---
11784
11785[TestLabelsSource/183 - 1]
11786expr: foo or on(job) bar
11787output:
11788 - labels:
11789 job:
11790 reason: Query is using many-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results if matched time series have them.
11791 kind: included
11792 fragment:
11793 start: 10
11794 end: 13
11795 returns: vector
11796 operations:
11797 - node: '[*parser.VectorSelector] foo'
11798 op: ""
11799 usedLabels:
11800 - job
11801 position:
11802 start: 0
11803 end: 3
11804 type: selector
11805 - returns: vector
11806 operations:
11807 - node: '[*parser.VectorSelector] bar'
11808 op: ""
11809 position:
11810 start: 15
11811 end: 18
11812 type: selector
11813
11814---
11815
11816[TestLabelsSource/184 - 1]
11817expr: |4
11818
11819 (
11820 sum(rate(panics_total{module_name=~".+"}[5m])) by (colo_name, module_name)
11821 /
11822 ignoring(module_name) group_left
11823 sum(colo:requests:rate5m) by (colo_name)
11824 ) > 0.01
11825output:
11826 - labels:
11827 "":
11828 reason: Query is using aggregation with `by(colo_name, module_name)`, only labels included inside `by(...)` will be present on the results.
11829 kind: excluded
11830 fragment:
11831 start: 52
11832 end: 55
11833 __name__:
11834 reason: Binary operation between two vectors removes metric names.
11835 kind: excluded
11836 fragment:
11837 start: 5
11838 end: 161
11839 colo_name:
11840 reason: Query is using aggregation with `by(colo_name, module_name)`, only labels included inside `by(...)` will be present on the results.
11841 kind: included
11842 fragment:
11843 start: 56
11844 end: 65
11845 module_name:
11846 reason: Query will only return series where these labels are present.
11847 kind: guaranteed
11848 fragment:
11849 start: 9
11850 end: 50
11851 returns: vector
11852 operations:
11853 - node: '[*parser.VectorSelector] panics_total{module_name=~".+"}'
11854 op: ""
11855 - node: '[*parser.Call] rate(panics_total{module_name=~".+"}[5m])'
11856 op: rate
11857 - node: '[*parser.AggregateExpr] sum by (colo_name, module_name) (rate(panics_total{module_name=~".+"}[5m]))'
11858 op: sum
11859 joins:
11860 - addedlabels: []
11861 depth: 0
11862 ison: false
11863 matchinglabels:
11864 - module_name
11865 op: /
11866 src:
11867 labels:
11868 "":
11869 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11870 kind: excluded
11871 fragment:
11872 start: 147
11873 end: 150
11874 __name__:
11875 reason: Aggregation removes metric name.
11876 kind: excluded
11877 fragment:
11878 start: 121
11879 end: 161
11880 colo_name:
11881 reason: Query is using aggregation with `by(colo_name)`, only labels included inside `by(...)` will be present on the results.
11882 kind: included
11883 fragment:
11884 start: 151
11885 end: 160
11886 returns: vector
11887 operations:
11888 - node: '[*parser.VectorSelector] colo:requests:rate5m'
11889 op: ""
11890 - node: '[*parser.AggregateExpr] sum by (colo_name) (colo:requests:rate5m)'
11891 op: sum
11892 usedLabels:
11893 - colo_name
11894 position:
11895 start: 125
11896 end: 145
11897 type: aggregation
11898 fixedLabels: true
11899 usedLabels:
11900 - colo_name
11901 - module_name
11902 position:
11903 start: 14
11904 end: 49
11905 type: aggregation
11906 fixedLabels: true
11907 isConditional: true
11908
11909---
11910
11911[TestLabelsSource/185 - 1]
11912expr: foo atan2 bar
11913output:
11914 - labels:
11915 __name__:
11916 reason: Binary operation between two vectors removes metric names.
11917 kind: excluded
11918 fragment:
11919 start: 0
11920 end: 13
11921 returns: vector
11922 operations:
11923 - node: '[*parser.VectorSelector] foo'
11924 op: ""
11925 joins:
11926 - addedlabels: []
11927 depth: 0
11928 ison: false
11929 matchinglabels: []
11930 op: atan2
11931 src:
11932 returns: vector
11933 operations:
11934 - node: '[*parser.VectorSelector] bar'
11935 op: ""
11936 position:
11937 start: 10
11938 end: 13
11939 type: selector
11940 position:
11941 start: 0
11942 end: 3
11943 type: selector
11944
11945---
11946
11947[TestLabelsSource/186 - 1]
11948expr: foo offset -5m
11949output:
11950 - returns: vector
11951 operations:
11952 - node: '[*parser.VectorSelector] foo offset -5m'
11953 op: ""
11954 position:
11955 start: 0
11956 end: 14
11957 type: selector
11958
11959---
11960
11961[TestLabelsSource/187 - 1]
11962expr: foo @ 1609459200
11963output:
11964 - returns: vector
11965 operations:
11966 - node: '[*parser.VectorSelector] foo @ 1609459200.000'
11967 op: ""
11968 position:
11969 start: 0
11970 end: 16
11971 type: selector
11972
11973---
11974
11975[TestLabelsSource/188 - 1]
11976expr: foo @ start()
11977output:
11978 - returns: vector
11979 operations:
11980 - node: '[*parser.VectorSelector] foo @ start()'
11981 op: ""
11982 position:
11983 start: 0
11984 end: 13
11985 type: selector
11986
11987---
11988
11989[TestLabelsSource/189 - 1]
11990expr: foo @ end()
11991output:
11992 - returns: vector
11993 operations:
11994 - node: '[*parser.VectorSelector] foo @ end()'
11995 op: ""
11996 position:
11997 start: 0
11998 end: 11
11999 type: selector
12000
12001---
12002
12003[TestLabelsSource/190 - 1]
12004expr: foo[5m] @ 1609459200
12005output:
12006 - returns: matrix
12007 operations:
12008 - node: '[*parser.VectorSelector] foo @ 1609459200.000'
12009 op: ""
12010 position:
12011 start: 0
12012 end: 3
12013 type: selector
12014
12015---
12016
12017[TestLabelsSource/191 - 1]
12018expr: rate(foo[5m] @ start())
12019output:
12020 - returns: vector
12021 operations:
12022 - node: '[*parser.VectorSelector] foo @ start()'
12023 op: ""
12024 - node: '[*parser.Call] rate(foo[5m] @ start())'
12025 op: rate
12026 position:
12027 start: 5
12028 end: 22
12029 type: function
12030
12031---
12032
12033[TestLabelsSource/192 - 1]
12034expr: histogram_quantile(0.9, rate(foo[5m]))
12035output:
12036 - returns: vector
12037 operations:
12038 - node: '[*parser.VectorSelector] foo'
12039 op: ""
12040 - node: '[*parser.Call] rate(foo[5m])'
12041 op: rate
12042 - args:
12043 - "0.9"
12044 node: '[*parser.Call] histogram_quantile(0.9, rate(foo[5m]))'
12045 op: histogram_quantile
12046 position:
12047 start: 24
12048 end: 37
12049 type: function
12050
12051---
12052
12053[TestLabelsSource/193 - 1]
12054expr: predict_linear(foo[5m], 3600)
12055output:
12056 - returns: vector
12057 operations:
12058 - node: '[*parser.VectorSelector] foo'
12059 op: ""
12060 - args:
12061 - "3600"
12062 node: '[*parser.Call] predict_linear(foo[5m], 3600)'
12063 op: predict_linear
12064 position:
12065 start: 15
12066 end: 22
12067 type: function
12068
12069---
12070
12071[TestLabelsSource/194 - 1]
12072expr: clamp(foo, 0, 100)
12073output:
12074 - returns: vector
12075 operations:
12076 - node: '[*parser.VectorSelector] foo'
12077 op: ""
12078 - args:
12079 - "0"
12080 - "100"
12081 node: '[*parser.Call] clamp(foo, 0, 100)'
12082 op: clamp
12083 position:
12084 start: 6
12085 end: 9
12086 type: function
12087
12088---
12089
12090[TestLabelsSource/195 - 1]
12091expr: irate(foo[5m])
12092output:
12093 - returns: vector
12094 operations:
12095 - node: '[*parser.VectorSelector] foo'
12096 op: ""
12097 - node: '[*parser.Call] irate(foo[5m])'
12098 op: irate
12099 position:
12100 start: 6
12101 end: 13
12102 type: function
12103
12104---
12105
12106[TestLabelsSource/196 - 1]
12107expr: delta(foo[5m])
12108output:
12109 - returns: vector
12110 operations:
12111 - node: '[*parser.VectorSelector] foo'
12112 op: ""
12113 - node: '[*parser.Call] delta(foo[5m])'
12114 op: delta
12115 position:
12116 start: 6
12117 end: 13
12118 type: function
12119
12120---
12121
12122[TestLabelsSource/197 - 1]
12123expr: idelta(foo[5m])
12124output:
12125 - returns: vector
12126 operations:
12127 - node: '[*parser.VectorSelector] foo'
12128 op: ""
12129 - node: '[*parser.Call] idelta(foo[5m])'
12130 op: idelta
12131 position:
12132 start: 7
12133 end: 14
12134 type: function
12135
12136---
12137
12138[TestLabelsSource/198 - 1]
12139expr: increase(foo[5m])
12140output:
12141 - returns: vector
12142 operations:
12143 - node: '[*parser.VectorSelector] foo'
12144 op: ""
12145 - node: '[*parser.Call] increase(foo[5m])'
12146 op: increase
12147 position:
12148 start: 9
12149 end: 16
12150 type: function
12151
12152---
12153
12154[TestLabelsSource/199 - 1]
12155expr: changes(foo[5m])
12156output:
12157 - returns: vector
12158 operations:
12159 - node: '[*parser.VectorSelector] foo'
12160 op: ""
12161 - node: '[*parser.Call] changes(foo[5m])'
12162 op: changes
12163 position:
12164 start: 8
12165 end: 15
12166 type: function
12167
12168---
12169
12170[TestLabelsSource/200 - 1]
12171expr: resets(foo[5m])
12172output:
12173 - returns: vector
12174 operations:
12175 - node: '[*parser.VectorSelector] foo'
12176 op: ""
12177 - node: '[*parser.Call] resets(foo[5m])'
12178 op: resets
12179 position:
12180 start: 7
12181 end: 14
12182 type: function
12183
12184---
12185
12186[TestLabelsSource/201 - 1]
12187expr: timestamp(foo)
12188output:
12189 - returns: vector
12190 operations:
12191 - node: '[*parser.VectorSelector] foo'
12192 op: ""
12193 - node: '[*parser.Call] timestamp(foo)'
12194 op: timestamp
12195 position:
12196 start: 10
12197 end: 13
12198 type: function
12199
12200---
12201
12202[TestLabelsSource/202 - 1]
12203expr: sort(foo)
12204output:
12205 - returns: vector
12206 operations:
12207 - node: '[*parser.VectorSelector] foo'
12208 op: ""
12209 - node: '[*parser.Call] sort(foo)'
12210 op: sort
12211 position:
12212 start: 5
12213 end: 8
12214 type: function
12215
12216---
12217
12218[TestLabelsSource/203 - 1]
12219expr: sort_desc(foo)
12220output:
12221 - returns: vector
12222 operations:
12223 - node: '[*parser.VectorSelector] foo'
12224 op: ""
12225 - node: '[*parser.Call] sort_desc(foo)'
12226 op: sort_desc
12227 position:
12228 start: 10
12229 end: 13
12230 type: function
12231
12232---
12233
12234[TestLabelsSource/204 - 1]
12235expr: pi()
12236output:
12237 - labels:
12238 "":
12239 reason: Calling `pi()` will return a scalar value with no labels.
12240 kind: excluded
12241 fragment:
12242 start: 0
12243 end: 4
12244 returns: scalar
12245 operations:
12246 - node: '[*parser.Call] pi()'
12247 op: pi
12248 returnInfo:
12249 logicalexpr: ""
12250 valueposition:
12251 start: 0
12252 end: 4
12253 returnednumber: 3.141592653589793
12254 alwaysreturns: true
12255 knownreturn: true
12256 isreturnbool: false
12257 position:
12258 start: 0
12259 end: 4
12260 type: function
12261 fixedLabels: true
12262
12263---
12264
12265[TestLabelsSource/205 - 1]
12266expr: sgn(foo)
12267output:
12268 - returns: vector
12269 operations:
12270 - node: '[*parser.VectorSelector] foo'
12271 op: ""
12272 - node: '[*parser.Call] sgn(foo)'
12273 op: sgn
12274 position:
12275 start: 4
12276 end: 7
12277 type: function
12278
12279---
12280
12281[TestLabelsSource/206 - 1]
12282expr: clamp_min(foo, 0)
12283output:
12284 - returns: vector
12285 operations:
12286 - node: '[*parser.VectorSelector] foo'
12287 op: ""
12288 - args:
12289 - "0"
12290 node: '[*parser.Call] clamp_min(foo, 0)'
12291 op: clamp_min
12292 position:
12293 start: 10
12294 end: 13
12295 type: function
12296
12297---
12298
12299[TestLabelsSource/207 - 1]
12300expr: clamp_max(foo, 100)
12301output:
12302 - returns: vector
12303 operations:
12304 - node: '[*parser.VectorSelector] foo'
12305 op: ""
12306 - args:
12307 - "100"
12308 node: '[*parser.Call] clamp_max(foo, 100)'
12309 op: clamp_max
12310 position:
12311 start: 10
12312 end: 13
12313 type: function
12314
12315---
12316
12317[TestLabelsSource/208 - 1]
12318expr: round(foo, 0.1)
12319output:
12320 - returns: vector
12321 operations:
12322 - node: '[*parser.VectorSelector] foo'
12323 op: ""
12324 - args:
12325 - "0.1"
12326 node: '[*parser.Call] round(foo, 0.1)'
12327 op: round
12328 position:
12329 start: 6
12330 end: 9
12331 type: function
12332
12333---
12334
12335[TestLabelsSource/209 - 1]
12336expr: exp(foo)
12337output:
12338 - returns: vector
12339 operations:
12340 - node: '[*parser.VectorSelector] foo'
12341 op: ""
12342 - node: '[*parser.Call] exp(foo)'
12343 op: exp
12344 position:
12345 start: 4
12346 end: 7
12347 type: function
12348
12349---
12350
12351[TestLabelsSource/210 - 1]
12352expr: ln(foo)
12353output:
12354 - returns: vector
12355 operations:
12356 - node: '[*parser.VectorSelector] foo'
12357 op: ""
12358 - node: '[*parser.Call] ln(foo)'
12359 op: ln
12360 position:
12361 start: 3
12362 end: 6
12363 type: function
12364
12365---
12366
12367[TestLabelsSource/211 - 1]
12368expr: log2(foo)
12369output:
12370 - returns: vector
12371 operations:
12372 - node: '[*parser.VectorSelector] foo'
12373 op: ""
12374 - node: '[*parser.Call] log2(foo)'
12375 op: log2
12376 position:
12377 start: 5
12378 end: 8
12379 type: function
12380
12381---
12382
12383[TestLabelsSource/212 - 1]
12384expr: log10(foo)
12385output:
12386 - returns: vector
12387 operations:
12388 - node: '[*parser.VectorSelector] foo'
12389 op: ""
12390 - node: '[*parser.Call] log10(foo)'
12391 op: log10
12392 position:
12393 start: 6
12394 end: 9
12395 type: function
12396
12397---
12398
12399[TestLabelsSource/213 - 1]
12400expr: sqrt(foo)
12401output:
12402 - returns: vector
12403 operations:
12404 - node: '[*parser.VectorSelector] foo'
12405 op: ""
12406 - node: '[*parser.Call] sqrt(foo)'
12407 op: sqrt
12408 position:
12409 start: 5
12410 end: 8
12411 type: function
12412
12413---
12414
12415[TestLabelsSource/214 - 1]
12416expr: ceil(foo)
12417output:
12418 - returns: vector
12419 operations:
12420 - node: '[*parser.VectorSelector] foo'
12421 op: ""
12422 - node: '[*parser.Call] ceil(foo)'
12423 op: ceil
12424 position:
12425 start: 5
12426 end: 8
12427 type: function
12428
12429---
12430
12431[TestLabelsSource/215 - 1]
12432expr: floor(foo)
12433output:
12434 - returns: vector
12435 operations:
12436 - node: '[*parser.VectorSelector] foo'
12437 op: ""
12438 - node: '[*parser.Call] floor(foo)'
12439 op: floor
12440 position:
12441 start: 6
12442 end: 9
12443 type: function
12444
12445---
12446
12447[TestLabelsSource/216 - 1]
12448expr: avg_over_time(foo[5m])
12449output:
12450 - returns: vector
12451 operations:
12452 - node: '[*parser.VectorSelector] foo'
12453 op: ""
12454 - node: '[*parser.Call] avg_over_time(foo[5m])'
12455 op: avg_over_time
12456 position:
12457 start: 14
12458 end: 21
12459 type: function
12460
12461---
12462
12463[TestLabelsSource/217 - 1]
12464expr: min_over_time(foo[5m])
12465output:
12466 - returns: vector
12467 operations:
12468 - node: '[*parser.VectorSelector] foo'
12469 op: ""
12470 - node: '[*parser.Call] min_over_time(foo[5m])'
12471 op: min_over_time
12472 position:
12473 start: 14
12474 end: 21
12475 type: function
12476
12477---
12478
12479[TestLabelsSource/218 - 1]
12480expr: max_over_time(foo[5m])
12481output:
12482 - returns: vector
12483 operations:
12484 - node: '[*parser.VectorSelector] foo'
12485 op: ""
12486 - node: '[*parser.Call] max_over_time(foo[5m])'
12487 op: max_over_time
12488 position:
12489 start: 14
12490 end: 21
12491 type: function
12492
12493---
12494
12495[TestLabelsSource/219 - 1]
12496expr: count_over_time(foo[5m])
12497output:
12498 - returns: vector
12499 operations:
12500 - node: '[*parser.VectorSelector] foo'
12501 op: ""
12502 - node: '[*parser.Call] count_over_time(foo[5m])'
12503 op: count_over_time
12504 position:
12505 start: 16
12506 end: 23
12507 type: function
12508
12509---
12510
12511[TestLabelsSource/220 - 1]
12512expr: last_over_time(foo[5m])
12513output:
12514 - returns: vector
12515 operations:
12516 - node: '[*parser.VectorSelector] foo'
12517 op: ""
12518 - node: '[*parser.Call] last_over_time(foo[5m])'
12519 op: last_over_time
12520 position:
12521 start: 15
12522 end: 22
12523 type: function
12524
12525---
12526
12527[TestLabelsSource/221 - 1]
12528expr: present_over_time(foo[5m])
12529output:
12530 - returns: vector
12531 operations:
12532 - node: '[*parser.VectorSelector] foo'
12533 op: ""
12534 - node: '[*parser.Call] present_over_time(foo[5m])'
12535 op: present_over_time
12536 position:
12537 start: 18
12538 end: 25
12539 type: function
12540
12541---
12542
12543[TestLabelsSource/222 - 1]
12544expr: quantile_over_time(0.9, foo[5m])
12545output:
12546 - returns: vector
12547 operations:
12548 - node: '[*parser.VectorSelector] foo'
12549 op: ""
12550 - args:
12551 - "0.9"
12552 node: '[*parser.Call] quantile_over_time(0.9, foo[5m])'
12553 op: quantile_over_time
12554 position:
12555 start: 24
12556 end: 31
12557 type: function
12558
12559---
12560
12561[TestLabelsSource/223 - 1]
12562expr: absent_over_time(foo[5m])
12563output:
12564 - labels:
12565 "":
12566 reason: |-
12567 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.
12568 You will only get any results back if the metric selector you pass doesn't match anything.
12569 Since there are no matching time series there are also no labels. If some time series is missing you cannot read its labels.
12570 This means that the only labels you can get back from absent call are the ones you pass to it.
12571 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.
12572 kind: excluded
12573 fragment:
12574 start: 0
12575 end: 16
12576 returns: vector
12577 operations:
12578 - node: '[*parser.VectorSelector] foo'
12579 op: ""
12580 - node: '[*parser.Call] absent_over_time(foo[5m])'
12581 op: absent_over_time
12582 position:
12583 start: 17
12584 end: 24
12585 type: function
12586 fixedLabels: true
12587
12588---
12589
12590[TestLabelsSource/224 - 1]
12591expr: deg(foo)
12592output:
12593 - returns: vector
12594 operations:
12595 - node: '[*parser.VectorSelector] foo'
12596 op: ""
12597 - node: '[*parser.Call] deg(foo)'
12598 op: deg
12599 position:
12600 start: 4
12601 end: 7
12602 type: function
12603
12604---
12605
12606[TestLabelsSource/225 - 1]
12607expr: rad(foo)
12608output:
12609 - returns: vector
12610 operations:
12611 - node: '[*parser.VectorSelector] foo'
12612 op: ""
12613 - node: '[*parser.Call] rad(foo)'
12614 op: rad
12615 position:
12616 start: 4
12617 end: 7
12618 type: function
12619
12620---
12621
12622[TestLabelsSource/226 - 1]
12623expr: acos(foo)
12624output:
12625 - returns: vector
12626 operations:
12627 - node: '[*parser.VectorSelector] foo'
12628 op: ""
12629 - node: '[*parser.Call] acos(foo)'
12630 op: acos
12631 position:
12632 start: 5
12633 end: 8
12634 type: function
12635
12636---
12637
12638[TestLabelsSource/227 - 1]
12639expr: asin(foo)
12640output:
12641 - returns: vector
12642 operations:
12643 - node: '[*parser.VectorSelector] foo'
12644 op: ""
12645 - node: '[*parser.Call] asin(foo)'
12646 op: asin
12647 position:
12648 start: 5
12649 end: 8
12650 type: function
12651
12652---
12653
12654[TestLabelsSource/228 - 1]
12655expr: atan(foo)
12656output:
12657 - returns: vector
12658 operations:
12659 - node: '[*parser.VectorSelector] foo'
12660 op: ""
12661 - node: '[*parser.Call] atan(foo)'
12662 op: atan
12663 position:
12664 start: 5
12665 end: 8
12666 type: function
12667
12668---
12669
12670[TestLabelsSource/229 - 1]
12671expr: cos(foo)
12672output:
12673 - returns: vector
12674 operations:
12675 - node: '[*parser.VectorSelector] foo'
12676 op: ""
12677 - node: '[*parser.Call] cos(foo)'
12678 op: cos
12679 position:
12680 start: 4
12681 end: 7
12682 type: function
12683
12684---
12685
12686[TestLabelsSource/230 - 1]
12687expr: sin(foo)
12688output:
12689 - returns: vector
12690 operations:
12691 - node: '[*parser.VectorSelector] foo'
12692 op: ""
12693 - node: '[*parser.Call] sin(foo)'
12694 op: sin
12695 position:
12696 start: 4
12697 end: 7
12698 type: function
12699
12700---
12701
12702[TestLabelsSource/231 - 1]
12703expr: tan(foo)
12704output:
12705 - returns: vector
12706 operations:
12707 - node: '[*parser.VectorSelector] foo'
12708 op: ""
12709 - node: '[*parser.Call] tan(foo)'
12710 op: tan
12711 position:
12712 start: 4
12713 end: 7
12714 type: function
12715
12716---
12717
12718[TestLabelsSource/232 - 1]
12719expr: acosh(foo)
12720output:
12721 - returns: vector
12722 operations:
12723 - node: '[*parser.VectorSelector] foo'
12724 op: ""
12725 - node: '[*parser.Call] acosh(foo)'
12726 op: acosh
12727 position:
12728 start: 6
12729 end: 9
12730 type: function
12731
12732---
12733
12734[TestLabelsSource/233 - 1]
12735expr: asinh(foo)
12736output:
12737 - returns: vector
12738 operations:
12739 - node: '[*parser.VectorSelector] foo'
12740 op: ""
12741 - node: '[*parser.Call] asinh(foo)'
12742 op: asinh
12743 position:
12744 start: 6
12745 end: 9
12746 type: function
12747
12748---
12749
12750[TestLabelsSource/234 - 1]
12751expr: atanh(foo)
12752output:
12753 - returns: vector
12754 operations:
12755 - node: '[*parser.VectorSelector] foo'
12756 op: ""
12757 - node: '[*parser.Call] atanh(foo)'
12758 op: atanh
12759 position:
12760 start: 6
12761 end: 9
12762 type: function
12763
12764---
12765
12766[TestLabelsSource/235 - 1]
12767expr: cosh(foo)
12768output:
12769 - returns: vector
12770 operations:
12771 - node: '[*parser.VectorSelector] foo'
12772 op: ""
12773 - node: '[*parser.Call] cosh(foo)'
12774 op: cosh
12775 position:
12776 start: 5
12777 end: 8
12778 type: function
12779
12780---
12781
12782[TestLabelsSource/236 - 1]
12783expr: sinh(foo)
12784output:
12785 - returns: vector
12786 operations:
12787 - node: '[*parser.VectorSelector] foo'
12788 op: ""
12789 - node: '[*parser.Call] sinh(foo)'
12790 op: sinh
12791 position:
12792 start: 5
12793 end: 8
12794 type: function
12795
12796---
12797
12798[TestLabelsSource/237 - 1]
12799expr: tanh(foo)
12800output:
12801 - returns: vector
12802 operations:
12803 - node: '[*parser.VectorSelector] foo'
12804 op: ""
12805 - node: '[*parser.Call] tanh(foo)'
12806 op: tanh
12807 position:
12808 start: 5
12809 end: 8
12810 type: function
12811
12812---
12813
12814[TestLabelsSource/238 - 1]
12815expr: histogram_count(foo)
12816output:
12817 - returns: vector
12818 operations:
12819 - node: '[*parser.VectorSelector] foo'
12820 op: ""
12821 - node: '[*parser.Call] histogram_count(foo)'
12822 op: histogram_count
12823 position:
12824 start: 16
12825 end: 19
12826 type: function
12827
12828---
12829
12830[TestLabelsSource/239 - 1]
12831expr: histogram_sum(foo)
12832output:
12833 - returns: vector
12834 operations:
12835 - node: '[*parser.VectorSelector] foo'
12836 op: ""
12837 - node: '[*parser.Call] histogram_sum(foo)'
12838 op: histogram_sum
12839 position:
12840 start: 14
12841 end: 17
12842 type: function
12843
12844---
12845
12846[TestLabelsSource/240 - 1]
12847expr: histogram_avg(foo)
12848output:
12849 - returns: vector
12850 operations:
12851 - node: '[*parser.VectorSelector] foo'
12852 op: ""
12853 - node: '[*parser.Call] histogram_avg(foo)'
12854 op: histogram_avg
12855 position:
12856 start: 14
12857 end: 17
12858 type: function
12859
12860---
12861
12862[TestLabelsSource/241 - 1]
12863expr: histogram_fraction(0, 0.1, foo)
12864output:
12865 - returns: vector
12866 operations:
12867 - node: '[*parser.VectorSelector] foo'
12868 op: ""
12869 - args:
12870 - "0"
12871 - "0.1"
12872 node: '[*parser.Call] histogram_fraction(0, 0.1, foo)'
12873 op: histogram_fraction
12874 position:
12875 start: 27
12876 end: 30
12877 type: function
12878
12879---
12880
12881[TestLabelsSource/242 - 1]
12882expr: histogram_stddev(foo)
12883output:
12884 - returns: vector
12885 operations:
12886 - node: '[*parser.VectorSelector] foo'
12887 op: ""
12888 - node: '[*parser.Call] histogram_stddev(foo)'
12889 op: histogram_stddev
12890 position:
12891 start: 17
12892 end: 20
12893 type: function
12894
12895---
12896
12897[TestLabelsSource/243 - 1]
12898expr: histogram_stdvar(foo)
12899output:
12900 - returns: vector
12901 operations:
12902 - node: '[*parser.VectorSelector] foo'
12903 op: ""
12904 - node: '[*parser.Call] histogram_stdvar(foo)'
12905 op: histogram_stdvar
12906 position:
12907 start: 17
12908 end: 20
12909 type: function
12910
12911---
12912
12913[TestLabelsSource/244 - 1]
12914expr: min(foo) by(job)
12915output:
12916 - labels:
12917 "":
12918 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
12919 kind: excluded
12920 fragment:
12921 start: 9
12922 end: 11
12923 __name__:
12924 reason: Aggregation removes metric name.
12925 kind: excluded
12926 fragment:
12927 start: 0
12928 end: 16
12929 job:
12930 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
12931 kind: included
12932 fragment:
12933 start: 12
12934 end: 15
12935 returns: vector
12936 operations:
12937 - node: '[*parser.VectorSelector] foo'
12938 op: ""
12939 - node: '[*parser.AggregateExpr] min by (job) (foo)'
12940 op: min
12941 usedLabels:
12942 - job
12943 position:
12944 start: 4
12945 end: 7
12946 type: aggregation
12947 fixedLabels: true
12948
12949---
12950
12951[TestLabelsSource/245 - 1]
12952expr: max(foo) without(job)
12953output:
12954 - labels:
12955 __name__:
12956 reason: Aggregation removes metric name.
12957 kind: excluded
12958 fragment:
12959 start: 0
12960 end: 21
12961 job:
12962 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
12963 kind: excluded
12964 fragment:
12965 start: 17
12966 end: 20
12967 returns: vector
12968 operations:
12969 - node: '[*parser.VectorSelector] foo'
12970 op: ""
12971 - node: '[*parser.AggregateExpr] max without (job) (foo)'
12972 op: max
12973 position:
12974 start: 4
12975 end: 7
12976 type: aggregation
12977
12978---
12979
12980[TestLabelsSource/246 - 1]
12981expr: sum(foo * on(job) group_left(cluster) bar) by(cluster)
12982output:
12983 - labels:
12984 "":
12985 reason: Query is using aggregation with `by(cluster)`, only labels included inside `by(...)` will be present on the results.
12986 kind: excluded
12987 fragment:
12988 start: 43
12989 end: 45
12990 __name__:
12991 reason: Aggregation removes metric name.
12992 kind: excluded
12993 fragment:
12994 start: 0
12995 end: 54
12996 cluster:
12997 reason: Query is using aggregation with `by(cluster)`, only labels included inside `by(...)` will be present on the results.
12998 kind: included
12999 fragment:
13000 start: 46
13001 end: 53
13002 job:
13003 reason: Query is using aggregation with `by(cluster)`, only labels included inside `by(...)` will be present on the results.
13004 kind: excluded
13005 fragment:
13006 start: 43
13007 end: 54
13008 returns: vector
13009 operations:
13010 - node: '[*parser.VectorSelector] foo'
13011 op: ""
13012 - node: '[*parser.AggregateExpr] sum by (cluster) (foo * on (job) group_left (cluster) bar)'
13013 op: sum
13014 joins:
13015 - addedlabels:
13016 - cluster
13017 depth: 1
13018 ison: true
13019 matchinglabels:
13020 - job
13021 op: '*'
13022 src:
13023 returns: vector
13024 operations:
13025 - node: '[*parser.VectorSelector] bar'
13026 op: ""
13027 position:
13028 start: 38
13029 end: 41
13030 type: selector
13031 usedLabels:
13032 - cluster
13033 position:
13034 start: 4
13035 end: 7
13036 type: aggregation
13037 fixedLabels: true
13038
13039---
13040
13041[TestLabelsSource/247 - 1]
13042expr: sum(foo * on(job) group_left(cluster) bar) without(instance)
13043output:
13044 - labels:
13045 __name__:
13046 reason: Aggregation removes metric name.
13047 kind: excluded
13048 fragment:
13049 start: 0
13050 end: 60
13051 cluster:
13052 reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
13053 kind: included
13054 fragment:
13055 start: 29
13056 end: 36
13057 instance:
13058 reason: Query is using aggregation with `without(instance)`, all labels included inside `without(...)` will be removed from the results.
13059 kind: excluded
13060 fragment:
13061 start: 51
13062 end: 59
13063 job:
13064 reason: Query is using many-to-one vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
13065 kind: included
13066 fragment:
13067 start: 13
13068 end: 16
13069 returns: vector
13070 operations:
13071 - node: '[*parser.VectorSelector] foo'
13072 op: ""
13073 - node: '[*parser.AggregateExpr] sum without (instance) (foo * on (job) group_left (cluster) bar)'
13074 op: sum
13075 joins:
13076 - addedlabels:
13077 - cluster
13078 depth: 1
13079 ison: true
13080 matchinglabels:
13081 - job
13082 op: '*'
13083 src:
13084 returns: vector
13085 operations:
13086 - node: '[*parser.VectorSelector] bar'
13087 op: ""
13088 position:
13089 start: 38
13090 end: 41
13091 type: selector
13092 usedLabels:
13093 - job
13094 position:
13095 start: 4
13096 end: 7
13097 type: aggregation
13098
13099---
13100
13101[TestLabelsSource/248 - 1]
13102expr: foo atan2 on(job) bar
13103output:
13104 - labels:
13105 "":
13106 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13107 kind: excluded
13108 fragment:
13109 start: 10
13110 end: 17
13111 __name__:
13112 reason: Binary operation between two vectors removes metric names.
13113 kind: excluded
13114 fragment:
13115 start: 0
13116 end: 21
13117 job:
13118 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13119 kind: included
13120 fragment:
13121 start: 13
13122 end: 16
13123 returns: vector
13124 operations:
13125 - node: '[*parser.VectorSelector] foo'
13126 op: ""
13127 joins:
13128 - addedlabels: []
13129 depth: 0
13130 ison: true
13131 matchinglabels:
13132 - job
13133 op: atan2
13134 src:
13135 returns: vector
13136 operations:
13137 - node: '[*parser.VectorSelector] bar'
13138 op: ""
13139 position:
13140 start: 18
13141 end: 21
13142 type: selector
13143 usedLabels:
13144 - job
13145 position:
13146 start: 0
13147 end: 3
13148 type: selector
13149 fixedLabels: true
13150
13151---
13152
13153[TestLabelsSource/249 - 1]
13154expr: foo atan2 on(job) group_left(cluster) bar
13155output:
13156 - labels:
13157 __name__:
13158 reason: Binary operation between two vectors removes metric names.
13159 kind: excluded
13160 fragment:
13161 start: 0
13162 end: 41
13163 cluster:
13164 reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
13165 kind: included
13166 fragment:
13167 start: 29
13168 end: 36
13169 job:
13170 reason: Query is using many-to-one vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
13171 kind: included
13172 fragment:
13173 start: 13
13174 end: 16
13175 returns: vector
13176 operations:
13177 - node: '[*parser.VectorSelector] foo'
13178 op: ""
13179 joins:
13180 - addedlabels:
13181 - cluster
13182 depth: 0
13183 ison: true
13184 matchinglabels:
13185 - job
13186 op: atan2
13187 src:
13188 returns: vector
13189 operations:
13190 - node: '[*parser.VectorSelector] bar'
13191 op: ""
13192 position:
13193 start: 38
13194 end: 41
13195 type: selector
13196 usedLabels:
13197 - job
13198 position:
13199 start: 0
13200 end: 3
13201 type: selector
13202
13203---
13204
13205[TestLabelsSource/250 - 1]
13206expr: foo != bool bar
13207output:
13208 - labels:
13209 __name__:
13210 reason: Binary operation between two vectors removes metric names.
13211 kind: excluded
13212 fragment:
13213 start: 0
13214 end: 15
13215 returns: vector
13216 operations:
13217 - node: '[*parser.VectorSelector] foo'
13218 op: ""
13219 joins:
13220 - addedlabels: []
13221 depth: 0
13222 ison: false
13223 matchinglabels: []
13224 op: '!='
13225 src:
13226 returns: vector
13227 operations:
13228 - node: '[*parser.VectorSelector] bar'
13229 op: ""
13230 position:
13231 start: 12
13232 end: 15
13233 type: selector
13234 returnInfo:
13235 logicalexpr: ""
13236 valueposition:
13237 start: 0
13238 end: 0
13239 returnednumber: 0
13240 alwaysreturns: false
13241 knownreturn: false
13242 isreturnbool: true
13243 position:
13244 start: 0
13245 end: 3
13246 type: selector
13247 isConditional: true
13248
13249---
13250
13251[TestLabelsSource/251 - 1]
13252expr: foo == on(job) bar
13253output:
13254 - labels:
13255 "":
13256 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13257 kind: excluded
13258 fragment:
13259 start: 7
13260 end: 14
13261 __name__:
13262 reason: Binary operation between two vectors removes metric names.
13263 kind: excluded
13264 fragment:
13265 start: 0
13266 end: 18
13267 job:
13268 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13269 kind: included
13270 fragment:
13271 start: 10
13272 end: 13
13273 returns: vector
13274 operations:
13275 - node: '[*parser.VectorSelector] foo'
13276 op: ""
13277 joins:
13278 - addedlabels: []
13279 depth: 0
13280 ison: true
13281 matchinglabels:
13282 - job
13283 op: ==
13284 src:
13285 returns: vector
13286 operations:
13287 - node: '[*parser.VectorSelector] bar'
13288 op: ""
13289 position:
13290 start: 15
13291 end: 18
13292 type: selector
13293 usedLabels:
13294 - job
13295 position:
13296 start: 0
13297 end: 3
13298 type: selector
13299 fixedLabels: true
13300 isConditional: true
13301
13302---
13303
13304[TestLabelsSource/252 - 1]
13305expr: foo > on(job) group_left() bar
13306output:
13307 - labels:
13308 __name__:
13309 reason: Binary operation between two vectors removes metric names.
13310 kind: excluded
13311 fragment:
13312 start: 0
13313 end: 30
13314 job:
13315 reason: Query is using many-to-one vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
13316 kind: included
13317 fragment:
13318 start: 9
13319 end: 12
13320 returns: vector
13321 operations:
13322 - node: '[*parser.VectorSelector] foo'
13323 op: ""
13324 joins:
13325 - addedlabels: []
13326 depth: 0
13327 ison: true
13328 matchinglabels:
13329 - job
13330 op: '>'
13331 src:
13332 returns: vector
13333 operations:
13334 - node: '[*parser.VectorSelector] bar'
13335 op: ""
13336 position:
13337 start: 27
13338 end: 30
13339 type: selector
13340 usedLabels:
13341 - job
13342 position:
13343 start: 0
13344 end: 3
13345 type: selector
13346 isConditional: true
13347
13348---
13349
13350[TestLabelsSource/253 - 1]
13351expr: foo < on(job) group_right() bar
13352output:
13353 - labels:
13354 __name__:
13355 reason: Binary operation between two vectors removes metric names.
13356 kind: excluded
13357 fragment:
13358 start: 0
13359 end: 31
13360 job:
13361 reason: Query is using one-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
13362 kind: included
13363 fragment:
13364 start: 9
13365 end: 12
13366 returns: vector
13367 operations:
13368 - node: '[*parser.VectorSelector] bar'
13369 op: ""
13370 joins:
13371 - addedlabels: []
13372 depth: 0
13373 ison: true
13374 matchinglabels:
13375 - job
13376 op: <
13377 src:
13378 returns: vector
13379 operations:
13380 - node: '[*parser.VectorSelector] foo'
13381 op: ""
13382 position:
13383 start: 0
13384 end: 3
13385 type: selector
13386 usedLabels:
13387 - job
13388 position:
13389 start: 28
13390 end: 31
13391 type: selector
13392 isConditional: true
13393
13394---
13395
13396[TestLabelsSource/254 - 1]
13397expr: foo >= on(job) group_left(cluster) bar
13398output:
13399 - labels:
13400 __name__:
13401 reason: Binary operation between two vectors removes metric names.
13402 kind: excluded
13403 fragment:
13404 start: 0
13405 end: 38
13406 cluster:
13407 reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
13408 kind: included
13409 fragment:
13410 start: 26
13411 end: 33
13412 job:
13413 reason: Query is using many-to-one vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
13414 kind: included
13415 fragment:
13416 start: 10
13417 end: 13
13418 returns: vector
13419 operations:
13420 - node: '[*parser.VectorSelector] foo'
13421 op: ""
13422 joins:
13423 - addedlabels:
13424 - cluster
13425 depth: 0
13426 ison: true
13427 matchinglabels:
13428 - job
13429 op: '>='
13430 src:
13431 returns: vector
13432 operations:
13433 - node: '[*parser.VectorSelector] bar'
13434 op: ""
13435 position:
13436 start: 35
13437 end: 38
13438 type: selector
13439 usedLabels:
13440 - job
13441 position:
13442 start: 0
13443 end: 3
13444 type: selector
13445 isConditional: true
13446
13447---
13448
13449[TestLabelsSource/255 - 1]
13450expr: foo <= on(job) group_right(cluster) bar
13451output:
13452 - labels:
13453 __name__:
13454 reason: Binary operation between two vectors removes metric names.
13455 kind: excluded
13456 fragment:
13457 start: 0
13458 end: 39
13459 cluster:
13460 reason: Query is using `group_right(cluster)`, all labels included inside `group_right(...)` will be joined to the results on the other side of the query.
13461 kind: included
13462 fragment:
13463 start: 27
13464 end: 34
13465 job:
13466 reason: Query is using one-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
13467 kind: included
13468 fragment:
13469 start: 10
13470 end: 13
13471 returns: vector
13472 operations:
13473 - node: '[*parser.VectorSelector] bar'
13474 op: ""
13475 joins:
13476 - addedlabels:
13477 - cluster
13478 depth: 0
13479 ison: true
13480 matchinglabels:
13481 - job
13482 op: <=
13483 src:
13484 returns: vector
13485 operations:
13486 - node: '[*parser.VectorSelector] foo'
13487 op: ""
13488 position:
13489 start: 0
13490 end: 3
13491 type: selector
13492 usedLabels:
13493 - job
13494 position:
13495 start: 36
13496 end: 39
13497 type: selector
13498 isConditional: true
13499
13500---
13501
13502[TestLabelsSource/256 - 1]
13503expr: foo * ignoring(job) group_left() bar
13504output:
13505 - labels:
13506 __name__:
13507 reason: Binary operation between two vectors removes metric names.
13508 kind: excluded
13509 fragment:
13510 start: 0
13511 end: 36
13512 returns: vector
13513 operations:
13514 - node: '[*parser.VectorSelector] foo'
13515 op: ""
13516 joins:
13517 - addedlabels: []
13518 depth: 0
13519 ison: false
13520 matchinglabels:
13521 - job
13522 op: '*'
13523 src:
13524 returns: vector
13525 operations:
13526 - node: '[*parser.VectorSelector] bar'
13527 op: ""
13528 position:
13529 start: 33
13530 end: 36
13531 type: selector
13532 position:
13533 start: 0
13534 end: 3
13535 type: selector
13536
13537---
13538
13539[TestLabelsSource/257 - 1]
13540expr: foo / ignoring(job) group_right() bar
13541output:
13542 - labels:
13543 __name__:
13544 reason: Binary operation between two vectors removes metric names.
13545 kind: excluded
13546 fragment:
13547 start: 0
13548 end: 37
13549 returns: vector
13550 operations:
13551 - node: '[*parser.VectorSelector] bar'
13552 op: ""
13553 joins:
13554 - addedlabels: []
13555 depth: 0
13556 ison: false
13557 matchinglabels:
13558 - job
13559 op: /
13560 src:
13561 returns: vector
13562 operations:
13563 - node: '[*parser.VectorSelector] foo'
13564 op: ""
13565 position:
13566 start: 0
13567 end: 3
13568 type: selector
13569 position:
13570 start: 34
13571 end: 37
13572 type: selector
13573
13574---
13575
13576[TestLabelsSource/258 - 1]
13577expr: foo % bar
13578output:
13579 - labels:
13580 __name__:
13581 reason: Binary operation between two vectors removes metric names.
13582 kind: excluded
13583 fragment:
13584 start: 0
13585 end: 9
13586 returns: vector
13587 operations:
13588 - node: '[*parser.VectorSelector] foo'
13589 op: ""
13590 joins:
13591 - addedlabels: []
13592 depth: 0
13593 ison: false
13594 matchinglabels: []
13595 op: '%'
13596 src:
13597 returns: vector
13598 operations:
13599 - node: '[*parser.VectorSelector] bar'
13600 op: ""
13601 position:
13602 start: 6
13603 end: 9
13604 type: selector
13605 position:
13606 start: 0
13607 end: 3
13608 type: selector
13609
13610---
13611
13612[TestLabelsSource/259 - 1]
13613expr: foo ^ bar
13614output:
13615 - labels:
13616 __name__:
13617 reason: Binary operation between two vectors removes metric names.
13618 kind: excluded
13619 fragment:
13620 start: 0
13621 end: 9
13622 returns: vector
13623 operations:
13624 - node: '[*parser.VectorSelector] foo'
13625 op: ""
13626 joins:
13627 - addedlabels: []
13628 depth: 0
13629 ison: false
13630 matchinglabels: []
13631 op: ^
13632 src:
13633 returns: vector
13634 operations:
13635 - node: '[*parser.VectorSelector] bar'
13636 op: ""
13637 position:
13638 start: 6
13639 end: 9
13640 type: selector
13641 position:
13642 start: 0
13643 end: 3
13644 type: selector
13645
13646---
13647
13648[TestLabelsSource/260 - 1]
13649expr: sum(foo * on(job) group_left(cluster) bar) by(job) * on(job) group_left(cluster) baz
13650output:
13651 - labels:
13652 "":
13653 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
13654 kind: excluded
13655 fragment:
13656 start: 43
13657 end: 45
13658 __name__:
13659 reason: Binary operation between two vectors removes metric names.
13660 kind: excluded
13661 fragment:
13662 start: 0
13663 end: 84
13664 cluster:
13665 reason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
13666 kind: included
13667 fragment:
13668 start: 72
13669 end: 79
13670 job:
13671 reason: Query is using many-to-one vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
13672 kind: included
13673 fragment:
13674 start: 56
13675 end: 59
13676 deadLabels:
13677 - name: cluster
13678 reason: Previously joined label `cluster` is being removed from the results.
13679 labelreason: Query is using `group_left(cluster)`, all labels included inside `group_left(...)` will be joined to the results on the other side of the query.
13680 usagefragment:
13681 start: 43
13682 end: 50
13683 labelfragment:
13684 start: 29
13685 end: 36
13686 kind: 3
13687 returns: vector
13688 operations:
13689 - node: '[*parser.VectorSelector] foo'
13690 op: ""
13691 - node: '[*parser.AggregateExpr] sum by (job) (foo * on (job) group_left (cluster) bar)'
13692 op: sum
13693 joins:
13694 - addedlabels:
13695 - cluster
13696 depth: 1
13697 ison: true
13698 matchinglabels:
13699 - job
13700 op: '*'
13701 src:
13702 returns: vector
13703 operations:
13704 - node: '[*parser.VectorSelector] bar'
13705 op: ""
13706 position:
13707 start: 38
13708 end: 41
13709 type: selector
13710 - addedlabels:
13711 - cluster
13712 depth: 0
13713 ison: true
13714 matchinglabels:
13715 - job
13716 op: '*'
13717 src:
13718 returns: vector
13719 operations:
13720 - node: '[*parser.VectorSelector] baz'
13721 op: ""
13722 position:
13723 start: 81
13724 end: 84
13725 type: selector
13726 usedLabels:
13727 - job
13728 position:
13729 start: 4
13730 end: 7
13731 type: aggregation
13732 fixedLabels: true
13733
13734---
13735
13736[TestLabelsSourceWithFeatures/all_four_features_combined - 1]
13737expr: mad_over_time(foo[5m+1m] smoothed) + on(job) fill(0) bar
13738output:
13739 - labels:
13740 "":
13741 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13742 kind: excluded
13743 fragment:
13744 start: 37
13745 end: 44
13746 __name__:
13747 reason: Binary operation between two vectors removes metric names.
13748 kind: excluded
13749 fragment:
13750 start: 0
13751 end: 56
13752 job:
13753 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13754 kind: included
13755 fragment:
13756 start: 40
13757 end: 43
13758 returns: vector
13759 operations:
13760 - node: '[*parser.VectorSelector] foo smoothed'
13761 op: ""
13762 - node: '[*parser.Call] mad_over_time(foo[5m + 1m] smoothed)'
13763 op: mad_over_time
13764 joins:
13765 - addedlabels: []
13766 depth: 0
13767 fill:
13768 lhs: 0
13769 rhs: 0
13770 ison: true
13771 matchinglabels:
13772 - job
13773 op: +
13774 src:
13775 returns: vector
13776 operations:
13777 - node: '[*parser.VectorSelector] bar'
13778 op: ""
13779 position:
13780 start: 53
13781 end: 56
13782 type: selector
13783 needsFeatures:
13784 - feature: promql-extended-range-selectors
13785 name: smoothed
13786 fragments:
13787 - start: 14
13788 end: 17
13789 - feature: promql-duration-expr
13790 name: duration_expr
13791 fragments:
13792 - start: 18
13793 end: 23
13794 - feature: promql-experimental-functions
13795 name: mad_over_time
13796 fragments:
13797 - start: 0
13798 end: 13
13799 - feature: promql-binop-fill-modifiers
13800 name: fill
13801 fragments:
13802 - start: 45
13803 end: 49
13804 usedLabels:
13805 - job
13806 position:
13807 start: 14
13808 end: 24
13809 type: function
13810 fixedLabels: true
13811 rangeSelectorMode: smoothed
13812
13813---
13814
13815[TestLabelsSourceWithFeatures/anchored_vector_selector - 1]
13816expr: foo anchored
13817output:
13818 - returns: vector
13819 operations:
13820 - node: '[*parser.VectorSelector] foo anchored'
13821 op: ""
13822 needsFeatures:
13823 - feature: promql-extended-range-selectors
13824 name: anchored
13825 fragments:
13826 - start: 0
13827 end: 3
13828 position:
13829 start: 0
13830 end: 3
13831 type: selector
13832 rangeSelectorMode: anchored
13833
13834---
13835
13836[TestLabelsSourceWithFeatures/binop_fill_left_modifier - 1]
13837expr: foo + on(job) fill_left(0) bar
13838output:
13839 - labels:
13840 "":
13841 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13842 kind: excluded
13843 fragment:
13844 start: 6
13845 end: 13
13846 __name__:
13847 reason: Binary operation between two vectors removes metric names.
13848 kind: excluded
13849 fragment:
13850 start: 0
13851 end: 30
13852 job:
13853 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13854 kind: included
13855 fragment:
13856 start: 9
13857 end: 12
13858 returns: vector
13859 operations:
13860 - node: '[*parser.VectorSelector] foo'
13861 op: ""
13862 joins:
13863 - addedlabels: []
13864 depth: 0
13865 fill:
13866 lhs: 0
13867 rhs: 0
13868 ison: true
13869 matchinglabels:
13870 - job
13871 op: +
13872 src:
13873 returns: vector
13874 operations:
13875 - node: '[*parser.VectorSelector] bar'
13876 op: ""
13877 position:
13878 start: 27
13879 end: 30
13880 type: selector
13881 needsFeatures:
13882 - feature: promql-binop-fill-modifiers
13883 name: fill
13884 fragments:
13885 - start: 14
13886 end: 18
13887 usedLabels:
13888 - job
13889 position:
13890 start: 0
13891 end: 3
13892 type: selector
13893 fixedLabels: true
13894
13895---
13896
13897[TestLabelsSourceWithFeatures/binop_fill_left_modifier_only - 1]
13898expr: foo + on(job) fill_left(0) bar
13899output:
13900 - labels:
13901 "":
13902 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13903 kind: excluded
13904 fragment:
13905 start: 6
13906 end: 13
13907 __name__:
13908 reason: Binary operation between two vectors removes metric names.
13909 kind: excluded
13910 fragment:
13911 start: 0
13912 end: 30
13913 job:
13914 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13915 kind: included
13916 fragment:
13917 start: 9
13918 end: 12
13919 returns: vector
13920 operations:
13921 - node: '[*parser.VectorSelector] foo'
13922 op: ""
13923 joins:
13924 - addedlabels: []
13925 depth: 0
13926 fill:
13927 lhs: 0
13928 rhs: 0
13929 ison: true
13930 matchinglabels:
13931 - job
13932 op: +
13933 src:
13934 returns: vector
13935 operations:
13936 - node: '[*parser.VectorSelector] bar'
13937 op: ""
13938 position:
13939 start: 27
13940 end: 30
13941 type: selector
13942 needsFeatures:
13943 - feature: promql-binop-fill-modifiers
13944 name: fill
13945 fragments:
13946 - start: 14
13947 end: 18
13948 usedLabels:
13949 - job
13950 position:
13951 start: 0
13952 end: 3
13953 type: selector
13954 fixedLabels: true
13955
13956---
13957
13958[TestLabelsSourceWithFeatures/binop_fill_modifier - 1]
13959expr: foo + on(job) fill(0) bar
13960output:
13961 - labels:
13962 "":
13963 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13964 kind: excluded
13965 fragment:
13966 start: 6
13967 end: 13
13968 __name__:
13969 reason: Binary operation between two vectors removes metric names.
13970 kind: excluded
13971 fragment:
13972 start: 0
13973 end: 25
13974 job:
13975 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
13976 kind: included
13977 fragment:
13978 start: 9
13979 end: 12
13980 returns: vector
13981 operations:
13982 - node: '[*parser.VectorSelector] foo'
13983 op: ""
13984 joins:
13985 - addedlabels: []
13986 depth: 0
13987 fill:
13988 lhs: 0
13989 rhs: 0
13990 ison: true
13991 matchinglabels:
13992 - job
13993 op: +
13994 src:
13995 returns: vector
13996 operations:
13997 - node: '[*parser.VectorSelector] bar'
13998 op: ""
13999 position:
14000 start: 22
14001 end: 25
14002 type: selector
14003 needsFeatures:
14004 - feature: promql-binop-fill-modifiers
14005 name: fill
14006 fragments:
14007 - start: 14
14008 end: 18
14009 usedLabels:
14010 - job
14011 position:
14012 start: 0
14013 end: 3
14014 type: selector
14015 fixedLabels: true
14016
14017---
14018
14019[TestLabelsSourceWithFeatures/binop_fill_right_modifier_only - 1]
14020expr: foo + on(job) fill_right(0) bar
14021output:
14022 - labels:
14023 "":
14024 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
14025 kind: excluded
14026 fragment:
14027 start: 6
14028 end: 13
14029 __name__:
14030 reason: Binary operation between two vectors removes metric names.
14031 kind: excluded
14032 fragment:
14033 start: 0
14034 end: 31
14035 job:
14036 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
14037 kind: included
14038 fragment:
14039 start: 9
14040 end: 12
14041 returns: vector
14042 operations:
14043 - node: '[*parser.VectorSelector] foo'
14044 op: ""
14045 joins:
14046 - addedlabels: []
14047 depth: 0
14048 fill:
14049 lhs: 0
14050 rhs: 0
14051 ison: true
14052 matchinglabels:
14053 - job
14054 op: +
14055 src:
14056 returns: vector
14057 operations:
14058 - node: '[*parser.VectorSelector] bar'
14059 op: ""
14060 position:
14061 start: 28
14062 end: 31
14063 type: selector
14064 needsFeatures:
14065 - feature: promql-binop-fill-modifiers
14066 name: fill
14067 fragments:
14068 - start: 14
14069 end: 18
14070 usedLabels:
14071 - job
14072 position:
14073 start: 0
14074 end: 3
14075 type: selector
14076 fixedLabels: true
14077
14078---
14079
14080[TestLabelsSourceWithFeatures/duration_expression_in_matrix_selector - 1]
14081expr: foo[11s+10s]
14082output:
14083 - returns: matrix
14084 operations:
14085 - node: '[*parser.VectorSelector] foo'
14086 op: ""
14087 needsFeatures:
14088 - feature: promql-duration-expr
14089 name: duration_expr
14090 fragments:
14091 - start: 4
14092 end: 11
14093 position:
14094 start: 0
14095 end: 3
14096 type: selector
14097
14098---
14099
14100[TestLabelsSourceWithFeatures/duration_expression_in_subquery_offset_expr - 1]
14101expr: max_over_time(foo[1h:5m] offset (5m+1m))
14102output:
14103 - returns: vector
14104 operations:
14105 - node: '[*parser.VectorSelector] foo'
14106 op: ""
14107 - node: '[*parser.Call] max_over_time(foo[1h:5m] offset (5m + 1m))'
14108 op: max_over_time
14109 needsFeatures:
14110 - feature: promql-duration-expr
14111 name: duration_expr
14112 fragments:
14113 - start: 33
14114 end: 38
14115 position:
14116 start: 14
14117 end: 40
14118 type: function
14119
14120---
14121
14122[TestLabelsSourceWithFeatures/duration_expression_in_subquery_range - 1]
14123expr: max_over_time(rate(foo[5m])[1h+10m:5m])
14124output:
14125 - returns: vector
14126 operations:
14127 - node: '[*parser.VectorSelector] foo'
14128 op: ""
14129 - node: '[*parser.Call] rate(foo[5m])'
14130 op: rate
14131 - node: '[*parser.Call] max_over_time(rate(foo[5m])[1h + 10m:5m])'
14132 op: max_over_time
14133 needsFeatures:
14134 - feature: promql-duration-expr
14135 name: duration_expr
14136 fragments:
14137 - start: 28
14138 end: 34
14139 position:
14140 start: 14
14141 end: 38
14142 type: function
14143
14144---
14145
14146[TestLabelsSourceWithFeatures/duration_expression_in_subquery_range_and_step - 1]
14147expr: max_over_time(rate(foo[5m])[1h+10m:5m+1m])
14148output:
14149 - returns: vector
14150 operations:
14151 - node: '[*parser.VectorSelector] foo'
14152 op: ""
14153 - node: '[*parser.Call] rate(foo[5m])'
14154 op: rate
14155 - node: '[*parser.Call] max_over_time(rate(foo[5m])[1h + 10m:5m + 1m])'
14156 op: max_over_time
14157 needsFeatures:
14158 - feature: promql-duration-expr
14159 name: duration_expr
14160 fragments:
14161 - start: 28
14162 end: 34
14163 - start: 35
14164 end: 40
14165 position:
14166 start: 14
14167 end: 41
14168 type: function
14169
14170---
14171
14172[TestLabelsSourceWithFeatures/duration_expression_in_subquery_step - 1]
14173expr: max_over_time(foo[1h:5m+1m])
14174output:
14175 - returns: vector
14176 operations:
14177 - node: '[*parser.VectorSelector] foo'
14178 op: ""
14179 - node: '[*parser.Call] max_over_time(foo[1h:5m + 1m])'
14180 op: max_over_time
14181 needsFeatures:
14182 - feature: promql-duration-expr
14183 name: duration_expr
14184 fragments:
14185 - start: 21
14186 end: 26
14187 position:
14188 start: 14
14189 end: 27
14190 type: function
14191
14192---
14193
14194[TestLabelsSourceWithFeatures/duration_expression_in_vector_offset - 1]
14195expr: foo offset 5m+1m
14196output:
14197 - returns: vector
14198 operations:
14199 - node: '[*parser.VectorSelector] foo offset 5m'
14200 op: ""
14201 position:
14202 start: 0
14203 end: 13
14204 type: selector
14205
14206---
14207
14208[TestLabelsSourceWithFeatures/duration_expression_in_vector_selector_offset_expr - 1]
14209expr: foo offset (5m+1m)
14210output:
14211 - returns: vector
14212 operations:
14213 - node: '[*parser.VectorSelector] foo offset (5m + 1m)'
14214 op: ""
14215 needsFeatures:
14216 - feature: promql-duration-expr
14217 name: duration_expr
14218 fragments:
14219 - start: 12
14220 end: 17
14221 position:
14222 start: 0
14223 end: 18
14224 type: selector
14225
14226---
14227
14228[TestLabelsSourceWithFeatures/duration_expression_inside_rate - 1]
14229expr: rate(foo[5m+1m])
14230output:
14231 - returns: vector
14232 operations:
14233 - node: '[*parser.VectorSelector] foo'
14234 op: ""
14235 - node: '[*parser.Call] rate(foo[5m + 1m])'
14236 op: rate
14237 needsFeatures:
14238 - feature: promql-duration-expr
14239 name: duration_expr
14240 fragments:
14241 - start: 9
14242 end: 14
14243 position:
14244 start: 5
14245 end: 15
14246 type: function
14247
14248---
14249
14250[TestLabelsSourceWithFeatures/duration_expression_with_smoothed_modifier - 1]
14251expr: rate(foo[5m+1m] smoothed)
14252output:
14253 - returns: vector
14254 operations:
14255 - node: '[*parser.VectorSelector] foo smoothed'
14256 op: ""
14257 - node: '[*parser.Call] rate(foo[5m + 1m] smoothed)'
14258 op: rate
14259 needsFeatures:
14260 - feature: promql-extended-range-selectors
14261 name: smoothed
14262 fragments:
14263 - start: 5
14264 end: 8
14265 - feature: promql-duration-expr
14266 name: duration_expr
14267 fragments:
14268 - start: 9
14269 end: 14
14270 position:
14271 start: 5
14272 end: 15
14273 type: function
14274 rangeSelectorMode: smoothed
14275
14276---
14277
14278[TestLabelsSourceWithFeatures/experimental_function_with_fill_modifier - 1]
14279expr: mad_over_time(foo[5m]) + on(job) fill(0) bar
14280output:
14281 - labels:
14282 "":
14283 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
14284 kind: excluded
14285 fragment:
14286 start: 25
14287 end: 32
14288 __name__:
14289 reason: Binary operation between two vectors removes metric names.
14290 kind: excluded
14291 fragment:
14292 start: 0
14293 end: 44
14294 job:
14295 reason: Query is using one-to-one vector matching with `on(job)`, only labels included inside `on(...)` will be present on the results.
14296 kind: included
14297 fragment:
14298 start: 28
14299 end: 31
14300 returns: vector
14301 operations:
14302 - node: '[*parser.VectorSelector] foo'
14303 op: ""
14304 - node: '[*parser.Call] mad_over_time(foo[5m])'
14305 op: mad_over_time
14306 joins:
14307 - addedlabels: []
14308 depth: 0
14309 fill:
14310 lhs: 0
14311 rhs: 0
14312 ison: true
14313 matchinglabels:
14314 - job
14315 op: +
14316 src:
14317 returns: vector
14318 operations:
14319 - node: '[*parser.VectorSelector] bar'
14320 op: ""
14321 position:
14322 start: 41
14323 end: 44
14324 type: selector
14325 needsFeatures:
14326 - feature: promql-experimental-functions
14327 name: mad_over_time
14328 fragments:
14329 - start: 0
14330 end: 13
14331 - feature: promql-binop-fill-modifiers
14332 name: fill
14333 fragments:
14334 - start: 33
14335 end: 37
14336 usedLabels:
14337 - job
14338 position:
14339 start: 14
14340 end: 21
14341 type: function
14342 fixedLabels: true
14343
14344---
14345
14346[TestLabelsSourceWithFeatures/experimental_function_with_smoothed_modifier - 1]
14347expr: mad_over_time(foo[5m] smoothed)
14348output:
14349 - returns: vector
14350 operations:
14351 - node: '[*parser.VectorSelector] foo smoothed'
14352 op: ""
14353 - node: '[*parser.Call] mad_over_time(foo[5m] smoothed)'
14354 op: mad_over_time
14355 needsFeatures:
14356 - feature: promql-extended-range-selectors
14357 name: smoothed
14358 fragments:
14359 - start: 14
14360 end: 17
14361 - feature: promql-experimental-functions
14362 name: mad_over_time
14363 fragments:
14364 - start: 0
14365 end: 13
14366 position:
14367 start: 14
14368 end: 21
14369 type: function
14370 rangeSelectorMode: smoothed
14371
14372---
14373
14374[TestLabelsSourceWithFeatures/fill_with_group_left - 1]
14375expr: foo + on(job) group_left() fill(0) bar
14376output:
14377 - labels:
14378 __name__:
14379 reason: Binary operation between two vectors removes metric names.
14380 kind: excluded
14381 fragment:
14382 start: 0
14383 end: 38
14384 job:
14385 reason: Query is using many-to-one vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
14386 kind: included
14387 fragment:
14388 start: 9
14389 end: 12
14390 returns: vector
14391 operations:
14392 - node: '[*parser.VectorSelector] foo'
14393 op: ""
14394 joins:
14395 - addedlabels: []
14396 depth: 0
14397 fill:
14398 lhs: 0
14399 rhs: 0
14400 ison: true
14401 matchinglabels:
14402 - job
14403 op: +
14404 src:
14405 returns: vector
14406 operations:
14407 - node: '[*parser.VectorSelector] bar'
14408 op: ""
14409 position:
14410 start: 35
14411 end: 38
14412 type: selector
14413 needsFeatures:
14414 - feature: promql-binop-fill-modifiers
14415 name: fill
14416 fragments:
14417 - start: 27
14418 end: 31
14419 usedLabels:
14420 - job
14421 position:
14422 start: 0
14423 end: 3
14424 type: selector
14425
14426---
14427
14428[TestLabelsSourceWithFeatures/fill_with_group_right - 1]
14429expr: foo + on(job) group_right() fill(0) bar
14430output:
14431 - labels:
14432 __name__:
14433 reason: Binary operation between two vectors removes metric names.
14434 kind: excluded
14435 fragment:
14436 start: 0
14437 end: 39
14438 job:
14439 reason: Query is using one-to-many vector matching with `on(job)`, labels included inside `on(...)` will be present on the results.
14440 kind: included
14441 fragment:
14442 start: 9
14443 end: 12
14444 returns: vector
14445 operations:
14446 - node: '[*parser.VectorSelector] bar'
14447 op: ""
14448 joins:
14449 - addedlabels: []
14450 depth: 0
14451 fill:
14452 lhs: 0
14453 rhs: 0
14454 ison: true
14455 matchinglabels:
14456 - job
14457 op: +
14458 src:
14459 returns: vector
14460 operations:
14461 - node: '[*parser.VectorSelector] foo'
14462 op: ""
14463 position:
14464 start: 0
14465 end: 3
14466 type: selector
14467 needsFeatures:
14468 - feature: promql-binop-fill-modifiers
14469 name: fill
14470 fragments:
14471 - start: 28
14472 end: 32
14473 usedLabels:
14474 - job
14475 position:
14476 start: 36
14477 end: 39
14478 type: selector
14479
14480---
14481
14482[TestLabelsSourceWithFeatures/limit_ratio_aggregator - 1]
14483expr: limit_ratio(0.5, foo) by(job)
14484output:
14485 - labels:
14486 "":
14487 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
14488 kind: excluded
14489 fragment:
14490 start: 22
14491 end: 24
14492 __name__:
14493 reason: Aggregation removes metric name.
14494 kind: excluded
14495 fragment:
14496 start: 0
14497 end: 29
14498 job:
14499 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
14500 kind: included
14501 fragment:
14502 start: 25
14503 end: 28
14504 returns: vector
14505 operations:
14506 - node: '[*parser.VectorSelector] foo'
14507 op: ""
14508 - args:
14509 - "0.5"
14510 node: '[*parser.AggregateExpr] limit_ratio by (job) (0.5, foo)'
14511 op: limit_ratio
14512 needsFeatures:
14513 - feature: promql-experimental-functions
14514 name: limit_ratio
14515 fragments:
14516 - start: 0
14517 end: 11
14518 usedLabels:
14519 - job
14520 position:
14521 start: 17
14522 end: 20
14523 type: aggregation
14524 fixedLabels: true
14525
14526---
14527
14528[TestLabelsSourceWithFeatures/limit_ratio_with_without - 1]
14529expr: limit_ratio(0.5, foo) without(job)
14530output:
14531 - labels:
14532 __name__:
14533 reason: Aggregation removes metric name.
14534 kind: excluded
14535 fragment:
14536 start: 0
14537 end: 34
14538 job:
14539 reason: Query is using aggregation with `without(job)`, all labels included inside `without(...)` will be removed from the results.
14540 kind: excluded
14541 fragment:
14542 start: 30
14543 end: 33
14544 returns: vector
14545 operations:
14546 - node: '[*parser.VectorSelector] foo'
14547 op: ""
14548 - args:
14549 - "0.5"
14550 node: '[*parser.AggregateExpr] limit_ratio without (job) (0.5, foo)'
14551 op: limit_ratio
14552 needsFeatures:
14553 - feature: promql-experimental-functions
14554 name: limit_ratio
14555 fragments:
14556 - start: 0
14557 end: 11
14558 position:
14559 start: 17
14560 end: 20
14561 type: aggregation
14562
14563---
14564
14565[TestLabelsSourceWithFeatures/limitk - 1]
14566expr: limitk(5, foo)
14567output:
14568 - labels:
14569 "":
14570 reason: Query is using aggregation that removes all labels.
14571 kind: excluded
14572 fragment:
14573 start: 0
14574 end: 6
14575 __name__:
14576 reason: Aggregation removes metric name.
14577 kind: excluded
14578 fragment:
14579 start: 0
14580 end: 14
14581 returns: vector
14582 operations:
14583 - node: '[*parser.VectorSelector] foo'
14584 op: ""
14585 - args:
14586 - "5"
14587 node: '[*parser.AggregateExpr] limitk(5, foo)'
14588 op: limitk
14589 needsFeatures:
14590 - feature: promql-experimental-functions
14591 name: limitk
14592 fragments:
14593 - start: 0
14594 end: 6
14595 position:
14596 start: 10
14597 end: 13
14598 type: aggregation
14599 fixedLabels: true
14600
14601---
14602
14603[TestLabelsSourceWithFeatures/limitk_aggregator - 1]
14604expr: limitk(5, foo) by(job)
14605output:
14606 - labels:
14607 "":
14608 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
14609 kind: excluded
14610 fragment:
14611 start: 15
14612 end: 17
14613 __name__:
14614 reason: Aggregation removes metric name.
14615 kind: excluded
14616 fragment:
14617 start: 0
14618 end: 22
14619 job:
14620 reason: Query is using aggregation with `by(job)`, only labels included inside `by(...)` will be present on the results.
14621 kind: included
14622 fragment:
14623 start: 18
14624 end: 21
14625 returns: vector
14626 operations:
14627 - node: '[*parser.VectorSelector] foo'
14628 op: ""
14629 - args:
14630 - "5"
14631 node: '[*parser.AggregateExpr] limitk by (job) (5, foo)'
14632 op: limitk
14633 needsFeatures:
14634 - feature: promql-experimental-functions
14635 name: limitk
14636 fragments:
14637 - start: 0
14638 end: 6
14639 usedLabels:
14640 - job
14641 position:
14642 start: 10
14643 end: 13
14644 type: aggregation
14645 fixedLabels: true
14646
14647---
14648
14649[TestLabelsSourceWithFeatures/limitk_without_grouping - 1]
14650expr: limitk(5, foo)
14651output:
14652 - labels:
14653 "":
14654 reason: Query is using aggregation that removes all labels.
14655 kind: excluded
14656 fragment:
14657 start: 0
14658 end: 6
14659 __name__:
14660 reason: Aggregation removes metric name.
14661 kind: excluded
14662 fragment:
14663 start: 0
14664 end: 14
14665 returns: vector
14666 operations:
14667 - node: '[*parser.VectorSelector] foo'
14668 op: ""
14669 - args:
14670 - "5"
14671 node: '[*parser.AggregateExpr] limitk(5, foo)'
14672 op: limitk
14673 needsFeatures:
14674 - feature: promql-experimental-functions
14675 name: limitk
14676 fragments:
14677 - start: 0
14678 end: 6
14679 position:
14680 start: 10
14681 end: 13
14682 type: aggregation
14683 fixedLabels: true
14684
14685---
14686
14687[TestLabelsSourceWithFeatures/mad_over_time - 1]
14688expr: mad_over_time(foo[5m])
14689output:
14690 - returns: vector
14691 operations:
14692 - node: '[*parser.VectorSelector] foo'
14693 op: ""
14694 - node: '[*parser.Call] mad_over_time(foo[5m])'
14695 op: mad_over_time
14696 needsFeatures:
14697 - feature: promql-experimental-functions
14698 name: mad_over_time
14699 fragments:
14700 - start: 0
14701 end: 13
14702 position:
14703 start: 14
14704 end: 21
14705 type: function
14706
14707---
14708
14709[TestLabelsSourceWithFeatures/smoothed_matrix_selector_inside_rate - 1]
14710expr: rate(foo[5m] smoothed)
14711output:
14712 - returns: vector
14713 operations:
14714 - node: '[*parser.VectorSelector] foo smoothed'
14715 op: ""
14716 - node: '[*parser.Call] rate(foo[5m] smoothed)'
14717 op: rate
14718 needsFeatures:
14719 - feature: promql-extended-range-selectors
14720 name: smoothed
14721 fragments:
14722 - start: 5
14723 end: 8
14724 position:
14725 start: 5
14726 end: 12
14727 type: function
14728 rangeSelectorMode: smoothed
14729
14730---
14731
14732[TestLabelsSourceWithFeatures/sort_by_label - 1]
14733expr: sort_by_label(foo, "job")
14734output:
14735 - returns: vector
14736 operations:
14737 - node: '[*parser.VectorSelector] foo'
14738 op: ""
14739 - args:
14740 - '"job"'
14741 node: '[*parser.Call] sort_by_label(foo, "job")'
14742 op: sort_by_label
14743 needsFeatures:
14744 - feature: promql-experimental-functions
14745 name: sort_by_label
14746 fragments:
14747 - start: 0
14748 end: 13
14749 position:
14750 start: 14
14751 end: 17
14752 type: function
14753
14754---