You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/08/24 02:17:33 UTC

[GitHub] [servicecomb-java-chassis] develpoerX opened a new pull request #2526: #SCB-2320 Add instanceId and serviceId in invocation header.

develpoerX opened a new pull request #2526:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2526


   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean install -Pit` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


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

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #2526: #SCB-2320 Add instanceId and serviceId in invocation header.

Posted by GitBox <gi...@apache.org>.
liubao68 merged pull request #2526:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2526


   


-- 
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: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2526: #SCB-2320 Add instanceId and serviceId in invocation header.

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2526:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2526#discussion_r696219208



##########
File path: core/src/main/java/org/apache/servicecomb/core/invocation/InvocationFactory.java
##########
@@ -42,11 +45,27 @@ public static Invocation forConsumer(ReferenceConfig referenceConfig, OperationM
   }
 
   public static Invocation setSrcMicroservice(Invocation invocation) {
-    String microserviceName = RegistrationManager.INSTANCE.getMicroservice().getServiceName();
-    invocation.addContext(Const.SRC_MICROSERVICE, microserviceName);
+    Microservice microservice = RegistrationManager.INSTANCE.getMicroservice();
+    invocation.addContext(Const.SRC_MICROSERVICE, microservice.getServiceName());
+    if (isServiceId()) {
+      invocation.addContext(Const.SRC_SERVICE_ID, microservice.getServiceId());
+    }
+    if (isInstanceId()) {
+      invocation.addContext(Const.SRC_INSTANCE_ID, microservice.getInstance().getInstanceId());
+    }
     return invocation;
   }
 
+  public static boolean isServiceId() {
+    return DynamicPropertyFactory.getInstance().
+        getBooleanProperty("servicecomb.context.enabled.serviceId", true).get();

Review comment:
       ok, good view.




-- 
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: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2526: #SCB-2320 Add instanceId and serviceId in invocation header.

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2526:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2526#discussion_r695325201



##########
File path: core/src/main/java/org/apache/servicecomb/core/invocation/InvocationFactory.java
##########
@@ -42,11 +45,27 @@ public static Invocation forConsumer(ReferenceConfig referenceConfig, OperationM
   }
 
   public static Invocation setSrcMicroservice(Invocation invocation) {
-    String microserviceName = RegistrationManager.INSTANCE.getMicroservice().getServiceName();
-    invocation.addContext(Const.SRC_MICROSERVICE, microserviceName);
+    Microservice microservice = RegistrationManager.INSTANCE.getMicroservice();
+    invocation.addContext(Const.SRC_MICROSERVICE, microservice.getServiceName());
+    if (isServiceId()) {
+      invocation.addContext(Const.SRC_SERVICE_ID, microservice.getServiceId());
+    }
+    if (isInstanceId()) {
+      invocation.addContext(Const.SRC_INSTANCE_ID, microservice.getInstance().getInstanceId());
+    }
     return invocation;
   }
 
+  public static boolean isServiceId() {
+    return DynamicPropertyFactory.getInstance().
+        getBooleanProperty("servicecomb.context.enabled.serviceId", true).get();

Review comment:
       How about `servicecomb.context.source.serviceId`, `servicecomb.context.source.instanceId`,  `servicecomb.context.source.serviceName` ? 
   




-- 
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: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] codecov-commenter edited a comment on pull request #2526: #SCB-2320 Add instanceId and serviceId in invocation header.

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2526:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2526#issuecomment-904277921


   # [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2526](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4e29051) into [master](https://codecov.io/gh/apache/servicecomb-java-chassis/commit/b61a2199f333bd2780b514f82cf003c46bc99cd7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b61a219) will **decrease** coverage by `1.56%`.
   > The diff coverage is `2.40%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/graphs/tree.svg?width=650&height=150&src=pr&token=KXfDcr9rX2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2526      +/-   ##
   ============================================
   - Coverage     79.19%   77.63%   -1.57%     
     Complexity     1419     1419              
   ============================================
     Files          1559     1597      +38     
     Lines         41574    42411     +837     
     Branches       3470     3570     +100     
   ============================================
   + Hits          32926    32927       +1     
   - Misses         7158     7990     +832     
   - Partials       1490     1494       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ecomb/config/center/client/ConfigCenterClient.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9jb25maWctY2VudGVyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VydmljZWNvbWIvY29uZmlnL2NlbnRlci9jbGllbnQvQ29uZmlnQ2VudGVyQ2xpZW50LmphdmE=) | `44.23% <0.00%> (-2.71%)` | :arrow_down: |
   | [...c/main/java/org/apache/servicecomb/core/Const.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VydmljZWNvbWIvY29yZS9Db25zdC5qYXZh) | `0.00% <ø> (ø)` | |
   | [.../apache/servicecomb/darklaunch/DarklaunchRule.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFJ1bGUuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...che/servicecomb/darklaunch/DarklaunchRuleItem.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFJ1bGVJdGVtLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...servicecomb/darklaunch/DarklaunchRuleItemJson.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFJ1bGVJdGVtSnNvbi5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...che/servicecomb/darklaunch/DarklaunchRuleJson.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFJ1bGVKc29uLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...icecomb/darklaunch/DarklaunchServerListFilter.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFNlcnZlckxpc3RGaWx0ZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...ache/servicecomb/darklaunch/MicroserviceCache.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvTWljcm9zZXJ2aWNlQ2FjaGUuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [.../org/apache/servicecomb/darklaunch/PolicyType.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvUG9saWN5VHlwZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...servicecomb/darklaunch/oper/AbstractCondition.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvb3Blci9BYnN0cmFjdENvbmRpdGlvbi5qYXZh) | `0.00% <0.00%> (ø)` | |
   | ... and [54 more](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [094119f...4e29051](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] codecov-commenter commented on pull request #2526: #SCB-2320 Add instanceId and serviceId in invocation header.

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2526:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2526#issuecomment-904277921


   # [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2526](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e854475) into [master](https://codecov.io/gh/apache/servicecomb-java-chassis/commit/b61a2199f333bd2780b514f82cf003c46bc99cd7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b61a219) will **decrease** coverage by `1.57%`.
   > The diff coverage is `2.40%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/graphs/tree.svg?width=650&height=150&src=pr&token=KXfDcr9rX2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2526      +/-   ##
   ============================================
   - Coverage     79.19%   77.62%   -1.58%     
     Complexity     1419     1419              
   ============================================
     Files          1559     1597      +38     
     Lines         41574    42411     +837     
     Branches       3470     3570     +100     
   ============================================
   - Hits          32926    32922       -4     
   - Misses         7158     7996     +838     
   - Partials       1490     1493       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ecomb/config/center/client/ConfigCenterClient.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9jb25maWctY2VudGVyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VydmljZWNvbWIvY29uZmlnL2NlbnRlci9jbGllbnQvQ29uZmlnQ2VudGVyQ2xpZW50LmphdmE=) | `44.23% <0.00%> (-2.71%)` | :arrow_down: |
   | [...c/main/java/org/apache/servicecomb/core/Const.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VydmljZWNvbWIvY29yZS9Db25zdC5qYXZh) | `0.00% <ø> (ø)` | |
   | [.../apache/servicecomb/darklaunch/DarklaunchRule.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFJ1bGUuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...che/servicecomb/darklaunch/DarklaunchRuleItem.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFJ1bGVJdGVtLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...servicecomb/darklaunch/DarklaunchRuleItemJson.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFJ1bGVJdGVtSnNvbi5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...che/servicecomb/darklaunch/DarklaunchRuleJson.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFJ1bGVKc29uLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...icecomb/darklaunch/DarklaunchServerListFilter.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvRGFya2xhdW5jaFNlcnZlckxpc3RGaWx0ZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...ache/servicecomb/darklaunch/MicroserviceCache.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvTWljcm9zZXJ2aWNlQ2FjaGUuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [.../org/apache/servicecomb/darklaunch/PolicyType.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvUG9saWN5VHlwZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...servicecomb/darklaunch/oper/AbstractCondition.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVhd2VpLWNsb3VkL2RhcmtsYXVuY2gvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RhcmtsYXVuY2gvb3Blci9BYnN0cmFjdENvbmRpdGlvbi5qYXZh) | `0.00% <0.00%> (ø)` | |
   | ... and [54 more](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [094119f...e854475](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2526?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2526: #SCB-2320 Add instanceId and serviceId in invocation header.

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2526:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2526#discussion_r695325475



##########
File path: core/src/main/java/org/apache/servicecomb/core/invocation/InvocationFactory.java
##########
@@ -42,11 +45,27 @@ public static Invocation forConsumer(ReferenceConfig referenceConfig, OperationM
   }
 
   public static Invocation setSrcMicroservice(Invocation invocation) {
-    String microserviceName = RegistrationManager.INSTANCE.getMicroservice().getServiceName();
-    invocation.addContext(Const.SRC_MICROSERVICE, microserviceName);
+    Microservice microservice = RegistrationManager.INSTANCE.getMicroservice();
+    invocation.addContext(Const.SRC_MICROSERVICE, microservice.getServiceName());
+    if (isServiceId()) {
+      invocation.addContext(Const.SRC_SERVICE_ID, microservice.getServiceId());
+    }
+    if (isInstanceId()) {
+      invocation.addContext(Const.SRC_INSTANCE_ID, microservice.getInstance().getInstanceId());
+    }
     return invocation;
   }
 
+  public static boolean isServiceId() {
+    return DynamicPropertyFactory.getInstance().
+        getBooleanProperty("servicecomb.context.enabled.serviceId", true).get();
+  }
+
+  public static boolean isInstanceId() {

Review comment:
       Change to private. And how about method name `addSourceServiceId` ? 




-- 
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: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2526: #SCB-2320 Add instanceId and serviceId in invocation header.

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2526:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2526#discussion_r696218765



##########
File path: core/src/main/java/org/apache/servicecomb/core/invocation/InvocationFactory.java
##########
@@ -42,11 +45,27 @@ public static Invocation forConsumer(ReferenceConfig referenceConfig, OperationM
   }
 
   public static Invocation setSrcMicroservice(Invocation invocation) {
-    String microserviceName = RegistrationManager.INSTANCE.getMicroservice().getServiceName();
-    invocation.addContext(Const.SRC_MICROSERVICE, microserviceName);
+    Microservice microservice = RegistrationManager.INSTANCE.getMicroservice();
+    invocation.addContext(Const.SRC_MICROSERVICE, microservice.getServiceName());
+    if (isServiceId()) {
+      invocation.addContext(Const.SRC_SERVICE_ID, microservice.getServiceId());
+    }
+    if (isInstanceId()) {
+      invocation.addContext(Const.SRC_INSTANCE_ID, microservice.getInstance().getInstanceId());
+    }
     return invocation;
   }
 
+  public static boolean isServiceId() {
+    return DynamicPropertyFactory.getInstance().
+        getBooleanProperty("servicecomb.context.enabled.serviceId", true).get();
+  }
+
+  public static boolean isInstanceId() {

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: commits-unsubscribe@servicecomb.apache.org

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