Include unique ID in 500 responses and link to Datadog trace #6022
amacfie
started this conversation in
Show and tell
Replies: 1 comment
-
With current Starlette (v0.26), remove |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Logging tools like Datadog or Sentry can record unhandled exceptions that lead to HTTP 500 responses, but what if a user receives a 500 response and you want to look up the log entry corresponding to that specific request? The following code adds a
x-error-id
header to 500 responses for unhandled exceptions. The value is a unique ID which is also saved as a tag associated with the trace in Datadog.Beta Was this translation helpful? Give feedback.
All reactions