Skip to content

Commit

Permalink
Document the canary analysis timespan
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Jan 3, 2019
1 parent 5d0939a commit 083556b
Showing 1 changed file with 71 additions and 1 deletion.
72 changes: 71 additions & 1 deletion docs/gitbook/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,54 @@ Gated canary promotion stages:
You can change the canary analysis _max weight_ and the _step weight_ percentage in the Flagger's custom resource.
### Canary Analisys
### Canary Analysis
Spec:
```yaml
canaryAnalysis:
# max number of failed metric checks before rollback
threshold: 10
# max traffic percentage routed to canary
# percentage (0-100)
maxWeight: 50
# canary increment step
# percentage (0-100)
stepWeight: 5
```
You can determine the minimum time that it takes to validate and promote a canary deployment using this formula:
```
controlLoopInterval * (maxWeight / stepWeight)
```

And the time it takes for a canary to be rollback:

```
controlLoopInterval * threshold
```

#### HTTP Metrics

The canary analysis is using the following Prometheus queries:

**HTTP requests success rate percentage**

Spec:

```yaml
canaryAnalysis:
metrics:
- name: istio_requests_total
# minimum req success rate (non 5xx responses)
# percentage (0-100)
threshold: 99
interval: 1m
```
Query:
```javascript
sum(
rate(
Expand All @@ -135,6 +177,20 @@ sum(

**HTTP requests milliseconds duration P99**

Spec:

```yaml
canaryAnalysis:
metrics:
- name: istio_request_duration_seconds_bucket
# maximum req duration P99
# milliseconds
threshold: 500
interval: 1m
```
Query:
```javascript
histogram_quantile(0.99,
sum(
Expand All @@ -149,10 +205,24 @@ histogram_quantile(0.99,
)
```

#### Webhooks

The canary analysis can be extended with webhooks.
Flagger would call a URL (HTTP POST) and determine from the response status code (HTTP 2xx) if the canary is failing or not.

Spec:

```yaml
canaryAnalysis:
webhooks:
- name: integration-tests
url: http://podinfo.test:9898/echo
timeout: 1m
metadata:
test: "all"
token: "16688eb5e9f289f1991c"
```
Webhook payload:
```json
Expand Down

0 comments on commit 083556b

Please sign in to comment.