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 2021/02/21 11:26:20 UTC

[GitHub] [skywalking] mrproliu commented on a change in pull request #6416: Fix the segment tag is not synchronized when updating the correlation value.

mrproliu commented on a change in pull request #6416:
URL: https://github.com/apache/skywalking/pull/6416#discussion_r579792390



##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/CorrelationContext.java
##########
@@ -78,6 +78,11 @@ public CorrelationContext() {
         // already contain key
         if (data.containsKey(key)) {
             final String previousValue = data.put(key, value);
+
+            // update tag if need
+            if (AUTO_TAG_KEYS.contains(key) && ContextManager.isActive()) {
+                ContextManager.activeSpan().tag(new StringTag(-1, key, true), value);

Review comment:
       `-1` is the tag `id`. It uses to compare with the same tag. In the `StringTag` constructor, the id is `-1` default. 




----------------------------------------------------------------
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:
users@infra.apache.org