Skip to content

Commit

Permalink
Fix: Span.tag() for overridable
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-pytel committed Nov 20, 2020
1 parent 586c3b6 commit 44a3a99
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions skywalking/trace/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 44a3a99

Please sign in to comment.