Commit 86cd50b9 by yinyong

update config

parent 49ea655a
...@@ -82,5 +82,6 @@ ...@@ -82,5 +82,6 @@
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.5.1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.5.1" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.5" level="project" /> <orderEntry type="library" name="Maven: javax.mail:mail:1.4.5" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" /> <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.16.22" level="project" />
</component> </component>
</module> </module>
\ No newline at end of file
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<version>1.4.5</version> <version>1.4.5</version>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.bailuntec.controller; package com.bailuntec.controller;
import com.bailuntec.dto.AlarmMessageDto;
import com.bailuntec.service.SkyWalkingNoticeService; import com.bailuntec.service.SkyWalkingNoticeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.mail.MessagingException; import javax.mail.MessagingException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.security.GeneralSecurityException; import java.security.GeneralSecurityException;
import java.util.List;
@RestController @RestController
public class SkyWalkingNotice { public class SkyWalkingNotice {
...@@ -16,8 +20,8 @@ public class SkyWalkingNotice { ...@@ -16,8 +20,8 @@ public class SkyWalkingNotice {
@Autowired @Autowired
private SkyWalkingNoticeService skyWalkingNoticeService; private SkyWalkingNoticeService skyWalkingNoticeService;
@GetMapping(value = "notice") @RequestMapping(value = "notice")
public void notice(HttpServletRequest request, HttpServletResponse response) throws GeneralSecurityException, MessagingException { public void notice(HttpServletRequest request, HttpServletResponse response, @RequestBody List<AlarmMessageDto> alarmMessageList) throws GeneralSecurityException, MessagingException {
skyWalkingNoticeService.send("邮件主题", "邮件内容"); skyWalkingNoticeService.send(alarmMessageList);
} }
} }
package com.bailuntec.dto;
import lombok.Data;
@Data
public class AlarmMessageDto {
private Integer scopeId;
private String name;
private Integer id0;
private Integer id1;
private String alarmMessage;
private long startTime;
}
...@@ -19,6 +19,7 @@ rules: ...@@ -19,6 +19,7 @@ rules:
# Rule unique name, must be ended with `_rule`. # Rule unique name, must be ended with `_rule`.
service_resp_time_rule: service_resp_time_rule:
indicator-name: service_resp_time indicator-name: service_resp_time
metrics-name: service_resp_time
op: ">" op: ">"
threshold: 1000 threshold: 1000
period: 10 period: 10
...@@ -28,6 +29,7 @@ rules: ...@@ -28,6 +29,7 @@ rules:
service_sla_rule: service_sla_rule:
# Indicator value need to be long, double or int # Indicator value need to be long, double or int
indicator-name: service_sla indicator-name: service_sla
metrics-name: service_sla
op: "<" op: "<"
threshold: 8000 threshold: 8000
# The length of time to evaluate the metric # The length of time to evaluate the metric
...@@ -40,6 +42,7 @@ rules: ...@@ -40,6 +42,7 @@ rules:
service_p90_sla_rule: service_p90_sla_rule:
# Indicator value need to be long, double or int # Indicator value need to be long, double or int
indicator-name: service_p90 indicator-name: service_p90
metrics-name: service_p90
op: ">" op: ">"
threshold: 1000 threshold: 1000
period: 10 period: 10
...@@ -48,6 +51,7 @@ rules: ...@@ -48,6 +51,7 @@ rules:
message: 90% response time of service {name} is more than 1000ms in 3 minutes of last 10 minutes message: 90% response time of service {name} is more than 1000ms in 3 minutes of last 10 minutes
service_instance_resp_time_rule: service_instance_resp_time_rule:
indicator-name: service_instance_resp_time indicator-name: service_instance_resp_time
metrics-name: service_instance_resp_time
op: ">" op: ">"
threshold: 1000 threshold: 1000
period: 10 period: 10
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment