Skip to content

Commit

Permalink
Add SkyPredictor project to E2E Testing alarm with baseline (#13047)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu authored Feb 20, 2025
1 parent 4049f25 commit c09d939
Show file tree
Hide file tree
Showing 25 changed files with 689 additions and 212 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/skywalking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@ jobs:
- name: Alarm BanyanDB
config: test/e2e-v2/cases/alarm/banyandb/e2e.yaml

- name: Baseline-driven Alarm ES
config: test/e2e-v2/cases/baseline/es/e2e.yaml
- name: Baseline-driven Alarm ES Sharding
config: test/e2e-v2/cases/baseline/es/es-sharding/e2e.yaml
- name: Baseline-driven Alarm BanyanDB
config: test/e2e-v2/cases/baseline/banyandb/e2e.yaml

- name: TTL ES 7.16.3
config: test/e2e-v2/cases/ttl/es/e2e.yaml
env: ES_VERSION=7.16.3
Expand Down
2 changes: 1 addition & 1 deletion oap-server/ai-pipeline/src/main/proto/baseline.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

syntax = "proto3";
package skywalking.baseline.v3;
package skywalking.v3;

import "google/protobuf/empty.proto";

Expand Down
9 changes: 0 additions & 9 deletions test/e2e-v2/cases/alarm/alarm-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@ rules:
tags:
level: CRITICAL
receivers: zhangsan
baseline_rule:
expression: sum(service_resp_time > baseline(service_resp_time,upper)) >= 1
period: 10
message: Response time of service {name} is more than baseline in 1 minutes of last 10 minutes.
tags:
level: CRITICAL
receivers: zhangsan
hooks:
- webhook.none

hooks:
webhook:
Expand Down
18 changes: 0 additions & 18 deletions test/e2e-v2/cases/alarm/banyandb/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,11 @@ services:
environment:
SW_STORAGE: banyandb
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
ports:
- 12800
depends_on:
banyandb:
condition: service_healthy
baseline-server:
condition: service_healthy
volumes:
- ../alarm-settings.yml:/skywalking/config/alarm-settings.yml

Expand All @@ -51,20 +48,5 @@ services:
oap:
condition: service_healthy

baseline-server:
image: "eclipse-temurin:11-jre"
volumes:
- ../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
networks:
- e2e
ports:
- 18080
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
interval: 5s
timeout: 60s
retries: 120

networks:
e2e:
18 changes: 0 additions & 18 deletions test/e2e-v2/cases/alarm/es/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,11 @@ services:
environment:
SW_STORAGE: elasticsearch
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
ports:
- 12800
depends_on:
es:
condition: service_healthy
baseline-server:
condition: service_healthy
volumes:
- ../alarm-settings.yml:/skywalking/config/alarm-settings.yml

Expand All @@ -58,20 +55,5 @@ services:
oap:
condition: service_healthy

baseline-server:
image: "eclipse-temurin:11-jre"
volumes:
- ../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
networks:
- e2e
ports:
- 18080
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
interval: 5s
timeout: 60s
retries: 120

networks:
e2e:
18 changes: 0 additions & 18 deletions test/e2e-v2/cases/alarm/es/es-sharding/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ services:
SW_STORAGE: elasticsearch
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
SW_STORAGE_ES_LOGIC_SHARDING: "true"
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
ports:
- 12800
depends_on:
es:
condition: service_healthy
baseline-server:
condition: service_healthy
volumes:
- ../../alarm-settings.yml:/skywalking/config/alarm-settings.yml

Expand All @@ -59,20 +56,5 @@ services:
oap:
condition: service_healthy

baseline-server:
image: "eclipse-temurin:11-jre"
volumes:
- ../../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
networks:
- e2e
ports:
- 18080
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
interval: 5s
timeout: 60s
retries: 120

networks:
e2e:
30 changes: 30 additions & 0 deletions test/e2e-v2/cases/alarm/expected/metrics-has-value.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

debuggingtrace: null
type: TIME_SERIES_VALUES
results:
{{- contains .results }}
- metric:
labels: []
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ notEmpty .value }}
owner: null
traceid: null
{{- end}}
{{- end}}
error: null
Original file line number Diff line number Diff line change
Expand Up @@ -58,60 +58,4 @@ msgs:
{{- end }}
{{- end }}
{{- end }}
- starttime: {{ gt .starttime 0 }}
scope: Service
id: ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1
name: e2e-service-provider
message: Response time of service e2e-service-provider is more than baseline in 1 minutes of last 10 minutes.
tags:
- key: level
value: CRITICAL
- key: receivers
value: zhangsan
events:
{{- contains .events }}
- uuid: {{ notEmpty .uuid }}
source:
service: e2e-service-provider
serviceinstance: ""
endpoint: ""
name: Alarm
type: ""
message: {{ notEmpty .message }}
parameters: []
starttime: {{ gt .starttime 0 }}
endtime: {{ gt .endtime 0 }}
layer: GENERAL
{{- end }}
snapshot:
expression: sum(service_resp_time > baseline(service_resp_time,upper)) >= 1
metrics:
{{- contains .snapshot.metrics }}
- name: service_resp_time
results:
{{- contains .results }}
- metric:
labels: []
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
owner: null
value: {{ .value }}
traceid: null
{{- end }}
{{- end }}
- name: baseline(service_resp_time,upper)
results:
{{- contains .results }}
- metric:
labels: []
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
owner: null
value: 10
traceid: null
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -58,60 +58,4 @@ msgs:
{{- end }}
{{- end }}
{{- end }}
- starttime: {{ gt .starttime 0 }}
scope: Service
id: ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1
name: e2e-service-provider
message: Response time of service e2e-service-provider is more than baseline in 1 minutes of last 10 minutes.
tags:
- key: level
value: CRITICAL
- key: receivers
value: zhangsan
events:
{{- contains .events }}
- uuid: {{ notEmpty .uuid }}
source:
service: e2e-service-provider
serviceinstance: ""
endpoint: ""
name: Alarm
type: ""
message: {{ notEmpty .message }}
parameters: []
starttime: {{ gt .starttime 0 }}
endtime: {{ gt .endtime 0 }}
layer: GENERAL
{{- end }}
snapshot:
expression: sum(service_resp_time > baseline(service_resp_time,upper)) >= 1
metrics:
{{- contains .snapshot.metrics }}
- name: service_resp_time
results:
{{- contains .results }}
- metric:
labels: []
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
owner: null
value: {{ .value }}
traceid: null
{{- end }}
{{- end }}
- name: baseline(service_resp_time,upper)
results:
{{- contains .results }}
- metric:
labels: []
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
owner: null
value: 10
traceid: null
{{- end }}
{{- end }}
{{- end }}
{{- end }}
17 changes: 0 additions & 17 deletions test/e2e-v2/cases/alarm/mysql/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ services:
environment:
SW_STORAGE: mysql
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
entrypoint: ['sh', '-c', '/download-mysql.sh /skywalking/oap-libs && /skywalking/docker-entrypoint.sh']
ports:
- 12800
depends_on:
mysql:
condition: service_healthy
baseline-server:
condition: service_healthy
volumes:
- ../alarm-settings.yml:/skywalking/config/alarm-settings.yml

Expand All @@ -61,19 +58,5 @@ services:
oap:
condition: service_healthy

baseline-server:
image: "eclipse-temurin:11-jre"
volumes:
- ../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
networks:
- e2e
ports:
- 18080
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
interval: 5s
timeout: 60s
retries: 120
networks:
e2e:
18 changes: 0 additions & 18 deletions test/e2e-v2/cases/alarm/postgres/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,11 @@ services:
SW_STORAGE: postgresql
SW_JDBC_URL: "jdbc:postgresql://postgres:5432/skywalking"
SW_SEARCHABLE_ALARM_TAG_KEYS: level,receivers
SW_API_PIPELINE_BASELINE_SERVICE_HOST: baseline-server
ports:
- 12800
depends_on:
postgres:
condition: service_healthy
baseline-server:
condition: service_healthy
volumes:
- ../alarm-settings.yml:/skywalking/config/alarm-settings.yml

Expand All @@ -60,20 +57,5 @@ services:
oap:
condition: service_healthy

baseline-server:
image: "eclipse-temurin:11-jre"
volumes:
- ../../../java-test-service/e2e-mock-baseline-server/target/e2e-mock-baseline-server-2.0.0.jar:/e2e-mock-baseline-server-2.0.0.jar
command: [ "java", "-jar", "/e2e-mock-baseline-server-2.0.0.jar" ]
networks:
- e2e
ports:
- 18080
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/18080"]
interval: 5s
timeout: 60s
retries: 120

networks:
e2e:
Loading

0 comments on commit c09d939

Please sign in to comment.