Docker安装Skywalking

docker-compose配置

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
version: '3.7'
services:
skywalking-oap:
image: apache/skywalking-oap-server:9.0.0
container_name: skywalking-oap
volumes:
- /data/docker/skywalking/alarm-settings.yml:/skywalking/config/alarm-settings.yml
ports:
- "11800:11800"
- "12800:12800"
environment:
TZ: Asia/Shanghai
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: 192.168.31.70:9200

skywalking-ui:
image: apache/skywalking-ui:9.0.0
container_name: skywalking-ui
depends_on:
- skywalking-oap
links:
- skywalking-oap
ports:
- "6395:8080"
environment:
TZ: Asia/Shanghai
SW_OAP_ADDRESS: http://skywalking-oap:12800

告警配置

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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
rules:
# Rule unique name, must be ended with `_rule`.
service_resp_time_rule:
metrics-name: service_resp_time
op: ">"
threshold: 1000
period: 10
count: 3
silence-period: 5
message: Response time of service {name} is more than 1000ms in 3 minutes of last 10 minutes.
service_sla_rule:
# Metrics value need to be long, double or int
metrics-name: service_sla
op: "<"
threshold: 8000
# The length of time to evaluate the metrics
period: 10
# How many times after the metrics match the condition, will trigger alarm
count: 2
# How many times of checks, the alarm keeps silence after alarm triggered, default as same as period.
silence-period: 3
message: Successful rate of service {name} is lower than 80% in 2 minutes of last 10 minutes
service_resp_time_percentile_rule:
# Metrics value need to be long, double or int
metrics-name: service_percentile
op: ">"
threshold: 1000,1000,1000,1000,1000
period: 10
count: 3
silence-period: 5
message: Percentile response time of service {name} alarm in 3 minutes of last 10 minutes, due to more than one condition of p50 > 1000, p75 > 1000, p90 > 1000, p95 > 1000, p99 > 1000
service_instance_resp_time_rule:
metrics-name: service_instance_resp_time
op: ">"
threshold: 1000
period: 10
count: 2
silence-period: 5
message: Response time of service instance {name} is more than 1000ms in 2 minutes of last 10 minutes
database_access_resp_time_rule:
metrics-name: database_access_resp_time
threshold: 1000
op: ">"
period: 10
count: 2
message: Response time of database access {name} is more than 1000ms in 2 minutes of last 10 minutes
endpoint_relation_resp_time_rule:
metrics-name: endpoint_relation_resp_time
threshold: 1000
op: ">"
period: 10
count: 2
message: Response time of endpoint relation {name} is more than 1000ms in 2 minutes of last 10 minutes

webhooks:
# - http://127.0.0.1/notify/
# - http://127.0.0.1/go-wechat/

#dingtalkHooks:
# textTemplate: |-
# {
# "msgtype": "text",
# "text": {
# "content": "Apache 告警: \n %s"
# }
# }
# webhooks:
# - url: https://oapi.dingtalk.com/robot/send?access_token=416e0d73280b480d5beb6533f475e493c6be9ca9eac85d0422718b8cfdf065e8
# secret: SEC87fc4df3f024cb76e36d75cdfc090009e275b672fd6b1062e0772ad8611e5b2d