[GitHub] [skywalking] aderm commented on a change in pull request #4353: Optimizing performance reduces es index queries scope by timebucket

2020-02-11 Thread GitBox
aderm commented on a change in pull request #4353: Optimizing performance 
reduces es index queries scope by timebucket
URL: https://github.com/apache/skywalking/pull/4353#discussion_r378083903
 
 

 ##
 File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/DurationUtils.java
 ##
 @@ -213,4 +213,36 @@ private DateTime parseToDateTime(Downsampling 
downsampling, long time) {
 }
 throw new UnexpectedException("Unexpected downsampling: " + 
downsampling.name());
 }
+
+public DateTime startTimeBucket2DateTime(Downsampling downsampling, long 
startTB) {
 
 Review comment:
   Indeed, it maybe faster to convert to long like 202002. When the timebucket 
scope in loop statement add one day or month will trouble. Or maybe convert to 
timestamps,comparing and adding will fast,but also has to convert to Date 
string.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm commented on a change in pull request #4353: Optimizing performance reduces es index queries scope by timebucket

2020-02-11 Thread GitBox
aderm commented on a change in pull request #4353: Optimizing performance 
reduces es index queries scope by timebucket
URL: https://github.com/apache/skywalking/pull/4353#discussion_r378083903
 
 

 ##
 File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/DurationUtils.java
 ##
 @@ -213,4 +213,36 @@ private DateTime parseToDateTime(Downsampling 
downsampling, long time) {
 }
 throw new UnexpectedException("Unexpected downsampling: " + 
downsampling.name());
 }
+
+public DateTime startTimeBucket2DateTime(Downsampling downsampling, long 
startTB) {
 
 Review comment:
   Indeed, it maybe faster to convert to long like 202002. When the timebucket 
scope in loop statement add one day or month will trouble.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm commented on a change in pull request #4353: Optimizing performance reduces es index queries scope by timebucket

2020-02-11 Thread GitBox
aderm commented on a change in pull request #4353: Optimizing performance 
reduces es index queries scope by timebucket
URL: https://github.com/apache/skywalking/pull/4353#discussion_r378083903
 
 

 ##
 File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/DurationUtils.java
 ##
 @@ -213,4 +213,36 @@ private DateTime parseToDateTime(Downsampling 
downsampling, long time) {
 }
 throw new UnexpectedException("Unexpected downsampling: " + 
downsampling.name());
 }
+
+public DateTime startTimeBucket2DateTime(Downsampling downsampling, long 
startTB) {
 
 Review comment:
   Indeed, it maybe faster to convert to long. When the date while loop 
statement is added, it needs to be converted to the character format of the 
date.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] mrproliu commented on issue #4104: [FEATURE] Performance profile at method level in production environment

2020-02-11 Thread GitBox
mrproliu commented on issue #4104: [FEATURE] Performance profile at method 
level in production environment
URL: https://github.com/apache/skywalking/issues/4104#issuecomment-585067724
 
 
   The UI design has been finished.
   - Add task model:
   
![add-task-modal](https://user-images.githubusercontent.com/3417650/74311813-40cacb80-4dab-11ea-9d20-9568546cdc89.png)
   
   - Profile main page:
   
![thread-monitor-page](https://user-images.githubusercontent.com/3417650/74311842-53450500-4dab-11ea-9c1e-ff21c26736f5.png)
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4353: Optimizing performance reduces es index queries scope by timebucket

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4353: Optimizing performance 
reduces es index queries scope by timebucket
URL: https://github.com/apache/skywalking/pull/4353#discussion_r378071809
 
 

 ##
 File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/DurationUtils.java
 ##
 @@ -213,4 +213,36 @@ private DateTime parseToDateTime(Downsampling 
downsampling, long time) {
 }
 throw new UnexpectedException("Unexpected downsampling: " + 
downsampling.name());
 }
+
+public DateTime startTimeBucket2DateTime(Downsampling downsampling, long 
startTB) {
 
 Review comment:
   Currently, you covert to DateTime, then cover to long like `202002`, but 
actually, you could use divide to get `202002` directly and more quickly, right?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4353: Optimizing performance reduces es index queries scope by timebucket

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4353: Optimizing performance 
reduces es index queries scope by timebucket
URL: https://github.com/apache/skywalking/pull/4353#discussion_r378070209
 
 

 ##
 File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/DurationUtils.java
 ##
 @@ -213,4 +213,36 @@ private DateTime parseToDateTime(Downsampling 
downsampling, long time) {
 }
 throw new UnexpectedException("Unexpected downsampling: " + 
downsampling.name());
 }
+
+public DateTime startTimeBucket2DateTime(Downsampling downsampling, long 
startTB) {
 
 Review comment:
   First, time covert should be inside `TimeBucket`, take a look at InfluxDB, 
https://github.com/apache/skywalking/pull/4239/files#diff-df3b7b3f55b25fb0e29e345e7e6cc078.
 Maybe good for you.
   I think you don't need the `DateTime`? Directly convert to long as day/month 
makes more sense?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] codecov-io commented on issue #4353: Optimizing performance reduces es index queries scope by timebucket

2020-02-11 Thread GitBox
codecov-io commented on issue #4353: Optimizing performance reduces es index 
queries scope by timebucket
URL: https://github.com/apache/skywalking/pull/4353#issuecomment-585057389
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4353?src=pr=h1) 
Report
   > Merging 
[#4353](https://codecov.io/gh/apache/skywalking/pull/4353?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking/commit/efed74a79888f9bd72dd6ef6f4b5a6e6dfb2bf77?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking/pull/4353/graphs/tree.svg?width=650=qrILxY5yA8=150=pr)](https://codecov.io/gh/apache/skywalking/pull/4353?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#4353   +/-   ##
   ===
 Coverage   26.19%   26.19%   
   ===
 Files1177 1177   
 Lines   2682126821   
 Branches 3703 3703   
   ===
 Hits 7026 7026   
 Misses  1917819178   
 Partials  617  617
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking/pull/4353?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking/pull/4353?src=pr=footer). 
Last update 
[efed74a...8fe5532](https://codecov.io/gh/apache/skywalking/pull/4353?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] codecov-io edited a comment on issue #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
codecov-io edited a comment on issue #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#issuecomment-584597339
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=h1) 
Report
   > Merging 
[#4344](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking/commit/0635bbe9b637a9baabd2ca244cdf99e6d9f62efe?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking/pull/4344/graphs/tree.svg?width=650=qrILxY5yA8=150=pr)](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#4344   +/-   ##
   ===
 Coverage   26.43%   26.43%   
   ===
 Files1180 1180   
 Lines   2676726767   
 Branches 3696 3696   
   ===
 Hits 7075 7075   
 Misses  1906519065   
 Partials  627  627
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=footer). 
Last update 
[0635bbe...abaee0f](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on issue #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#issuecomment-585052587
 
 
   @kezhenxu94 Recheck?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r378059399
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/AlarmRulesWatcher.java
 ##
 @@ -18,23 +18,22 @@
 
 package org.apache.skywalking.oap.server.core.alarm.provider;
 
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import lombok.Getter;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.skywalking.oap.server.configuration.api.ConfigChangeWatcher;
 import org.apache.skywalking.oap.server.core.Const;
 import org.apache.skywalking.oap.server.core.alarm.AlarmModule;
+import 
org.apache.skywalking.oap.server.core.alarm.provider.grpc.GRPCAlarmSetting;
 
 Review comment:
   FYI @kezhenxu94 By following your style, do we have a format way to make 
sure all these imports are in the same order rather than different people using 
different orders.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
wu-sheng commented on issue #4327: Tag annotation supports returned expression
URL: https://github.com/apache/skywalking/pull/4327#issuecomment-585046372
 
 
   Welcome to be 205th contributor of this repo.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[skywalking] branch grpc_alarm updated (0635bbe -> abaee0f)

2020-02-11 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch grpc_alarm
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


from 0635bbe  fix.
 add e5366c0  Tag annotation supports returned expression (#4327)
 add abaee0f  Merge branch 'master' into grpc_alarm

No new revisions were added by this update.

Summary of changes:
 .../apm/agent/core/util/CustomizeExpression.java   |  24 +++
 .../trace/TagAnnotationMethodInterceptor.java  |  39 +++--
 .../trace/TraceAnnotationMethodInterceptor.java|  37 +++--
 .../apm/toolkit/activation/util/TagUtil.java   |  43 ++
 .../activation/trace/TagAnnotationTest.java| 169 +
 .../activation/trace/TraceAnnotationTest.java  |  76 -
 .../java-agent/Application-toolkit-trace.md|   8 +-
 .../config/expectedData.yaml   |  15 ++
 .../apache/skywalking/apm/toolkit/model/User.java  |  28 ++--
 .../toolkit/controller/TestController.java |   1 +
 .../testcase/toolkit/controller/TestService.java   |   6 +
 11 files changed, 405 insertions(+), 41 deletions(-)
 create mode 100644 
apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/util/TagUtil.java
 create mode 100644 
apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/test/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationTest.java
 copy 
apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/plugin/bytebuddy/Person.java
 => 
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/model/User.java
 (66%)



[GitHub] [skywalking] lxliuxuankb commented on issue #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
lxliuxuankb commented on issue #4327: Tag annotation supports returned 
expression
URL: https://github.com/apache/skywalking/pull/4327#issuecomment-585045240
 
 
   thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 merged pull request #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
kezhenxu94 merged pull request #4327: Tag annotation supports returned 
expression
URL: https://github.com/apache/skywalking/pull/4327
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] codecov-io edited a comment on issue #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
codecov-io edited a comment on issue #4327: Tag annotation supports returned 
expression
URL: https://github.com/apache/skywalking/pull/4327#issuecomment-583735666
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4327?src=pr=h1) 
Report
   > :exclamation: No coverage uploaded for pull request base 
(`master@ee6364e`). [Click here to learn what that 
means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `69.23%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking/pull/4327/graphs/tree.svg?width=650=qrILxY5yA8=150=pr)](https://codecov.io/gh/apache/skywalking/pull/4327?src=pr=tree)
   
   ```diff
   @@Coverage Diff@@
   ## master#4327   +/-   ##
   =
 Coverage  ?   26.41%   
   =
 Files ? 1178   
 Lines ?26726   
 Branches  ? 3695   
   =
 Hits  ? 7061   
 Misses?19041   
 Partials  ?  624
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/skywalking/pull/4327?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[...lking/apm/agent/core/util/CustomizeExpression.java](https://codecov.io/gh/apache/skywalking/pull/4327/diff?src=pr=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvdXRpbC9DdXN0b21pemVFeHByZXNzaW9uLmphdmE=)
 | `0% <0%> (ø)` | |
   | 
[...tivation/trace/TagAnnotationMethodInterceptor.java](https://codecov.io/gh/apache/skywalking/pull/4327/diff?src=pr=tree#diff-YXBtLXNuaWZmZXIvYXBtLXRvb2xraXQtYWN0aXZhdGlvbi9hcG0tdG9vbGtpdC10cmFjZS1hY3RpdmF0aW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL2FwbS90b29sa2l0L2FjdGl2YXRpb24vdHJhY2UvVGFnQW5ub3RhdGlvbk1ldGhvZEludGVyY2VwdG9yLmphdmE=)
 | `68.96% <75%> (ø)` | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking/pull/4327?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking/pull/4327?src=pr=footer). 
Last update 
[ee6364e...6ae8922](https://codecov.io/gh/apache/skywalking/pull/4327?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[skywalking] branch master updated: Tag annotation supports returned expression (#4327)

2020-02-11 Thread kezhenxu94
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
 new e5366c0  Tag annotation supports returned expression (#4327)
e5366c0 is described below

commit e5366c0921f0ec0052db33aa87ca72257cd3c7f1
Author: lxliuxuankb <389361...@qq.com>
AuthorDate: Wed Feb 12 14:03:02 2020 +0800

Tag annotation supports returned expression (#4327)

Co-authored-by: 吴晟 Wu Sheng 
Co-authored-by: kezhenxu94 
---
 .../apm/agent/core/util/CustomizeExpression.java   |  24 +++
 .../trace/TagAnnotationMethodInterceptor.java  |  39 +++--
 .../trace/TraceAnnotationMethodInterceptor.java|  37 +++--
 .../apm/toolkit/activation/util/TagUtil.java   |  43 ++
 .../activation/trace/TagAnnotationTest.java| 169 +
 .../activation/trace/TraceAnnotationTest.java  |  76 -
 .../java-agent/Application-toolkit-trace.md|   8 +-
 .../config/expectedData.yaml   |  15 ++
 .../apache/skywalking/apm/toolkit/model/User.java  |  45 ++
 .../toolkit/controller/TestController.java |   1 +
 .../testcase/toolkit/controller/TestService.java   |   6 +
 11 files changed, 435 insertions(+), 28 deletions(-)

diff --git 
a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/CustomizeExpression.java
 
b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/CustomizeExpression.java
index df261c7..c03a121 100644
--- 
a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/CustomizeExpression.java
+++ 
b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/CustomizeExpression.java
@@ -47,6 +47,20 @@ public class CustomizeExpression {
 return context;
 }
 
+public static Map evaluationReturnContext(Object ret)  {
+Map context = new HashMap<>();
+Field[] fields = ret.getClass().getDeclaredFields();
+for (Field field : fields) {
+field.setAccessible(true);
+try {
+context.put(field.getName(), field.get(ret));
+} catch (Exception e) {
+logger.debug("evaluationReturnContext error, ret is {}, 
exception is {}", ret, e.getMessage());
+}
+}
+return context;
+}
+
 public static String parseExpression(String expression, Map context) {
 try {
 String[] es = expression.split("\\.");
@@ -56,7 +70,17 @@ public class CustomizeExpression {
 logger.debug("parse expression error, expression is {}, exception 
is {}", expression, e.getMessage());
 }
 return "null";
+}
 
+public static String parseReturnExpression(String expression, Map context) {
+try {
+String[] es = expression.split("\\.");
+Object o = context.get(es[1]);
+return o == null ? "null" : String.valueOf(parse(es, o, 1));
+} catch (Exception e) {
+logger.debug("parse expression error, expression is {}, exception 
is {}", expression, e.getMessage());
+}
+return "null";
 }
 
 private static Object parse(String[] expressions, Object o, int i) {
diff --git 
a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java
 
b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java
index 50bcf33..fcb701c 100644
--- 
a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java
+++ 
b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java
@@ -22,8 +22,8 @@ import java.lang.reflect.Method;
 import java.util.Map;
 
 import org.apache.skywalking.apm.agent.core.context.ContextManager;
-import org.apache.skywalking.apm.agent.core.context.tag.StringTag;
 import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.toolkit.activation.util.TagUtil;
 import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
 import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
 import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
@@ -46,23 +46,42 @@ public class TagAnnotationMethodInterceptor implements 
InstanceMethodsAroundInte
 final Tags tags = method.getAnnotation(Tags.class);
 if (tags != null && tags.value().length > 0) {
 for (final 

[GitHub] [skywalking] kezhenxu94 closed issue #4255: Support evaluation using the returned object

2020-02-11 Thread GitBox
kezhenxu94 closed issue #4255: Support evaluation using the returned object
URL: https://github.com/apache/skywalking/issues/4255
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] codecov-io edited a comment on issue #4228: Support Browser protocol at OAP

2020-02-11 Thread GitBox
codecov-io edited a comment on issue #4228: Support Browser protocol at OAP
URL: https://github.com/apache/skywalking/pull/4228#issuecomment-575036602
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4228?src=pr=h1) 
Report
   > :exclamation: No coverage uploaded for pull request base 
(`master@e86fd78`). [Click here to learn what that 
means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `0%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking/pull/4228/graphs/tree.svg?width=650=qrILxY5yA8=150=pr)](https://codecov.io/gh/apache/skywalking/pull/4228?src=pr=tree)
   
   ```diff
   @@Coverage Diff@@
   ## master#4228   +/-   ##
   =
 Coverage  ?   25.71%   
   =
 Files ? 1212   
 Lines ?27353   
 Branches  ? 3750   
   =
 Hits  ? 7035   
 Misses?19701   
 Partials  ?  617
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/skywalking/pull/4228?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[...g/listener/errorlog/ErrorTrafficSourceBuilder.java](https://codecov.io/gh/apache/skywalking/pull/4228/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctYnJvd3Nlci1yZWNlaXZlci1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9yZWNldmllci9icm93c2VyL3Byb3ZpZGVyL3BhcnNlci9lcnJvcmxvZy9saXN0ZW5lci9lcnJvcmxvZy9FcnJvclRyYWZmaWNTb3VyY2VCdWlsZGVyLmphdmE=)
 | `0% <ø> (ø)` | |
   | 
[...r/browser/provider/BrowserServiceModuleConfig.java](https://codecov.io/gh/apache/skywalking/pull/4228/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctYnJvd3Nlci1yZWNlaXZlci1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9yZWNldmllci9icm93c2VyL3Byb3ZpZGVyL0Jyb3dzZXJTZXJ2aWNlTW9kdWxlQ29uZmlnLmphdmE=)
 | `0% <ø> (ø)` | |
   | 
[...tandardization/BrowserPerfDataStandardization.java](https://codecov.io/gh/apache/skywalking/pull/4228/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctYnJvd3Nlci1yZWNlaXZlci1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9yZWNldmllci9icm93c2VyL3Byb3ZpZGVyL3BhcnNlci9wZXJmb3JtYW5jZS9zdGFuZGFyZGl6YXRpb24vQnJvd3NlclBlcmZEYXRhU3RhbmRhcmRpemF0aW9uLmphdmE=)
 | `0% <ø> (ø)` | |
   | 
[...ier/browser/provider/parser/BrowserDataSource.java](https://codecov.io/gh/apache/skywalking/pull/4228/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctYnJvd3Nlci1yZWNlaXZlci1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9yZWNldmllci9icm93c2VyL3Byb3ZpZGVyL3BhcnNlci9Ccm93c2VyRGF0YVNvdXJjZS5qYXZh)
 | `0% <ø> (ø)` | |
   | 
[...er/errorlog/decorator/BrowserErrorLogCoreInfo.java](https://codecov.io/gh/apache/skywalking/pull/4228/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctYnJvd3Nlci1yZWNlaXZlci1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9yZWNldmllci9icm93c2VyL3Byb3ZpZGVyL3BhcnNlci9lcnJvcmxvZy9kZWNvcmF0b3IvQnJvd3NlckVycm9yTG9nQ29yZUluZm8uamF2YQ==)
 | `0% <ø> (ø)` | |
   | 
[...tandardization/BrowserErrorLogStandardization.java](https://codecov.io/gh/apache/skywalking/pull/4228/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctYnJvd3Nlci1yZWNlaXZlci1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9yZWNldmllci9icm93c2VyL3Byb3ZpZGVyL3BhcnNlci9lcnJvcmxvZy9zdGFuZGFyZGl6YXRpb24vQnJvd3NlckVycm9yTG9nU3RhbmRhcmRpemF0aW9uLmphdmE=)
 | `0% <ø> (ø)` | |
   | 
[...errorlog/BrowserErrorLogParserListenerManager.java](https://codecov.io/gh/apache/skywalking/pull/4228/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctYnJvd3Nlci1yZWNlaXZlci1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9yZWNldmllci9icm93c2VyL3Byb3ZpZGVyL3BhcnNlci9lcnJvcmxvZy9Ccm93c2VyRXJyb3JMb2dQYXJzZXJMaXN0ZW5lck1hbmFnZXIuamF2YQ==)
 | `0% <ø> (ø)` | |
   | 
[.../server/recevier/browser/module/BrowserModule.java](https://codecov.io/gh/apache/skywalking/pull/4228/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctYnJvd3Nlci1yZWNlaXZlci1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9yZWNldmllci9icm93c2VyL21vZHVsZS9Ccm93c2VyTW9kdWxlLmphdmE=)
 | `0% <ø> (ø)` | |
   | 

[GitHub] [skywalking] aderm commented on issue #4291: Improve ES query performance

2020-02-11 Thread GitBox
aderm commented on issue #4291: Improve ES query performance
URL: https://github.com/apache/skywalking/issues/4291#issuecomment-585039094
 
 
   agree, maybe can choose a suitable scenario for large data volumes. But for 
using filters, the occupation of ES-side resources has not been evaluated yet.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm opened a new pull request #4353: Optimizing ES query performance reduces the scope of index queries th…

2020-02-11 Thread GitBox
aderm opened a new pull request #4353: Optimizing ES query performance reduces 
the scope of index queries th…
URL: https://github.com/apache/skywalking/pull/4353
 
 
   …rough precise queries
   
   Please answer these questions before submitting pull request
   
   - Why submit this pull request?
   - [ ] Bug fix
   - [ ] New feature provided
   - [x] Improve performance
   
   - Related issues
   #4194
   ___
   ### Bug fix
   - Bug description.
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #4352: About Upgrade 6.2.0 to 6.6.0 questions

2020-02-11 Thread GitBox
wu-sheng commented on issue #4352: About Upgrade 6.2.0 to 6.6.0 questions
URL: https://github.com/apache/skywalking/issues/4352#issuecomment-585027969
 
 
   Read FAQ, doc is there.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng closed issue #4352: About Upgrade 6.2.0 to 6.6.0 questions

2020-02-11 Thread GitBox
wu-sheng closed issue #4352: About Upgrade 6.2.0 to 6.6.0 questions
URL: https://github.com/apache/skywalking/issues/4352
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] dengliming commented on issue #4352: About Upgrade 6.2.0 to 6.6.0 questions

2020-02-11 Thread GitBox
dengliming commented on issue #4352: About Upgrade 6.2.0 to 6.6.0 questions
URL: https://github.com/apache/skywalking/issues/4352#issuecomment-585026276
 
 
   Is there any way to solve this?And there is no official update 
documentation. @wu-sheng 
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] dengliming edited a comment on issue #4352: About Upgrade 6.2.0 to 6.6.0 questions

2020-02-11 Thread GitBox
dengliming edited a comment on issue #4352: About Upgrade 6.2.0 to 6.6.0 
questions
URL: https://github.com/apache/skywalking/issues/4352#issuecomment-585026276
 
 
   Is there any way to solve this?And there is no official upgrade 
documentation. @wu-sheng 
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] dengliming opened a new issue #4352: About Upgrade 6.2.0 to 6.6.0 questions

2020-02-11 Thread GitBox
dengliming opened a new issue #4352: About Upgrade 6.2.0 to 6.6.0 questions
URL: https://github.com/apache/skywalking/issues/4352
 
 
   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   
   ___
   ### Bug
   - Which version of SkyWalking, OS and JRE?
   
   - Which company or project?
   
   - What happen?
   If possible, provide a way for reproducing the error. e.g. demo application, 
component version.
   
   When I upgrade skywalking 6.2.0 to 6.6.0, The following exception occurs.
   
   
   
   2020-02-12 11:28:01,989 - 
org.apache.skywalking.oap.server.storage.plugin.elasticsearch.cache.NetworkAddressInventoryCacheEsDAO
 - 78 [grpcServerPool-1-thread-2] ERROR [] - null
   java.lang.NullPointerException: null
at 
org.apache.skywalking.oap.server.core.register.NetworkAddressInventory$Builder.map2Data(NetworkAddressInventory.java:151)
 ~[server-core-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.storage.plugin.elasticsearch.cache.NetworkAddressInventoryCacheEsDAO.get(NetworkAddressInventoryCacheEsDAO.java:73)
 [storage-elasticsearch-plugin-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.core.cache.NetworkAddressInventoryCache.get(NetworkAddressInventoryCache.java:80)
 [server-core-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.core.register.service.NetworkAddressInventoryRegister.update(NetworkAddressInventoryRegister.java:113)
 [server-core-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.standardization.SpanExchanger.exchange(SpanExchanger.java:118)
 [skywalking-trace-receiver-plugin-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.SegmentParseV2.preBuild(SegmentParseV2.java:161)
 [skywalking-trace-receiver-plugin-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.SegmentParseV2.parse(SegmentParseV2.java:104)
 [skywalking-trace-receiver-plugin-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.SegmentParseV2$Producer.send(SegmentParseV2.java:282)
 [skywalking-trace-receiver-plugin-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.receiver.trace.provider.handler.v6.grpc.TraceSegmentReportServiceHandler$1.onNext(TraceSegmentReportServiceHandler.java:57)
 [skywalking-trace-receiver-plugin-6.6.0.jar:6.6.0]
at 
org.apache.skywalking.oap.server.receiver.trace.provider.handler.v6.grpc.TraceSegmentReportServiceHandler$1.onNext(TraceSegmentReportServiceHandler.java:49)
 [skywalking-trace-receiver-plugin-6.6.0.jar:6.6.0]
at 
io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:248)
 [grpc-stub-1.15.1.jar:1.15.1]
at 
io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailable(ServerCallImpl.java:263)
 [grpc-core-1.15.1.jar:1.15.1]
at 
io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable.runInContext(ServerImpl.java:683)
 [grpc-core-1.15.1.jar:1.15.1]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) 
[grpc-core-1.15.1.jar:1.15.1]
at 
io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) 
[grpc-core-1.15.1.jar:1.15.1]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[?:1.8.0_65]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[?:1.8.0_65]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]
   
   
   ___
   ### Requirement or improvement
   - Please describe about your requirements or improvement suggestions.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] codecov-io edited a comment on issue #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
codecov-io edited a comment on issue #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#issuecomment-584597339
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=h1) 
Report
   > Merging 
[#4344](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking/commit/2f5a4ee7453dfe82cd0ae6f4a8f27382a9336b44?src=pr=desc)
 will **decrease** coverage by `0.01%`.
   > The diff coverage is `41.3%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking/pull/4344/graphs/tree.svg?width=650=qrILxY5yA8=150=pr)](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=tree)
   
   ```diff
   @@Coverage Diff@@
   ##   master   #4344  +/-   ##
   =
   - Coverage   26.42%   26.4%   -0.02% 
   =
 Files11791180   +1 
 Lines   26743   26767  +24 
 Branches 36903696   +6 
   =
   + Hits 70687069   +1 
   - Misses  19051   19070  +19 
   - Partials  624 628   +4
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[...king/oap/server/library/util/GRPCStreamStatus.java](https://codecov.io/gh/apache/skywalking/pull/4344/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LXV0aWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9saWJyYXJ5L3V0aWwvR1JQQ1N0cmVhbVN0YXR1cy5qYXZh)
 | `0% <ø> (ø)` | |
   | 
[.../server/core/alarm/provider/grpc/GRPCCallback.java](https://codecov.io/gh/apache/skywalking/pull/4344/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYWxhcm0tcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvY29yZS9hbGFybS9wcm92aWRlci9ncnBjL0dSUENDYWxsYmFjay5qYXZh)
 | `60.86% <35.71%> (-11.68%)` | :arrow_down: |
   | 
[...ver/core/alarm/provider/grpc/GRPCAlarmSetting.java](https://codecov.io/gh/apache/skywalking/pull/4344/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYWxhcm0tcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvY29yZS9hbGFybS9wcm92aWRlci9ncnBjL0dSUENBbGFybVNldHRpbmcuamF2YQ==)
 | `50% <50%> (ø)` | |
   | 
[...ap/server/exporter/provider/grpc/GRPCExporter.java](https://codecov.io/gh/apache/skywalking/pull/4344/diff?src=pr=tree#diff-b2FwLXNlcnZlci9leHBvcnRlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2V4cG9ydGVyL3Byb3ZpZGVyL2dycGMvR1JQQ0V4cG9ydGVyLmphdmE=)
 | `75.82% <50%> (-2.34%)` | :arrow_down: |
   | 
[.../skywalking/apm/agent/core/remote/GRPCChannel.java](https://codecov.io/gh/apache/skywalking/pull/4344/diff?src=pr=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENDaGFubmVsLmphdmE=)
 | `81.25% <0%> (-6.25%)` | :arrow_down: |
   | 
[.../agent/core/context/trace/AbstractTracingSpan.java](https://codecov.io/gh/apache/skywalking/pull/4344/diff?src=pr=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvY29udGV4dC90cmFjZS9BYnN0cmFjdFRyYWNpbmdTcGFuLmphdmE=)
 | `61.6% <0%> (-2.68%)` | :arrow_down: |
   | 
[...king/apm/agent/core/remote/GRPCChannelManager.java](https://codecov.io/gh/apache/skywalking/pull/4344/diff?src=pr=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENDaGFubmVsTWFuYWdlci5qYXZh)
 | `69.23% <0%> (-1.29%)` | :arrow_down: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=footer). 
Last update 
[2f5a4ee...0635bbe](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #4228: Support Browser protocol at OAP

2020-02-11 Thread GitBox
wu-sheng commented on issue #4228: Support Browser protocol at OAP
URL: https://github.com/apache/skywalking/pull/4228#issuecomment-585008534
 
 
   > For error logs, if backend can't cache/persistent the context, how do we 
query error details? Error details are needed to analyse code error location.
   
   Context is not the log itself. Context is which PV has an error log already 
or not. Think in this way
   there are 1 -> 1,000,000,000 page accesses, each one of them has random [0, 
5) errors. Then now, the client-js reports an error log, if following your 
proposal, the backend need to query all existing 1m access and check whether 
this page has been counted as an error, then error count could be +1. But 
meanwhile, there is other 1m accesses happen in the next several seconds. Could 
you imagine how much payload this design gives the system?
   That is typical and classics error when we talked about distributed systems 
and distributed statistics.  The backend design must make sure affordable 
resource usage. This principle keeps as always in agent upstream protocol and 
tracing analysis in all language agents. That is why I said `Theoretically, it 
could help the calculation, but in engineering practice, it can't`. We increase 
a little complexity at the agent side, but tradeoff higher performance at the 
backend and storage. This makes SkyWalking could widely used and cost 
reasonable VMs(A.K.A. money for the end users)
   Hope this explanation could make you more clear.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] Fine0830 edited a comment on issue #4228: Support Browser protocol at OAP

2020-02-11 Thread GitBox
Fine0830 edited a comment on issue #4228: Support Browser protocol at OAP
URL: https://github.com/apache/skywalking/pull/4228#issuecomment-584998594
 
 
   @wu-sheng For error logs, if backend can't cache/persistent the context, how 
do we query error details? Error details are needed to analyse code error 
location.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] Fine0830 commented on issue #4228: Support Browser protocol at OAP

2020-02-11 Thread GitBox
Fine0830 commented on issue #4228: Support Browser protocol at OAP
URL: https://github.com/apache/skywalking/pull/4228#issuecomment-584998594
 
 
   @wu-sheng For error logs, if backend can't cache/persistent the context, how 
do we query error details. Error details are needed to analyse code error 
location.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[skywalking] branch grpc_alarm updated (b63fda4 -> 0635bbe)

2020-02-11 Thread tanjian
This is an automated email from the ASF dual-hosted git repository.

tanjian pushed a change to branch grpc_alarm
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


from b63fda4  fix empty settings.
 add 0635bbe  fix.

No new revisions were added by this update.

Summary of changes:
 .../skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[GitHub] [skywalking] wu-sheng commented on issue #4351: Byte-buddy occurs exception when match type.

2020-02-11 Thread GitBox
wu-sheng commented on issue #4351:  Byte-buddy occurs exception when match 
type. 
URL: https://github.com/apache/skywalking/issues/4351#issuecomment-584993480
 
 
   If `org.apache.commons.csv.CSVFormat` can't be found by ByteBuddy in the 
classpath, then this error shows up. But basically, this is a warning. Unless 
you want to instrument this type, this is not an issue.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng closed issue #4351: Byte-buddy occurs exception when match type.

2020-02-11 Thread GitBox
wu-sheng closed issue #4351:  Byte-buddy occurs exception when match type. 
URL: https://github.com/apache/skywalking/issues/4351
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] dmsolr commented on a change in pull request #4239: Provide influxdb as a new storage plugin

2020-02-11 Thread GitBox
dmsolr commented on a change in pull request #4239: Provide influxdb as a new 
storage plugin
URL: https://github.com/apache/skywalking/pull/4239#discussion_r378014958
 
 

 ##
 File path: .github/workflows/e2e.yaml
 ##
 @@ -39,19 +39,21 @@ jobs:
   ./mvnw --batch-mode -Dcheckstyle.skip -Drat.skip -T2 
-Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean install
   ./mvnw --batch-mode -f test/e2e/pom.xml -pl e2e-base clean install
   - name: Single Node Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
 
 Review comment:
   Got it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] dmsolr commented on a change in pull request #4239: Provide influxdb as a new storage plugin

2020-02-11 Thread GitBox
dmsolr commented on a change in pull request #4239: Provide influxdb as a new 
storage plugin
URL: https://github.com/apache/skywalking/pull/4239#discussion_r378014946
 
 

 ##
 File path: .github/workflows/e2e.yaml
 ##
 @@ -39,19 +39,21 @@ jobs:
   ./mvnw --batch-mode -Dcheckstyle.skip -Drat.skip -T2 
-Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean install
   ./mvnw --batch-mode -f test/e2e/pom.xml -pl e2e-base clean install
   - name: Single Node Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
+  - name: Single Node Tests(InfluxDB/JDK8)
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-influxdb
   - name: Single Node Tests(MySQL/JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh e2e-mysql
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh e2e-mysql
   - name: Single Node Tests(JDK9)
-run: export E2E_VERSION=jdk9-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk9-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Single Node Tests(JDK11)
-run: export E2E_VERSION=jdk11-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk11-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Single Node Tests(JDK12)
-run: export E2E_VERSION=jdk12-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk12-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Agent Reboot Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-agent-reboot
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-agent-reboot
 
-  Cluster:
+  Cluster_N_TTL:
 
 Review comment:
   Yes. I will revert it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #4228: Support Browser protocol at OAP

2020-02-11 Thread GitBox
wu-sheng commented on issue #4228: Support Browser protocol at OAP
URL: https://github.com/apache/skywalking/pull/4228#issuecomment-584992794
 
 
   > For PV with JS error in specified time, If server can't know which errors 
belong to which PV now, we can add a parameter to mark in error logs. After 
this, PV with JS error will be calculate. I think it is easy to calculate total 
PV in specified time.
   
   Theoretically, it could help the calculation, but in engineering practice, 
it can't. No matter which parameter(or ID) you gave the error log, the backend 
can't cache/persistent the context. It will be easy to crash the backend as 
endless memory requirements. Also, you should know, the backend is in the 
cluster mode, as millions of browser could be opened at the same time, every 
time you report the data, there is one or multiple Gateways(LBs) to forward the 
data to a random OAP cluster node, which may or may not have the 
context(cached) even we could afford the memory. 
   
   Only solution I could have is, the client knows this is the first report or 
further report for every page, we could add a flag in the log report protocol 
to indicate this. Then the PV with error is only calculated when this new 
flag(isFirstPageErrorReport) is true.
   
   WDYT? @Fine0830 @arugal 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[skywalking] branch grpc_alarm updated (9079ed0 -> b63fda4)

2020-02-11 Thread tanjian
This is an automated email from the ASF dual-hosted git repository.

tanjian pushed a change to branch grpc_alarm
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


from 9079ed0  fix
 add b63fda4  fix empty settings.

No new revisions were added by this update.

Summary of changes:
 .../core/alarm/provider/grpc/GRPCAlarmSetting.java |  5 
 .../core/alarm/provider/grpc/GRPCCallback.java | 27 ++
 .../alarm/provider/grpc/GRPChookCallbackTest.java  | 10 
 3 files changed, 38 insertions(+), 4 deletions(-)



[GitHub] [skywalking] wu-sheng commented on issue #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
wu-sheng commented on issue #4327: Tag annotation supports returned expression
URL: https://github.com/apache/skywalking/pull/4327#issuecomment-584990917
 
 
   Look like CIs are failing. Please check locally before you push to the 
upstream. It will cause the CPU of CI resource pool, which will block other PRs 
processes.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4239: Provide influxdb as a new storage plugin

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4239: Provide influxdb as a new 
storage plugin
URL: https://github.com/apache/skywalking/pull/4239#discussion_r378012577
 
 

 ##
 File path: .github/workflows/e2e.yaml
 ##
 @@ -39,19 +39,21 @@ jobs:
   ./mvnw --batch-mode -Dcheckstyle.skip -Drat.skip -T2 
-Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean install
   ./mvnw --batch-mode -f test/e2e/pom.xml -pl e2e-base clean install
   - name: Single Node Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
 
 Review comment:
   Upgrade to 1.5 please, based on, 
https://github.com/apache/skywalking/issues/4343#issuecomment-584990302


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] Fine0830 edited a comment on issue #4228: Support Browser protocol at OAP

2020-02-11 Thread GitBox
Fine0830 edited a comment on issue #4228: Support Browser protocol at OAP
URL: https://github.com/apache/skywalking/pull/4228#issuecomment-584989598
 
 
   > @Fine0830 It is easy to say like that. Please take a look at the protocol, 
how to implement that? JS error has never been reported, we received error logs 
which you confirmed could be multiple.
   
   Probably, there are some gaps. It is definitive that client-js reports logs 
for one page in multiple times. There is  a common scene.
   
   When user load one page, page report resource errors, then user continue 
view the page for a few minutes, finally user click one button, page report js 
errors.
   
   For the scene, when  client-js catch errors and report to server at once. 
It's impossible to get all the errors at once, as user need to trigger events.
   
   Let's talk about JS error rate, we need to calculate PV. 
   `JS error rate = PV(pv with JS error in specified time) / PV (total PV in 
specified time)`
   For PV with JS error in specified time, If server can't know which errors 
belong to which PV now, we can add a parameter to mark in error logs. After 
this, PV with JS error will be calculate. I think it is easy to calculate total 
PV in specified time.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 closed issue #4343: [e2e] MySQL e2e test could pass even MySQL driver downloaded failure.

2020-02-11 Thread GitBox
kezhenxu94 closed issue #4343: [e2e] MySQL e2e test could pass even MySQL 
driver downloaded failure.
URL: https://github.com/apache/skywalking/issues/4343
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on issue #4343: [e2e] MySQL e2e test could pass even MySQL driver downloaded failure.

2020-02-11 Thread GitBox
kezhenxu94 commented on issue #4343: [e2e] MySQL e2e test could pass even MySQL 
driver downloaded failure.
URL: https://github.com/apache/skywalking/issues/4343#issuecomment-584990302
 
 
   The e2e still passed because the failure (download) stops the replacement of 
`application.yaml`, and it falls back to H2 storage, this is fixed by 
https://github.com/SkyAPMTest/e2e-container/commit/bf4cee3bd5488262a51b33d80fa2246f39ad019f
 and I just released e2e-container 1.5 
https://hub.docker.com/r/skyapm/e2e-container/tags?page=1=last_updated 
since @dmsolr you're upgrading the container versions in your PR, please 
upgrade them to 1.5


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] Fine0830 edited a comment on issue #4228: Support Browser protocol at OAP

2020-02-11 Thread GitBox
Fine0830 edited a comment on issue #4228: Support Browser protocol at OAP
URL: https://github.com/apache/skywalking/pull/4228#issuecomment-584989598
 
 
   > @Fine0830 It is easy to say like that. Please take a look at the protocol, 
how to implement that? JS error has never been reported, we received error logs 
which you confirmed could be multiple.
   
   Probably, there are some gaps. It is definitive that client-js reports logs 
for one page in multiple times. There is  a common scene.
   
   When user load one page, page report resource errors, then user continue 
view the page for a few minutes, finally user click one button, page report js 
errors.
   
   For the scene, when  client-js catch errors and report to server at once. 
It's impossible to get all the errors at once, as user need to trigger events.
   
   Let's talk about JS error rate, we need to calculate PV. 
   `JS error rate = PV(pv with JS error in specified time) / PV (total PV in 
specified time)`
   For PV with JS error in specified time, If server can't know which errors 
belong to which PV now, we can add a parameter to mark. After this, PV with JS 
error will be calculate. I think it is easy to calculate total PV in specified 
time.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] Fine0830 commented on issue #4228: Support Browser protocol at OAP

2020-02-11 Thread GitBox
Fine0830 commented on issue #4228: Support Browser protocol at OAP
URL: https://github.com/apache/skywalking/pull/4228#issuecomment-584989598
 
 
   > @Fine0830 It is easy to say like that. Please take a look at the protocol, 
how to implement that? JS error has never been reported, we received error logs 
which you confirmed could be multiple.
   
   Probably, there are some gaps. It is definitive that client-js reports logs 
for one page in multiple times. There is  a common scene.
   
   When user load one page, page report resource errors, then user continue 
view the page for a few minutes, finally user click one button, page report js 
errors.
   
   For the scene, when  client-js catch errors and report to server at once. 
It's impossible to get all the errors at once, as user need to trigger events.
   
   Let's talk about JS error rate, we need to calculate PV. 
   `JS error rate = PV(pv with JS error in specified time) / PV (total PV in 
specified time)`
   For PV with JS error in specified time, If server can't know which errors 
belong to which PV now, we can add a parameter to mark. I think it is easy to 
calculate total PV in specified time.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4239: Provide influxdb as a new storage plugin

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4239: Provide influxdb as a new 
storage plugin
URL: https://github.com/apache/skywalking/pull/4239#discussion_r378009922
 
 

 ##
 File path: .github/workflows/e2e.yaml
 ##
 @@ -39,19 +39,21 @@ jobs:
   ./mvnw --batch-mode -Dcheckstyle.skip -Drat.skip -T2 
-Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean install
   ./mvnw --batch-mode -f test/e2e/pom.xml -pl e2e-base clean install
   - name: Single Node Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
+  - name: Single Node Tests(InfluxDB/JDK8)
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-influxdb
   - name: Single Node Tests(MySQL/JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh e2e-mysql
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh e2e-mysql
   - name: Single Node Tests(JDK9)
-run: export E2E_VERSION=jdk9-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk9-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Single Node Tests(JDK11)
-run: export E2E_VERSION=jdk11-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk11-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Single Node Tests(JDK12)
-run: export E2E_VERSION=jdk12-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk12-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Agent Reboot Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-agent-reboot
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-agent-reboot
 
-  Cluster:
+  Cluster_N_TTL:
 
 Review comment:
   Three things
   1. N represent AND is not a common case. `+` and `&` are better
   1. This name should not be changed randomly, `Cluster` is a required test, 
without this check(named as `cluster`), we can't merge PR unless we request the 
INFRA change the settings.
   1. If you want the test group names more clear, moving the TTL out of the 
cluster test group makes sense to me. But notice, it will take more time as it 
requires to compile the project again.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4239: Provide influxdb as a new storage plugin

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4239: Provide influxdb as a 
new storage plugin
URL: https://github.com/apache/skywalking/pull/4239#discussion_r378009081
 
 

 ##
 File path: .github/workflows/e2e.yaml
 ##
 @@ -39,19 +39,21 @@ jobs:
   ./mvnw --batch-mode -Dcheckstyle.skip -Drat.skip -T2 
-Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean install
   ./mvnw --batch-mode -f test/e2e/pom.xml -pl e2e-base clean install
   - name: Single Node Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
+  - name: Single Node Tests(InfluxDB/JDK8)
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-influxdb
   - name: Single Node Tests(MySQL/JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh e2e-mysql
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh e2e-mysql
   - name: Single Node Tests(JDK9)
-run: export E2E_VERSION=jdk9-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk9-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Single Node Tests(JDK11)
-run: export E2E_VERSION=jdk11-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk11-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Single Node Tests(JDK12)
-run: export E2E_VERSION=jdk12-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk12-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Agent Reboot Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-agent-reboot
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-agent-reboot
 
-  Cluster:
+  Cluster_N_TTL:
 
 Review comment:
   > What do you mean N_TTL?
   
   Possibly `N` == `And`, we don't need to save 2 letters to cause confusion, 
no?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
wu-sheng commented on issue #4327: Tag annotation supports returned expression
URL: https://github.com/apache/skywalking/pull/4327#issuecomment-584985052
 
 
   Once CI passed, the codes LGTM. Welcome.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4239: Provide influxdb as a new storage plugin

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4239: Provide influxdb as a new 
storage plugin
URL: https://github.com/apache/skywalking/pull/4239#discussion_r378004330
 
 

 ##
 File path: .github/workflows/e2e.yaml
 ##
 @@ -39,19 +39,21 @@ jobs:
   ./mvnw --batch-mode -Dcheckstyle.skip -Drat.skip -T2 
-Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean install
   ./mvnw --batch-mode -f test/e2e/pom.xml -pl e2e-base clean install
   - name: Single Node Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
+  - name: Single Node Tests(InfluxDB/JDK8)
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-influxdb
   - name: Single Node Tests(MySQL/JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh e2e-mysql
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh e2e-mysql
   - name: Single Node Tests(JDK9)
-run: export E2E_VERSION=jdk9-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk9-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Single Node Tests(JDK11)
-run: export E2E_VERSION=jdk11-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk11-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Single Node Tests(JDK12)
-run: export E2E_VERSION=jdk12-1.3 && bash -x test/e2e/run.sh 
e2e-single-service
+run: export E2E_VERSION=jdk12-1.4 && bash -x test/e2e/run.sh 
e2e-single-service
   - name: Agent Reboot Tests(JDK8)
-run: export E2E_VERSION=jdk8-1.3 && bash -x test/e2e/run.sh 
e2e-agent-reboot
+run: export E2E_VERSION=jdk8-1.4 && bash -x test/e2e/run.sh 
e2e-agent-reboot
 
-  Cluster:
+  Cluster_N_TTL:
 
 Review comment:
   What do you mean N_TTL?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
wu-sheng commented on issue #4327: Tag annotation supports returned expression
URL: https://github.com/apache/skywalking/pull/4327#issuecomment-584980509
 
 
   BTW, please check CIs why they are failing.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] dengliming opened a new issue #4351: Byte-buddy occurs exception when match type.

2020-02-11 Thread GitBox
dengliming opened a new issue #4351:  Byte-buddy occurs exception when match 
type. 
URL: https://github.com/apache/skywalking/issues/4351
 
 
   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   
   ___
   ### Bug
   - Which version of SkyWalking, OS and JRE?
   6.6.0
   
   - Which company or project?
   
   - What happen?
   WARN 2020-02-12 09:56:27:497 main ProtectiveShieldMatcher : Byte-buddy 
occurs exception when match type. 
   java.lang.NoClassDefFoundError: org/apache/commons/csv/CSVFormat
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getDeclaredConstructors(Class.java:2020)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.description.method.MethodList$ForLoadedMethods.(MethodList.java:109)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$ForLoadedType.getDeclaredMethods(TypeDescription.java:8433)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.DeclaringMethodMatcher.matches(DeclaringMethodMatcher.java:49)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.DeclaringMethodMatcher.matches(DeclaringMethodMatcher.java:28)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Conjunction.matches(ElementMatcher.java:122)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Disjunction.matches(ElementMatcher.java:160)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Disjunction.matches(ElementMatcher.java:160)
at 
org.apache.skywalking.apm.agent.core.plugin.match.ProtectiveShieldMatcher.matches(ProtectiveShieldMatcher.java:47)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RawMatcher$ForElementMatchers.matches(AgentBuilder.java:1275)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Simple.matches(AgentBuilder.java:9974)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Compound.matches(AgentBuilder.java:10176)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Collector.consider(AgentBuilder.java:6943)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy.apply(AgentBuilder.java:4826)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default.installOn(AgentBuilder.java:9350)
at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default.installOn(AgentBuilder.java:9320)
at 
org.apache.skywalking.apm.agent.SkyWalkingAgent.premain(SkyWalkingAgent.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at 
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
   Caused by: java.lang.ClassNotFoundException: org.apache.commons.csv.CSVFormat
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 25 more
   ___
   ### Requirement or improvement
   - Please describe about your requirements or improvement suggestions.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] jadezhong removed a comment on issue #4292: Improve ES query performance

2020-02-11 Thread GitBox
jadezhong removed a comment on issue #4292: Improve ES query performance
URL: https://github.com/apache/skywalking/pull/4292#issuecomment-584975530
 
 
   ok
   ---原始邮件---
   发件人:"吴晟 Wu Sheng"
   发送时间:2020年2月11日 星期二 下午3:28
   收件人:"apache/skywalking"
   抄送:"jadezhong";"Comment"
   主题:Re: [apache/skywalking] Improve ES query performance (#4292)
   
   any progress?
   
   The conclusion has been made here.#4291 (comment)
   This PR would not improve the performance.
   
   
   You are receiving this because you commented.
   Reply to this email directly,view it on GitHub, orunsubscribe.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] jadezhong commented on issue #4292: Improve ES query performance

2020-02-11 Thread GitBox
jadezhong commented on issue #4292: Improve ES query performance
URL: https://github.com/apache/skywalking/pull/4292#issuecomment-584978651
 
 
   ok


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] jadezhong commented on issue #4292: Improve ES query performance

2020-02-11 Thread GitBox
jadezhong commented on issue #4292: Improve ES query performance
URL: https://github.com/apache/skywalking/pull/4292#issuecomment-584975530
 
 
   ok
   ---原始邮件---
   发件人:"吴晟 Wu Sheng"
   发送时间:2020年2月11日 星期二 下午3:28
   收件人:"apache/skywalking"
   抄送:"jadezhong";"Comment"
   主题:Re: [apache/skywalking] Improve ES query performance (#4292)
   
   any progress?
   
   The conclusion has been made here.#4291 (comment)
   This PR would not improve the performance.
   
   
   You are receiving this because you commented.
   Reply to this email directly,view it on GitHub, orunsubscribe.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4327: Tag annotation supports 
returned expression
URL: https://github.com/apache/skywalking/pull/4327#discussion_r377997459
 
 

 ##
 File path: 
apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java
 ##
 @@ -46,23 +46,47 @@ public void beforeMethod(final EnhancedInstance objInst, 
final Method method, fi
 final Tags tags = method.getAnnotation(Tags.class);
 if (tags != null && tags.value().length > 0) {
 for (final Tag tag : tags.value()) {
-tagSpan(activeSpan, tag, context);
+if (!TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagParamsSpan(activeSpan, context, tag);
+}
 }
 }
 
 final Tag tag = method.getAnnotation(Tag.class);
-if (tag != null) {
-tagSpan(activeSpan, tag, context);
+if (tag != null && !TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagParamsSpan(activeSpan, context, tag);
 }
 }
 
-private void tagSpan(final AbstractSpan span, final Tag tag, final 
Map context) {
-new StringTag(tag.key()).set(span, 
CustomizeExpression.parseExpression(tag.value(), context));
-}
 
 @Override
-public Object afterMethod(final EnhancedInstance objInst, final Method 
method, final Object[] allArguments,
-final Class[] argumentsTypes, final Object ret) {
+public Object afterMethod(
+final EnhancedInstance objInst,
+final Method method,
+final Object[] allArguments,
+final Class[] argumentsTypes,
+final Object ret) {
+try {
+if (ret == null || !ContextManager.isActive()) {
+return ret;
+}
+final AbstractSpan localSpan = ContextManager.activeSpan();
+final Map context = 
CustomizeExpression.evaluationReturnContext(ret);
+final Tags tags = method.getAnnotation(Tags.class);
+if (tags != null && tags.value().length > 0) {
+for (final Tag tag : tags.value()) {
+if (TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagReturnSpanSpan(localSpan, context, tag);
+}
+}
+}
+final Tag tag = method.getAnnotation(Tag.class);
+if (tag != null && TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagReturnSpanSpan(localSpan, context, tag);
+}
+} finally {
+ContextManager.stopSpan();
 
 Review comment:
   We don't create span in the `#beforeMethod`, so please remove the 
`stopSpan()` here, we  cannot stop a span by mistake here


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4327: Tag annotation supports 
returned expression
URL: https://github.com/apache/skywalking/pull/4327#discussion_r377997300
 
 

 ##
 File path: 
apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TraceAnnotationMethodInterceptor.java
 ##
 @@ -56,24 +56,41 @@ public void beforeMethod(EnhancedInstance objInst, Method 
method, Object[] allAr
 final Tags tags = method.getAnnotation(Tags.class);
 if (tags != null && tags.value().length > 0) {
 for (final Tag tag : tags.value()) {
-tagSpan(localSpan, tag, context);
+if (!TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagParamsSpan(localSpan, context, tag);
+}
 }
 }
-
 final Tag tag = method.getAnnotation(Tag.class);
-if (tag != null) {
-tagSpan(localSpan, tag, context);
+if (tag != null && !TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagParamsSpan(localSpan, context, tag);
 }
 }
 
-private void tagSpan(final AbstractSpan span, final Tag tag, final 
Map context) {
-new StringTag(tag.key()).set(span, 
CustomizeExpression.parseExpression(tag.value(), context));
-}
-
 @Override
 public Object afterMethod(EnhancedInstance objInst, Method method, 
Object[] allArguments, Class[] argumentsTypes,
 Object ret) throws Throwable {
-ContextManager.stopSpan();
+try {
+if (ret == null) {
+return ret;
+}
+final AbstractSpan localSpan = ContextManager.activeSpan();
+final Map context = 
CustomizeExpression.evaluationReturnContext(ret);
+final Tags tags = method.getAnnotation(Tags.class);
+if (tags != null && tags.value().length > 0) {
+for (final Tag tag : tags.value()) {
+if (TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagReturnSpanSpan(localSpan, context, tag);
+}
+}
+}
+final Tag tag = method.getAnnotation(Tag.class);
+if (tag != null && TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagReturnSpanSpan(localSpan, context, tag);
+}
+} finally {
+ContextManager.stopSpan();
 
 Review comment:
   > Same here.
   
   There is no conditional creation of span in the `#beforeMethod`, so it's 
right here


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377996822
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+import org.apache.skywalking.oap.server.library.util.GRPCStreamStatus;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
 
 Review comment:
   Anyway, not important thing, mark as resolved


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377996414
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+import org.apache.skywalking.oap.server.library.util.GRPCStreamStatus;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
 
 Review comment:
   > If that, GRPCClient instance will be initialized every time in`doAlarm` 
mthoid, may not appropriate.
   
   Of course you should take care whether the client is initialized or not


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377989703
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+import org.apache.skywalking.oap.server.library.util.GRPCStreamStatus;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
 
 Review comment:
   > What if the user delete the gRPC hooks entirely? Say target host and port 
is empty
   
   If  target host and port is empty, may not step into 
`onGRPCAlarmSettingUpdated` method.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377989703
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+import org.apache.skywalking.oap.server.library.util.GRPCStreamStatus;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
 
 Review comment:
   > What if the user delete the gRPC hooks entirely? Say target host and port 
is empty
   
   If  target host and port is empty, may not step into 
`onGRPCAlarmSettingUpdated` method.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377990396
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+import org.apache.skywalking.oap.server.library.util.GRPCStreamStatus;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
 
 Review comment:
   If that, GRPCClient instance will be initialized every time in`doAlarm` 
mthoid, may not appropriate.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377988008
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+import org.apache.skywalking.oap.server.library.util.GRPCStreamStatus;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
 
 Review comment:
   Alarm is rare in most cases, this client may be lazily initialized (in 
doAlarm method)?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377987571
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,144 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+import org.apache.skywalking.oap.server.library.util.GRPCStreamStatus;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+GRPCStreamStatus status = new GRPCStreamStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+
+// For memory safe of oap, we must wait for the peer confirmation.
+while (!status.isDone()) {
+try {
+sleepTime += cycle;
+Thread.sleep(cycle);
+} catch (InterruptedException ignored) {
+}
+
+if (log.isDebugEnabled()) {
+log.debug("Send {} alarm message to {}:{}.", 

[skywalking] branch grpc_alarm updated (415b15d -> 9079ed0)

2020-02-11 Thread tanjian
This is an automated email from the ASF dual-hosted git repository.

tanjian pushed a change to branch grpc_alarm
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


from 415b15d  fix
 add 9079ed0  fix

No new revisions were added by this update.

Summary of changes:
 .../exporter/provider/grpc/GRPCExporter.java   | 61 --
 .../core/alarm/provider/grpc/GRPCCallback.java | 11 ++--
 .../oap/server/library/util/GRPCStreamStatus.java} | 14 ++---
 3 files changed, 45 insertions(+), 41 deletions(-)
 rename 
oap-server/{server-core/src/main/java/org/apache/skywalking/oap/server/core/exporter/ExportStatus.java
 => 
server-library/library-util/src/main/java/org/apache/skywalking/oap/server/library/util/GRPCStreamStatus.java}
 (83%)



[GitHub] [skywalking] codecov-io edited a comment on issue #4239: Provide influxdb as a new storage plugin

2020-02-11 Thread GitBox
codecov-io edited a comment on issue #4239: Provide influxdb as a new storage 
plugin
URL: https://github.com/apache/skywalking/pull/4239#issuecomment-575965825
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=h1) 
Report
   > :exclamation: No coverage uploaded for pull request base 
(`master@4fda55d`). [Click here to learn what that 
means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `0%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking/pull/4239/graphs/tree.svg?width=650=qrILxY5yA8=150=pr)](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=tree)
   
   ```diff
   @@Coverage Diff@@
   ## master#4239   +/-   ##
   =
 Coverage  ?   25.58%   
   =
 Files ? 1196   
 Lines ?27470   
 Branches  ? 3786   
   =
 Hits  ? 7028   
 Misses?19826   
 Partials  ?  616
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[...server/storage/plugin/influxdb/query/LogQuery.java](https://codecov.io/gh/apache/skywalking/pull/4239/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9xdWVyeS9Mb2dRdWVyeS5qYXZh)
 | `0% <ø> (ø)` | |
   | 
[...r/storage/plugin/influxdb/InfluxStorageConfig.java](https://codecov.io/gh/apache/skywalking/pull/4239/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlQ29uZmlnLmphdmE=)
 | `0% <0%> (ø)` | |
   | 
[...r/storage/plugin/influxdb/query/TopologyQuery.java](https://codecov.io/gh/apache/skywalking/pull/4239/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9xdWVyeS9Ub3BvbG9neVF1ZXJ5LmphdmE=)
 | `0% <0%> (ø)` | |
   | 
[...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4239/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==)
 | `0% <0%> (ø)` | |
   | 
[...age/plugin/influxdb/query/ProfileTaskLogQuery.java](https://codecov.io/gh/apache/skywalking/pull/4239/diff?src=pr=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9xdWVyeS9Qcm9maWxlVGFza0xvZ1F1ZXJ5LmphdmE=)
 | `0% <0%> (ø)` | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=footer). 
Last update 
[4fda55d...4c06a1d](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] codecov-io edited a comment on issue #4239: Provide influxdb as a new storage plugin

2020-02-11 Thread GitBox
codecov-io edited a comment on issue #4239: Provide influxdb as a new storage 
plugin
URL: https://github.com/apache/skywalking/pull/4239#issuecomment-575965825
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=h1) 
Report
   > :exclamation: No coverage uploaded for pull request base 
(`master@4fda55d`). [Click here to learn what that 
means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking/pull/4239/graphs/tree.svg?width=650=qrILxY5yA8=150=pr)](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=tree)
   
   ```diff
   @@Coverage Diff@@
   ## master#4239   +/-   ##
   =
 Coverage  ?   25.57%   
   =
 Files ? 1196   
 Lines ?27470   
 Branches  ? 3786   
   =
 Hits  ? 7026   
 Misses?19827   
 Partials  ?  617
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=footer). 
Last update 
[4fda55d...4c06a1d](https://codecov.io/gh/apache/skywalking/pull/4239?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377743774
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
 
 Review comment:
   Considering `exporter 
grpc`(https://github.com/apache/skywalking/blob/5b255ba3e3b50e0e0196b28cdca21dcd5c9c3da2/oap-server/exporter/src/main/java/org/apache/skywalking/oap/server/exporter/provider/grpc/GRPCExporter.java#L173)
  have 

[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377743774
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
 
 Review comment:
   Considering `exporter 
grpc`(https://github.com/apache/skywalking/blob/5b255ba3e3b50e0e0196b28cdca21dcd5c9c3da2/oap-server/exporter/src/main/java/org/apache/skywalking/oap/server/exporter/provider/grpc/GRPCExporter.java#L173)
  have 

[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377734123
 
 

 ##
 File path: docs/en/setup/backend/backend-alarm.md
 ##
 @@ -113,6 +114,24 @@ Example as following
 }]
 ```
 
+## gRPCHook
+The alarm message will send through remote gRPC method by `Protobuf` content 
type. 
+The message format with following key information which are defined in 
`oap-server/server-alarm-plugin/src/main/proto/alarm-hook.proto`.
 
 Review comment:
   I agree with you, but link `alarm-hook.proto` from docs to `source code` dir 
looks weird. show part of `alarm-hook.proto` and explain `alarm-hook.proto`'s 
location may be more friendly. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377716826
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
 
 Review comment:
   It works, or move `ExportStatus` to higher-level package, such as 
`library-util`.


This is an automated message from the Apache Git Service.
To respond to the message, 

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377711492
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
 
 Review comment:
   > ExportStatus is in exporter, why use it in the alarm?
   
   Maybe a `CountDownLatch` is enough to make it more convenient and safe (in 
terms of thread visibility)?



[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377711492
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
 
 Review comment:
   > ExportStatus is in exporter, why use it in the alarm?
   
   Maybe a `CountDownLatch` makes it more convenient and safe (in terms of 
thread visibility)?


This is an 

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377711492
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
 
 Review comment:
   > ExportStatus is in exporter, why use it in the alarm?
   
   Maybe a `CountDownLatch` makes it more convenient?


This is an automated message from the Apache Git 

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377709241
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
 
 Review comment:
   ExportStatus is in exporter, why use it in the alarm?  


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377706433
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
 
 Review comment:
   Yes, I agree. I missed that last time. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above 

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377670357
 
 

 ##
 File path: docs/en/setup/backend/backend-alarm.md
 ##
 @@ -113,6 +114,24 @@ Example as following
 }]
 ```
 
+## gRPCHook
+The alarm message will send through remote gRPC method by `Protobuf` content 
type. 
+The message format with following key information which are defined in 
`oap-server/server-alarm-plugin/src/main/proto/alarm-hook.proto`.
 
 Review comment:
   We may not need to show "Part of protocol" file, my suggestion is to 
**link** to the `alarm-hook.proto` file directly, because the gRPC receiver may 
be implemented in any language, and the `proto` file is fundamental in any kind 
of implementation. If I were the user, I'd like to click the link and navigate 
to the `proto` file directly, instead of finding in the souce codes myself.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377695139
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
 
 Review comment:
   Dangling Javadoc comment 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With 

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
kezhenxu94 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377694858
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
 
 Review comment:
   There may be thread-visibility issue,  
`org.apache.skywalking.oap.server.core.exporter.ExportStatus#done` is not 
`volatile`, BTW, `ExportStatus` can be annotated with Lombok annotations


[GitHub] [skywalking] wu-sheng commented on issue #4104: [FEATURE] Performance profile at method level in production environment

2020-02-11 Thread GitBox
wu-sheng commented on issue #4104: [FEATURE] Performance profile at method 
level in production environment
URL: https://github.com/apache/skywalking/issues/4104#issuecomment-584682790
 
 
   I will review the UI design draft again tomorrow, and try to finalize with 
@mrproliu 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #4104: [FEATURE] Performance profile at method level in production environment

2020-02-11 Thread GitBox
wu-sheng commented on issue #4104: [FEATURE] Performance profile at method 
level in production environment
URL: https://github.com/apache/skywalking/issues/4104#issuecomment-584673781
 
 
   @Fine0830 Above inform should be ready for your local run and test. UI draft 
is there if you have any issue, please ping me, we could discuss, especially 
about the UI design.
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] hanahmily commented on issue #4347: How can I deploy skywalking 6.6 in k8s

2020-02-11 Thread GitBox
hanahmily commented on issue #4347: How can I deploy skywalking 6.6 in k8s
URL: https://github.com/apache/skywalking/issues/4347#issuecomment-584670681
 
 
   notice you don't intend to use helm to deploy skywalking into Kubernetes
   cluster, Can you share what's your concerns about helm?
   
   JCchenxiang  于2020年2月11日周二 下午4:12写道:
   
   > I see,thanks
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > 
,
   > or unsubscribe
   > 

   > .
   >
   
   
   -- 
   Hongtao Gao
   
   Apache SkyWalking && Apache ShardingSphere
   Twitter, @hanahmily
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] mrproliu commented on issue #4104: [FEATURE] Performance profile at method level in production environment

2020-02-11 Thread GitBox
mrproliu commented on issue #4104: [FEATURE] Performance profile at method 
level in production environment
URL: https://github.com/apache/skywalking/issues/4104#issuecomment-58409
 
 
   The data is ready for the UI team(@Fine0830 ) to access.
   - By running this command, you can start the OAP server locally, which 
already contains the data content:
   `docker run -d -p 12800:12800 -p 9090:9090 mliu111477/profile-graphql:0.0.5`
   
   - Data query related GraphQL has generated query related statements through 
postman(exclude create). [You can refer to this 
file](https://www.getpostman.com/collections/8f84a74da2bb9bb6f118). After 
importing, you can use.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4327: Tag annotation supports 
returned expression
URL: https://github.com/apache/skywalking/pull/4327#discussion_r377671896
 
 

 ##
 File path: 
apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java
 ##
 @@ -46,23 +46,47 @@ public void beforeMethod(final EnhancedInstance objInst, 
final Method method, fi
 final Tags tags = method.getAnnotation(Tags.class);
 if (tags != null && tags.value().length > 0) {
 for (final Tag tag : tags.value()) {
-tagSpan(activeSpan, tag, context);
+if (!TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagParamsSpan(activeSpan, context, tag);
+}
 }
 }
 
 final Tag tag = method.getAnnotation(Tag.class);
-if (tag != null) {
-tagSpan(activeSpan, tag, context);
+if (tag != null && !TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagParamsSpan(activeSpan, context, tag);
 }
 }
 
-private void tagSpan(final AbstractSpan span, final Tag tag, final 
Map context) {
-new StringTag(tag.key()).set(span, 
CustomizeExpression.parseExpression(tag.value(), context));
-}
 
 @Override
-public Object afterMethod(final EnhancedInstance objInst, final Method 
method, final Object[] allArguments,
-final Class[] argumentsTypes, final Object ret) {
+public Object afterMethod(
+final EnhancedInstance objInst,
+final Method method,
+final Object[] allArguments,
+final Class[] argumentsTypes,
+final Object ret) {
+try {
+if (ret == null || !ContextManager.isActive()) {
+return ret;
+}
+final AbstractSpan localSpan = ContextManager.activeSpan();
+final Map context = 
CustomizeExpression.evaluationReturnContext(ret);
+final Tags tags = method.getAnnotation(Tags.class);
+if (tags != null && tags.value().length > 0) {
+for (final Tag tag : tags.value()) {
+if (TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagReturnSpanSpan(localSpan, context, tag);
+}
+}
+}
+final Tag tag = method.getAnnotation(Tag.class);
+if (tag != null && TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagReturnSpanSpan(localSpan, context, tag);
+}
+} finally {
+ContextManager.stopSpan();
 
 Review comment:
   Sorry, this is not right. This could be NPE, if `ContextManager.isActive() 
== false`, right? In `#beforeMethod`,  there is 
   ```java
   if (!ContextManager.isActive()) {
   return;
   }
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4327: Tag annotation supports returned expression

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4327: Tag annotation supports 
returned expression
URL: https://github.com/apache/skywalking/pull/4327#discussion_r377671986
 
 

 ##
 File path: 
apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TraceAnnotationMethodInterceptor.java
 ##
 @@ -56,24 +56,41 @@ public void beforeMethod(EnhancedInstance objInst, Method 
method, Object[] allAr
 final Tags tags = method.getAnnotation(Tags.class);
 if (tags != null && tags.value().length > 0) {
 for (final Tag tag : tags.value()) {
-tagSpan(localSpan, tag, context);
+if (!TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagParamsSpan(localSpan, context, tag);
+}
 }
 }
-
 final Tag tag = method.getAnnotation(Tag.class);
-if (tag != null) {
-tagSpan(localSpan, tag, context);
+if (tag != null && !TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagParamsSpan(localSpan, context, tag);
 }
 }
 
-private void tagSpan(final AbstractSpan span, final Tag tag, final 
Map context) {
-new StringTag(tag.key()).set(span, 
CustomizeExpression.parseExpression(tag.value(), context));
-}
-
 @Override
 public Object afterMethod(EnhancedInstance objInst, Method method, 
Object[] allArguments, Class[] argumentsTypes,
 Object ret) throws Throwable {
-ContextManager.stopSpan();
+try {
+if (ret == null) {
+return ret;
+}
+final AbstractSpan localSpan = ContextManager.activeSpan();
+final Map context = 
CustomizeExpression.evaluationReturnContext(ret);
+final Tags tags = method.getAnnotation(Tags.class);
+if (tags != null && tags.value().length > 0) {
+for (final Tag tag : tags.value()) {
+if (TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagReturnSpanSpan(localSpan, context, tag);
+}
+}
+}
+final Tag tag = method.getAnnotation(Tag.class);
+if (tag != null && TagUtil.isReturnTag(tag.value())) {
+TagUtil.tagReturnSpanSpan(localSpan, context, tag);
+}
+} finally {
+ContextManager.stopSpan();
 
 Review comment:
   Same here.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377668907
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+grpcClient.connect();
+alarmServiceStub = AlarmServiceGrpc.newStub(grpcClient.getChannel());
 
 Review comment:
   We should, but, the setting could not change here.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[skywalking] branch grpc_alarm updated (3b26c16 -> 415b15d)

2020-02-11 Thread tanjian
This is an automated email from the ASF dual-hosted git repository.

tanjian pushed a change to branch grpc_alarm
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


from 3b26c16  update logical.
 add 415b15d  fix

No new revisions were added by this update.

Summary of changes:
 .../oap/server/core/alarm/provider/grpc/GRPCCallback.java  | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)



[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377664934
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+grpcClient.connect();
+alarmServiceStub = AlarmServiceGrpc.newStub(grpcClient.getChannel());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
+try {
+sleepTime += cycle;
+Thread.sleep(cycle);
+} catch (InterruptedException e) {
+  

[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377664291
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+grpcClient.connect();
+alarmServiceStub = AlarmServiceGrpc.newStub(grpcClient.getChannel());
 
 Review comment:
   But, we should reconnect when client settings changed.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[skywalking] branch pull/4327 created (now be62c8e)

2020-02-11 Thread kezhenxu94
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a change to branch pull/4327
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


  at be62c8e  Revert submodule updates

This branch includes the following new commits:

 new be62c8e  Revert submodule updates

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[skywalking] 01/01: Revert submodule updates

2020-02-11 Thread kezhenxu94
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch pull/4327
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit be62c8edb38c5855f0623c86a9f933ff37145092
Author: kezhenxu94 
AuthorDate: Tue Feb 11 22:09:28 2020 +0800

Revert submodule updates
---
 .../query-graphql-plugin/src/main/resources/query-protocol  | 2 +-
 skywalking-ui   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol
 
b/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol
index f4e314d..6104df8 16
--- 
a/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol
+++ 
b/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol
@@ -1 +1 @@
-Subproject commit f4e314de312a5bc053c6dbd6a07b561885b33888
+Subproject commit 6104df8f0debce4c81142e5b1fc696d61bb673c5
diff --git a/skywalking-ui b/skywalking-ui
index dfe5606..2cb2305 16
--- a/skywalking-ui
+++ b/skywalking-ui
@@ -1 +1 @@
-Subproject commit dfe56060f3d63eda7fbd2639a1ad72fe5d8466d7
+Subproject commit 2cb2305af5b2a787fbf877fd0f0092a960b956c2



[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377652350
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+grpcClient.connect();
+alarmServiceStub = AlarmServiceGrpc.newStub(grpcClient.getChannel());
 
 Review comment:
   I think we should not create stub and connect every time. Right?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377652037
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+grpcClient.connect();
+alarmServiceStub = AlarmServiceGrpc.newStub(grpcClient.getChannel());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
+try {
+sleepTime += cycle;
+Thread.sleep(cycle);
+} catch (InterruptedException e) {
+

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377652695
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private AlarmRulesWatcher alarmRulesWatcher;
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+this.alarmRulesWatcher = alarmRulesWatcher;
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+
+if (alarmSetting != null) {
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
+}
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+// recreate gRPC client if host and port configuration changed.
+onGRPCAlarmSettingUpdated(alarmRulesWatcher.getGrpchookSetting());
+
+grpcClient.connect();
+alarmServiceStub = AlarmServiceGrpc.newStub(grpcClient.getChannel());
+
+ExportStatus status = new ExportStatus();
+
+
StreamObserver 
streamObserver =
+alarmServiceStub.withDeadlineAfter(10, 
TimeUnit.SECONDS).doAlarm(new StreamObserver() {
+@Override
+public void onNext(Response response) {
+// ignore empty response
+}
+
+@Override
+public void onError(Throwable throwable) {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message failed: {}", 
throwable.getMessage());
+}
+}
+
+@Override
+public void onCompleted() {
+status.done();
+if (log.isDebugEnabled()) {
+log.debug("Send alarm message successful.");
+}
+}
+});
+
+alarmMessage.forEach(message -> {
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.Builder builder =
+
org.apache.skywalking.oap.server.core.alarm.grpc.AlarmMessage.newBuilder();
+
+builder.setScopeId(message.getScopeId());
+builder.setScope(message.getScope());
+builder.setName(message.getName());
+builder.setId0(message.getId0());
+builder.setId1(message.getId1());
+builder.setRuleName(message.getRuleName());
+builder.setAlarmMessage(message.getAlarmMessage());
+builder.setStartTime(message.getStartTime());
+
+streamObserver.onNext(builder.build());
+});
+
+streamObserver.onCompleted();
+
+long sleepTime = 0;
+long cycle = 100L;
+/**
+ * For memory safe of oap, we must wait for the peer confirmation.
+ */
+while (!status.isDone()) {
+try {
+sleepTime += cycle;
+Thread.sleep(cycle);
+} catch (InterruptedException e) {
+

[GitHub] [skywalking] JohnNiang commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JohnNiang commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377652539
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCAlarmSetting.java
 ##
 @@ -27,4 +28,20 @@
 public class GRPCAlarmSetting extends ModuleConfig {
 private String targetHost;
 private int targetPort;
+
+@Override
+public boolean equals(final Object o) {
 
 Review comment:
   `equals` and `hashCode` methods could be replaced by Lombok annotation: 
`@EqualsAndHashCode(callSuper = false)`


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[skywalking] branch grpc_alarm updated (2bb16b1 -> 3b26c16)

2020-02-11 Thread tanjian
This is an automated email from the ASF dual-hosted git repository.

tanjian pushed a change to branch grpc_alarm
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


from 2bb16b1  update logical.
 add 3b26c16  update logical.

No new revisions were added by this update.

Summary of changes:
 docs/en/setup/backend/backend-alarm.md |  2 +-
 .../core/alarm/provider/grpc/GRPCAlarmSetting.java | 22 +++---
 2 files changed, 4 insertions(+), 20 deletions(-)



[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377652074
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCAlarmSetting.java
 ##
 @@ -0,0 +1,47 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import java.util.Objects;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.skywalking.oap.server.library.module.ModuleConfig;
+
+@Setter
+@Getter
+public class GRPCAlarmSetting extends ModuleConfig {
 
 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 to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377651089
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCAlarmSetting.java
 ##
 @@ -0,0 +1,47 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import java.util.Objects;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.skywalking.oap.server.library.module.ModuleConfig;
+
+@Setter
+@Getter
+public class GRPCAlarmSetting extends ModuleConfig {
 
 Review comment:
   Why this extends `ModuleConfig`?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377650108
 
 

 ##
 File path: docs/en/setup/backend/backend-alarm.md
 ##
 @@ -115,9 +115,11 @@ Example as following
 ```
 
 ## gRPCHook
-This code language could be `Protobuf` which are defined in 
`oap-server/server-alarm-plugin/src/main/proto/alarm-hook.proto`.
-It will result as following:
-```text
+The alarm message will send through remote gRPC method by `Protobuf` content 
type. 
+The message format with following key information which are defined in 
`oap-server/server-alarm-plugin/src/main/proto/alarm-hook.proto`.
+
+Example as following
 
 Review comment:
   This is not example, this is the message protocol :)


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[skywalking] branch grpc_alarm updated (5a36298 -> 2bb16b1)

2020-02-11 Thread tanjian
This is an automated email from the ASF dual-hosted git repository.

tanjian pushed a change to branch grpc_alarm
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


from 5a36298  update logical.
 add 2bb16b1  update logical.

No new revisions were added by this update.

Summary of changes:
 docs/en/setup/backend/backend-alarm.md  |  8 +---
 .../core/alarm/provider/grpc/GRPCAlarmSetting.java  | 17 +
 .../server/core/alarm/provider/grpc/GRPCCallback.java   | 17 -
 3 files changed, 38 insertions(+), 4 deletions(-)



[GitHub] [skywalking] codecov-io edited a comment on issue #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
codecov-io edited a comment on issue #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#issuecomment-584597339
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=h1) 
Report
   > Merging 
[#4344](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking/commit/2f5a4ee7453dfe82cd0ae6f4a8f27382a9336b44?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking/pull/4344/graphs/tree.svg?width=650=qrILxY5yA8=150=pr)](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#4344   +/-   ##
   ===
 Coverage   26.42%   26.42%   
   ===
 Files1179 1179   
 Lines   2674326743   
 Branches 3690 3690   
   ===
 Hits 7068 7068   
 Misses  1905119051   
 Partials  624  624
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=footer). 
Last update 
[2f5a4ee...5a36298](https://codecov.io/gh/apache/skywalking/pull/4344?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
wu-sheng commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377634229
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,130 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
 
 Review comment:
   Take a look at how HTTP works, it should be similar, just keep the existing 
client settings, and only create the new stub when settings changed.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


[GitHub] [skywalking] JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.

2020-02-11 Thread GitBox
JaredTan95 commented on a change in pull request #4344: supprt gRPC alarm hook.
URL: https://github.com/apache/skywalking/pull/4344#discussion_r377632705
 
 

 ##
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java
 ##
 @@ -0,0 +1,130 @@
+/*
+ * 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.skywalking.oap.server.core.alarm.provider.grpc;
+
+import io.grpc.stub.StreamObserver;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.core.alarm.AlarmCallback;
+import org.apache.skywalking.oap.server.core.alarm.AlarmMessage;
+import org.apache.skywalking.oap.server.core.alarm.grpc.AlarmServiceGrpc;
+import org.apache.skywalking.oap.server.core.alarm.grpc.Response;
+import org.apache.skywalking.oap.server.core.alarm.provider.AlarmRulesWatcher;
+import org.apache.skywalking.oap.server.core.exporter.ExportStatus;
+import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
+
+/**
+ * Use SkyWalking alarm grpc API call a remote methods.
+ */
+@Slf4j
+public class GRPCCallback implements AlarmCallback {
+
+private GRPCAlarmSetting alarmSetting;
+
+private AlarmServiceGrpc.AlarmServiceStub alarmServiceStub;
+
+private GRPCClient grpcClient;
+
+public GRPCCallback(AlarmRulesWatcher alarmRulesWatcher) {
+alarmSetting = alarmRulesWatcher.getGrpchookSetting();
+}
+
+@Override
+public void doAlarm(List alarmMessage) {
+
+if (alarmSetting == null) {
+return;
+}
+
+grpcClient = new GRPCClient(alarmSetting.getTargetHost(), 
alarmSetting.getTargetPort());
 
 Review comment:
   This way may not appropriate. I am working on it~


This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services


  1   2   >