File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed
pythonkr_backend/pythonkr_backend/settings Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,15 @@ PID_FILE="/home/pk/pk.pid"
4
4
LOG_DIR=" /home/pk/logs"
5
5
6
6
cd ~ /
7
+ source .env
7
8
cd python.or.kr
9
+
10
+ # SHA 환경변수가 없으면 현재 git 커밋의 SHA 값을 가져와서 설정
11
+ if [ -z " ${SHA} " ]; then
12
+ export SHA=$( git rev-parse HEAD)
13
+ echo " SHA 환경변수가 없어서 현재 git SHA로 설정: ${SHA} "
14
+ fi
15
+
8
16
# shutdown exist gunicorn
9
17
if [ -f ${PID_FILE} ]; then
10
18
PID=$( cat $PID_FILE )
Original file line number Diff line number Diff line change 12
12
13
13
from pathlib import Path
14
14
import os
15
+ import logfire
15
16
16
17
# Build paths inside the project like this: BASE_DIR / 'subdir'.
17
18
BASE_DIR = Path (__file__ ).resolve ().parent .parent .parent
170
171
BAKERY_VIEWS = (
171
172
"wagtailbakery.views.AllPublishedPagesView" ,
172
173
)
174
+
175
+
176
+
177
+ # setup logfire
178
+
179
+ logfire .configure (environment = 'base' , service_name = "web" )
180
+ logfire .instrument_django ()
Original file line number Diff line number Diff line change 1
1
from pathlib import Path
2
2
import os
3
+ import logfire
3
4
4
5
from .base import *
5
6
25
26
# bakery
26
27
27
28
BAKERY_MULTISITE = True
28
- BUILD_DIR = os .path .join ("/app/bakery_static" , "build" )
29
+ BUILD_DIR = os .path .join ("/app/bakery_static" , "build" )
30
+
31
+ # setup logfire
32
+ logfire .configure (environment = 'localtest' )
33
+ logfire .instrument_django ()
Original file line number Diff line number Diff line change 1
1
from pathlib import Path
2
2
import os
3
+ import logfire
3
4
4
5
from .base import *
5
6
22
23
# bakery
23
24
24
25
BAKERY_MULTISITE = True
25
- BUILD_DIR = os .path .join ("/home/pk/bakery_static" , "build" )
26
+ BUILD_DIR = os .path .join ("/home/pk/bakery_static" , "build" )
27
+
28
+
29
+ # service_version
30
+ sha_service_version = os .environ .get ("SHA" )
31
+
32
+ # logfire settings
33
+ logfire .configure (environment = 'prod' , service_name = "web" , service_version = sha_service_version )
34
+ logfire .instrument_system_metrics ()
35
+ logfire .instrument_django ()
36
+ logfire .instrument_psycopg ('psycopg' )
You can’t perform that action at this time.
0 commit comments