Skip to content

Commit

Permalink
Add a comment about the request id
Browse files Browse the repository at this point in the history
  • Loading branch information
vxgmichel committed Sep 6, 2024
1 parent ff4c49b commit f624c06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/parsec/client_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ class AuthenticatedClientContext:
logger: ParsecBoundLogger = field(init=False)

def __post_init__(self):
# Generate a request ID just for the logs
# It doesn't have to be as long as a UUID, 4 hex characters should be enough
request_id = (uuid4().hex[:4],)
self.logger = logger.bind(
request=uuid4().hex[:4],
request=request_id,
api=f"{self.settled_api_version.version}.{self.settled_api_version.revision}",
auth="authenticated",
organization=self.organization_id.str,
Expand Down

0 comments on commit f624c06

Please sign in to comment.