Skip to content

Commit

Permalink
chore: promtail config 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
5uhwann committed Sep 24, 2024
1 parent 8a765fc commit ef6fd31
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .ebextensions/02-install-promtail.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ container_commands:
grpc_listen_port: 0

positions:
filename: /etc/promtail/positions.yaml
filename: /var/app/current/positions.yaml

clients:
- url: \${LOKI_URL}
Expand All @@ -45,23 +45,23 @@ container_commands:
- localhost
labels:
job: all_logs
__path__: /etc/promtail/logs/all/*.log
__path__: /var/app/current/logs/all/*.log

- job_name: warn
static_configs:
- targets:
- localhost
labels:
job: warn_logs
__path__: /etc/promtail/logs/warn/*.log
__path__: /var/app/current/logs/warn/*.log

- job_name: error
static_configs:
- targets:
- localhost
labels:
job: error_logs
__path__: /etc/promtail/logs/error/*.log
__path__: /var/app/current/logs/error/*.log
EOF

06_setup_promtail:
Expand All @@ -79,7 +79,14 @@ container_commands:
ports:
- "9080:9080" # 호스트의 9080 포트를 컨테이너의 9080 포트에 매핑
volumes:
- /var/app/current:/etc/promtail
command: -config.file=/etc/promtail/promtail-config.yml
- /var/app/current/positions.yaml:/var/app/current/positions.yaml
- /var/app/current:/var/app/current
command: -config.file=/var/app/current/promtail-config.yml
EOF
docker-compose -f /var/app/current/promtail-docker-compose.yml up -d

# 로그 디렉토리 확인 후 Docker Compose 실행
if [ -d /var/app/current/logs ]; then
docker-compose -f /var/app/current/promtail-docker-compose.yml up -d
else
echo "Logs directory not found!"
fi

0 comments on commit ef6fd31

Please sign in to comment.