Repository navigation
fix(logging): inject user_email into structured log output - #94
Merged
Merged
Conversation
VOC UI의 Pod Logs(Loki) 검색이 user.email로 조회되지 않는 문제 수정. 기존에는 user.email이 OTel span attribute로만 기록되어 OpenSearch 트레이스 검색에서만 사용 가능했고, stdout 로그 라인 텍스트에는 찍히지 않아 Loki의 |= 텍스트 검색으로는 찾을 수 없었다. get_current_user()에서 인증된 요청마다 ContextVar에 user_email을 저장하고, OtelJsonFormatter가 로그 엔트리에 이를 포함시키도록 함.
wonzz
self-requested a review
July 3, 2026 03:14
wonzz
approved these changes
Jul 3, 2026
2 of 4 tasks
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
user.email은 지금까지 OTel span attribute로만 기록되어(feat(observability): HTTP span and SQS PRODUCER span user.id #91) OpenSearch 트레이스 검색에서는 동작했지만, stdout 로그 라인 텍스트에는 없어서 Loki의|=텍스트 검색으로는 찾을 수 없었음get_current_user()에서 인증된 요청마다ContextVar에 이메일을 저장하고,OtelJsonFormatter가 매 로그 엔트리에user_email필드로 포함시키도록 변경Test plan
"user_email": "..."필드가 찍히는지 확인