Repository navigation
fix(loki): promote OTel log.file.name to stream label - #81
Merged
Merged
Conversation
#30 (filelog/host) 후속 — 호스트 syslog 가 Loki 에 들어오고 있지만 `{log_file_name="syslog"}` stream selector 가 매칭되지 않아 host-log alert rule (`HighErrorLogRate`, `OOMKillDetected`, `FilesystemPressureLogDetected`, `HostSyslogSilent`) 이 영구 silent 상태로 발화 불가. 같은 이유로 ai-analyzer 의 `logql_context_query` 도 0 line 반환. 원인: Loki 3.x 의 OTLP receiver 가 record-level attribute (filelog operator 가 부여하는 `log.file.name` 등) 를 기본적으로 structured_metadata 로 처리. line filter (`| log_file_name="syslog"`) 로는 매칭되지만 stream selector 로는 미반환. #30 closed 시점에는 stream label 이었던 것으로 보아 그 사이 chart upgrade (S3 마이그레이션 33dcf9b 동반) 로 기본 정책이 strict 해진 듯. Fix: limits_config.otlp_config.log_attributes 에 index_label 매핑 추가. `log.file.name` 을 stream label 로 promote 하면 기존 alert rule / ai-analyzer 쿼리 모두 변경 없이 동작. 카디널리티는 노드당 파일 종류 수준으로 안전. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
apps/log-server/values.yaml의loki.limits_config에otlp_config.log_attributes매핑 추가. OTellog.file.name을 stream label로 promote 하여 host-log alert rule 들이 발화 가능하게 함.Why
PR #78 검증 중 host-log alert rule 들이 매칭 0 임을 확인:
{k8s_cluster_name="pc1", log_file_name="syslog"}(stream selector){k8s_cluster_name="pc1"} | log_file_name="syslog"(line filter)→
log.file.name이 stream label이 아닌 structured_metadata 로 들어오고 있음. PR #78의 alert rule 들 (HighErrorLogRate,OOMKillDetected,FilesystemPressureLogDetected,HostSyslogSilent) 과 ai-analyzer 의logql_context_query가 모두 stream selector 가정으로 작성되어 있어 영구 silent.#30 closed 댓글 (6/4) 에서는
log_file_name=syslog가 stream label 로 동작했다고 보고했는데, 이후33dcf9b(Loki S3 마이그레이션) 시 chart upgrade가 동반되며 OTLP attribute promotion 기본 정책이 strict 해진 듯.What
log.file.name(filelog receiver 자동 부여) →log_file_namestream label 로 promotesyslog한 개) 수준 → 안전Validation
helm template apps/log-server정상 렌더{k8s_cluster_name="pc1", log_file_name="syslog"}가 stream 반환loki_lines > 0확인Notes
appVersion >= 3.x부터 지원 (현재7.1.0/ Loki3.6.8)Related: #30, PR #78, PR #80
🤖 Generated with Claude Code