[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16517929#comment-16517929 ] ASF GitHub Bot commented on SCB-506: liubao68 closed pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java new file mode 100644 index 0..1f100c148 --- /dev/null +++ b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.foundation.common.event; + +public class AlarmEvent { + + Type type; + + public AlarmEvent(Type type) { +this.type = type; + } + + public Type getType() { +return this.type; + } + + public enum Type { +OPEN, +CLOSE + }; +} diff --git a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java index a4e0aa428..22a2cfcdc 100644 --- a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java +++ b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java @@ -31,8 +31,8 @@ private CommandKey() { } public static HystrixCommandGroupKey toHystrixCommandGroupKey(String type, Invocation invocation) { -return HystrixCommandGroupKey.Factory -.asKey(type + "." + invocation.getOperationMeta().getMicroserviceQualifiedName()); +return CustomizeCommandGroupKey.asKey(type + "." + invocation.getOperationMeta().getMicroserviceQualifiedName(), +invocation); } public static HystrixCommandKey toHystrixCommandKey(String type, Invocation invocation) { diff --git a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java new file mode 100644 index 0..c80e926f1 --- /dev/null +++ b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper; + +import org.apache.servicecomb.core.Invocation; + +import com.netflix.hystrix.HystrixCommandGroupKey; +import com.netflix.hystrix.HystrixKey; +import com.netflix.hystrix.util.InternMap; + +/** + * ͨ��CommandGroupKey��ĿЯ��Invocation���־�̬��Ϣ��CircutBreakerEvent��ȡ�� + */ +public class CustomizeCommandGroupKey extends HystrixKey.HystrixKeyDefault implements HystrixCommandGroupKey { + + private Invocation instance; + + public CustomizeCommandGroupKey(String key) { +super(key); + } + + private static final InternMap intern = new InternMap( + new InternM
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16513297#comment-16513297 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-384615018 [![Coverage Status](https://coveralls.io/builds/17504584/badge)](https://coveralls.io/builds/17504584) Coverage decreased (-0.2%) to 87.193% when pulling **f8095bffc1c00ead662f784fdd9adc8cdad9fae0 on xuyiyun0929:alarm** into **5348393b977f5e6a8eac87016dd1f969a7a1e6df on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16513220#comment-16513220 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r195614690 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java ## @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper; + +import org.apache.servicecomb.core.Invocation; + +import com.netflix.hystrix.HystrixCommandGroupKey; +import com.netflix.hystrix.HystrixKey; +import com.netflix.hystrix.util.InternMap; + +public class CustomizeCommandGroupKey extends HystrixKey.HystrixKeyDefault implements HystrixCommandGroupKey { + + private String invocationType; + + private String microserviceName; + + private String schema; + + private String operation; + + public CustomizeCommandGroupKey(Invocation invocation) { +super(invocation.getInvocationType().name() + "." + invocation.getOperationMeta().getMicroserviceQualifiedName()); +this.invocationType = invocation.getInvocationType().name(); +this.microserviceName = invocation.getMicroserviceName(); +this.schema = invocation.getSchemaId(); +this.operation = invocation.getOperationName(); + } + + private static final InternMap intern = + new InternMap( + new InternMap.ValueConstructor() { +@Override +public CustomizeCommandGroupKey create(Invocation invocation) { + return new CustomizeCommandGroupKey(invocation); +} + }); + + + public static HystrixCommandGroupKey asKey(String type, Invocation invocation) { +return intern.interned(invocation); Review comment: Submitted code resolved. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16513215#comment-16513215 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r195614463 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEvent.java ## @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.bizkeeper.event; + + +import org.apache.servicecomb.bizkeeper.CustomizeCommandGroupKey; +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixCommandMetrics; + +public class CircutBreakerEvent extends AlarmEvent { + + private String role; + + private String microservice; + + private String schema; + + private String operation; + + //当前总请求数 + private long currentTotalRequest; + + //当前请求出错计数 + private long currentErrorCount; + + //当前请求出错百分比 + private long currentErrorPercentage; + + private int requestVolumeThreshold; + + private int sleepWindowInMilliseconds; + + private int errorThresholdPercentage; + + public CircutBreakerEvent(HystrixCommandKey commandKey, Type type) { +super(type); +HystrixCommandMetrics hystrixCommandMetrics = +HystrixCommandMetrics.getInstance(commandKey); +if (hystrixCommandMetrics != null) { + CustomizeCommandGroupKey customizeCommandGroupKey = + (CustomizeCommandGroupKey) hystrixCommandMetrics.getCommandGroup(); Review comment: done This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16513207#comment-16513207 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r195613419 ## File path: handlers/handler-bizkeeper/src/test/java/org/apache/servicecomb/bizkeeper/TestCustomCommandGroupKey.java ## @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper; + +import org.apache.servicecomb.core.Invocation; +import org.apache.servicecomb.core.definition.OperationMeta; +import org.apache.servicecomb.swagger.invocation.InvocationType; +import org.junit.Assert; +import org.junit.Test; +import org.mockito.Mockito; + +public class TestCustomCommandGroupKey { + @Test + public void testToHystrixCommandGroupKey() { + +Invocation invocation = Mockito.mock(Invocation.class); + Mockito.when(invocation.getOperationMeta()).thenReturn(Mockito.mock(OperationMeta.class)); + Mockito.when(invocation.getOperationMeta().getMicroserviceQualifiedName()).thenReturn("test2"); + Mockito.when(invocation.getMicroserviceName()).thenReturn("microserviceName"); + Mockito.when(invocation.getInvocationType()).thenReturn(InvocationType.CONSUMER); +Mockito.when(invocation.getSchemaId()).thenReturn("schemaId"); +Mockito.when(invocation.getOperationName()).thenReturn("operationName"); +CustomizeCommandGroupKey customizeCommandGroupKey = +(CustomizeCommandGroupKey) CustomizeCommandGroupKey.asKey("type", invocation); +Assert.assertEquals("CONSUMER", customizeCommandGroupKey.getInvocationType()); +Assert.assertEquals("microserviceName", customizeCommandGroupKey.getMicroserviceName()); +Assert.assertEquals("schemaId", customizeCommandGroupKey.getSchema()); +Assert.assertEquals("operationName", customizeCommandGroupKey.getOperation()); Review comment: done This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16512576#comment-16512576 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-384615018 [![Coverage Status](https://coveralls.io/builds/17492237/badge)](https://coveralls.io/builds/17492237) Coverage decreased (-0.2%) to 87.213% when pulling **b6c65f73f0eb7ef2fe6ebf97e3d7e7e8453a6e49 on xuyiyun0929:alarm** into **5348393b977f5e6a8eac87016dd1f969a7a1e6df on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16510743#comment-16510743 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r194986012 ## File path: handlers/handler-bizkeeper/src/test/java/org/apache/servicecomb/bizkeeper/TestCustomCommandGroupKey.java ## @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper; + +import org.apache.servicecomb.core.Invocation; +import org.apache.servicecomb.core.definition.OperationMeta; +import org.apache.servicecomb.swagger.invocation.InvocationType; +import org.junit.Assert; +import org.junit.Test; +import org.mockito.Mockito; + +public class TestCustomCommandGroupKey { + @Test + public void testToHystrixCommandGroupKey() { + +Invocation invocation = Mockito.mock(Invocation.class); + Mockito.when(invocation.getOperationMeta()).thenReturn(Mockito.mock(OperationMeta.class)); + Mockito.when(invocation.getOperationMeta().getMicroserviceQualifiedName()).thenReturn("test2"); + Mockito.when(invocation.getMicroserviceName()).thenReturn("microserviceName"); + Mockito.when(invocation.getInvocationType()).thenReturn(InvocationType.CONSUMER); +Mockito.when(invocation.getSchemaId()).thenReturn("schemaId"); +Mockito.when(invocation.getOperationName()).thenReturn("operationName"); +CustomizeCommandGroupKey customizeCommandGroupKey = +(CustomizeCommandGroupKey) CustomizeCommandGroupKey.asKey("type", invocation); +Assert.assertEquals("CONSUMER", customizeCommandGroupKey.getInvocationType()); +Assert.assertEquals("microserviceName", customizeCommandGroupKey.getMicroserviceName()); +Assert.assertEquals("schemaId", customizeCommandGroupKey.getSchema()); +Assert.assertEquals("operationName", customizeCommandGroupKey.getOperation()); Review comment: As mentioned above about OOM, we can add a test case to ensure for same operation, CustomizeCommandGroupKey is the same. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16510723#comment-16510723 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r194980743 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEvent.java ## @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.bizkeeper.event; + + +import org.apache.servicecomb.bizkeeper.CustomizeCommandGroupKey; +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixCommandMetrics; + +public class CircutBreakerEvent extends AlarmEvent { + + private String role; + + private String microservice; + + private String schema; + + private String operation; + + //当前总请求数 + private long currentTotalRequest; + + //当前请求出错计数 + private long currentErrorCount; + + //当前请求出错百分比 + private long currentErrorPercentage; + + private int requestVolumeThreshold; + + private int sleepWindowInMilliseconds; + + private int errorThresholdPercentage; + + public CircutBreakerEvent(HystrixCommandKey commandKey, Type type) { +super(type); +HystrixCommandMetrics hystrixCommandMetrics = +HystrixCommandMetrics.getInstance(commandKey); +if (hystrixCommandMetrics != null) { + CustomizeCommandGroupKey customizeCommandGroupKey = + (CustomizeCommandGroupKey) hystrixCommandMetrics.getCommandGroup(); Review comment: Maybe we can check if instance of CustomizeCommandGroupKey and do the following work. Because Hystrix maybe used some where else This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16510718#comment-16510718 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r194980248 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java ## @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper; + +import org.apache.servicecomb.core.Invocation; + +import com.netflix.hystrix.HystrixCommandGroupKey; +import com.netflix.hystrix.HystrixKey; +import com.netflix.hystrix.util.InternMap; + +public class CustomizeCommandGroupKey extends HystrixKey.HystrixKeyDefault implements HystrixCommandGroupKey { + + private String invocationType; + + private String microserviceName; + + private String schema; + + private String operation; + + public CustomizeCommandGroupKey(Invocation invocation) { +super(invocation.getInvocationType().name() + "." + invocation.getOperationMeta().getMicroserviceQualifiedName()); +this.invocationType = invocation.getInvocationType().name(); +this.microserviceName = invocation.getMicroserviceName(); +this.schema = invocation.getSchemaId(); +this.operation = invocation.getOperationName(); + } + + private static final InternMap intern = + new InternMap( + new InternMap.ValueConstructor() { +@Override +public CustomizeCommandGroupKey create(Invocation invocation) { + return new CustomizeCommandGroupKey(invocation); +} + }); + + + public static HystrixCommandGroupKey asKey(String type, Invocation invocation) { +return intern.interned(invocation); Review comment: Will this code cause OOM? Invocation does not implement equals & hashcode This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16509463#comment-16509463 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-384615018 [![Coverage Status](https://coveralls.io/builds/17441465/badge)](https://coveralls.io/builds/17441465) Coverage decreased (-0.2%) to 87.227% when pulling **d3f39df232400d5ef34e462ef582bf0d60139b98 on xuyiyun0929:alarm** into **5348393b977f5e6a8eac87016dd1f969a7a1e6df on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16509292#comment-16509292 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 closed pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java new file mode 100644 index 0..1f100c148 --- /dev/null +++ b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.foundation.common.event; + +public class AlarmEvent { + + Type type; + + public AlarmEvent(Type type) { +this.type = type; + } + + public Type getType() { +return this.type; + } + + public enum Type { +OPEN, +CLOSE + }; +} diff --git a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java index a4e0aa428..90d3672e5 100644 --- a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java +++ b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java @@ -31,8 +31,7 @@ private CommandKey() { } public static HystrixCommandGroupKey toHystrixCommandGroupKey(String type, Invocation invocation) { -return HystrixCommandGroupKey.Factory -.asKey(type + "." + invocation.getOperationMeta().getMicroserviceQualifiedName()); +return CustomizeCommandGroupKey.asKey(type, invocation); } public static HystrixCommandKey toHystrixCommandKey(String type, Invocation invocation) { diff --git a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java new file mode 100644 index 0..cdb5b6f2e --- /dev/null +++ b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper; + +import org.apache.servicecomb.core.Invocation; + +import com.netflix.hystrix.HystrixCommandGroupKey; +import com.netflix.hystrix.HystrixKey; +import com.netflix.hystrix.util.InternMap; + +public class CustomizeCommandGroupKey extends HystrixKey.HystrixKeyDefault implements HystrixCommandGroupKey { + + private String invocationType; + + private String microserviceName; + + private String schema; + + private String operation; + + public CustomizeCommandGroupKey(Invocation invocation) { +super(invocation.getInvocationType().name() + "." + invocation.getOperationMeta().getMicroserviceQualifiedName()); +this.invocationType = invocation.getI
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16509293#comment-16509293 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 opened a new pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16507572#comment-16507572 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r194279099 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationServerListFilter.java ## @@ -91,19 +94,20 @@ private boolean allowVisit(Server server) { ServerStats serverStats = stats.getSingleServerStat(server); long totalRequest = serverStats.getTotalRequestsCount(); long failureRequest = serverStats.getSuccessiveConnectionFailureCount(); - +int currentCountinuousFailureCount = ((CseServer) server).getCountinuousFailureCount(); Review comment: done. Calculate currentErrorThresholdPercentage after the conditions are met This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16507566#comment-16507566 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r194277099 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.atomic.AtomicBoolean; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitFlag来记录被熔断的接口 + */ + private ConcurrentHashMapEx circuitFlag = new ConcurrentHashMapEx<>(); + + public EventManager eventManager = new EventManager(); + + @SuppressWarnings("static-access") Review comment: Avoid using global instances directly with EventManager.getEventBus(): EventBus eventBus = EventManager.getEventBus(); This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16507558#comment-16507558 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r194276834 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEvent.java ## @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.bizkeeper.event; + +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixCommandMetrics; + +public class CircutBreakerEvent extends AlarmEvent { + + private String role; + + private String microservice; + + private String schema; + + private String operation; + + //当前总请求数 + private long currentTotalRequest; + + //当前请求出错计数 + private long currentErrorCount; + + //当前请求出错百分比 + private long currentErrorPercentage; + + private int requestVolumeThreshold; + + private int sleepWindowInMilliseconds; + + private int errorThresholdPercentage; + + public CircutBreakerEvent(HystrixCommandKey commandKey, Type type) { +super(type); +HystrixCommandMetrics hystrixCommandMetrics = +HystrixCommandMetrics.getInstance(commandKey); +String[] arrayKey = commandKey.name().split("\\."); Review comment: done This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505860#comment-16505860 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 opened a new pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: Java-chassis-1.0.0 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505859#comment-16505859 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 closed pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java new file mode 100644 index 0..1f100c148 --- /dev/null +++ b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.foundation.common.event; + +public class AlarmEvent { + + Type type; + + public AlarmEvent(Type type) { +this.type = type; + } + + public Type getType() { +return this.type; + } + + public enum Type { +OPEN, +CLOSE + }; +} diff --git a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java index a4e0aa428..90d3672e5 100644 --- a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java +++ b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java @@ -31,8 +31,7 @@ private CommandKey() { } public static HystrixCommandGroupKey toHystrixCommandGroupKey(String type, Invocation invocation) { -return HystrixCommandGroupKey.Factory -.asKey(type + "." + invocation.getOperationMeta().getMicroserviceQualifiedName()); +return CustomizeCommandGroupKey.asKey(type, invocation); } public static HystrixCommandKey toHystrixCommandKey(String type, Invocation invocation) { diff --git a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java new file mode 100644 index 0..cdb5b6f2e --- /dev/null +++ b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper; + +import org.apache.servicecomb.core.Invocation; + +import com.netflix.hystrix.HystrixCommandGroupKey; +import com.netflix.hystrix.HystrixKey; +import com.netflix.hystrix.util.InternMap; + +public class CustomizeCommandGroupKey extends HystrixKey.HystrixKeyDefault implements HystrixCommandGroupKey { + + private String invocationType; + + private String microserviceName; + + private String schema; + + private String operation; + + public CustomizeCommandGroupKey(Invocation invocation) { +super(invocation.getInvocationType().name() + "." + invocation.getOperationMeta().getMicroserviceQualifiedName()); +this.invocationType = invocation.getI
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499663#comment-16499663 ] ASF GitHub Bot commented on SCB-506: WillemJiang commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-394215187 Any update for this PR? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16488372#comment-16488372 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r190457961 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.atomic.AtomicBoolean; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitFlag来记录被熔断的接口 + */ + private ConcurrentHashMapEx circuitFlag = new ConcurrentHashMapEx<>(); + + public EventManager eventManager = new EventManager(); + + @SuppressWarnings("static-access") + @Override + public synchronized void markEvent(HystrixEventType eventType, HystrixCommandKey key) { Review comment: Mistake, I will remove it This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16488354#comment-16488354 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-384615018 [![Coverage Status](https://coveralls.io/builds/17139464/badge)](https://coveralls.io/builds/17139464) Coverage increased (+0.002%) to 87.394% when pulling **533dcc88019220c8b409837024bd592f718d56b4 on xuyiyun0929:alarm** into **5348393b977f5e6a8eac87016dd1f969a7a1e6df on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16488352#comment-16488352 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r190454316 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEvent.java ## @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.bizkeeper.event; + +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixCommandMetrics; + +public class CircutBreakerEvent extends AlarmEvent { + + private String role; + + private String microservice; + + private String schema; + + private String operation; + + //当前总请求数 + private long currentTotalRequest; + + //当前请求出错计数 + private long currentErrorCount; + + //当前请求出错百分比 + private long currentErrorPercentage; + + private int requestVolumeThreshold; + + private int sleepWindowInMilliseconds; + + private int errorThresholdPercentage; + + public CircutBreakerEvent(HystrixCommandKey commandKey, Type type) { +super(type); +HystrixCommandMetrics hystrixCommandMetrics = +HystrixCommandMetrics.getInstance(commandKey); +String[] arrayKey = commandKey.name().split("\\."); Review comment: is it possible to customize HystrixCommandGroupKey to avoid always split string? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16488341#comment-16488341 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r190453481 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.atomic.AtomicBoolean; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitFlag来记录被熔断的接口 + */ + private ConcurrentHashMapEx circuitFlag = new ConcurrentHashMapEx<>(); + + public EventManager eventManager = new EventManager(); + + @SuppressWarnings("static-access") + @Override + public synchronized void markEvent(HystrixEventType eventType, HystrixCommandKey key) { Review comment: why synchronized? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16488340#comment-16488340 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r190453446 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.atomic.AtomicBoolean; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitFlag来记录被熔断的接口 + */ + private ConcurrentHashMapEx circuitFlag = new ConcurrentHashMapEx<>(); + + public EventManager eventManager = new EventManager(); + + @SuppressWarnings("static-access") Review comment: did you think about why need to suppress this warning?? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16482289#comment-16482289 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189521545 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.atomic.AtomicBoolean; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitFlag来记录被熔断的接口 + */ + private ConcurrentHashMapEx circuitFlag = new ConcurrentHashMapEx<>(); + + public EventManager eventManager = new EventManager(); + + @SuppressWarnings("static-access") + @Override + public synchronized void markEvent(HystrixEventType eventType, HystrixCommandKey key) { +String keyName = key.name(); +AtomicBoolean flag = circuitFlag.computeIfAbsent(keyName, k -> new AtomicBoolean()); +switch (eventType) { + case SHORT_CIRCUITED: +if (flag.compareAndSet(false, true)) { + eventManager.post(new CircutBreakerEvent(key, Type.OPEN)); Review comment: subscriber is difficult to know who is curcuited because key maybe is microservice or schema or operation level subscribers must split the string, and judge by result array length, it's so ugly. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16482282#comment-16482282 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189519409 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationServerListFilter.java ## @@ -91,19 +94,20 @@ private boolean allowVisit(Server server) { ServerStats serverStats = stats.getSingleServerStat(server); long totalRequest = serverStats.getTotalRequestsCount(); long failureRequest = serverStats.getSuccessiveConnectionFailureCount(); - +int currentCountinuousFailureCount = ((CseServer) server).getCountinuousFailureCount(); Review comment: currentErrorThresholdPercentage only need to be calc in one condition but now, always do this calc. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480040#comment-16480040 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189149707 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationServerListFilter.java ## @@ -112,10 +116,18 @@ private boolean allowVisit(Server server) { LOGGER.info("The Service {}'s instance {} has been break, will give a single test opportunity.", microserviceName, server); + EventManager.post(new IsolationServerEvent(microserviceName, totalRequest, currentCountinuousFailureCount, Review comment: done. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480023#comment-16480023 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189147432 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitMarker来记录被熔断的接口 + */ + private static ConcurrentHashMap circuitMarker = new ConcurrentHashMap<>(); + + @Override + public void markEvent(HystrixEventType eventType, HystrixCommandKey key) { +String keyName = key.name(); +switch (eventType) { + case SHORT_CIRCUITED: +if (circuitMarker.get(keyName) == null) { Review comment: Succeeded/failed is not used and has been deleted. Open/close is used to indicate circuit and isolation status. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480024#comment-16480024 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189147665 ## File path: handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java ## @@ -60,29 +63,26 @@ public static void classTeardown() { Deencapsulation.setField(ConfigurationManager.class, "instance", null); Deencapsulation.setField(ConfigurationManager.class, "customConfigurationInstalled", false); Deencapsulation.setField(DynamicPropertyFactory.class, "config", null); +ArchaiusUtils.resetConfig(); Review comment: done,removed other reflections. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480025#comment-16480025 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189148033 ## File path: handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java ## @@ -45,6 +48,8 @@ LoadBalancerStats loadBalancerStats = null; + private List taskList; + Review comment: done This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480020#comment-16480020 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189147962 ## File path: handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java ## @@ -60,29 +63,26 @@ public static void classTeardown() { Deencapsulation.setField(ConfigurationManager.class, "instance", null); Deencapsulation.setField(ConfigurationManager.class, "customConfigurationInstalled", false); Deencapsulation.setField(DynamicPropertyFactory.class, "config", null); +ArchaiusUtils.resetConfig(); } @Before public void setUp() throws Exception { IsolationServerListFilter = new IsolationServerListFilter(); loadBalancerStats = new LoadBalancerStats("loadBalancer"); - -AbstractConfiguration configuration = -(AbstractConfiguration) DynamicPropertyFactory.getBackingConfigurationSource(); -configuration.clearProperty("cse.loadbalance.isolation.enabled"); -configuration.addProperty("cse.loadbalance.isolation.enabled", +ArchaiusUtils.setProperty("cse.loadbalance.isolation.enabled", "true"); - configuration.clearProperty("cse.loadbalance.isolation.enableRequestThreshold"); - configuration.addProperty("cse.loadbalance.isolation.enableRequestThreshold", + ArchaiusUtils.setProperty("cse.loadbalance.isolation.enableRequestThreshold", "3"); taskList = new ArrayList<>(); -EventManager.register(new Object() { +receiveEvent = new Object() { @Subscribe public void onEvent(AlarmEvent isolationServerEvent) { taskList.add(isolationServerEvent); } -}); +}; +EventManager.register(receiveEvent); Review comment: done,save a reference in filter when UT create a new instance for it. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480021#comment-16480021 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189147541 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/event/IsolationServerEvent.java ## @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.loadbalance.event; + +import java.util.HashMap; + +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +public class IsolationServerEvent extends AlarmEvent { + + private String microserviceName; + + //当前实例总请求数 + private long currentTotalRequest; + + //当前实例连续出错次数 + private int currentCountinuousFailureCount; + + //当前实例出错百分比 + private double currentErrorPercentage; + + private long enableRequestThreshold; + + private int continuousFailureThreshold; + + private int errorThresholdPercentage; + + private long singleTestTime; + + public IsolationServerEvent(String microserviceName, long totalRequest, int currentCountinuousFailureCount, + double currentErrorPercentage, int continuousFailureThreshold, + int errorThresholdPercentage, long enableRequestThreshold, long singleTestTime, Type type) { +super(type); +HashMap msg = new HashMap<>(); +this.microserviceName = microserviceName; +this.currentTotalRequest = totalRequest; +this.currentCountinuousFailureCount = currentCountinuousFailureCount; +this.currentErrorPercentage = currentErrorPercentage; +this.enableRequestThreshold = enableRequestThreshold; +this.continuousFailureThreshold = continuousFailureThreshold; +this.errorThresholdPercentage = errorThresholdPercentage; +this.singleTestTime = singleTestTime; +msg.put("microserviceName", this.microserviceName); Review comment: done,Removed map This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480022#comment-16480022 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r188549839 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationServerListFilter.java ## @@ -91,19 +94,20 @@ private boolean allowVisit(Server server) { ServerStats serverStats = stats.getSingleServerStat(server); long totalRequest = serverStats.getTotalRequestsCount(); long failureRequest = serverStats.getSuccessiveConnectionFailureCount(); - +int currentCountinuousFailureCount = ((CseServer) server).getCountinuousFailureCount(); Review comment: The event post needs these values, these are used as the parameters for the event post. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16478524#comment-16478524 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-384615018 [![Coverage Status](https://coveralls.io/builds/17026195/badge)](https://coveralls.io/builds/17026195) Coverage decreased (-0.1%) to 87.261% when pulling **d08c751fea23364c603f7edf322ba3acfb9c7729 on xuyiyun0929:alarm** into **5348393b977f5e6a8eac87016dd1f969a7a1e6df on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16470394#comment-16470394 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187331013 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationServerListFilter.java ## @@ -112,10 +116,18 @@ private boolean allowVisit(Server server) { LOGGER.info("The Service {}'s instance {} has been break, will give a single test opportunity.", microserviceName, server); + EventManager.post(new IsolationServerEvent(microserviceName, totalRequest, currentCountinuousFailureCount, Review comment: still use global instance? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16470390#comment-16470390 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187330052 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationServerListFilter.java ## @@ -91,19 +94,20 @@ private boolean allowVisit(Server server) { ServerStats serverStats = stats.getSingleServerStat(server); long totalRequest = serverStats.getTotalRequestsCount(); long failureRequest = serverStats.getSuccessiveConnectionFailureCount(); - +int currentCountinuousFailureCount = ((CseServer) server).getCountinuousFailureCount(); Review comment: why move calc to this place? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16470388#comment-16470388 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187329477 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/event/IsolationServerEvent.java ## @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.loadbalance.event; + +import java.util.HashMap; + +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +public class IsolationServerEvent extends AlarmEvent { + + private String microserviceName; + + //当前实例总请求数 + private long currentTotalRequest; + + //当前实例连续出错次数 + private int currentCountinuousFailureCount; + + //当前实例出错百分比 + private double currentErrorPercentage; + + private long enableRequestThreshold; + + private int continuousFailureThreshold; + + private int errorThresholdPercentage; + + private long singleTestTime; + + public IsolationServerEvent(String microserviceName, long totalRequest, int currentCountinuousFailureCount, + double currentErrorPercentage, int continuousFailureThreshold, + int errorThresholdPercentage, long enableRequestThreshold, long singleTestTime, Type type) { +super(type); +HashMap msg = new HashMap<>(); +this.microserviceName = microserviceName; +this.currentTotalRequest = totalRequest; +this.currentCountinuousFailureCount = currentCountinuousFailureCount; +this.currentErrorPercentage = currentErrorPercentage; +this.enableRequestThreshold = enableRequestThreshold; +this.continuousFailureThreshold = continuousFailureThreshold; +this.errorThresholdPercentage = errorThresholdPercentage; +this.singleTestTime = singleTestTime; +msg.put("microserviceName", this.microserviceName); Review comment: why we need not only model, but also map? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16470387#comment-16470387 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187329270 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitMarker来记录被熔断的接口 + */ + private static ConcurrentHashMap circuitMarker = new ConcurrentHashMap<>(); + + @Override + public void markEvent(HystrixEventType eventType, HystrixCommandKey key) { +String keyName = key.name(); +switch (eventType) { + case SHORT_CIRCUITED: +if (circuitMarker.get(keyName) == null) { Review comment: ConcurrentHashMapEx circuitFlag = new ConcurrentHashMapEx<>(); AtomicBoolean flag = circuitFlag.computeIfAbsent(key, k -> new AtomicBoolean()); // circuit event if (flag.compareAndSet(false, true)) { // post xxx event } // success event if (flag.compareAndSet(true, false)) { // post xxx event } --- and infact, i don't know what does eventType mean, open/close/succeeded/failed This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16470196#comment-16470196 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187295182 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitMarker来记录被熔断的接口 + */ + private static ConcurrentHashMap circuitMarker = new ConcurrentHashMap<>(); + + @Override + public void markEvent(HystrixEventType eventType, HystrixCommandKey key) { +String keyName = key.name(); +switch (eventType) { + case SHORT_CIRCUITED: +if (circuitMarker.get(keyName) == null) { Review comment: subscribers only need switch event, We need only send event when last time is OPEN and turn to be CLOSED. Can't send for each invocation.I discussed with Liu Bao. about concurrency problem,can you provide some improvement suggestions? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16469922#comment-16469922 ] ASF GitHub Bot commented on SCB-506: wujimin commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-387951815 why did not changed by review message and did not wrote any response? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16469924#comment-16469924 ] ASF GitHub Bot commented on SCB-506: wujimin commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-387951815 why did not changed by review message and did not wrote any response? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16469921#comment-16469921 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187239668 ## File path: handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java ## @@ -60,29 +63,26 @@ public static void classTeardown() { Deencapsulation.setField(ConfigurationManager.class, "instance", null); Deencapsulation.setField(ConfigurationManager.class, "customConfigurationInstalled", false); Deencapsulation.setField(DynamicPropertyFactory.class, "config", null); +ArchaiusUtils.resetConfig(); } @Before public void setUp() throws Exception { IsolationServerListFilter = new IsolationServerListFilter(); loadBalancerStats = new LoadBalancerStats("loadBalancer"); - -AbstractConfiguration configuration = -(AbstractConfiguration) DynamicPropertyFactory.getBackingConfigurationSource(); -configuration.clearProperty("cse.loadbalance.isolation.enabled"); -configuration.addProperty("cse.loadbalance.isolation.enabled", +ArchaiusUtils.setProperty("cse.loadbalance.isolation.enabled", "true"); - configuration.clearProperty("cse.loadbalance.isolation.enableRequestThreshold"); - configuration.addProperty("cse.loadbalance.isolation.enableRequestThreshold", + ArchaiusUtils.setProperty("cse.loadbalance.isolation.enableRequestThreshold", "3"); taskList = new ArrayList<>(); -EventManager.register(new Object() { +receiveEvent = new Object() { @Subscribe public void onEvent(AlarmEvent isolationServerEvent) { taskList.add(isolationServerEvent); } -}); +}; +EventManager.register(receiveEvent); Review comment: EventManager is global instance where is the clear action? and it's better not do this also had wrote this days ago This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16469920#comment-16469920 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187239487 ## File path: handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java ## @@ -60,29 +63,26 @@ public static void classTeardown() { Deencapsulation.setField(ConfigurationManager.class, "instance", null); Deencapsulation.setField(ConfigurationManager.class, "customConfigurationInstalled", false); Deencapsulation.setField(DynamicPropertyFactory.class, "config", null); +ArchaiusUtils.resetConfig(); Review comment: already ArchaiusUtils.resetConfig() why need other reflections? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16469914#comment-16469914 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187238597 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitMarker来记录被熔断的接口 + */ + private static ConcurrentHashMap circuitMarker = new ConcurrentHashMap<>(); + + @Override + public void markEvent(HystrixEventType eventType, HystrixCommandKey key) { +String keyName = key.name(); +switch (eventType) { + case SHORT_CIRCUITED: +if (circuitMarker.get(keyName) == null) { Review comment: remember you said that, subscribers not only need switch event, but also every invocation that circuited. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16469909#comment-16469909 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r187238232 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java ## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.bizkeeper.event; + +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixEventType; +import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier; + +public class CircutBreakerEventNotifier extends HystrixEventNotifier { + + /** + * 使用circuitMarker来记录被熔断的接口 + */ + private static ConcurrentHashMap circuitMarker = new ConcurrentHashMap<>(); + + @Override + public void markEvent(HystrixEventType eventType, HystrixCommandKey key) { +String keyName = key.name(); +switch (eventType) { + case SHORT_CIRCUITED: +if (circuitMarker.get(keyName) == null) { Review comment: concurrency problem i had wrote this problem days ago. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16468295#comment-16468295 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-384615018 [![Coverage Status](https://coveralls.io/builds/16897188/badge)](https://coveralls.io/builds/16897188) Coverage decreased (-0.2%) to 87.215% when pulling **ecba65107ca72299d38ded981fd1bc8ab152e244 on xuyiyun0929:alarm** into **5348393b977f5e6a8eac87016dd1f969a7a1e6df on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464603#comment-16464603 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r186251122 ## File path: handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java ## @@ -45,6 +48,8 @@ LoadBalancerStats loadBalancerStats = null; + private List taskList; + Review comment: teardown: org.apache.servicecomb.foundation.test.scaffolding.config.ArchaiusUtils.resetConfig This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464602#comment-16464602 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r186251088 ## File path: handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java ## @@ -70,6 +75,14 @@ public void setUp() throws Exception { configuration.clearProperty("cse.loadbalance.isolation.enableRequestThreshold"); Review comment: org.apache.servicecomb.foundation.test.scaffolding.config.ArchaiusUtils.setProperty This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464599#comment-16464599 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r186251045 ## File path: handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java ## @@ -70,6 +75,14 @@ public void setUp() throws Exception { configuration.clearProperty("cse.loadbalance.isolation.enableRequestThreshold"); configuration.addProperty("cse.loadbalance.isolation.enableRequestThreshold", "3"); + +taskList = new ArrayList<>(); +EventManager.register(new Object() { Review comment: global instance it's better do not use this directly. you can save a reference in filter when UT create a new instance for it. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464597#comment-16464597 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r186251016 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -74,6 +83,7 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) { HystrixObservable command = delegate.createBizkeeperCommand(invocation); Observable observable = command.toObservable(); +eventAlarm(invocation); Review comment: // record that we are returning a short-circuited fallback eventNotifier.markEvent(HystrixEventType.SHORT_CIRCUITED, commandKey); when allowRequest return false, will invoke this, it seems that we no need to check everytime. please check is it possible to optimize This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464593#comment-16464593 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r186250938 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -82,6 +92,25 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) { }); } + /** + * 使用circuitMarker来记录被熔断的接口 + * 判断熔断开启或关闭,如果之前没有发送过告警信息才会发送告警 + */ + private void eventAlarm(Invocation invocation) { +HystrixCommandKey commandKey = CommandKey.toHystrixCommandKey(groupname, invocation); +HystrixCircuitBreaker circuitBreaker = +HystrixCircuitBreaker.Factory.getInstance(commandKey); +String microserviceQualifiedName = invocation.getMicroserviceQualifiedName(); +if (circuitBreaker != null && circuitBreaker.isOpen() && circuitMarker.get(microserviceQualifiedName) == null) { + EventManager.post(new CircutBreakerEvent(invocation, commandKey, this.groupname, Type.OPEN)); Review comment: both? by your code, only when break flag changed will post event. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464591#comment-16464591 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r186250923 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEvent.java ## @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.bizkeeper.event; + +import java.util.HashMap; + +import org.apache.servicecomb.bizkeeper.Configuration; +import org.apache.servicecomb.core.Invocation; +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixCommandMetrics; + +public class CircutBreakerEvent extends AlarmEvent { + + private static int id = 1001; + + private HashMap msg = new HashMap<>(); Review comment: someone subscribe CircutBreakerEvent, how to know what's information in it? 1.read doc? 2.run and watch the instance? why not define model, so that developers can get everything by class? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463698#comment-16463698 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-384615018 [![Coverage Status](https://coveralls.io/builds/16832977/badge)](https://coveralls.io/builds/16832977) Coverage decreased (-0.04%) to 87.354% when pulling **1a63868e8ddef89465c4c1affc347d1495020452 on xuyiyun0929:alarm** into **5348393b977f5e6a8eac87016dd1f969a7a1e6df on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463625#comment-16463625 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r186033593 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -82,6 +92,25 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) { }); } + /** + * 使用circuitMarker来记录被熔断的接口 + * 判断熔断开启或关闭,如果之前没有发送过告警信息才会发送告警 + */ + private void eventAlarm(Invocation invocation) { +HystrixCommandKey commandKey = CommandKey.toHystrixCommandKey(groupname, invocation); +HystrixCircuitBreaker circuitBreaker = +HystrixCircuitBreaker.Factory.getInstance(commandKey); +String microserviceQualifiedName = invocation.getMicroserviceQualifiedName(); +if (circuitBreaker != null && circuitBreaker.isOpen() && circuitMarker.get(microserviceQualifiedName) == null) { + EventManager.post(new CircutBreakerEvent(invocation, commandKey, this.groupname, Type.OPEN)); Review comment: both This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463623#comment-16463623 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r18607 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEvent.java ## @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.bizkeeper.event; + +import java.util.HashMap; + +import org.apache.servicecomb.bizkeeper.Configuration; +import org.apache.servicecomb.core.Invocation; +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixCommandMetrics; + +public class CircutBreakerEvent extends AlarmEvent { + + private static int id = 1001; + + private HashMap msg = new HashMap<>(); Review comment: CircutBreakerEvent extends from AlarmEvent,so I think I can use msg.put() directly. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463619#comment-16463619 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r186032008 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -74,6 +83,7 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) { HystrixObservable command = delegate.createBizkeeperCommand(invocation); Observable observable = command.toObservable(); +eventAlarm(invocation); Review comment: yes,we can not know when will do the break action,the break action occurs in the hystrix code,so need this logic, every time. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463437#comment-16463437 ] ASF GitHub Bot commented on SCB-506: WillemJiang commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-386518520 @xuyiyun0929 Could you take a look at the review messages of wujimin? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461162#comment-16461162 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r185535372 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -82,6 +92,25 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) { }); } + /** + * 使用circuitMarker来记录被熔断的接口 + * 判断熔断开启或关闭,如果之前没有发送过告警信息才会发送告警 + */ + private void eventAlarm(Invocation invocation) { +HystrixCommandKey commandKey = CommandKey.toHystrixCommandKey(groupname, invocation); +HystrixCircuitBreaker circuitBreaker = +HystrixCircuitBreaker.Factory.getInstance(commandKey); +String microserviceQualifiedName = invocation.getMicroserviceQualifiedName(); +if (circuitBreaker != null && circuitBreaker.isOpen() && circuitMarker.get(microserviceQualifiedName) == null) { + EventManager.post(new CircutBreakerEvent(invocation, commandKey, this.groupname, Type.OPEN)); Review comment: requirement is want to know the even that some one invocation is broken or break flag change from one to another or both? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461163#comment-16461163 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r185535372 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -82,6 +92,25 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) { }); } + /** + * 使用circuitMarker来记录被熔断的接口 + * 判断熔断开启或关闭,如果之前没有发送过告警信息才会发送告警 + */ + private void eventAlarm(Invocation invocation) { +HystrixCommandKey commandKey = CommandKey.toHystrixCommandKey(groupname, invocation); +HystrixCircuitBreaker circuitBreaker = +HystrixCircuitBreaker.Factory.getInstance(commandKey); +String microserviceQualifiedName = invocation.getMicroserviceQualifiedName(); +if (circuitBreaker != null && circuitBreaker.isOpen() && circuitMarker.get(microserviceQualifiedName) == null) { + EventManager.post(new CircutBreakerEvent(invocation, commandKey, this.groupname, Type.OPEN)); Review comment: requirement is want to know the event that some one invocation is broken or break flag change from one to another or both? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461159#comment-16461159 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r185534113 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEvent.java ## @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.bizkeeper.event; + +import java.util.HashMap; + +import org.apache.servicecomb.bizkeeper.Configuration; +import org.apache.servicecomb.core.Invocation; +import org.apache.servicecomb.foundation.common.event.AlarmEvent; + +import com.netflix.hystrix.HystrixCommandKey; +import com.netflix.hystrix.HystrixCommandMetrics; + +public class CircutBreakerEvent extends AlarmEvent { + + private static int id = 1001; + + private HashMap msg = new HashMap<>(); Review comment: every key is known, why not define a model? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461157#comment-16461157 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r185533766 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -74,6 +83,7 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) { HystrixObservable command = delegate.createBizkeeperCommand(invocation); Observable observable = command.toObservable(); +eventAlarm(invocation); Review comment: need this logic every time ? we can not know when will do the break action? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461155#comment-16461155 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r185533065 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -82,6 +92,25 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) { }); } + /** + * 使用circuitMarker来记录被熔断的接口 + * 判断熔断开启或关闭,如果之前没有发送过告警信息才会发送告警 + */ + private void eventAlarm(Invocation invocation) { +HystrixCommandKey commandKey = CommandKey.toHystrixCommandKey(groupname, invocation); +HystrixCircuitBreaker circuitBreaker = +HystrixCircuitBreaker.Factory.getInstance(commandKey); +String microserviceQualifiedName = invocation.getMicroserviceQualifiedName(); +if (circuitBreaker != null && circuitBreaker.isOpen() && circuitMarker.get(microserviceQualifiedName) == null) { + EventManager.post(new CircutBreakerEvent(invocation, commandKey, this.groupname, Type.OPEN)); + circuitMarker.put(microserviceQualifiedName, true); +} else if (circuitBreaker != null && !circuitBreaker.isOpen() +&& circuitMarker.get(microserviceQualifiedName) != null) { + EventManager.post(new CircutBreakerEvent(invocation, commandKey, this.groupname, Type.CLOSE)); Review comment: even circuitMarker no concurrency problem this logic is not good. multi threads run if conditions and got true, then all run into post and remove logic. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461151#comment-16461151 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r185532292 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -39,6 +46,8 @@ public abstract class BizkeeperHandler implements Handler { private static final Logger LOG = LoggerFactory.getLogger(BizkeeperHandler.class); + private static HashMap circuitMarker = new HashMap<>(); Review comment: concurrency problem? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461149#comment-16461149 ] ASF GitHub Bot commented on SCB-506: wujimin commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r185531931 ## File path: foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java ## @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.foundation.common.event; + +import java.util.HashMap; + +public class AlarmEvent { + + Type type; + + private int id; + + private HashMap msg; + + public AlarmEvent(Type type, int id) { +this.type = type; +this.id = id; + } + + public Type getType() { +return this.type; + } + + public int getId() { +return id; + } + + public HashMap getMsg() { +return msg; + } + + public void setMsg(HashMap msg2) { +this.msg = msg2; + } + + public enum Type { +OPEN, +CLOSE, +SUCCEDED, Review comment: SUCCEEDED? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453914#comment-16453914 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#issuecomment-384615018 [![Coverage Status](https://coveralls.io/builds/16708066/badge)](https://coveralls.io/builds/16708066) Coverage increased (+0.02%) to 87.411% when pulling **a9fa862360f9f8d33edffe072814feffd2c301af on xuyiyun0929:alarm** into **5348393b977f5e6a8eac87016dd1f969a7a1e6df on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453879#comment-16453879 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 opened a new pull request #678: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16451800#comment-16451800 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 closed pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java new file mode 100644 index 0..ecbb5045c --- /dev/null +++ b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.foundation.common.event; + +import java.util.HashMap; + +public class AlarmEvent { + + Type type; + + private int id; + + private HashMap msg; + + public AlarmEvent(Type type, int id) { +this.type = type; +this.id = id; + } + + public Type getType() { +return this.type; + } + + public int getId() { +return id; + } + + public HashMap getMsg() { +return msg; + } + + public void setMsg(HashMap msg2) { +this.msg = msg2; + } + + public enum Type { +OPEN, +CLOSE, +SUCCED, +FAILD + }; +} diff --git a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java index bf6f91140..5c3743a29 100644 --- a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java +++ b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java @@ -17,13 +17,17 @@ package org.apache.servicecomb.bizkeeper; +import org.apache.servicecomb.bizkeeper.event.CircutBreakerEvent; import org.apache.servicecomb.core.Handler; import org.apache.servicecomb.core.Invocation; +import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type; +import org.apache.servicecomb.foundation.common.event.EventManager; import org.apache.servicecomb.swagger.invocation.AsyncResponse; import org.apache.servicecomb.swagger.invocation.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.netflix.hystrix.HystrixCircuitBreaker; import com.netflix.hystrix.HystrixCommandProperties; import com.netflix.hystrix.HystrixInvokable; import com.netflix.hystrix.HystrixObservable; @@ -72,8 +76,14 @@ public BizkeeperHandler(String groupname) { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) { HystrixObservable command = delegate.createBizkeeperCommand(invocation); - Observable observable = command.toObservable(); +HystrixCircuitBreaker circuitBreaker = + HystrixCircuitBreaker.Factory.getInstance(CommandKey.toHystrixCommandKey(groupname, invocation)); +if (circuitBreaker != null && circuitBreaker.isOpen()) { + EventManager.post(new CircutBreakerEvent(invocation, this.groupname, Type.OPEN)); +}else { + EventManager.post(new CircutBreakerEvent(invocation, this.groupname, Type.CLOSE)); +} observable.subscribe(asyncResp::complete, error -> { LOG.warn("catch error in bizkeeper:" + error.getMessage()); asyncResp.fail(invocation.getInvocationType(), error); diff --git a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/FallbackPolicyManager.java b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/FallbackPolicyManager.java index cf0bad2c8..5ce07c243 100644 --- a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/FallbackPolicyManager.java +++ b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/biz
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449402#comment-16449402 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on a change in pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#discussion_r183620187 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -72,8 +76,14 @@ public BizkeeperHandler(String groupname) { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) { HystrixObservable command = delegate.createBizkeeperCommand(invocation); - Observable observable = command.toObservable(); +HystrixCircuitBreaker circuitBreaker = + HystrixCircuitBreaker.Factory.getInstance(CommandKey.toHystrixCommandKey(groupname, invocation)); +if (circuitBreaker != null && circuitBreaker.isOpen()) { + EventManager.post(new CircutBreakerEvent(invocation, this.groupname, Type.OPEN)); +}else { + EventManager.post(new CircutBreakerEvent(invocation, this.groupname, Type.CLOSE)); Review comment: We need only send event when last time is OPEN and turn to be CLOSED. Can't send for each invocation. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449399#comment-16449399 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on a change in pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#discussion_r183619964 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/FallbackPolicyManager.java ## @@ -39,6 +42,7 @@ public static void record(String type, Invocation invocation, Response response, public static Response getFallbackResponse(String type, Throwable error, Invocation invocation) { FallbackPolicy policy = getPolicy(type, invocation); if (policy != null) { + EventManager.post(new FallbackEvent(policy, invocation, Type.OPEN)); Review comment: Fallback is called in HystrixCommand, send event there. But I think this will send a lot of unnecessary events because any error will call fallback. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449395#comment-16449395 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on a change in pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#discussion_r183619352 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -72,8 +76,14 @@ public BizkeeperHandler(String groupname) { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) { HystrixObservable command = delegate.createBizkeeperCommand(invocation); - Observable observable = command.toObservable(); +HystrixCircuitBreaker circuitBreaker = + HystrixCircuitBreaker.Factory.getInstance(CommandKey.toHystrixCommandKey(groupname, invocation)); +if (circuitBreaker != null && circuitBreaker.isOpen()) { + EventManager.post(new CircutBreakerEvent(invocation, this.groupname, Type.OPEN)); Review comment: Format your code use code template in /etc folder and it's better to turn on show blanks in your IDE This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449393#comment-16449393 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on a change in pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#discussion_r183619352 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java ## @@ -72,8 +76,14 @@ public BizkeeperHandler(String groupname) { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) { HystrixObservable command = delegate.createBizkeeperCommand(invocation); - Observable observable = command.toObservable(); +HystrixCircuitBreaker circuitBreaker = + HystrixCircuitBreaker.Factory.getInstance(CommandKey.toHystrixCommandKey(groupname, invocation)); +if (circuitBreaker != null && circuitBreaker.isOpen()) { + EventManager.post(new CircutBreakerEvent(invocation, this.groupname, Type.OPEN)); Review comment: Format your code use code template in /etc folder This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449390#comment-16449390 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on a change in pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#discussion_r183619179 ## File path: foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java ## @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.servicecomb.foundation.common.event; + +import java.util.HashMap; + +public class AlarmEvent { + + Type type; + + private int id; + + private HashMap msg; + + public AlarmEvent(Type type, int id) { +this.type = type; +this.id = id; + } + + public Type getType() { +return this.type; + } + + public int getId() { +return id; + } + + public HashMap getMsg() { +return msg; + } + + public void setMsg(HashMap msg2) { +this.msg = msg2; + } + + public enum Type { +OPEN, +CLOSE, +SUCCED, Review comment: Use SUCCEDED or SUCCESSFUL. When should we use OPEN vs SUCCED? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449384#comment-16449384 ] ASF GitHub Bot commented on SCB-506: liubao68 commented on issue #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#issuecomment-383820433 You have make some related merge. Please fix it or submit a new one. You can refer http://servicecomb.incubator.apache.org/developers/submit-codes/ to create new PR's. And you can directly commit to your new branch for comments fix to your PR. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449381#comment-16449381 ] ASF GitHub Bot commented on SCB-506: coveralls commented on issue #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#issuecomment-383819845 [![Coverage Status](https://coveralls.io/builds/16664255/badge)](https://coveralls.io/builds/16664255) Coverage increased (+0.02%) to 87.395% when pulling **9c358ad8a20778d0beb3775dd78869b519af4102 on xuyiyun0929:alarm** into **43cec8919f32de8311019639bc517fada8c7c704 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445798#comment-16445798 ] ASF GitHub Bot commented on SCB-506: WillemJiang commented on a change in pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#discussion_r183067342 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEvent.java ## @@ -0,0 +1,50 @@ +package org.apache.servicecomb.bizkeeper.event; Review comment: License header please. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445795#comment-16445795 ] ASF GitHub Bot commented on SCB-506: WillemJiang commented on a change in pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#discussion_r183067126 ## File path: handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/event/IsolationServerEvent.java ## @@ -0,0 +1,32 @@ +package org.apache.servicecomb.loadbalance.event; Review comment: License header please. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445796#comment-16445796 ] ASF GitHub Bot commented on SCB-506: WillemJiang commented on a change in pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666#discussion_r183067239 ## File path: handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/FallbackEvent.java ## @@ -0,0 +1,27 @@ +package org.apache.servicecomb.bizkeeper.event; Review comment: License header please. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445564#comment-16445564 ] ASF GitHub Bot commented on SCB-506: xuyiyun0929 opened a new pull request #666: [SCB-506]服务治理相关的需要事件上报 URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/666 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16443473#comment-16443473 ] xuyiyun commented on SCB-506: - !_thumb_12493.png|thumbnail! > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-506) 服务治理相关的需要事件上报
[ https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16443472#comment-16443472 ] xuyiyun commented on SCB-506: - 各事件上报,包含字段如图所示 !_thumb_12491.png|thumbnail!!_thumb_12492.png|thumbnail!!_thumb_12493.png|thumbnail! > 服务治理相关的需要事件上报 > - > > Key: SCB-506 > URL: https://issues.apache.org/jira/browse/SCB-506 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis >Reporter: xuyiyun >Assignee: xuyiyun >Priority: Major > > 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成 -- This message was sent by Atlassian JIRA (v7.6.3#76005)