You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analysis arguments defined in a Rollout are merged with the args from the AnalysisTemplate when the AnalysisRun is created.
@@ -411,7 +411,7 @@ spec:
411
411
templates:
412
412
- templateName: args-example
413
413
args:
414
-
# required value
414
+
# required value
415
415
- name: service-name
416
416
value: guestbook-svc.default.svc.cluster.local
417
417
# override default value
@@ -485,19 +485,19 @@ spec:
485
485
```
486
486
487
487
In this example, the Rollout creates a pre-promotion AnalysisRun once the new ReplicaSet is fully available.
488
-
The Rollout will not switch traffic to the new version until the analysis run finishes successfully.
488
+
The Rollout will not switch traffic to the new version until the analysis run finishes successfully.
489
489
490
490
Note: if the`autoPromotionSeconds` field is specified and the Rollout has waited auto promotion seconds amount of time,
491
491
the Rollout marks the AnalysisRun successful and switches the traffic to a new version automatically. If the AnalysisRun
492
-
completes before then, the Rollout will not create another AnalysisRun and wait out the rest of the
492
+
completes before then, the Rollout will not create another AnalysisRun and wait out the rest of the
493
493
`autoPromotionSeconds`.
494
494
495
495
## BlueGreen Post Promotion Analysis
496
496
497
497
A Rollout using a BlueGreen strategy can launch an analysis run *after* the traffic switch to the new version using
498
498
post-promotion analysis. If post-promotion Analysis fails or errors, the Rollout enters an aborted state and switches traffic back to the
499
499
previous stable Replicaset. When post-analysis is Successful, the Rollout is considered fully promoted and
500
-
the new ReplicaSet will be marked as stable. The old ReplicaSet will then be scaled down according to
500
+
the new ReplicaSet will be marked as stable. The old ReplicaSet will then be scaled down according to
501
501
`scaleDownDelaySeconds`(default 30 seconds).
502
502
503
503
```yaml
@@ -522,8 +522,8 @@ spec:
522
522
523
523
## Failure Conditions
524
524
525
-
`failureCondition`can be used to cause an analysis run to fail. The following example continually polls a prometheus
526
-
server to get the total number of errors every 5 minutes, causing the analysis run to fail if 10 or more errors were
525
+
`failureCondition`can be used to cause an analysis run to fail. The following example continually polls a prometheus
526
+
server to get the total number of errors every 5 minutes, causing the analysis run to fail if 10 or more errors were
527
527
encountered.
528
528
529
529
```yaml hl_lines="4"
@@ -546,7 +546,7 @@ encountered.
546
546
Analysis runs can also be considered `Inconclusive`, which indicates the run was neither successful,
547
547
nor failed. Inconclusive runs causes a rollout to become paused at its current step. Manual
548
548
intervention is then needed to either resume the rollout, or abort. One example of how analysis runs
549
-
could become `Inconclusive`, is when a metric defines no success or failure conditions.
549
+
could become `Inconclusive`, is when a metric defines no success or failure conditions.
550
550
551
551
```yaml
552
552
metrics:
@@ -575,17 +575,17 @@ A use case for having `Inconclusive` analysis runs are to enable Argo Rollouts t
575
575
whether or not measurement value is acceptable and decide to proceed or abort.
576
576
577
577
## Delay Analysis Runs
578
-
If the analysis run does not need to start immediately (i.e give the metric provider time to collect
578
+
If the analysis run does not need to start immediately (i.e give the metric provider time to collect
579
579
metrics on the canary version), Analysis Runs can delay the specific metric analysis. Each metric
580
-
can be configured to have a different delay. In additional to the metric specific delays, the rollouts
580
+
can be configured to have a different delay. In additional to the metric specific delays, the rollouts
581
581
with background analysis can delay creating an analysis run until a certain step is reached
582
582
583
583
Delaying a specific analysis metric:
584
584
```yaml hl_lines="3 4"
585
585
metrics:
586
586
- name: success-rate
587
587
# Do not start this analysis until 5 minutes after the analysis run starts
588
-
initialDelay: 5m
588
+
initialDelay: 5m
589
589
successCondition: result[0] >= 0.90
590
590
provider:
591
591
prometheus:
@@ -602,7 +602,7 @@ metadata:
602
602
name: guestbook
603
603
spec:
604
604
strategy:
605
-
canary:
605
+
canary:
606
606
analysis:
607
607
templates:
608
608
- templateName: success-rate
@@ -642,7 +642,7 @@ spec:
642
642
web:
643
643
headers:
644
644
- key: Authorization
645
-
value: "Bearer {{ args.api-token }}"
645
+
value: "Bearer {{ args.api-token }}"
646
646
```
647
647
648
648
## Handling Metric Results
@@ -758,6 +758,8 @@ status:
758
758
759
759
### Empty array
760
760
761
+
#### Prometheus
762
+
761
763
Metric providers can sometimes return empty array, e.g., no data returned from prometheus query.
762
764
763
765
Here are two examples where a metric result of empty array is considered successful and failed respectively.
@@ -801,3 +803,17 @@ status:
801
803
phase: Failed
802
804
startedAt: "2021-09-08T19:19:44Z"
803
805
```
806
+
807
+
#### Datadog
808
+
809
+
Datadog queries can return empty results if the query takes place during a time interval with no metrics. The Datadog provider will return a `nil` value yielding an error during the evaluation phase like:
810
+
811
+
```
812
+
invalid operation: < (mismatched types <nil> and float64)
813
+
```
814
+
815
+
However, empty query results yielding a `nil` value can be handled using the `default()` function. Here is a succeeding example using the `default()` function:
0 commit comments