You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 2.hey team built the rfc7807 'Problem Details' structure this should help
26
+
27
+
content= {
28
+
"type": "about:blank",
29
+
"title": HTTPStatus(exc.status_code).phrase,
30
+
"status": exc.status_code,
31
+
"detail": exc.detail,
32
+
"instance": request.url.path,
33
+
"correlation_id": correlation_id
34
+
}
35
+
36
+
# 3.enhanced logging logic log the error with all relevant details, including the correlation id, request method, path, and exception details. This will help in debugging and tracing issues effectively.
#1.it generate the unique id i tried to use only single id for the request and response cycle, so that we can easily trace the logs and the response for a particular request.
13
+
correlation_id=str(uuid.uuid4())
14
+
request.state.correlation_id=correlation_id
15
+
#2.pass the request to the next person in line
16
+
response=awaitcall_next(request)
17
+
#3.inject the correlation id into response headers for client side tracking (Egress) stamped the id on the way out so the user sees it
0 commit comments