원 레포랑 완전 분리
This commit is contained in:
44
promtail-config.yaml
Normal file
44
promtail-config.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
server: # Promtail 자체 HTTP 서버 (내부용, 포트 9080)
|
||||
http_listen_port: 9080
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions: # 로그 읽은 위치 저장 (로그 재수집 방지용)
|
||||
filename: /tmp/positions.yaml
|
||||
|
||||
clients: # Loki로 로그 전송 (pgn_loki:3100)
|
||||
- url: http://pgn_loki:3100/loki/api/v1/push
|
||||
|
||||
scrape_configs: # 어떤 로그를 읽을지 설정
|
||||
- job_name: llm_gateway
|
||||
static_configs:
|
||||
- targets:
|
||||
- localhost
|
||||
labels:
|
||||
job: llm_gateway
|
||||
__path__: /var/lib/docker/containers/*/*.log
|
||||
|
||||
pipeline_stages:
|
||||
- docker: {} # 로그에서 도커 메타데이터 추출
|
||||
|
||||
- match:
|
||||
selector: '{container_name=~"pgn_api_.*"}'
|
||||
stages:
|
||||
- json: # 로그 내용이 JSON이면 자동 파싱 (level, msg, time 추출)
|
||||
expressions:
|
||||
level: level
|
||||
msg: message
|
||||
time: timestamp
|
||||
- labels: # level, container_name을 Loki에 라벨링
|
||||
level:
|
||||
container_name:
|
||||
job:
|
||||
|
||||
- match:
|
||||
selector: '{container_name=~"pgn_api_.*"}'
|
||||
stages:
|
||||
- regex:
|
||||
expression: "^(?P<time>[^ ]+) (?P<level>[^ ]+) (?P<msg>.*)"
|
||||
- labels:
|
||||
level:
|
||||
container_name:
|
||||
job:
|
||||
Reference in New Issue
Block a user