fix(otelcol): use AccountID/ProjectID headers for VictoriaLogs multitenancy

로그 테넌트 라우팅이 동작하지 않던 결함 수정. otelcol exporter가
'VictoriaLogs-AccountID' 헤더를 사용했으나 VictoriaLogs는 이를 인식하지 못해
모든 로그가 account 0 으로 적재됨(dev 실측: AccountID:1 쓰기는 acct1,
VictoriaLogs-AccountID:1 쓰기는 acct0). 올바른 헤더 AccountID/ProjectID 로 교체.

- opentelemetry-collector custom-values(로그 3파이프라인) + events(acct0)
- docs: deploy-guide §1.4 relabel '[]'=격리아님 경고+예시, vmagent CUSTOM-README keep 규칙 예시
- .gitignore: tenant-verification/ (로컬 검증 산출물)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
wbsong111
2026-07-01 15:37:46 +09:00
parent b022204004
commit aef64390f1
5 changed files with 41 additions and 8 deletions
@@ -13,7 +13,20 @@ kubectl create configmap vmagent-relabel-configs -n monitoring \
--from-file=demo01.yaml --from-file=demo02.yaml --from-file=platform.yaml
```
각 파일은 `write_relabel_configs` 규칙(예: 특정 namespace만 통과)을 담는다. 테넌트별 격리가 필요 없으면 fallback(accountID 0) remoteWrite 하나만 남겨도 된다.
각 파일은 `write_relabel_configs` 규칙을 담는다. 해당 accountID에 **남길 시계열만 keep**(또는 특정 테넌트를 drop)하는 규칙이다. 예:
```yaml
# demo01.yaml — accountID 1: demo01-* namespace 메트릭만 남김
- action: keep
source_labels: [namespace]
regex: "demo01-.*"
# platform.yaml — accountID 9000: demo 테넌트 제외한 나머지
- action: drop
source_labels: [namespace]
regex: "(demo01|demo02)-.*"
```
> ⚠️ **빈 규칙(`[]`)은 격리가 아니다.** keep 규칙이 없으면 스크레이프한 모든 메트릭이 그 accountID에 기록된다 → 여러 URL에 `[]`를 두면 모든 테넌트가 서로의 메트릭을 보게 된다. 격리하려면 위처럼 namespace 기준 keep/drop 규칙을 반드시 채운다. 테넌트별 격리가 필요 없으면 fallback(accountID 0) remoteWrite 하나만 남겨도 된다.
```sh
helm upgrade vmagent ./ -f custom-values.yaml --install -n monitoring