-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb-analysis.yaml
41 lines (41 loc) · 1.28 KB
/
web-analysis.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: success-rate
spec:
args:
- name: service-name
metrics:
- name: webmetric
successCondition: "result.ok && result.successPercent >= 0.90"
provider:
web:
url: "http://my-server.com/api/v1/measurement?service={{ args.service-name }}"
headers:
- key: Authorization
value: "Bearer {{ args.api-token }}"
jsonPath: "{$.data}"
# Expected response from the API:
# {
# "data": {
# "ok": true,
# "successPercent": 0.95
# }
# }
# with oauth:
- name: webmetric
successCondition: result == true
provider:
web:
url: "http://my-server.com/api/v1/measurement?service={{ args.service-name }}"
timeoutSeconds: 20 # defaults to 10 seconds
authentication:
oauth2:
tokenUrl: https://my-oauth2-provider/token
clientId: my-cliend-id
clientSecret: "{{ args.oauthSecret }}"
scopes: ["my-oauth2-scope"]
headers:
- key: Content-Type # if body is a json, it is recommended to set the Content-Type
value: "application/json"
jsonPath: "{$.data.ok}"