This commit is contained in:
@ -9,8 +9,43 @@ https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
# ✅ Django 설정을 미리 불러온다
|
||||||
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'butler_ddochi.settings')
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'auth_prj.settings')
|
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'auth_prj.settings')
|
||||||
|
|
||||||
|
# ✅ DEBUG 모드 아닐 때만 OpenTelemetry 활성
|
||||||
|
if not settings.DEBUG:
|
||||||
|
from opentelemetry import trace
|
||||||
|
from opentelemetry.sdk.resources import Resource
|
||||||
|
from opentelemetry.sdk.trace import TracerProvider
|
||||||
|
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
||||||
|
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
|
||||||
|
from opentelemetry.instrumentation.django import DjangoInstrumentor
|
||||||
|
|
||||||
|
trace.set_tracer_provider(
|
||||||
|
TracerProvider(
|
||||||
|
resource=Resource.create({
|
||||||
|
"service.name": "msa-django-auth",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
otlp_exporter = OTLPSpanExporter(
|
||||||
|
endpoint="http://jaeger-collector.istio-system:4317",
|
||||||
|
insecure=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
trace.get_tracer_provider().add_span_processor(
|
||||||
|
BatchSpanProcessor(otlp_exporter)
|
||||||
|
)
|
||||||
|
|
||||||
|
DjangoInstrumentor().instrument()
|
||||||
|
|
||||||
|
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
application = get_wsgi_application()
|
application = get_wsgi_application()
|
||||||
|
@ -10,14 +10,30 @@ django-cors-headers==4.7.0
|
|||||||
djangorestframework==3.16.0
|
djangorestframework==3.16.0
|
||||||
djangorestframework_simplejwt==5.5.0
|
djangorestframework_simplejwt==5.5.0
|
||||||
drf-yasg==1.21.10
|
drf-yasg==1.21.10
|
||||||
|
googleapis-common-protos==1.70.0
|
||||||
|
grpcio==1.72.1
|
||||||
gunicorn==20.1.0
|
gunicorn==20.1.0
|
||||||
idna==3.10
|
idna==3.10
|
||||||
|
importlib_metadata==8.7.0
|
||||||
inflection==0.5.1
|
inflection==0.5.1
|
||||||
itypes==1.2.0
|
itypes==1.2.0
|
||||||
Jinja2==3.1.6
|
Jinja2==3.1.6
|
||||||
MarkupSafe==3.0.2
|
MarkupSafe==3.0.2
|
||||||
mysqlclient==2.2.7
|
mysqlclient==2.2.7
|
||||||
|
opentelemetry-api==1.34.0
|
||||||
|
opentelemetry-exporter-otlp==1.34.0
|
||||||
|
opentelemetry-exporter-otlp-proto-common==1.34.0
|
||||||
|
opentelemetry-exporter-otlp-proto-grpc==1.34.0
|
||||||
|
opentelemetry-exporter-otlp-proto-http==1.34.0
|
||||||
|
opentelemetry-instrumentation==0.55b0
|
||||||
|
opentelemetry-instrumentation-django==0.55b0
|
||||||
|
opentelemetry-instrumentation-wsgi==0.55b0
|
||||||
|
opentelemetry-proto==1.34.0
|
||||||
|
opentelemetry-sdk==1.34.0
|
||||||
|
opentelemetry-semantic-conventions==0.55b0
|
||||||
|
opentelemetry-util-http==0.55b0
|
||||||
packaging==25.0
|
packaging==25.0
|
||||||
|
protobuf==5.29.5
|
||||||
pycparser==2.22
|
pycparser==2.22
|
||||||
PyJWT==2.9.0
|
PyJWT==2.9.0
|
||||||
python-dotenv==1.0.1
|
python-dotenv==1.0.1
|
||||||
@ -28,3 +44,5 @@ sqlparse==0.5.3
|
|||||||
typing_extensions==4.13.2
|
typing_extensions==4.13.2
|
||||||
uritemplate==4.1.1
|
uritemplate==4.1.1
|
||||||
urllib3==2.4.0
|
urllib3==2.4.0
|
||||||
|
wrapt==1.17.2
|
||||||
|
zipp==3.23.0
|
||||||
|
Reference in New Issue
Block a user