diff --git a/skywalking/trace/span.py b/skywalking/trace/span.py index 53c36c73..0b458b33 100644 --- a/skywalking/trace/span.py +++ b/skywalking/trace/span.py @@ -87,14 +87,13 @@ def log(self, ex: Exception) -> 'Span': return self def tag(self, tag: Tag) -> 'Span': - if not tag.overridable: - self.tags.append(deepcopy(tag)) - return self + if tag.overridable: + for i, t in enumerate(self.tags): + if t.key == tag.key: + self.tags[i] = deepcopy(tag) + return self - for t in self.tags: - if t.key == tag.key: - t.val = tag.val - break + self.tags.append(deepcopy(tag)) return self