File tree Expand file tree Collapse file tree 1 file changed +48
-1
lines changed Expand file tree Collapse file tree 1 file changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -645,7 +645,9 @@ spec:
645
645
value: "Bearer {{ args.api-token }}"
646
646
` ` `
647
647
648
- # # Handling Metric Results - NaN and Infinity
648
+ # # Handling Metric Results
649
+
650
+ # ## NaN and Infinity
649
651
Metric providers can sometimes return values of NaN (not a number) and infinity. Users can edit the `successCondition` and `failureCondition` fields
650
652
to handle these cases accordingly.
651
653
@@ -754,3 +756,48 @@ status:
754
756
startedAt: "2021-02-10T00:15:26Z"
755
757
` ` `
756
758
759
+ # ## Empty array
760
+
761
+ Metric providers can sometimes return empty array, e.g., no data returned from prometheus query.
762
+
763
+ Here are two examples where a metric result of empty array is considered successful and failed respectively.
764
+
765
+ ` ` ` yaml
766
+ apiVersion: argoproj.io/v1alpha1
767
+ kind: AnalysisRun
768
+ ...
769
+ successCondition: len(result) == 0 || result >= 0.95
770
+ status:
771
+ metricResults:
772
+ - count: 1
773
+ measurements:
774
+ - finishedAt: "2021-09-08T19:15:49Z"
775
+ phase: Successful
776
+ startedAt: "2021-09-08T19:15:49Z"
777
+ value: '[]'
778
+ name: success-rate
779
+ phase: Successful
780
+ successful: 1
781
+ phase: Successful
782
+ startedAt: "2021-09-08T19:15:49Z"
783
+ ` ` `
784
+
785
+ ` ` ` yaml
786
+ apiVersion: argoproj.io/v1alpha1
787
+ kind: AnalysisRun
788
+ ...
789
+ successCondition: len(result) > 0 && result >= 0.95
790
+ status:
791
+ metricResults:
792
+ - count: 1
793
+ measurements:
794
+ - finishedAt: "2021-09-08T19:19:44Z"
795
+ phase: Failed
796
+ startedAt: "2021-09-08T19:19:44Z"
797
+ value: '[]'
798
+ name: success-rate
799
+ phase: Failed
800
+ successful: 1
801
+ phase: Failed
802
+ startedAt: "2021-09-08T19:19:44Z"
803
+ ` ` `
You can’t perform that action at this time.
0 commit comments