-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 트래킹 모니터링 시스템 구축 (Actuator + Prometheus + 구조화 로깅) #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
55f79c9
feat: Actuator + Prometheus 의존성 및 보안 설정 추가
howooyeon b764c44
feat: JSON 로깅 설정 추가 (logback-spring.xml)
howooyeon d4d2d3f
feat: MDC sessionId/userId 세팅 (HTTP, WebSocket, Redis Consumer)
howooyeon 3992010
feat: 트래킹 핵심 로그 info 레벨 강화
howooyeon 0bb5dd2
refactor: 트래킹 로그 메시지 가독성 개선
howooyeon e308183
fix: 트래킹 모니터링 보안 취약점 수정
howooyeon b0986c0
fix: 고빈도 로그 DEBUG 레벨 조정 및 logback 프로파일 fallback 추가
howooyeon c3080eb
revert: GPS/FLUSH 로그 INFO 레벨 복원
howooyeon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <configuration> | ||
|
|
||
| <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
| <encoder> | ||
| <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%X{sessionId}] - %msg%n</pattern> | ||
| </encoder> | ||
| </appender> | ||
|
|
||
| <springProfile name="!prod"> | ||
| <root level="INFO"> | ||
| <appender-ref ref="CONSOLE"/> | ||
| </root> | ||
| </springProfile> | ||
|
|
||
| <springProfile name="prod"> | ||
| <appender name="JSON" class="ch.qos.logback.core.ConsoleAppender"> | ||
| <encoder class="net.logstash.logback.encoder.LogstashEncoder"> | ||
| <includeMdcKeyName>sessionId</includeMdcKeyName> | ||
| <includeMdcKeyName>userId</includeMdcKeyName> | ||
| <timeZone>Asia/Seoul</timeZone> | ||
| </encoder> | ||
| </appender> | ||
| <root level="INFO"> | ||
| <appender-ref ref="JSON"/> | ||
| </root> | ||
| </springProfile> | ||
|
|
||
| </configuration> | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] MDC 키 필터링 방식 검토 (향후 분산 추적 연동 고려)
현재
LogstashEncoder설정에서<includeMdcKeyName>을 사용하여sessionId와userId만 MDC에서 포함하도록 필터링하고 있습니다.이 방식은 로그를 깔끔하게 유지하는 데 도움이 되지만, 향후 Spring Cloud Sleuth나 Micrometer Tracing 등을 도입하여 분산 추적(
traceId,spanId등)을 로그에 포함하고자 할 때, 해당 MDC 키들이 누락되는 문제가 발생할 수 있습니다.따라서 특정 MDC 키만 명시적으로 포함하기보다는, 기본적으로 모든 MDC 키를 포함하도록 하거나 제외할 키만
<excludeMdcKeyNames>로 관리하는 방식을 검토해 주세요.References