feat(server): span X-Request-ID by server log#269
Merged
hittyt merged 2 commits intoalibaba:mainfrom Mar 3, 2026
Merged
Conversation
Collaborator
|
审查结果(按严重级别排序):
建议:
|
346223e to
ff7f96a
Compare
Collaborator
Author
日志关联覆盖不完整,部分请求链路可能没有 request-id - 实际上只有fastAPI的access没有日志 移除路由函数里的 x_request_id: Header(...) 会让 FastAPI 生成的 OpenAPI 丢失 X-Request-ID 参数 - fixed this |
hittyt
requested changes
Mar 2, 2026
Collaborator
hittyt
left a comment
There was a problem hiding this comment.
Implemented X-Request-ID middleware and logging correlation. The core logic for injecting the ID into contextvars is sound, but the middleware registration order in main.py needs to be corrected to ensure it is actually the outermost layer as intended.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
X-Request-IDby server logX-Request-ID#267Testing
Breaking Changes
Checklist
X-Request-ID#267