You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/01/12 03:59:34 UTC

[GitHub] [skywalking] arugal opened a new pull request #8408: Add faas to SpanLayer

arugal opened a new pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408


   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/CHANGES.md).
   
   reference: https://github.com/OpenFunction/OpenFunction/issues/146


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arugal commented on a change in pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
arugal commented on a change in pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#discussion_r783029870



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java
##########
@@ -119,10 +119,16 @@ public void parseEntry(SpanObject span, SegmentObject segmentObject) {
                 sourceBuilder.setDestEndpointName(span.getOperationName());
                 sourceBuilder.setDestServiceInstanceName(segmentObject.getServiceInstance());
                 sourceBuilder.setDestServiceName(segmentObject.getService());
-                sourceBuilder.setDestLayer(Layer.GENERAL);
+                sourceBuilder.setDestLayer(fromSpanLayerValue(span.getSpanLayer()));

Review comment:
       done




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#discussion_r783029331



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java
##########
@@ -119,10 +119,16 @@ public void parseEntry(SpanObject span, SegmentObject segmentObject) {
                 sourceBuilder.setDestEndpointName(span.getOperationName());
                 sourceBuilder.setDestServiceInstanceName(segmentObject.getServiceInstance());
                 sourceBuilder.setDestServiceName(segmentObject.getService());
-                sourceBuilder.setDestLayer(Layer.GENERAL);
+                sourceBuilder.setDestLayer(fromSpanLayerValue(span.getSpanLayer()));

Review comment:
       Miss deleting this?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wankai123 commented on a change in pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wankai123 commented on a change in pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#discussion_r782722001



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java
##########
@@ -390,6 +390,8 @@ private Layer fromSpanLayerValue(SpanLayer spanLayer) {
                 return Layer.CACHE;
             case UNRECOGNIZED:
                 return Layer.UNDEFINED;
+            case FAAS:
+                return Layer.FAAS;

Review comment:
       I don't think should return `Layer.GENERAL` by default. The Layer should be set specifically.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arugal commented on a change in pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
arugal commented on a change in pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#discussion_r783028091



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java
##########
@@ -133,7 +133,7 @@ public void parseEntry(SpanObject span, SegmentObject segmentObject) {
             sourceBuilder.setSourceNormal(false);
             sourceBuilder.setDestServiceInstanceName(segmentObject.getServiceInstance());
             sourceBuilder.setDestServiceName(segmentObject.getService());
-            sourceBuilder.setDestLayer(Layer.GENERAL);
+            sourceBuilder.setDestLayer(fromSpanLayerValue(span.getSpanLayer()));

Review comment:
       done




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arugal edited a comment on pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
arugal edited a comment on pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#issuecomment-1011874028


   > And this `Please rename fromSpanLayerValue to identifyRemoteServiceLayer.`.
   
   done


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arugal commented on a change in pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
arugal commented on a change in pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#discussion_r783686185



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java
##########
@@ -392,11 +392,25 @@ private Layer fromSpanLayerValue(SpanLayer spanLayer) {
                 return Layer.CACHE;
             case UNRECOGNIZED:
                 return Layer.UNDEFINED;
+            case FAAS:
+                return Layer.FAAS;
             default:
                 throw new UnexpectedException("Can't transfer to the Layer. SpanLayer=" + spanLayer);
         }
     }
 
+    /**
+     * Simple logic, only judge ${@link Layer#FAAS} and ${@link Layer#GENERAL}.
+     */
+    private Layer fromSpanLayer(SpanLayer spanLayer) {

Review comment:
       yes




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng merged pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arugal commented on pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
arugal commented on pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#issuecomment-1011865342


   > Apply my change should break the CI :) And another method should be changed too. Will need your local change.
   
   done


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#issuecomment-1011868015


   And this `Please rename fromSpanLayerValue to identifyRemoteServiceLayer.`.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#issuecomment-1010998836


   @wankai123 @arugal I think the current codes missed the `SourceBuilder#sourceLayer` in `#parseExit`.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arugal commented on pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
arugal commented on pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#issuecomment-1011874028


   > identifyRemoteServiceLayer
   
   done


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#issuecomment-1011861244


   Apply my change should break the CI :) And another method should be changed too. Will need your local change.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#discussion_r783678739



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java
##########
@@ -392,11 +392,25 @@ private Layer fromSpanLayerValue(SpanLayer spanLayer) {
                 return Layer.CACHE;
             case UNRECOGNIZED:
                 return Layer.UNDEFINED;
+            case FAAS:
+                return Layer.FAAS;
             default:
                 throw new UnexpectedException("Can't transfer to the Layer. SpanLayer=" + spanLayer);
         }
     }
 
+    /**
+     * Simple logic, only judge ${@link Layer#FAAS} and ${@link Layer#GENERAL}.
+     */
+    private Layer fromSpanLayer(SpanLayer spanLayer) {

Review comment:
       ```suggestion
       /**
        * Identify the layer of span service/instance owner. Such as  ${@link Layer#FAAS} and ${@link Layer#GENERAL}.
        */
       private Layer identifyServiceLayer(SpanLayer spanLayer) {
   ```
   
   Please rename `fromSpanLayerValue` to `identifyRemoteServiceLayer`.
   I think this could make the scope of 2 methods more clear. WDYT?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#issuecomment-1011005039


   Please add source layer at here
   
   https://github.com/apache/skywalking/blob/02999da4ff766a856af2bd813ef0dfc7b1f3ba4d/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java#L175


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arugal commented on a change in pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
arugal commented on a change in pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#discussion_r782692855



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java
##########
@@ -390,6 +390,8 @@ private Layer fromSpanLayerValue(SpanLayer spanLayer) {
                 return Layer.CACHE;
             case UNRECOGNIZED:
                 return Layer.UNDEFINED;
+            case FAAS:
+                return Layer.FAAS;

Review comment:
       Need to return `Layer.GENERAL` by default? I'm not sure @wu-sheng @wankai123 




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8408: Add faas to SpanLayer

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8408:
URL: https://github.com/apache/skywalking/pull/8408#discussion_r782822686



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java
##########
@@ -133,7 +133,7 @@ public void parseEntry(SpanObject span, SegmentObject segmentObject) {
             sourceBuilder.setSourceNormal(false);
             sourceBuilder.setDestServiceInstanceName(segmentObject.getServiceInstance());
             sourceBuilder.setDestServiceName(segmentObject.getService());
-            sourceBuilder.setDestLayer(Layer.GENERAL);
+            sourceBuilder.setDestLayer(fromSpanLayerValue(span.getSpanLayer()));

Review comment:
       I think this is wrong for MQ case. Entry span has the MQ as layer but it represents the service itself.
   
   In my idea, you should not use `fromSpanLayerValue` directly, we just should consider `FAAS` service as a new general condition here, but all others should keep in `Layer.GNERAL`.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org