Skip to content

Commit da1817d

Browse files
authored
Documentation for Iter8 metrics (#627)
* multidb * Creating new Iter8 metrics * prometheus metric descriptions * prometheus with basic auth * new relic documentation * block chomped yaml * sysdig documentation * complete documentation for metrics * Elastic documentation * Updated sample experiment in metrics documentation * relative slack unfurl path * DBs * Providers in slack expansion * Shorter slack description * Fixed installation instructions * Fixed install instructions * Updated install and conformance tests * Updated installation and platform setup * Updated check.sh * Fixed documentation for metrics * check.sh for mirroring * image url * Fixing illustration.png absolute path * Updated install and quickstart instructions
1 parent 06c808e commit da1817d

File tree

17 files changed

+748
-73
lines changed

17 files changed

+748
-73
lines changed

mkdocs/docs/concepts/buildingblocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ When two or more versions participate in an experiment, Iter8 **recommends a ver
3939

4040
## Metrics
4141

42-
Metric backends like Prometheus, New Relic, Sysdig and Elastic collect metrics for deployed versions and serve them through REST APIs. Iter8 defines a new Kubernetes resource called **Metric** that makes it easy to use metrics in experiments from any RESTful metrics backend.
42+
Metric providers like **Prometheus**, **New Relic**, **Sysdig** and **Elastic** can collect metrics for versions and serve them through REST APIs. Iter8 defines a new Kubernetes resource called **Metric** that makes it easy to use metrics in experiments from these and any other RESTful metrics provider.
4343

4444
## Objectives
4545

mkdocs/docs/concepts/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Iter8 makes it easy to achieve the following goals.
1414
- **Progressive** traffic shifting.
1515
- **Dark launches**, **traffic mirroring** and **traffic segmentation**.
1616
- Use Helm, Kustomize, and plain YAML/JSON for defining your app manifests.
17-
- Use out-of-the-box metrics or define custom metrics based on data in **Prometheus**.
17+
- Use metrics from any RESTful provider including **Prometheus**, **New Relic**, **Sysdig**, and **Elastic**.
1818
- Statistically rigorous evaluation of versions, traffic splitting, and promotion/rollback decisions using **Bayesian learning** and **multi-armed bandit** algorithms.
1919
- Observe experiments in realtime.
2020

mkdocs/docs/getting-started/install.md

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,18 @@ title: Installation
55

66
# Installation
77

8-
## Step 1: Iter8
8+
## Iter8
99

10-
!!! example "Prerequisites"
11-
12-
1. A Kubernetes cluster
13-
2. [kubectl CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
14-
15-
Install Iter8 in your Kubernetes cluster as follows.
10+
Install Iter8 in your Kubernetes cluster as follows. This installation requires [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/).
1611

1712
```shell
18-
export TAG=v0.3.2
13+
export TAG=v0.4.3
1914
curl -s https://raw.githubusercontent.com/iter8-tools/iter8-install/main/install.sh | bash
2015
```
2116

22-
## (Optional) Step 2: Prometheus add-on
23-
24-
Install Iter8's Prometheus add-on in your cluster as follows. This step assumes you have installed Iter8 following Step 1 above.
25-
26-
```shell
27-
export TAG=v0.3.2
28-
curl -s https://raw.githubusercontent.com/iter8-tools/iter8-install/main/install-prom-add-on.sh | bash
29-
```
30-
31-
??? note "Running Iter8 tutorials without Iter8's Prometheus add-on"
32-
When you installed Iter8 in the first step above, you also installed several *out-of-the-box* Iter8 metric resources. They are required for running the tutorials documented on this site.
33-
34-
The out-of-the-box metric resources have a urlTemplate field. This field is configured as the URL of the Prometheus instance created in this step.
35-
36-
You can skip this step and still run Iter8 tutorials using your own Prometheus instance. To do so, ensure that your Prometheus instance scrapes the end-points that would have been scraped by the Prometheus instance created in this step, and configure the urlTemplate fields of Iter8 metric resources to match the URL of your Prometheus instance.
37-
38-
## (Optional) Step 3: iter8ctl
39-
The iter8ctl CLI enables real-time observability of Iter8 experiments.
40-
41-
!!! example "Prerequisites"
42-
43-
Go 1.13+
17+
## iter8ctl (optional)
18+
The `iter8ctl` client facilitates real-time observability of Iter8 experiments. Install `iter8ctl` on your local machine as follows. This installation requires Go 1.13+.
4419

4520
```shell
46-
GO111MODULE=on GOBIN=/usr/local/bin go get github.com/iter8-tools/[email protected].2
21+
GO111MODULE=on GOBIN=/usr/local/bin go get github.com/iter8-tools/[email protected].3
4722
```

mkdocs/docs/getting-started/quick-start/with-knative.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Observe the experiment in realtime. Paste commands from the tabs below in separa
251251
=== "iter8ctl"
252252
Install `iter8ctl`. You can change the directory where `iter8ctl` binary is installed by changing `GOBIN` below.
253253
```shell
254-
GO111MODULE=on GOBIN=/usr/local/bin go get github.com/iter8-tools/[email protected].2
254+
GO111MODULE=on GOBIN=/usr/local/bin go get github.com/iter8-tools/[email protected].3
255255
```
256256

257257
Periodically describe the experiment.
@@ -261,7 +261,7 @@ Observe the experiment in realtime. Paste commands from the tabs below in separa
261261
sleep 4
262262
done
263263
```
264-
??? info "iter8ctl output"
264+
??? info "Look inside `iter8ctl` output"
265265
The `iter8ctl` output will be similar to the following.
266266
```shell
267267
****** Overview ******

mkdocs/docs/images/illustration.png

-1.05 KB
Loading

mkdocs/docs/images/whatisiter8.png

-9.55 KB
Loading

mkdocs/docs/metrics/defining-iter8-metrics.md

Lines changed: 645 additions & 0 deletions
Large diffs are not rendered by default.

mkdocs/docs/metrics/using-metrics.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ template: main.html
55
# Using Metrics in Experiments
66

77
!!! tip "Iter8 metrics API"
8-
Iter8 defines a new Kubernetes resource called Metric that makes it easy to use metrics in experiments from RESTful metric backends like Prometheus, New Relic, Sysdig and Elastic.
8+
Iter8 defines a new Kubernetes resource called Metric that makes it easy to use metrics in experiments from RESTful metric providers like Prometheus, New Relic, Sysdig and Elastic.
99

1010
List metrics available in your cluster using the `kubectl get metrics.iter8.tools` command. Use metrics in experiments by referencing them in experiment criteria.
1111

@@ -18,11 +18,11 @@ kubectl get metrics.iter8.tools --all-namespaces
1818

1919
```shell
2020
NAMESPACE NAME TYPE DESCRIPTION
21-
iter8-knative 95th-percentile-tail-latency gauge 95th percentile tail latency
22-
iter8-knative error-count counter Number of error responses
23-
iter8-knative error-rate gauge Fraction of requests with error responses
24-
iter8-knative mean-latency gauge Mean latency
25-
iter8-knative request-count counter Number of requests
21+
iter8-knative 95th-percentile-tail-latency Gauge 95th percentile tail latency
22+
iter8-knative error-count Counter Number of error responses
23+
iter8-knative error-rate Gauge Fraction of requests with error responses
24+
iter8-knative mean-latency Gauge Mean latency
25+
iter8-knative request-count Counter Number of requests
2626
```
2727

2828
## Referencing metrics

mkdocs/docs/reference/apispec.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ template: main.html
88
The Iter8 API provides two [Kubernetes custom resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) to automate metrics and AI-driven experiments, progressive delivery, and rollout of Kubernetes and OpenShift apps.
99

1010
1. The **Experiment** resource provides expressive controls required by application developers and service operators who wish to automate new releases of their apps in a robust, principled and metrics-driven manner. These controls encompass [testing, deployment, traffic shaping, and version promotion functions](../../../concepts/buildingblocks/) and can be flexibly composed to automate [diverse use-cases](../../../tutorials/knative/canary-progressive/).
11-
2. The **Metric** resource encapsulates the REST query that is used by Iter8 for retrieving a metric value from the metrics backend. Metrics are referenced in experiments.
11+
2. The **Metric** resource encapsulates the REST query that is used by Iter8 for retrieving a metric value from the metrics provider. Metrics are referenced in experiments.
1212

1313

1414
!!! note "API Version"
@@ -132,16 +132,19 @@ Standard Kubernetes [meta.v1/ObjectMeta](https://kubernetes.io/docs/reference/ge
132132
#### Spec
133133
| Field name | Field type | Description | Required |
134134
| ----- | ------------ | ----------- | -------- |
135-
| params | [][NamedValue](#namedvalue) | List of name/value pairs corresponding to the name and value of the HTTP query parameters used by Iter8 when querying the metrics backend. Each name represents a parameter name; the corresponding value is a string template with placeholders, which will be interpolated by Iter8 at query time. | No |
136-
| description | string | Human readable description. | No |
137-
| units | string | Units of measurement. Units are used only for display purposes. | No |
138-
| type | string | Metric type. Valid values are `counter` and `gauge`. Default value = `gauge`. | No |
139-
| sampleSize | string | Reference to a metric that represents the number of data points over which the metric value is computed. This field applies only to `gauge` metrics. References can be expressed in the form 'name' or 'namespace/name'. If just `name` is used, the implied namespace is the namespace of the referring metric. | No |
140-
| provider | string | Type of the metrics database. Provider is used only for display purposes. | No |
141-
| jqExpression | string | The [jq](https://stedolan.github.io/jq/) expression used by Iter8 to extract the metric value from the JSON response of the metrics backend to a metrics query. | Yes |
142-
| secret | string | Reference to a secret that contains information used for authenticating with the metrics database. In particular, Iter8 uses data in this secret to interpolate the HTTP headers and URL while querying the database. References can be expressed in the form 'name' or 'namespace/name'. If just `name` is used, the implied namespace is the namespace where Iter8 is installed (which is `iter8-system` by default). | No |
143-
| headerTemplates | [][NamedValue](#namedvalue) | List of templates for headers that should be added to metrics queries. Variable portions of the headers, expressed in the form `{.name}` will be replaced at runtime with the value of the `name` entry defined in the secret. If no value can be found in the secret, no replacement will be done. | No |
144-
| urlTemplate | string | Template for URL of metrics server. Variable portions of the URL, expressed in the form `{.name}` will be replaced at runtimme with the value of the `name` entry defined in the secret. If no value can be found in the secret, no replacement will be done. | Yes |
135+
| description | string | Human readable description. This field is meant for informational purposes. | No |
136+
| units | string | Units of measurement. This field is meant for informational purposes. | No |
137+
| provider | string | Type of the metrics provider. This field is meant for informational purposes. | No |
138+
| params | [][NamedValue](#namedvalue) | List of name/value pairs corresponding to the name and value of the HTTP query parameters used by Iter8 when querying the metrics provider. Each name represents a parameter name; the corresponding value is a string template with placeholders; the placeholders will be dynamically substituted by Iter8 with values at query time. | No |
139+
| body | string | String used to construct the JSON body of the HTTP request. Body may be templated, in which Iter8 will attempt to substitute placeholders in the template at query time using version information. | No |
140+
| type | string | Metric type. Valid values are `Counter` and `Gauge`. Default value = `Gauge`. A `Counter` metric is one whose value never decreases over time. A `Gauge` metric is one whose value may increase or decrease over time. | No |
141+
| method | string | HTTP method (verb) used in the HTTP request. Valid values are `GET` and `POST`. Default value = `GET`. | No |
142+
| authType | string | Identifies the type of authentication used in the HTTP request. Valid values are `Basic`, `Bearer` and `APIKey` which correspond to HTTP authentication with these respective methods. | No |
143+
| sampleSize | string | Reference to a metric that represents the number of data points over which the value of this metric is computed. This field applies only to `Gauge` metrics. References can be expressed in the form 'name' or 'namespace/name'. If just `name` is used, the implied namespace is the namespace of the referring metric. | No |
144+
| secret | string | Reference to a secret that contains information used for authenticating with the metrics provider. In particular, Iter8 uses data in this secret to substitute placeholders in the HTTP headers and URL while querying the provider. References can be expressed in the form 'name' or 'namespace/name'. If just `name` is used, the implied namespace is the namespace where Iter8 is installed (which is `iter8-system` by default). | No |
145+
| headerTemplates | [][NamedValue](#namedvalue) | List of name/value pairs corresponding to the name and value of the HTTP request headers used by Iter8 when querying the metrics provider. Each name represents a header field name; the corresponding value is a string template with placeholders; the placeholders will be dynamically substituted by Iter8 with values at query time. Placeholder substitution is attempted only if `authType` and `secret` fields are present. | No |
146+
| jqExpression | string | The [jq](https://stedolan.github.io/jq/) expression used by Iter8 to extract the metric value from the JSON response returned by the provider. | Yes |
147+
| urlTemplate | string | Template for the metric provider's URL. Typically, urlTemplate is expected to be the actual URL without any placeholders. However, urlTemplate may be templated, in which case, Iter8 will attempt to substitute placeholders in the urlTemplate at query time using the `secret` referenced in the metric. Placeholder substitution will not be attempted if `secret` is not specified. | Yes |
145148

146149
## Experiment field types
147150

@@ -214,7 +217,7 @@ Standard Kubernetes [meta.v1/ObjectMeta](https://kubernetes.io/docs/reference/ge
214217
| Field name | Field type | Description | Required |
215218
| ----- | ---- | ----------- | -------- |
216219
| name | string | Name of the version. | Yes |
217-
| variables | [][NamedValue](#namedvalue) | Variables are name-value pairs associated with a version. Metrics and tasks within experiment specs can contain strings with placeholders. Iter8 uses variables to interpolate these strings. | No |
220+
| variables | [][NamedValue](#namedvalue) | Variables are name-value pairs associated with a version. Metrics and tasks within experiment specs can contain strings with placeholders. Iter8 uses variables to substitute placeholders in these strings. | No |
218221
| weightObjRef | [corev1.ObjectReference](https://pkg.go.dev/k8s.io/[email protected]/core/v1#ObjectReference) | Reference to a Kubernetes resource and a field-path within the resource. Iter8 uses `weightObjRef` to get or set weight (traffic percentage) for the version. | No |
219222

220223

@@ -534,7 +537,7 @@ The `common` task library provides the `exec` task. Use this task to execute she
534537
- "sample-app" # release name
535538
- "--namespace=iter8-system" # release namespace
536539
- "sample-app" # chart name
537-
- "--values=https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/canaryprogressive/{{ .promote }}-values.yaml" # values URL dynamically interpolated
540+
- "--values=https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/canaryprogressive/{{ .promote }}-values.yaml" # placeholder is substituted dynamically
538541
```
539542

540543
=== "Kustomize"
@@ -562,21 +565,21 @@ The `common` task library provides the `exec` task. Use this task to execute she
562565
kustomize build github.com/iter8-tools/iter8/samples/knative/canaryfixedsplit/{{ .name }}?ref=master | kubectl apply -f -
563566
```
564567

565-
### Interpolation of task inputs
568+
### Placeholder substitution in task inputs
566569

567570
Inputs to tasks can contain placeholders, or template variables, which will be dynamically substituted when the task is executed by Iter8. For example, in the sample experiment above, one input is:
568571

569572
```bash
570573
"https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/quickstart/{{ .promote }}.yaml"
571574
```
572575

573-
In this case, the placeholder is `{{ .promote }}`. Variable interpolation works as follows.
576+
In this case, the placeholder is `{{ .promote }}`. Placeholder substitution in task inputs works as follows.
574577

575578
1. Iter8 will find the version recommended for promotion. This information is stored in the `status.versionRecommendedForPromotion` field of the experiment. The version recommended for promotion is the `winner`, if a `winner` has been found in the experiment. Otherwise, it is the baseline version supplied in the `spec.versionInfo` field of the experiment.
576579

577580
2. If the placeholder is `{{ .name }}`, Iter8 will substitute it with the name of the version recommended for promotion. Else, if it is any other variable, Iter8 will substitute it with the value of the corresponding variable for the version recommended for promotion. Variable values are specified in the `variables` field of the version detail. Note that variable values could have been supplied by the creator of the experiment, or by other tasks such as `init-experiment` that may already have been executed by Iter8 as part of the experiment.
578581

579-
??? example "Interpolation Example 1"
582+
??? example "Placeholder substitution Example 1"
580583

581584
Consider the sample experiment above. Suppose the `winner` of this experiment was `candidate`. Then:
582585

@@ -585,7 +588,7 @@ In this case, the placeholder is `{{ .promote }}`. Variable interpolation works
585588
3. The value of the placeholder for the version recommended for promotion is `candid`.
586589
4. The command executed by the `exec` task is then `kubectl apply -f https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/quickstart/candid.yaml`.
587590

588-
??? example "Interpolation Example 2"
591+
??? example "Placeholder substitution Example 2"
589592

590593
Consider the sample experiment above. Suppose the `winner` of this experiment was `current`. Then:
591594

@@ -594,7 +597,7 @@ In this case, the placeholder is `{{ .promote }}`. Variable interpolation works
594597
3. The value of the placeholder for the version recommended for promotion is `base`.
595598
4. The command executed by the `exec` task is then `kubectl apply -f https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/quickstart/base.yaml`.
596599

597-
??? example "Interpolation Example 3"
600+
??? example "Placeholder substitution Example 3"
598601

599602
Consider the sample experiment above. Suppose the experiment did not yield a `winner`. Then:
600603

@@ -604,7 +607,7 @@ In this case, the placeholder is `{{ .promote }}`. Variable interpolation works
604607
4. The command executed by the `exec` task is then `kubectl apply -f https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/quickstart/base.yaml`.
605608

606609
### Disable Interpolation (always do this in a `start` action)
607-
By default, the `common/exec` task will attempt to find the version recommended for promotion, and use its values to interpolate the inputs to the task. However, this behavior will lead to task failure since version recommended for promotion will be generally undefined at this stage of the experiment. To use the `common/exec` task as part of an experiment `start` action, set `disableInterpolation` to `true` as illustrated in the `kubectl/Helm/Kustomize` samples above.
610+
By default, the `common/exec` task will attempt to find the version recommended for promotion, and use its values to substitute placeholders in the inputs to the task. However, this behavior will lead to task failure since version recommended for promotion will be generally undefined at this stage of the experiment. To use the `common/exec` task as part of an experiment `start` action, set `disableInterpolation` to `true` as illustrated in the `kubectl/Helm/Kustomize` samples above.
608611

609612
### Error handling in tasks
610613
When a task exits with an error, it will result in the failure of the experiment to which it belongs.

0 commit comments

Comments
 (0)