From 0d91480fcb9f1321e03aef52f1225c6613e1dadd Mon Sep 17 00:00:00 2001 From: realanna Date: Mon, 25 Sep 2023 13:38:37 +0200 Subject: [PATCH 01/53] docs: add first iteration of analysis documentation Signed-off-by: realanna --- docs/content/en/docs/implementing/analysis.md | 101 ++++++++++++++++++ .../samples/metrics_v1alpha3_analysis.yaml | 2 +- ...etrics_v1alpha3_analysisvaluetemplate.yaml | 2 +- 3 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 docs/content/en/docs/implementing/analysis.md diff --git a/docs/content/en/docs/implementing/analysis.md b/docs/content/en/docs/implementing/analysis.md new file mode 100644 index 0000000000..3b9ecde063 --- /dev/null +++ b/docs/content/en/docs/implementing/analysis.md @@ -0,0 +1,101 @@ +--- +title: Analyses +description: Understand Analyses in Keptn and how to use them +weight: 150 +--- + +The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptnv1 under the name of Analysis. +With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. +At the end of the Analysis the status will return whether your objective failed or passed. + +This data can be seen as prometheus metrics and can be displayed on Grafana. + +## Keptn Analysis basics + +Keptn Analysis are implemented with three resources: + +* [Analysis](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysis) -- + define the specific configurations and the analysis to report +* [AnalysisDefinition](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisdefinition) -- + define the list of SLOs for an analysis +* [AnalysisValueTemplate](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- + define the SLI: the KeptnMetricsProvider and the Query to perform for each SLO + +### Define Analysis, Analysis Definition and AnalysisValueTemplate + +An Analysis customizes the templates defined inside an AnalysisDefinition by adding configurations such as: +* a Timeframe that specifies the range for the corresponding query in the AnalysisValueTemplate +* a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate + +An AnalysisDefinition contains a list of objectives to satisfy. +Each of these objectives: +* specifies failure or warning target criteria, +* specifies whether the objective is a key objective (its failure would fail the analysis) +* indicates the weight of the objective on the overall analysis +* refers to an AnalysisValueTemplate that contains the SLIs, so from what provider to gather the data and how to compute the analysis + +In each AnalysisValueTemplate we store the query for the analysis of the SLI. You must define a +[KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) resource +for each instance of each data provider you are using. +The template will refer to that provider and query it. + +Let's consider the following Analysis: + +{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} + +This cr setups the timeframe we are interested in as between 5am and 10am of the 5th of May 2023 , +and adds a few specific key-value pair that will be substituted in the query +for instance the query could contain a {{.nodename }} and this value will be substituted by test + +The definition of this Analysis is referenced by its name and namespace and can be seen here: + +{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml" >}} + +This simple definition contains a single objective, response-time-p95. For this objective there are both a +failure and warning criteria: + +* objective will fail if the percentile 95 is less than 600 +* there will be a warning in case the value is in between 300 and 500 + +The total score shows that this analysis should overall score 90% of all objectives to pass or 75 to get a warning. +Since the objective is one only, this means that we either will pass with 100% (response time is less than 600) or fail with 0%(slower response time) + +The objective points to the corresponding AnalysisValueTemplate: + +{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysisdvaluetemplate.yaml" >}} + +This template tell us that we will query a provider called prometheus using this query: +```shell + sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) +``` + +at runtime the metrics operator will try to substitute everything in {{. }} format with a key-value pair in the Analysis resource, +so in this case the query would become: + +```shell + sum(kube_pod_container_resource_limits{node='test'}) - sum(kube_node_status_capacity{node='test'}) +``` + +For a working example you can check [here]() + +## Accessing Analysis + +### Retrieve KeptnMetric values with kubectl +Use the `kubectl get` command to retrieve all the `Analysis` in your cluster: + +```shell +$ kubectl get analyses.metrics.keptn.sh -A + +``` +This will return something like + +```shell +NAMESPACE NAME ANALYSISDEFINITION STATE WARNING PASS +default analysis-sample ed-my-proj-dev-svc1 +``` + +You can than describe the analysis like so: + +```shell +kubectl describe analyses.metrics.keptn.sh analysis-sample -n=default +``` \ No newline at end of file diff --git a/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml b/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml index 63d71bb7ed..26b5af9e1a 100644 --- a/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml +++ b/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml @@ -16,7 +16,7 @@ spec: project: my-project stage: dev service: svc1 - foo: bar # can be any key/value pair; NOT only project/stage/service + nodename: test # can be any key/value pair; NOT only project/stage/service analysisDefinition: name: ed-my-proj-dev-svc1 namespace: keptn-lifecycle-toolkit-system diff --git a/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml b/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml index 790796adc9..c03d2d4e11 100644 --- a/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml +++ b/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml @@ -12,4 +12,4 @@ metadata: spec: provider: name: prometheus - query: "sum(kube_pod_container_resource_limits{resource='{{.Resource}}'}) - sum(kube_node_status_capacity{resource='{{.Resource}}'})" + query: "sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'})" From 900cd70913f69524b63e2b76cd05c797dbdd51d4 Mon Sep 17 00:00:00 2001 From: realanna Date: Mon, 25 Sep 2023 13:54:53 +0200 Subject: [PATCH 02/53] docs: lint Signed-off-by: realanna --- docs/content/en/docs/implementing/analysis.md | 4 ++-- docs/content/en/docs/migrate/metrics-observe/_index.md | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/content/en/docs/implementing/analysis.md b/docs/content/en/docs/implementing/analysis.md index 3b9ecde063..c1f58978b0 100644 --- a/docs/content/en/docs/implementing/analysis.md +++ b/docs/content/en/docs/implementing/analysis.md @@ -69,14 +69,14 @@ This template tell us that we will query a provider called prometheus using this sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -at runtime the metrics operator will try to substitute everything in {{. }} format with a key-value pair in the Analysis resource, +at runtime the metrics operator will try to substitute everything in '{{. }}' format with a key-value pair in the Analysis resource, so in this case the query would become: ```shell sum(kube_pod_container_resource_limits{node='test'}) - sum(kube_node_status_capacity{node='test'}) ``` -For a working example you can check [here]() +For a working example you can check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/analysis-controller-multiple-providers) ## Accessing Analysis diff --git a/docs/content/en/docs/migrate/metrics-observe/_index.md b/docs/content/en/docs/migrate/metrics-observe/_index.md index bba6d6ff8f..d82bf9d74c 100644 --- a/docs/content/en/docs/migrate/metrics-observe/_index.md +++ b/docs/content/en/docs/migrate/metrics-observe/_index.md @@ -20,9 +20,7 @@ and Keptn evaluations. > **Note** The full SLO capabilities provided by Keptn v1 such as weighting and scoring -are currently under development for Keptn. -You can follow and participate in the design and implementation process at -[GitHub Epic 1646](https://github.com/keptn/lifecycle-toolkit/issues/1646). +have a first implementation in the Analysis.[GitHub Epic 1646](https://github.com/keptn/lifecycle-toolkit/issues/1646). Notice the paradigm differences when implementing Keptn evaluations: From 940aa4fbed7447191ed665b44d7eb41d5062ab78 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:53:48 +0200 Subject: [PATCH 03/53] Update docs/content/en/docs/implementing/analysis.md Co-authored-by: Florian Bacher Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/analysis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/analysis.md b/docs/content/en/docs/implementing/analysis.md index c1f58978b0..05b2c0dadf 100644 --- a/docs/content/en/docs/implementing/analysis.md +++ b/docs/content/en/docs/implementing/analysis.md @@ -4,7 +4,7 @@ description: Understand Analyses in Keptn and how to use them weight: 150 --- -The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptnv1 under the name of Analysis. +The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v1 under the name of Analysis. With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. At the end of the Analysis the status will return whether your objective failed or passed. From f38f9e46cc5f08826fbf61af32b12c74157957f3 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:53:54 +0200 Subject: [PATCH 04/53] Update docs/content/en/docs/implementing/analysis.md Co-authored-by: Florian Bacher Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/analysis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/analysis.md b/docs/content/en/docs/implementing/analysis.md index 05b2c0dadf..296ceb7bf0 100644 --- a/docs/content/en/docs/implementing/analysis.md +++ b/docs/content/en/docs/implementing/analysis.md @@ -8,7 +8,7 @@ The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. At the end of the Analysis the status will return whether your objective failed or passed. -This data can be seen as prometheus metrics and can be displayed on Grafana. +This data can be seen as Prometheus metrics and can be displayed on Grafana. ## Keptn Analysis basics From d2704b3d34e80abebb6a40d2199d6e16e240b4d1 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:54:49 +0200 Subject: [PATCH 05/53] Update docs/content/en/docs/implementing/analysis.md Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/analysis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/analysis.md b/docs/content/en/docs/implementing/analysis.md index 296ceb7bf0..3a2b38b6a6 100644 --- a/docs/content/en/docs/implementing/analysis.md +++ b/docs/content/en/docs/implementing/analysis.md @@ -12,7 +12,7 @@ This data can be seen as Prometheus metrics and can be displayed on Grafana. ## Keptn Analysis basics -Keptn Analysis are implemented with three resources: +A Keptn Analysis is implemented with three resources: * [Analysis](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysis) -- define the specific configurations and the analysis to report From 3339243a6aad29ce20f7872cfc9e4794497d2b1c Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:55:29 +0200 Subject: [PATCH 06/53] Update docs/content/en/docs/implementing/analysis.md Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/analysis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/analysis.md b/docs/content/en/docs/implementing/analysis.md index 3a2b38b6a6..d50ca1677e 100644 --- a/docs/content/en/docs/implementing/analysis.md +++ b/docs/content/en/docs/implementing/analysis.md @@ -94,7 +94,7 @@ NAMESPACE NAME ANALYSISDEFINITION STATE WARNING PASS default analysis-sample ed-my-proj-dev-svc1 ``` -You can than describe the analysis like so: +You can then describe the analysis like so: ```shell kubectl describe analyses.metrics.keptn.sh analysis-sample -n=default From f057f52980551f5eafb9c3dc6308198367ad64ab Mon Sep 17 00:00:00 2001 From: realanna Date: Mon, 25 Sep 2023 15:38:13 +0200 Subject: [PATCH 07/53] fix: removed skip lint Signed-off-by: realanna --- .../en/docs/implementing/slo/_index.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 docs/content/en/docs/implementing/slo/_index.md diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md new file mode 100644 index 0000000000..d20349c5e4 --- /dev/null +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -0,0 +1,101 @@ +--- +title: Analyses +description: Understand Analyses in Keptn and how to use them +weight: 150 +cascade: + type: docs + currentversion: main +--- + +The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v1 under the name of Analysis. +With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. +At the end of the Analysis the status will return whether your objective failed or passed. + +This data can be seen as Prometheus metrics and can be displayed on Grafana. + +## Keptn Analysis basics + +A Keptn Analysis is implemented with three resources: + +* [Analysis](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysis) -- + define the specific configurations and the analysis to report +* [AnalysisDefinition](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisdefinition) -- + define the list of SLOs for an analysis +* [AnalysisValueTemplate](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- + define the SLI: the KeptnMetricsProvider and the Query to perform for each SLO + +### Define Analysis, Analysis Definition and AnalysisValueTemplate + +An Analysis customizes the templates defined inside an AnalysisDefinition by adding configurations such as: +* a Timeframe that specifies the range for the corresponding query in the AnalysisValueTemplate +* a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate + +An AnalysisDefinition contains a list of objectives to satisfy. +Each of these objectives: +* specifies failure or warning target criteria, +* specifies whether the objective is a key objective (its failure would fail the analysis) +* indicates the weight of the objective on the overall analysis +* refers to an AnalysisValueTemplate that contains the SLIs, so from what provider to gather the data and how to compute the analysis + +In each AnalysisValueTemplate we store the query for the analysis of the SLI. You must define a +[KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) resource +for each instance of each data provider you are using. +The template will refer to that provider and query it. + +Let's consider the following Analysis: + +{{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} + +This cr setups the timeframe we are interested in as between 5am and 10am of the 5th of May 2023 , +and adds a few specific key-value pair that will be substituted in the query +for instance the query could contain a {{.nodename }} and this value will be substituted by test + +The definition of this Analysis is referenced by its name and namespace and can be seen here: + +This simple definition contains a single objective, response-time-p95. For this objective there are both a +failure and warning criteria: + +* objective will fail if the percentile 95 is less than 600 +* there will be a warning in case the value is in between 300 and 500 + +The total score shows that this analysis should overall score 90% of all objectives to pass or 75 to get a warning. +Since the objective is one only, this means that we either will pass with 100% (response time is less than 600) or fail with 0%(slower response time) + +The objective points to the corresponding AnalysisValueTemplate: + + +This template tell us that we will query a provider called prometheus using this query: +```shell + sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) +``` + +at runtime the metrics operator will try to substitute everything in '{{. }}' format with a key-value pair in the Analysis resource, +so in this case the query would become: + +```shell + sum(kube_pod_container_resource_limits{node='test'}) - sum(kube_node_status_capacity{node='test'}) +``` + +For a working example you can check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/analysis-controller-multiple-providers) + +## Accessing Analysis + +### Retrieve KeptnMetric values with kubectl +Use the `kubectl get` command to retrieve all the `Analysis` in your cluster: + +```shell +$ kubectl get analyses.metrics.keptn.sh -A + +``` +This will return something like + +```shell +NAMESPACE NAME ANALYSISDEFINITION STATE WARNING PASS +default analysis-sample ed-my-proj-dev-svc1 +``` + +You can then describe the analysis like so: + +```shell +kubectl describe analyses.metrics.keptn.sh analysis-sample -n=default +``` \ No newline at end of file From 9ed6e3499a6b4a62977dfce9a9a2a8587693649a Mon Sep 17 00:00:00 2001 From: realanna Date: Mon, 25 Sep 2023 15:39:11 +0200 Subject: [PATCH 08/53] fix: removed skip lint Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index d20349c5e4..07a5503c2b 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -44,7 +44,7 @@ The template will refer to that provider and query it. Let's consider the following Analysis: -{{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} +{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} This cr setups the timeframe we are interested in as between 5am and 10am of the 5th of May 2023 , and adds a few specific key-value pair that will be substituted in the query @@ -52,6 +52,8 @@ for instance the query could contain a {{.nodename }} and this value will be sub The definition of this Analysis is referenced by its name and namespace and can be seen here: +{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml" >}} + This simple definition contains a single objective, response-time-p95. For this objective there are both a failure and warning criteria: @@ -63,6 +65,7 @@ Since the objective is one only, this means that we either will pass with 100% ( The objective points to the corresponding AnalysisValueTemplate: +{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysisdvaluetemplate.yaml" >}} This template tell us that we will query a provider called prometheus using this query: ```shell From 42c68f1e453fcf3c29c11442e3a65c430085cb33 Mon Sep 17 00:00:00 2001 From: realanna Date: Mon, 25 Sep 2023 15:44:54 +0200 Subject: [PATCH 09/53] fix: removed skip lint Signed-off-by: realanna --- docs/content/en/docs/implementing/analysis.md | 101 ------------------ 1 file changed, 101 deletions(-) delete mode 100644 docs/content/en/docs/implementing/analysis.md diff --git a/docs/content/en/docs/implementing/analysis.md b/docs/content/en/docs/implementing/analysis.md deleted file mode 100644 index d50ca1677e..0000000000 --- a/docs/content/en/docs/implementing/analysis.md +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: Analyses -description: Understand Analyses in Keptn and how to use them -weight: 150 ---- - -The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v1 under the name of Analysis. -With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. -At the end of the Analysis the status will return whether your objective failed or passed. - -This data can be seen as Prometheus metrics and can be displayed on Grafana. - -## Keptn Analysis basics - -A Keptn Analysis is implemented with three resources: - -* [Analysis](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysis) -- - define the specific configurations and the analysis to report -* [AnalysisDefinition](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisdefinition) -- - define the list of SLOs for an analysis -* [AnalysisValueTemplate](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- - define the SLI: the KeptnMetricsProvider and the Query to perform for each SLO - -### Define Analysis, Analysis Definition and AnalysisValueTemplate - -An Analysis customizes the templates defined inside an AnalysisDefinition by adding configurations such as: -* a Timeframe that specifies the range for the corresponding query in the AnalysisValueTemplate -* a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate - -An AnalysisDefinition contains a list of objectives to satisfy. -Each of these objectives: -* specifies failure or warning target criteria, -* specifies whether the objective is a key objective (its failure would fail the analysis) -* indicates the weight of the objective on the overall analysis -* refers to an AnalysisValueTemplate that contains the SLIs, so from what provider to gather the data and how to compute the analysis - -In each AnalysisValueTemplate we store the query for the analysis of the SLI. You must define a -[KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) resource -for each instance of each data provider you are using. -The template will refer to that provider and query it. - -Let's consider the following Analysis: - -{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} - -This cr setups the timeframe we are interested in as between 5am and 10am of the 5th of May 2023 , -and adds a few specific key-value pair that will be substituted in the query -for instance the query could contain a {{.nodename }} and this value will be substituted by test - -The definition of this Analysis is referenced by its name and namespace and can be seen here: - -{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml" >}} - -This simple definition contains a single objective, response-time-p95. For this objective there are both a -failure and warning criteria: - -* objective will fail if the percentile 95 is less than 600 -* there will be a warning in case the value is in between 300 and 500 - -The total score shows that this analysis should overall score 90% of all objectives to pass or 75 to get a warning. -Since the objective is one only, this means that we either will pass with 100% (response time is less than 600) or fail with 0%(slower response time) - -The objective points to the corresponding AnalysisValueTemplate: - -{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysisdvaluetemplate.yaml" >}} - -This template tell us that we will query a provider called prometheus using this query: -```shell - sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) -``` - -at runtime the metrics operator will try to substitute everything in '{{. }}' format with a key-value pair in the Analysis resource, -so in this case the query would become: - -```shell - sum(kube_pod_container_resource_limits{node='test'}) - sum(kube_node_status_capacity{node='test'}) -``` - -For a working example you can check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/analysis-controller-multiple-providers) - -## Accessing Analysis - -### Retrieve KeptnMetric values with kubectl -Use the `kubectl get` command to retrieve all the `Analysis` in your cluster: - -```shell -$ kubectl get analyses.metrics.keptn.sh -A - -``` -This will return something like - -```shell -NAMESPACE NAME ANALYSISDEFINITION STATE WARNING PASS -default analysis-sample ed-my-proj-dev-svc1 -``` - -You can then describe the analysis like so: - -```shell -kubectl describe analyses.metrics.keptn.sh analysis-sample -n=default -``` \ No newline at end of file From 9fee9b010b075943a20bd4f94c4a91921ed2097d Mon Sep 17 00:00:00 2001 From: realanna Date: Mon, 25 Sep 2023 15:52:01 +0200 Subject: [PATCH 10/53] fix: removed skip lint Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 07a5503c2b..fd53afaf66 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -44,7 +44,7 @@ The template will refer to that provider and query it. Let's consider the following Analysis: -{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} +{{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} This cr setups the timeframe we are interested in as between 5am and 10am of the 5th of May 2023 , and adds a few specific key-value pair that will be substituted in the query @@ -52,7 +52,7 @@ for instance the query could contain a {{.nodename }} and this value will be sub The definition of this Analysis is referenced by its name and namespace and can be seen here: -{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml" >}} +{{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml" >}} This simple definition contains a single objective, response-time-p95. For this objective there are both a failure and warning criteria: @@ -65,7 +65,9 @@ Since the objective is one only, this means that we either will pass with 100% ( The objective points to the corresponding AnalysisValueTemplate: -{{< embed path="/lifecycle-operator/config/samples/metrics_v1alpha3_analysisdvaluetemplate.yaml" >}} + + +{{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml" >}} This template tell us that we will query a provider called prometheus using this query: ```shell From 28ecebf6c7213f32f0a18c8d47a891920d563fc9 Mon Sep 17 00:00:00 2001 From: realanna Date: Mon, 25 Sep 2023 15:54:59 +0200 Subject: [PATCH 11/53] fix: removed skip lint Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index fd53afaf66..48aa61ae64 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -13,6 +13,8 @@ At the end of the Analysis the status will return whether your objective failed This data can be seen as Prometheus metrics and can be displayed on Grafana. +Keptn v1 users may use [SLO](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/slo_converter.md#slo-converter) and [SLI converters](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/sli_converter.md#sli-converter) to migrate towards Keptn Analysis + ## Keptn Analysis basics A Keptn Analysis is implemented with three resources: From c3cb7e4dd3985bbbacfa8fbdd3b1498dfd967fcb Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:59:05 +0200 Subject: [PATCH 12/53] Update docs/content/en/docs/migrate/metrics-observe/_index.md Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/migrate/metrics-observe/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/migrate/metrics-observe/_index.md b/docs/content/en/docs/migrate/metrics-observe/_index.md index d82bf9d74c..a53e268133 100644 --- a/docs/content/en/docs/migrate/metrics-observe/_index.md +++ b/docs/content/en/docs/migrate/metrics-observe/_index.md @@ -20,7 +20,7 @@ and Keptn evaluations. > **Note** The full SLO capabilities provided by Keptn v1 such as weighting and scoring -have a first implementation in the Analysis.[GitHub Epic 1646](https://github.com/keptn/lifecycle-toolkit/issues/1646). +have a first implementation in the [Analysis](https://lifecycle.keptn.sh/docs/implementing/slo/). Notice the paradigm differences when implementing Keptn evaluations: From b42705b6fe5701a9689d726399cbdb96761af2b5 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:06:57 +0200 Subject: [PATCH 13/53] fixed dot Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 48aa61ae64..0199198d15 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -1,6 +1,6 @@ --- -title: Analyses -description: Understand Analyses in Keptn and how to use them +title: Analisis +description: Understand Analysis in Keptn and how to use them weight: 150 cascade: type: docs @@ -13,7 +13,7 @@ At the end of the Analysis the status will return whether your objective failed This data can be seen as Prometheus metrics and can be displayed on Grafana. -Keptn v1 users may use [SLO](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/slo_converter.md#slo-converter) and [SLI converters](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/sli_converter.md#sli-converter) to migrate towards Keptn Analysis +Keptn v1 users may use [SLO](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/slo_converter.md#slo-converter) and [SLI converters](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/sli_converter.md#sli-converter) to migrate towards Keptn Analysis. ## Keptn Analysis basics From 9083bccc7e0f8ff54c8a4a2569bdbf370b554d53 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:16:11 +0200 Subject: [PATCH 14/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Meg McRoberts Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 0199198d15..26a2b0c478 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -1,5 +1,5 @@ --- -title: Analisis +title: Analysis description: Understand Analysis in Keptn and how to use them weight: 150 cascade: From dc181ee88582b5675584fba612d25f1ead82bba4 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:16:20 +0200 Subject: [PATCH 15/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Meg McRoberts Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 26a2b0c478..d524bfbb7f 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -1,6 +1,6 @@ --- title: Analysis -description: Understand Analysis in Keptn and how to use them +description: Understand Analyses in Keptn and how to use them weight: 150 cascade: type: docs From d5abd7fe672b1fc5d2293abd108166258b5efa15 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:16:29 +0200 Subject: [PATCH 16/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Meg McRoberts Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index d524bfbb7f..879458b076 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -9,7 +9,7 @@ cascade: The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v1 under the name of Analysis. With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. -At the end of the Analysis the status will return whether your objective failed or passed. +At the end of the Analysis the status returns whether your objective failed or passed. This data can be seen as Prometheus metrics and can be displayed on Grafana. From a1d2ac10eb2e8fbf42d27dd289dd547fcbf88344 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:18:27 +0200 Subject: [PATCH 17/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Meg McRoberts Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 879458b076..84859c6542 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -37,7 +37,7 @@ Each of these objectives: * specifies failure or warning target criteria, * specifies whether the objective is a key objective (its failure would fail the analysis) * indicates the weight of the objective on the overall analysis -* refers to an AnalysisValueTemplate that contains the SLIs, so from what provider to gather the data and how to compute the analysis +* refers to an AnalysisValueTemplate that contains the SLIs, defining the data provider from which to gather the data and how to compute the analysis In each AnalysisValueTemplate we store the query for the analysis of the SLI. You must define a [KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) resource From 313262630ea55ece2466a7e305863b1593685844 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:18:34 +0200 Subject: [PATCH 18/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Meg McRoberts Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 84859c6542..6365a6d43d 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -42,7 +42,7 @@ Each of these objectives: In each AnalysisValueTemplate we store the query for the analysis of the SLI. You must define a [KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) resource for each instance of each data provider you are using. -The template will refer to that provider and query it. +The template refers to that provider and queries it. Let's consider the following Analysis: From ebfa307f778ee470423b8ca04d6b0a5b75be4042 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:18:42 +0200 Subject: [PATCH 19/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Meg McRoberts Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 6365a6d43d..539c8e4474 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -48,7 +48,8 @@ Let's consider the following Analysis: {{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} -This cr setups the timeframe we are interested in as between 5am and 10am of the 5th of May 2023 , +This cr sets up the timeframe we are interested in +as between 5am and 10am of the 5th of May 2023 , and adds a few specific key-value pair that will be substituted in the query for instance the query could contain a {{.nodename }} and this value will be substituted by test From 846b8266a1b9443c44d780543c1e568fefcffd86 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:20:55 +0200 Subject: [PATCH 20/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 539c8e4474..7b8cc8cd08 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -8,7 +8,7 @@ cascade: --- The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v1 under the name of Analysis. -With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. +With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. At the end of the Analysis the status returns whether your objective failed or passed. This data can be seen as Prometheus metrics and can be displayed on Grafana. From 5cd82f291954f0b49e0a3b49094b18fcf895cd03 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:21:09 +0200 Subject: [PATCH 21/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Meg McRoberts Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 7b8cc8cd08..adf60ed7f4 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -40,7 +40,7 @@ Each of these objectives: * refers to an AnalysisValueTemplate that contains the SLIs, defining the data provider from which to gather the data and how to compute the analysis In each AnalysisValueTemplate we store the query for the analysis of the SLI. You must define a -[KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) resource +[KeptnMetricsProvider](../../yaml-crd-ref/metricsprovider.md) resource for each instance of each data provider you are using. The template refers to that provider and queries it. From 82322882ca907604d37f6bd982395ff4391ec9b4 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:21:23 +0200 Subject: [PATCH 22/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index adf60ed7f4..c49a1d9086 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -11,7 +11,7 @@ The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. At the end of the Analysis the status returns whether your objective failed or passed. -This data can be seen as Prometheus metrics and can be displayed on Grafana. +The Analysis result is exposed as an OpenTelemetry metric and can be displayed on dashboard tools, such as Grafana. Keptn v1 users may use [SLO](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/slo_converter.md#slo-converter) and [SLI converters](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/sli_converter.md#sli-converter) to migrate towards Keptn Analysis. From 8365a718af4b9300593d3d4eefd8b04c797dd582 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:21:34 +0200 Subject: [PATCH 23/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index c49a1d9086..39d67e02c6 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -48,7 +48,7 @@ Let's consider the following Analysis: {{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} -This cr sets up the timeframe we are interested in +This CR sets up the timeframe we are interested in as between 5am and 10am of the 5th of May 2023 , and adds a few specific key-value pair that will be substituted in the query for instance the query could contain a {{.nodename }} and this value will be substituted by test From cf90bdf4a92be743a3b3a74a6c7d286120198af2 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:23:28 +0200 Subject: [PATCH 24/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 39d67e02c6..c2a5c4ef26 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -24,7 +24,7 @@ A Keptn Analysis is implemented with three resources: * [AnalysisDefinition](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisdefinition) -- define the list of SLOs for an analysis * [AnalysisValueTemplate](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- - define the SLI: the KeptnMetricsProvider and the Query to perform for each SLO + define the SLI: the KeptnMetricsProvider and the Query to perform for each SLI ### Define Analysis, Analysis Definition and AnalysisValueTemplate From 88702d43984d8f683c68716137af8a1d98251776 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:23:39 +0200 Subject: [PATCH 25/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index c2a5c4ef26..1260b121e9 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -49,7 +49,7 @@ Let's consider the following Analysis: {{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml" >}} This CR sets up the timeframe we are interested in -as between 5am and 10am of the 5th of May 2023 , +as between 5 am and 10 am on the 5th of May 2023, and adds a few specific key-value pair that will be substituted in the query for instance the query could contain a {{.nodename }} and this value will be substituted by test From cf7b9f5ac38058427e2f5fb7eab84c15e2c656cf Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:23:46 +0200 Subject: [PATCH 26/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 1260b121e9..5910fb8719 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -50,7 +50,7 @@ Let's consider the following Analysis: This CR sets up the timeframe we are interested in as between 5 am and 10 am on the 5th of May 2023, -and adds a few specific key-value pair that will be substituted in the query +and adds a few specific key-value pairs that will be substituted in the query. for instance the query could contain a {{.nodename }} and this value will be substituted by test The definition of this Analysis is referenced by its name and namespace and can be seen here: From ae956d23c812d76ae3e6251dc418e9aaa3cabbfa Mon Sep 17 00:00:00 2001 From: realanna Date: Tue, 26 Sep 2023 11:24:58 +0200 Subject: [PATCH 27/53] fix: reference Signed-off-by: realanna --- docs/content/en/docs/migrate/metrics-observe/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/migrate/metrics-observe/_index.md b/docs/content/en/docs/migrate/metrics-observe/_index.md index a53e268133..ae92c71717 100644 --- a/docs/content/en/docs/migrate/metrics-observe/_index.md +++ b/docs/content/en/docs/migrate/metrics-observe/_index.md @@ -20,7 +20,7 @@ and Keptn evaluations. > **Note** The full SLO capabilities provided by Keptn v1 such as weighting and scoring -have a first implementation in the [Analysis](https://lifecycle.keptn.sh/docs/implementing/slo/). +have a first implementation in the [Analysis](../../implementing/slo/). Notice the paradigm differences when implementing Keptn evaluations: From 4ff6c615b02ff0d0bf166a43200c6884d1e2cdef Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:25:42 +0200 Subject: [PATCH 28/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 5910fb8719..5f2d984c96 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -51,7 +51,7 @@ Let's consider the following Analysis: This CR sets up the timeframe we are interested in as between 5 am and 10 am on the 5th of May 2023, and adds a few specific key-value pairs that will be substituted in the query. -for instance the query could contain a {{.nodename }} and this value will be substituted by test +For instance, the query could contain a `{{.nodename }}` and this value will be substituted by test The definition of this Analysis is referenced by its name and namespace and can be seen here: From ddac2f89e9b2632c818253a489d6719a4e6aeacf Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:25:52 +0200 Subject: [PATCH 29/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 5f2d984c96..96913c89c3 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -57,7 +57,7 @@ The definition of this Analysis is referenced by its name and namespace and can {{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml" >}} -This simple definition contains a single objective, response-time-p95. For this objective there are both a +This simple definition contains a single objective, `response-time-p95`. For this objective, there are both failure and warning criteria: * objective will fail if the percentile 95 is less than 600 From 5323ccda6f59a989ee85b446c0b0e5c01dee41f2 Mon Sep 17 00:00:00 2001 From: realanna Date: Tue, 26 Sep 2023 11:28:54 +0200 Subject: [PATCH 30/53] fix: review Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 96913c89c3..a6cd4e0e9c 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -67,9 +67,6 @@ The total score shows that this analysis should overall score 90% of all object Since the objective is one only, this means that we either will pass with 100% (response time is less than 600) or fail with 0%(slower response time) The objective points to the corresponding AnalysisValueTemplate: - - - {{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml" >}} This template tell us that we will query a provider called prometheus using this query: @@ -77,13 +74,13 @@ This template tell us that we will query a provider called prometheus using this sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -at runtime the metrics operator will try to substitute everything in '{{. }}' format with a key-value pair in the Analysis resource, +at runtime the metrics operator will try to substitute everything in `{{. }}` format with a key-value pair in the Analysis resource, so in this case the query would become: ```shell sum(kube_pod_container_resource_limits{node='test'}) - sum(kube_node_status_capacity{node='test'}) ``` - +The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider information similar to old Keptn v1 objectives. For a working example you can check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/analysis-controller-multiple-providers) ## Accessing Analysis From d624f2f47dc1b373de039f54ca09217b6e8f13a6 Mon Sep 17 00:00:00 2001 From: realanna Date: Tue, 26 Sep 2023 12:34:24 +0200 Subject: [PATCH 31/53] fix: lint Signed-off-by: realanna --- .../en/docs/implementing/slo/_index.md | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index a6cd4e0e9c..3668648466 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -13,7 +13,10 @@ At the end of the Analysis the status returns whether your objective failed or p The Analysis result is exposed as an OpenTelemetry metric and can be displayed on dashboard tools, such as Grafana. -Keptn v1 users may use [SLO](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/slo_converter.md#slo-converter) and [SLI converters](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/sli_converter.md#sli-converter) to migrate towards Keptn Analysis. +Keptn v1 users may +use [SLO](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/slo_converter.md#slo-converter) +and [SLI converters](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/sli_converter.md#sli-converter) +to migrate towards Keptn Analysis. ## Keptn Analysis basics @@ -29,15 +32,18 @@ A Keptn Analysis is implemented with three resources: ### Define Analysis, Analysis Definition and AnalysisValueTemplate An Analysis customizes the templates defined inside an AnalysisDefinition by adding configurations such as: + * a Timeframe that specifies the range for the corresponding query in the AnalysisValueTemplate * a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate An AnalysisDefinition contains a list of objectives to satisfy. Each of these objectives: + * specifies failure or warning target criteria, * specifies whether the objective is a key objective (its failure would fail the analysis) * indicates the weight of the objective on the overall analysis -* refers to an AnalysisValueTemplate that contains the SLIs, defining the data provider from which to gather the data and how to compute the analysis +* refers to an AnalysisValueTemplate that contains the SLIs, defining the data provider from which to gather the data + and how to compute the analysis In each AnalysisValueTemplate we store the query for the analysis of the SLI. You must define a [KeptnMetricsProvider](../../yaml-crd-ref/metricsprovider.md) resource @@ -63,35 +69,43 @@ failure and warning criteria: * objective will fail if the percentile 95 is less than 600 * there will be a warning in case the value is in between 300 and 500 -The total score shows that this analysis should overall score 90% of all objectives to pass or 75 to get a warning. -Since the objective is one only, this means that we either will pass with 100% (response time is less than 600) or fail with 0%(slower response time) +The total score shows that this analysis should overall score 90% of all objectives to pass or 75 to get a warning. +Since the objective is one only, this means that we either will pass with 100% (response time is less than 600) or fail +with 0%(slower response time) The objective points to the corresponding AnalysisValueTemplate: {{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml" >}} This template tell us that we will query a provider called prometheus using this query: + ```shell sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -at runtime the metrics operator will try to substitute everything in `{{. }}` format with a key-value pair in the Analysis resource, +at runtime the metrics operator will try to substitute everything in `{{. }}` format with a key-value pair in the +Analysis resource, so in this case the query would become: ```shell sum(kube_pod_container_resource_limits{node='test'}) - sum(kube_node_status_capacity{node='test'}) ``` -The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider information similar to old Keptn v1 objectives. -For a working example you can check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/analysis-controller-multiple-providers) + +The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider +information similar to old Keptn v1 objectives. +For a working example you can +check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/analysis-controller-multiple-providers) ## Accessing Analysis ### Retrieve KeptnMetric values with kubectl + Use the `kubectl get` command to retrieve all the `Analysis` in your cluster: ```shell $ kubectl get analyses.metrics.keptn.sh -A ``` + This will return something like ```shell From 56570fddf1d78accdc911de2d5f86c09f76e6736 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:08:14 +0200 Subject: [PATCH 32/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 3668648466..973b79ed45 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -82,7 +82,7 @@ This template tell us that we will query a provider called prometheus using this sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -at runtime the metrics operator will try to substitute everything in `{{. }}` format with a key-value pair in the +at runtime the metrics operator will try to substitute everything in `{{.VariableName }}` format with a key-value pair in the Analysis resource, so in this case the query would become: From 8f7164226453a746bc3bbc07bbc568daa2ef3343 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:08:24 +0200 Subject: [PATCH 33/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Giovanni Liva Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 973b79ed45..671e23dadc 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -102,7 +102,7 @@ check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integrati Use the `kubectl get` command to retrieve all the `Analysis` in your cluster: ```shell -$ kubectl get analyses.metrics.keptn.sh -A +kubectl get analyses.metrics.keptn.sh -A ``` From 4abfa30f2c8b168c7f9f89bc7edb2350e73dee1e Mon Sep 17 00:00:00 2001 From: realanna Date: Wed, 27 Sep 2023 12:25:31 +0200 Subject: [PATCH 34/53] fix: lint Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 671e23dadc..fff5e681b2 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -45,7 +45,8 @@ Each of these objectives: * refers to an AnalysisValueTemplate that contains the SLIs, defining the data provider from which to gather the data and how to compute the analysis -In each AnalysisValueTemplate we store the query for the analysis of the SLI. You must define a +In each AnalysisValueTemplate we store the query for the analysis of the SLI. +You must define a [KeptnMetricsProvider](../../yaml-crd-ref/metricsprovider.md) resource for each instance of each data provider you are using. The template refers to that provider and queries it. @@ -63,7 +64,8 @@ The definition of this Analysis is referenced by its name and namespace and can {{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml" >}} -This simple definition contains a single objective, `response-time-p95`. For this objective, there are both +This simple definition contains a single objective, `response-time-p95`. +For this objective, there are both failure and warning criteria: * objective will fail if the percentile 95 is less than 600 @@ -117,4 +119,4 @@ You can then describe the analysis like so: ```shell kubectl describe analyses.metrics.keptn.sh analysis-sample -n=default -``` \ No newline at end of file +``` From 5c08a04b11bdf74662487f78a6a27155a1f3cb23 Mon Sep 17 00:00:00 2001 From: realanna Date: Wed, 27 Sep 2023 12:42:20 +0200 Subject: [PATCH 35/53] fix: lint Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index fff5e681b2..7ad002237b 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -84,8 +84,8 @@ This template tell us that we will query a provider called prometheus using this sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -at runtime the metrics operator will try to substitute everything in `{{.VariableName }}` format with a key-value pair in the -Analysis resource, +at runtime the metrics operator will try to substitute everything in`{{.VariableName }}` +format with a key-value pair in the Analysis resource, so in this case the query would become: ```shell From b7e5b05e113ce0683cd421abcfe20fbc2a31aa68 Mon Sep 17 00:00:00 2001 From: realanna Date: Wed, 27 Sep 2023 12:43:50 +0200 Subject: [PATCH 36/53] fix: link Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 7ad002237b..a932225f3c 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -95,7 +95,7 @@ so in this case the query would become: The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider information similar to old Keptn v1 objectives. For a working example you can -check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/analysis-controller-multiple-providers) +check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/testanalysis/analysis-controller-multiple-providers) ## Accessing Analysis From eab01eb7046b1a0d88ac579785d836ace8afadde Mon Sep 17 00:00:00 2001 From: realanna Date: Wed, 27 Sep 2023 12:44:57 +0200 Subject: [PATCH 37/53] fix: link Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index a932225f3c..8108bd16ef 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -84,8 +84,8 @@ This template tell us that we will query a provider called prometheus using this sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -at runtime the metrics operator will try to substitute everything in`{{.VariableName }}` -format with a key-value pair in the Analysis resource, +at runtime the metrics operator will try to substitute everything in`{{.VariableName }}` +format with a key-value pair in the Analysis resource, so in this case the query would become: ```shell From e7b562c828e6799d4fbd2f2d77b1365c7ac63039 Mon Sep 17 00:00:00 2001 From: realanna Date: Wed, 27 Sep 2023 12:49:25 +0200 Subject: [PATCH 38/53] fix: link Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 8108bd16ef..2fa2d0901c 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -95,7 +95,7 @@ so in this case the query would become: The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider information similar to old Keptn v1 objectives. For a working example you can -check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/integration/testanalysis/analysis-controller-multiple-providers) +check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testanalysis/analysis-controller-multiple-providers) ## Accessing Analysis From efdbff300d202c1fb4775ca1e7bd00319ec6c50f Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:16:24 +0200 Subject: [PATCH 39/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: odubajDT <93584209+odubajDT@users.noreply.github.com> Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 2fa2d0901c..c0c366c85b 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -84,7 +84,7 @@ This template tell us that we will query a provider called prometheus using this sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -at runtime the metrics operator will try to substitute everything in`{{.VariableName }}` +at runtime the metrics operator will try to substitute everything in`{{.variableName }}` format with a key-value pair in the Analysis resource, so in this case the query would become: From 2ccb090c0341a14b976cd9fae0768ed5dcbaf2ce Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:20:35 +0200 Subject: [PATCH 40/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index c0c366c85b..8ff5c208b3 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -8,7 +8,7 @@ cascade: --- The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v1 under the name of Analysis. -With an Analysis Definition you can specify multiple Service Level Objectives that will be evaluated in your Analysis. +With an Analysis Definition you can specify multiple Service Level Objectives (SLOs) that will be evaluated in your Analysis. At the end of the Analysis the status returns whether your objective failed or passed. The Analysis result is exposed as an OpenTelemetry metric and can be displayed on dashboard tools, such as Grafana. From 8885722a7b4f75e5a9a0605663efec220a682f84 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:20:45 +0200 Subject: [PATCH 41/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 8ff5c208b3..4d1088236a 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -25,7 +25,7 @@ A Keptn Analysis is implemented with three resources: * [Analysis](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysis) -- define the specific configurations and the analysis to report * [AnalysisDefinition](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisdefinition) -- - define the list of SLOs for an analysis + define the list of SLOs for an Analysis * [AnalysisValueTemplate](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- define the SLI: the KeptnMetricsProvider and the Query to perform for each SLI From aae87bde1cc19ad4b29a06745ff47c46719fcf28 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:20:59 +0200 Subject: [PATCH 42/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 4d1088236a..d3865b144b 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -93,7 +93,7 @@ so in this case the query would become: ``` The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider -information similar to old Keptn v1 objectives. +information similar to Keptn v1 objectives. For a working example you can check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testanalysis/analysis-controller-multiple-providers) From ad5c69338a5f17a41b0f29c04793fd06231877f0 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:21:16 +0200 Subject: [PATCH 43/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index d3865b144b..c0bc235ab9 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -95,7 +95,7 @@ so in this case the query would become: The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider information similar to Keptn v1 objectives. For a working example you can -check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testanalysis/analysis-controller-multiple-providers) +check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testanalysis/analysis-controller-multiple-providers). ## Accessing Analysis From 02bcd52e8f6f33aabcb1c3192fe39d8599e8ed3d Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:21:34 +0200 Subject: [PATCH 44/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index c0bc235ab9..146d65f7ea 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -115,7 +115,7 @@ NAMESPACE NAME ANALYSISDEFINITION STATE WARNING PASS default analysis-sample ed-my-proj-dev-svc1 ``` -You can then describe the analysis like so: +You can then describe the analysis with: ```shell kubectl describe analyses.metrics.keptn.sh analysis-sample -n=default From 5d45de78ec50d44899f17e9851daafa422deff45 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:21:46 +0200 Subject: [PATCH 45/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 146d65f7ea..08e1a3c3ae 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -101,7 +101,7 @@ check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testanaly ### Retrieve KeptnMetric values with kubectl -Use the `kubectl get` command to retrieve all the `Analysis` in your cluster: +Use the `kubectl get` command to retrieve all the `Analyses` in your cluster: ```shell kubectl get analyses.metrics.keptn.sh -A From 5d86106d232b331c0477886d5d2da64817ac45c5 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:22:22 +0200 Subject: [PATCH 46/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 08e1a3c3ae..98bb83241c 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -27,7 +27,7 @@ A Keptn Analysis is implemented with three resources: * [AnalysisDefinition](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisdefinition) -- define the list of SLOs for an Analysis * [AnalysisValueTemplate](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- - define the SLI: the KeptnMetricsProvider and the Query to perform for each SLI + define the SLI: the KeptnMetricsProvider and the query to perform for each SLI ### Define Analysis, Analysis Definition and AnalysisValueTemplate From 741ed933718d39fc07c7bdaa5e6025e308edbde5 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:24:44 +0200 Subject: [PATCH 47/53] review Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 98bb83241c..6fefa4fa4a 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -2,9 +2,6 @@ title: Analysis description: Understand Analyses in Keptn and how to use them weight: 150 -cascade: - type: docs - currentversion: main --- The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v1 under the name of Analysis. @@ -84,7 +81,7 @@ This template tell us that we will query a provider called prometheus using this sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -at runtime the metrics operator will try to substitute everything in`{{.variableName }}` +At runtime, the metrics operator will try to substitute everything in`{{.variableName }}` format with a key-value pair in the Analysis resource, so in this case the query would become: From 696aa8c38553754336b4f375a4358fa0fce098e1 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:25:59 +0200 Subject: [PATCH 48/53] Apply suggestions from code review Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: realanna --- .../en/docs/implementing/slo/_index.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 6fefa4fa4a..db828652bf 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -10,9 +10,9 @@ At the end of the Analysis the status returns whether your objective failed or p The Analysis result is exposed as an OpenTelemetry metric and can be displayed on dashboard tools, such as Grafana. -Keptn v1 users may -use [SLO](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/slo_converter.md#slo-converter) -and [SLI converters](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/sli_converter.md#sli-converter) +Keptn v1 users may use converters for +[SLOs](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/slo_converter.md#slo-converter) +and [SLIs](https://github.com/keptn/lifecycle-toolkit/blob/main/metrics-operator/converter/sli_converter.md#sli-converter) to migrate towards Keptn Analysis. ## Keptn Analysis basics @@ -28,15 +28,15 @@ A Keptn Analysis is implemented with three resources: ### Define Analysis, Analysis Definition and AnalysisValueTemplate -An Analysis customizes the templates defined inside an AnalysisDefinition by adding configurations such as: +An Analysis customizes the templates defined inside an AnalysisDefinition by adding configuration such as: -* a Timeframe that specifies the range for the corresponding query in the AnalysisValueTemplate +* a timeframe that specifies the range for the corresponding query in the AnalysisValueTemplate * a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate An AnalysisDefinition contains a list of objectives to satisfy. Each of these objectives: -* specifies failure or warning target criteria, +* specifies failure or warning target criteria * specifies whether the objective is a key objective (its failure would fail the analysis) * indicates the weight of the objective on the overall analysis * refers to an AnalysisValueTemplate that contains the SLIs, defining the data provider from which to gather the data @@ -55,7 +55,7 @@ Let's consider the following Analysis: This CR sets up the timeframe we are interested in as between 5 am and 10 am on the 5th of May 2023, and adds a few specific key-value pairs that will be substituted in the query. -For instance, the query could contain a `{{.nodename }}` and this value will be substituted by test +For instance, the query could contain a `{{ .nodename }}` and this value will be substituted with `test` The definition of this Analysis is referenced by its name and namespace and can be seen here: @@ -65,17 +65,17 @@ This simple definition contains a single objective, `response-time-p95`. For this objective, there are both failure and warning criteria: -* objective will fail if the percentile 95 is less than 600 -* there will be a warning in case the value is in between 300 and 500 +* the objective will fail if the percentile 95 is less than 600 +* there will be a warning in case the value is between 300 and 500 -The total score shows that this analysis should overall score 90% of all objectives to pass or 75 to get a warning. -Since the objective is one only, this means that we either will pass with 100% (response time is less than 600) or fail -with 0%(slower response time) +The total score shows that this analysis should have an overall score of 90% to pass or 75% to get a warning. +Since the objective is only one, this means that we either will pass with 100% (response time is less than 600) or fail +with 0% (slower response time). The objective points to the corresponding AnalysisValueTemplate: {{< embed path="/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml" >}} -This template tell us that we will query a provider called prometheus using this query: +This template tells us that we will query a provider called `prometheus` using this query: ```shell sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) From 66080d63a3a3abf0da54c132dd337e0f8bae7ba0 Mon Sep 17 00:00:00 2001 From: realanna Date: Wed, 27 Sep 2023 13:29:11 +0200 Subject: [PATCH 49/53] fix: order Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index db828652bf..bbcebdfe48 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -1,7 +1,7 @@ --- -title: Analysis +title: Define SLOs/SLIs with Analyses description: Understand Analyses in Keptn and how to use them -weight: 150 +weight: 91 --- The Keptn Metrics Operator implements an SLO/SLI feature set inspired by Keptn v1 under the name of Analysis. From 5e9ad9f88525501d63d236c11343b5690fec59ca Mon Sep 17 00:00:00 2001 From: realanna Date: Wed, 27 Sep 2023 13:35:48 +0200 Subject: [PATCH 50/53] fix: review Signed-off-by: realanna --- .../en/docs/implementing/slo/_index.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index bbcebdfe48..9eb551cca8 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -20,7 +20,7 @@ to migrate towards Keptn Analysis. A Keptn Analysis is implemented with three resources: * [Analysis](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysis) -- - define the specific configurations and the analysis to report + define the specific configurations and the Analysis to report * [AnalysisDefinition](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisdefinition) -- define the list of SLOs for an Analysis * [AnalysisValueTemplate](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- @@ -37,12 +37,12 @@ An AnalysisDefinition contains a list of objectives to satisfy. Each of these objectives: * specifies failure or warning target criteria -* specifies whether the objective is a key objective (its failure would fail the analysis) -* indicates the weight of the objective on the overall analysis +* specifies whether the objective is a key objective (its failure would fail the Analysis) +* indicates the weight of the objective on the overall Analysis * refers to an AnalysisValueTemplate that contains the SLIs, defining the data provider from which to gather the data - and how to compute the analysis + and how to compute the Analysis -In each AnalysisValueTemplate we store the query for the analysis of the SLI. +In each AnalysisValueTemplate we store the query for the Analysis of the SLI. You must define a [KeptnMetricsProvider](../../yaml-crd-ref/metricsprovider.md) resource for each instance of each data provider you are using. @@ -55,7 +55,7 @@ Let's consider the following Analysis: This CR sets up the timeframe we are interested in as between 5 am and 10 am on the 5th of May 2023, and adds a few specific key-value pairs that will be substituted in the query. -For instance, the query could contain a `{{ .nodename }}` and this value will be substituted with `test` +For instance, the query could contain a `{{.nodename}}` and this value will be substituted with `test` The definition of this Analysis is referenced by its name and namespace and can be seen here: @@ -68,7 +68,7 @@ failure and warning criteria: * the objective will fail if the percentile 95 is less than 600 * there will be a warning in case the value is between 300 and 500 -The total score shows that this analysis should have an overall score of 90% to pass or 75% to get a warning. +The total score shows that this Analysis should have an overall score of 90% to pass or 75% to get a warning. Since the objective is only one, this means that we either will pass with 100% (response time is less than 600) or fail with 0% (slower response time). @@ -81,7 +81,7 @@ This template tells us that we will query a provider called `prometheus` using t sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'}) ``` -At runtime, the metrics operator will try to substitute everything in`{{.variableName }}` +At runtime, the metrics operator will try to substitute everything in`{{.variableName}}` format with a key-value pair in the Analysis resource, so in this case the query would become: @@ -92,7 +92,7 @@ so in this case the query would become: The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider information similar to Keptn v1 objectives. For a working example you can -check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testanalysis/analysis-controller-multiple-providers). +check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testAnalysis/analysis-controller-multiple-providers). ## Accessing Analysis @@ -108,11 +108,11 @@ kubectl get analyses.metrics.keptn.sh -A This will return something like ```shell -NAMESPACE NAME ANALYSISDEFINITION STATE WARNING PASS +NAMESPACE NAME AnalysisDEFINITION STATE WARNING PASS default analysis-sample ed-my-proj-dev-svc1 ``` -You can then describe the analysis with: +You can then describe the Analysis with: ```shell kubectl describe analyses.metrics.keptn.sh analysis-sample -n=default From 175bc5ef5b60937ca05aef12095544fce90834f5 Mon Sep 17 00:00:00 2001 From: realanna Date: Wed, 27 Sep 2023 13:38:08 +0200 Subject: [PATCH 51/53] fix: review Signed-off-by: realanna --- docs/content/en/docs/implementing/slo/_index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 9eb551cca8..6c65f836f6 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -19,11 +19,11 @@ to migrate towards Keptn Analysis. A Keptn Analysis is implemented with three resources: -* [Analysis](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysis) -- +* [Analysis](../../crd-ref/metrics/v1alpha3/#analysis) -- define the specific configurations and the Analysis to report -* [AnalysisDefinition](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisdefinition) -- +* [AnalysisDefinition](../..crd-ref/metrics/v1alpha3/#analysisdefinition) -- define the list of SLOs for an Analysis -* [AnalysisValueTemplate](https://lifecycle.keptn.sh/docs/crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- +* [AnalysisValueTemplate](../../crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- define the SLI: the KeptnMetricsProvider and the query to perform for each SLI ### Define Analysis, Analysis Definition and AnalysisValueTemplate @@ -92,7 +92,7 @@ so in this case the query would become: The other key-value pairs such as 'project' and 'stage' are just examples of how one could pass to the provider information similar to Keptn v1 objectives. For a working example you can -check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testAnalysis/analysis-controller-multiple-providers). +check [here](https://github.com/keptn/lifecycle-toolkit/tree/main/test/testanalysis/analysis-controller-multiple-providers). ## Accessing Analysis From 386ab48e262dc36cfe91fc7e1d5ef38a9ec0579b Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:38:42 +0200 Subject: [PATCH 52/53] Update docs/content/en/docs/implementing/slo/_index.md Co-authored-by: Moritz Wiesinger Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index 6c65f836f6..ebd556860a 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -108,7 +108,7 @@ kubectl get analyses.metrics.keptn.sh -A This will return something like ```shell -NAMESPACE NAME AnalysisDEFINITION STATE WARNING PASS +NAMESPACE NAME ANALYSISDEFINITION STATE WARNING PASS default analysis-sample ed-my-proj-dev-svc1 ``` From d4ac76db1ec71773e6f0b75527536822fc245632 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:42:14 +0200 Subject: [PATCH 53/53] Update docs/content/en/docs/implementing/slo/_index.md Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> --- docs/content/en/docs/implementing/slo/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/slo/_index.md b/docs/content/en/docs/implementing/slo/_index.md index ebd556860a..1b548f050f 100644 --- a/docs/content/en/docs/implementing/slo/_index.md +++ b/docs/content/en/docs/implementing/slo/_index.md @@ -21,7 +21,7 @@ A Keptn Analysis is implemented with three resources: * [Analysis](../../crd-ref/metrics/v1alpha3/#analysis) -- define the specific configurations and the Analysis to report -* [AnalysisDefinition](../..crd-ref/metrics/v1alpha3/#analysisdefinition) -- +* [AnalysisDefinition](../../crd-ref/metrics/v1alpha3/#analysisdefinition) -- define the list of SLOs for an Analysis * [AnalysisValueTemplate](../../crd-ref/metrics/v1alpha3/#analysisvaluetemplate) -- define the SLI: the KeptnMetricsProvider and the query to perform for each SLI