diff --git a/sermant-plugins/sermant-flowcontrol/flowcontrol-service/pom.xml b/sermant-plugins/sermant-flowcontrol/flowcontrol-service/pom.xml index a659015cf1..15c06f44f0 100644 --- a/sermant-plugins/sermant-flowcontrol/flowcontrol-service/pom.xml +++ b/sermant-plugins/sermant-flowcontrol/flowcontrol-service/pom.xml @@ -37,7 +37,8 @@ service false 1.7.1 - 2.11.0 + 2.13.4.1 + 2.13.4 0.16.0 @@ -70,7 +71,7 @@ com.fasterxml.jackson.core jackson-core - ${jackson.version} + ${jackson.core.version} com.fasterxml.jackson.core diff --git a/sermant-plugins/sermant-service-removal/removal-service/src/main/java/com/huaweicloud/sermant/event/RemovalEventDefinitions.java b/sermant-plugins/sermant-service-removal/removal-service/src/main/java/com/huaweicloud/sermant/event/RemovalEventDefinitions.java index adea9910c6..af62126e97 100644 --- a/sermant-plugins/sermant-service-removal/removal-service/src/main/java/com/huaweicloud/sermant/event/RemovalEventDefinitions.java +++ b/sermant-plugins/sermant-service-removal/removal-service/src/main/java/com/huaweicloud/sermant/event/RemovalEventDefinitions.java @@ -30,13 +30,13 @@ public enum RemovalEventDefinitions { * 离群实例摘除事件 */ INSTANCE_REMOVAL("INSTANCE_REMOVAL", EventType.GOVERNANCE, EventLevel.IMPORTANT, "removal", - "Outlier instance removal"), + "The outlier instance is removed and the instance information is: "), /** * 离群实例恢复事件 */ INSTANCE_RECOVERY("INSTANCE_RECOVERY", EventType.GOVERNANCE, EventLevel.IMPORTANT, "removal", - "Outlier instance recovery"),; + "The outlier instance is recovery and the instance information is: "),; /** * 事件名称 */ diff --git a/sermant-plugins/sermant-service-removal/removal-service/src/main/java/com/huaweicloud/sermant/service/RemovalEventServiceImpl.java b/sermant-plugins/sermant-service-removal/removal-service/src/main/java/com/huaweicloud/sermant/service/RemovalEventServiceImpl.java index 4ce683a3a0..638f7404f7 100644 --- a/sermant-plugins/sermant-service-removal/removal-service/src/main/java/com/huaweicloud/sermant/service/RemovalEventServiceImpl.java +++ b/sermant-plugins/sermant-service-removal/removal-service/src/main/java/com/huaweicloud/sermant/service/RemovalEventServiceImpl.java @@ -32,6 +32,8 @@ * @since 2023-02-27 */ public class RemovalEventServiceImpl implements RemovalEventService { + private static final String CONNECTOR = ":"; + private final RemovalEventCollector removalEventCollector = new RemovalEventCollector(); private final RemovalConfig removalConfig = PluginConfigManager.getConfig(RemovalConfig.class); @@ -52,23 +54,25 @@ public void stop() { @Override public void reportRemovalEvent(InstanceInfo info) { - removalEventCollector.offerEvent(getEvent(RemovalEventDefinitions.INSTANCE_REMOVAL)); + removalEventCollector.offerEvent(getEvent(RemovalEventDefinitions.INSTANCE_REMOVAL, info)); } /** * 创建事件信息 * * @param eventDefinition 事件定义 + * @param info 实例信息 * @return 事件信息 */ - private static Event getEvent(RemovalEventDefinitions eventDefinition) { - EventInfo eventInfo = new EventInfo(eventDefinition.getName(), eventDefinition.getDescription()); + private static Event getEvent(RemovalEventDefinitions eventDefinition, InstanceInfo info) { + String description = eventDefinition.getDescription() + info.getHost() + CONNECTOR + info.getPort(); + EventInfo eventInfo = new EventInfo(eventDefinition.getName(), description); return new Event(eventDefinition.getScope(), eventDefinition.getEventLevel(), eventDefinition.getEventType(), eventInfo); } @Override public void reportRecoveryEvent(InstanceInfo info) { - removalEventCollector.offerEvent(getEvent(RemovalEventDefinitions.INSTANCE_RECOVERY)); + removalEventCollector.offerEvent(getEvent(RemovalEventDefinitions.INSTANCE_RECOVERY, info)); } }