Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

Commit 702f1d0

Browse files
authored
Merge pull request #57 from keptn/patch/slo-files
added example slo files and custom sli config
2 parents a8b0429 + 8a82fd8 commit 702f1d0

9 files changed

+145
-35
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
data:
3+
sli-provider: dynatrace
4+
kind: ConfigMap
5+
metadata:
6+
name: lighthouse-config-sockshop
7+
namespace: keptn
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
data:
3+
sli-provider: prometheus
4+
kind: ConfigMap
5+
metadata:
6+
name: lighthouse-config-sockshop
7+
namespace: keptn
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
data:
3+
custom-queries: |
4+
cpu_usage: avg(rate(container_cpu_usage_seconds_total{namespace="$PROJECT-$STAGE",pod_name=~"$SERVICE-primary-.*"}[5m]))
5+
kind: ConfigMap
6+
metadata:
7+
name: prometheus-sli-service-config-sockshop
8+
namespace: keptn

onboarding-carts/remediation.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
remediations:
2-
- name: cpu_usage_sockshop_carts
2+
- name: cpu_usage
33
actions:
44
- action: scaling
55
value: +1

onboarding-carts/service-indicators.yaml

-14
This file was deleted.

onboarding-carts/service-objectives-dynatrace-only.yaml

-8
This file was deleted.

onboarding-carts/service-objectives-prometheus-only.yaml

-12
This file was deleted.
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
spec_version: '1.0'
3+
# filter is optional
4+
# specifies selection criteria for service in the SLI provider; project, stage,
5+
# and service can be overwritten, if needed
6+
filter:
7+
handler: "ItemsController.addToCart"
8+
# comparison is mandatory
9+
comparison:
10+
# compare_with is mandatory
11+
# possible values:
12+
# - single_result: only compare with one previous result
13+
# - several_results: compare with several previous results
14+
# this option requires ‘number_of_comparison_results’
15+
compare_with: "single_result"
16+
# include_result_with_score is optional
17+
# default value: all
18+
# possible values:
19+
# - pass: only use previous results that had a ‘pass’ result in comparison
20+
# - pass_or_warn: only use previous results that had a ‘pass’ or a ‘warning’
21+
# result in the comparison
22+
# - all: all previous values are used in the comparison
23+
include_result_with_score: "pass"
24+
# number_of_comparison_results is optional
25+
# default value: 3
26+
# possible values are positive integers greater than zero
27+
# if less than 3 values are available for comparison the evaluation fails
28+
number_of_comparison_results: 3
29+
# aggregate_function is optional
30+
# decides on the aggregate function which is applied to the previous results
31+
# before comparison
32+
# default value: avg
33+
# possible values:
34+
# - avg: average
35+
# - p90: 90th percentile
36+
# - p95: 95th percentile
37+
aggregate_function: avg
38+
# objectives is mandatory
39+
# describes the objectives for SLIs
40+
objectives:
41+
# sli is mandatory
42+
# can be specified several times, if sli is specified without further attributes
43+
# the values are fetched and stored but are not taken into account for the
44+
# evaluation
45+
- sli: response_time_p95
46+
# pass is optional
47+
# it defines the pass criteria for the SLI values
48+
pass: # pass if (relative change <= 10% OR absolute value is < 200)
49+
# e.g.: If response time changes by more than 10%, it should still
50+
# be considered as a pass if it is less than 200 ms
51+
- criteria:
52+
- "<=+10%" # relative values require a prefixed sign (plus or minus)
53+
- "<1000" # absolute values only require a logical operator
54+
warning: # allow small relative changes, and response time has to be < 500 ms
55+
- criteria: # criteria connected by AND
56+
- "<=800"
57+
total_score: # maximum score = sum of weights
58+
pass: "90%" # by default this is interpreted as ">="
59+
warning: 75%
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
spec_version: '1.0'
3+
# filter is optional
4+
# specifies selection criteria for service in the SLI provider; project, stage,
5+
# and service can be overwritten, if needed
6+
filter:
7+
handler: "ItemsController.addToCart"
8+
# comparison is mandatory
9+
comparison:
10+
# compare_with is mandatory
11+
# possible values:
12+
# - single_result: only compare with one previous result
13+
# - several_results: compare with several previous results
14+
# this option requires ‘number_of_comparison_results’
15+
compare_with: "single_result"
16+
# include_result_with_score is optional
17+
# default value: all
18+
# possible values:
19+
# - pass: only use previous results that had a ‘pass’ result in comparison
20+
# - pass_or_warn: only use previous results that had a ‘pass’ or a ‘warning’
21+
# result in the comparison
22+
# - all: all previous values are used in the comparison
23+
include_result_with_score: "pass"
24+
# number_of_comparison_results is optional
25+
# default value: 3
26+
# possible values are positive integers greater than zero
27+
# if less than 3 values are available for comparison the evaluation fails
28+
number_of_comparison_results: 3
29+
# aggregate_function is optional
30+
# decides on the aggregate function which is applied to the previous results
31+
# before comparison
32+
# default value: avg
33+
# possible values:
34+
# - avg: average
35+
# - p90: 90th percentile
36+
# - p95: 95th percentile
37+
aggregate_function: avg
38+
# objectives is mandatory
39+
# describes the objectives for SLIs
40+
objectives:
41+
# sli is mandatory
42+
# can be specified several times, if sli is specified without further attributes
43+
# the values are fetched and stored but are not taken into account for the
44+
# evaluation
45+
- sli: response_time_p95
46+
# pass is optional
47+
# it defines the pass criteria for the SLI values
48+
pass: # pass if (relative change <= 10% OR absolute value is < 200)
49+
# e.g.: If response time changes by more than 10%, it should still
50+
# be considered as a pass if it is less than 200 ms
51+
- criteria:
52+
- "<=+10%" # relative values require a prefixed sign (plus or minus)
53+
- "<1000" # absolute values only require a logical operator
54+
warning: # allow small relative changes, and response time has to be < 500 ms
55+
- criteria: # criteria connected by AND
56+
- "<=800"
57+
- sli: cpu_usage
58+
pass:
59+
- criteria:
60+
- "<0.2"
61+
total_score: # maximum score = sum of weights
62+
pass: "90%" # by default this is interpreted as ">="
63+
warning: 75%

0 commit comments

Comments
 (0)