Commit 86cd50b9 by yinyong

update config

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