-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpromtail-config.yml
More file actions
94 lines (82 loc) · 2.36 KB
/
promtail-config.yml
File metadata and controls
94 lines (82 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: "http://${MONITORING_INSTANCE}/loki/api/v1/push"
scrape_configs:
# EduKit API 모듈 - Blue 슬롯
- job_name: edukit-api-blue
static_configs:
- targets:
- localhost
labels:
job: edukit-api
module: api
environment: ${ENVIRONMENT}
host: ${HOSTNAME_BLUE:-dev-1-blue}
__path__: /log/blue/**/*.log
pipeline_stages:
# JSON 로그 파싱
- json:
expressions:
timestamp: timestamp
level: level
message: message
traceId: traceId
userId: userId
requestUrl: requestUrl
method: method
# 헬스체크 및 메트릭 엔드포인트 필터링 (구조화된 필드 기반)
- drop:
expression: '.*(health|actuator|metrics|prometheus|favicon\.ico).*'
source: requestUrl
# 동적 라벨 설정
- labels:
timestamp:
level:
traceId:
requestUrl:
# 타임스탬프 파싱
- timestamp:
source: timestamp
format: "2006-01-02 15:04:05.000"
location: "Asia/Seoul"
# EduKit API 모듈 - Green 슬롯
- job_name: edukit-api-green
static_configs:
- targets:
- localhost
labels:
job: edukit-api
module: api
environment: ${ENVIRONMENT}
host: ${HOSTNAME_GREEN:-dev-1-green}
__path__: /log/green/**/*.log
pipeline_stages:
# JSON 로그 파싱
- json:
expressions:
timestamp: timestamp
level: level
message: message
traceId: traceId
userId: userId
requestUrl: requestUrl
method: method
# 헬스체크 및 메트릭 엔드포인트 필터링 (구조화된 필드 기반)
- drop:
expression: '.*(health|actuator|metrics|prometheus|favicon\.ico).*'
source: requestUrl
# 동적 라벨 설정 (고카디널리티 라벨 최소화)
- labels:
timestamp:
level:
traceId:
requestUrl:
# 타임스탬프 파싱
- timestamp:
source: timestamp
format: "2006-01-02 15:04:05.000"
location: "Asia/Seoul"