跳至主要內容

docker-skywalking.yml

soulballad环境配置DockerComposeDockerCompose约 411 字大约 1 分钟

docker-skywalking.yml

version: '3.0'
services:
  skwoap:
    image: apache/skywalking-oap-server:9.0.0
    container_name: skwoap
    volumes:
      - /opt/docker/skywalking/config/alarm-settings.yml:/skywalking/config/alarm-settings.yml
    ports:
      - "11800:11800"
      - "12800:12800"
    healthcheck:
      test: ["CMD-SHELL", "/skywalking/bin/swctl"]
      interval: 30s
      timeout: 10s
      retries: 3
      # start_period: 40s
    environment:
      TZ: Asia/Shanghai
      SW_STORAGE: elasticsearch
      SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
      SW_HEALTH_CHECKER: default
      SW_TELEMETRY: prometheus
      JAVA_OPTS: "-Xms1g -Xmx1g -XX:-UseCMSInitiatingOccupancyOnly -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=75"
      SW_KAFKA_FETCHER_SERVERS: kafka:9092
      SW_KAFKA_FETCHER: 'default'
      SW_KAFKA_FETCHER_PARTITIONS_FACTOR: '1'
  skwui:
    image: apache/skywalking-ui:9.0.0
    container_name: skwui
    ports:
      - "11880:8080"
    environment:
      TZ: Asia/Shanghai
      SW_skwoap_ADDRESS: http://skwoap:12800
    depends_on:
      - skwoap
networks:
  default:
     external:
       name: mkdtbs

alarm-settings.yml

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://skwoapi.dingtalk.com/robot/send?access_token=416e0d73280b480d5beb6533f475e493c6be9ca9eac85d0422718b8cfdf065e8
      secret: SEC87fc4df3f024cb76e36d75cdfc090009e275b672fd6b1062e0772ad8611e5b2d
上次编辑于:
贡献者: soulballad