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 2020/05/08 06:32:13 UTC
[GitHub] [skywalking-python] wu-sheng commented on a change in pull request #4: Feature: inter-process propagation
wu-sheng commented on a change in pull request #4:
URL: https://github.com/apache/skywalking-python/pull/4#discussion_r421965113
##########
File path: skywalking/trace/__init__.py
##########
@@ -25,10 +25,13 @@
class ID(object):
- def __init__(self):
- self.part1 = str(uuid.uuid1())
- self.part2 = threading.get_ident() # FIXME: thread ids are reused
- self.part3 = int(time.time() * 1000) * 10000 + _id.next()
+ def __init__(self, string: str = None):
+ if string:
+ self.part1, self.part2, self.part3 = string.split('.')
+ else:
+ self.part1 = str(uuid.uuid1())
Review comment:
If you have used UUID already, I would say, you only need one part. In java agent, the UUID is created once in the bootstrap stage.
##########
File path: skywalking/trace/__init__.py
##########
@@ -25,10 +25,13 @@
class ID(object):
- def __init__(self):
- self.part1 = str(uuid.uuid1())
- self.part2 = threading.get_ident() # FIXME: thread ids are reused
- self.part3 = int(time.time() * 1000) * 10000 + _id.next()
+ def __init__(self, string: str = None):
+ if string:
+ self.part1, self.part2, self.part3 = string.split('.')
Review comment:
Today, we don't require the 3 parts as trace id anymore. No matter string or number. Trace id/segment id are only literal string.
----------------------------------------------------------------
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