Skip to content

Commit c09d939

Browse files
authored
Add SkyPredictor project to E2E Testing alarm with baseline (#13047)
1 parent 4049f25 commit c09d939

File tree

25 files changed

+689
-212
lines changed

25 files changed

+689
-212
lines changed

.github/workflows/skywalking.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,13 @@ jobs:
404404
- name: Alarm BanyanDB
405405
config: test/e2e-v2/cases/alarm/banyandb/e2e.yaml
406406

407+
- name: Baseline-driven Alarm ES
408+
config: test/e2e-v2/cases/baseline/es/e2e.yaml
409+
- name: Baseline-driven Alarm ES Sharding
410+
config: test/e2e-v2/cases/baseline/es/es-sharding/e2e.yaml
411+
- name: Baseline-driven Alarm BanyanDB
412+
config: test/e2e-v2/cases/baseline/banyandb/e2e.yaml
413+
407414
- name: TTL ES 7.16.3
408415
config: test/e2e-v2/cases/ttl/es/e2e.yaml
409416
env: ES_VERSION=7.16.3

oap-server/ai-pipeline/src/main/proto/baseline.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
syntax = "proto3";
20-
package skywalking.baseline.v3;
20+
package skywalking.v3;
2121

2222
import "google/protobuf/empty.proto";
2323

test/e2e-v2/cases/alarm/alarm-settings.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ rules:
4343
tags:
4444
level: CRITICAL
4545
receivers: zhangsan
46-
baseline_rule:
47-
expression: sum(service_resp_time > baseline(service_resp_time,upper)) >= 1
48-
period: 10
49-
message: Response time of service {name} is more than baseline in 1 minutes of last 10 minutes.
50-
tags:
51-
level: CRITICAL
52-
receivers: zhangsan
53-
hooks:
54-
- webhook.none
5546

5647
hooks:
5748
webhook:

test/e2e-v2/cases/alarm/banyandb/docker-compose.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,11 @@ services:
3030
environment:
3131
SW_STORAGE: banyandb
3232
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
33-
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
3433
ports:
3534
- 12800
3635
depends_on:
3736
banyandb:
3837
condition: service_healthy
39-
baseline-server:
40-
condition: service_healthy
4138
volumes:
4239
- ../alarm-settings.yml:/skywalking/config/alarm-settings.yml
4340

@@ -51,20 +48,5 @@ services:
5148
oap:
5249
condition: service_healthy
5350

54-
baseline-server:
55-
image: "eclipse-temurin:11-jre"
56-
volumes:
57-
- ../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
58-
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
59-
networks:
60-
- e2e
61-
ports:
62-
- 18080
63-
healthcheck:
64-
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
65-
interval: 5s
66-
timeout: 60s
67-
retries: 120
68-
6951
networks:
7052
e2e:

test/e2e-v2/cases/alarm/es/docker-compose.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,11 @@ services:
3737
environment:
3838
SW_STORAGE: elasticsearch
3939
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
40-
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
4140
ports:
4241
- 12800
4342
depends_on:
4443
es:
4544
condition: service_healthy
46-
baseline-server:
47-
condition: service_healthy
4845
volumes:
4946
- ../alarm-settings.yml:/skywalking/config/alarm-settings.yml
5047

@@ -58,20 +55,5 @@ services:
5855
oap:
5956
condition: service_healthy
6057

61-
baseline-server:
62-
image: "eclipse-temurin:11-jre"
63-
volumes:
64-
- ../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
65-
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
66-
networks:
67-
- e2e
68-
ports:
69-
- 18080
70-
healthcheck:
71-
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
72-
interval: 5s
73-
timeout: 60s
74-
retries: 120
75-
7658
networks:
7759
e2e:

test/e2e-v2/cases/alarm/es/es-sharding/docker-compose.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,11 @@ services:
3838
SW_STORAGE: elasticsearch
3939
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
4040
SW_STORAGE_ES_LOGIC_SHARDING: "true"
41-
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
4241
ports:
4342
- 12800
4443
depends_on:
4544
es:
4645
condition: service_healthy
47-
baseline-server:
48-
condition: service_healthy
4946
volumes:
5047
- ../../alarm-settings.yml:/skywalking/config/alarm-settings.yml
5148

@@ -59,20 +56,5 @@ services:
5956
oap:
6057
condition: service_healthy
6158

62-
baseline-server:
63-
image: "eclipse-temurin:11-jre"
64-
volumes:
65-
- ../../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
66-
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
67-
networks:
68-
- e2e
69-
ports:
70-
- 18080
71-
healthcheck:
72-
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
73-
interval: 5s
74-
timeout: 60s
75-
retries: 120
76-
7759
networks:
7860
e2e:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
debuggingtrace: null
17+
type: TIME_SERIES_VALUES
18+
results:
19+
{{- contains .results }}
20+
- metric:
21+
labels: []
22+
values:
23+
{{- contains .values }}
24+
- id: {{ notEmpty .id }}
25+
value: {{ notEmpty .value }}
26+
owner: null
27+
traceid: null
28+
{{- end}}
29+
{{- end}}
30+
error: null

test/e2e-v2/cases/alarm/expected/silence-after-graphql-critical.yml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -58,60 +58,4 @@ msgs:
5858
{{- end }}
5959
{{- end }}
6060
{{- end }}
61-
- starttime: {{ gt .starttime 0 }}
62-
scope: Service
63-
id: ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1
64-
name: e2e-service-provider
65-
message: Response time of service e2e-service-provider is more than baseline in 1 minutes of last 10 minutes.
66-
tags:
67-
- key: level
68-
value: CRITICAL
69-
- key: receivers
70-
value: zhangsan
71-
events:
72-
{{- contains .events }}
73-
- uuid: {{ notEmpty .uuid }}
74-
source:
75-
service: e2e-service-provider
76-
serviceinstance: ""
77-
endpoint: ""
78-
name: Alarm
79-
type: ""
80-
message: {{ notEmpty .message }}
81-
parameters: []
82-
starttime: {{ gt .starttime 0 }}
83-
endtime: {{ gt .endtime 0 }}
84-
layer: GENERAL
85-
{{- end }}
86-
snapshot:
87-
expression: sum(service_resp_time > baseline(service_resp_time,upper)) >= 1
88-
metrics:
89-
{{- contains .snapshot.metrics }}
90-
- name: service_resp_time
91-
results:
92-
{{- contains .results }}
93-
- metric:
94-
labels: []
95-
values:
96-
{{- contains .values }}
97-
- id: {{ notEmpty .id }}
98-
owner: null
99-
value: {{ .value }}
100-
traceid: null
101-
{{- end }}
102-
{{- end }}
103-
- name: baseline(service_resp_time,upper)
104-
results:
105-
{{- contains .results }}
106-
- metric:
107-
labels: []
108-
values:
109-
{{- contains .values }}
110-
- id: {{ notEmpty .id }}
111-
owner: null
112-
value: 10
113-
traceid: null
114-
{{- end }}
115-
{{- end }}
116-
{{- end }}
11761
{{- end }}

test/e2e-v2/cases/alarm/expected/silence-before-graphql-critical.yml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -58,60 +58,4 @@ msgs:
5858
{{- end }}
5959
{{- end }}
6060
{{- end }}
61-
- starttime: {{ gt .starttime 0 }}
62-
scope: Service
63-
id: ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1
64-
name: e2e-service-provider
65-
message: Response time of service e2e-service-provider is more than baseline in 1 minutes of last 10 minutes.
66-
tags:
67-
- key: level
68-
value: CRITICAL
69-
- key: receivers
70-
value: zhangsan
71-
events:
72-
{{- contains .events }}
73-
- uuid: {{ notEmpty .uuid }}
74-
source:
75-
service: e2e-service-provider
76-
serviceinstance: ""
77-
endpoint: ""
78-
name: Alarm
79-
type: ""
80-
message: {{ notEmpty .message }}
81-
parameters: []
82-
starttime: {{ gt .starttime 0 }}
83-
endtime: {{ gt .endtime 0 }}
84-
layer: GENERAL
85-
{{- end }}
86-
snapshot:
87-
expression: sum(service_resp_time > baseline(service_resp_time,upper)) >= 1
88-
metrics:
89-
{{- contains .snapshot.metrics }}
90-
- name: service_resp_time
91-
results:
92-
{{- contains .results }}
93-
- metric:
94-
labels: []
95-
values:
96-
{{- contains .values }}
97-
- id: {{ notEmpty .id }}
98-
owner: null
99-
value: {{ .value }}
100-
traceid: null
101-
{{- end }}
102-
{{- end }}
103-
- name: baseline(service_resp_time,upper)
104-
results:
105-
{{- contains .results }}
106-
- metric:
107-
labels: []
108-
values:
109-
{{- contains .values }}
110-
- id: {{ notEmpty .id }}
111-
owner: null
112-
value: 10
113-
traceid: null
114-
{{- end }}
115-
{{- end }}
116-
{{- end }}
11761
{{- end }}

test/e2e-v2/cases/alarm/mysql/docker-compose.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,12 @@ services:
3939
environment:
4040
SW_STORAGE: mysql
4141
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
42-
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
4342
entrypoint: ['sh', '-c', '/download-mysql.sh /skywalking/oap-libs && /skywalking/docker-entrypoint.sh']
4443
ports:
4544
- 12800
4645
depends_on:
4746
mysql:
4847
condition: service_healthy
49-
baseline-server:
50-
condition: service_healthy
5148
volumes:
5249
- ../alarm-settings.yml:/skywalking/config/alarm-settings.yml
5350

@@ -61,19 +58,5 @@ services:
6158
oap:
6259
condition: service_healthy
6360

64-
baseline-server:
65-
image: "eclipse-temurin:11-jre"
66-
volumes:
67-
- ../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
68-
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
69-
networks:
70-
- e2e
71-
ports:
72-
- 18080
73-
healthcheck:
74-
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
75-
interval: 5s
76-
timeout: 60s
77-
retries: 120
7861
networks:
7962
e2e:

0 commit comments

Comments
 (0)