Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DataSpace/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DataSpace.settings")

# Initialize OpenTelemetry before application
from api.telemetry import setup_telemetry
if os.getenv("TELEMETRY_URL"):
from api.telemetry import setup_telemetry

setup_telemetry() # Initialize telemetry for ASGI application
setup_telemetry() # Initialize telemetry for ASGI application

application = get_asgi_application()
5 changes: 3 additions & 2 deletions DataSpace/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DataSpace.settings")

# Initialize OpenTelemetry before application
from api.telemetry import setup_telemetry
if os.getenv("TELEMETRY_URL"):
from api.telemetry import setup_telemetry

setup_telemetry() # Initialize telemetry for production application
setup_telemetry() # Initialize telemetry for production application

application = get_wsgi_application()
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ services:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.2
container_name: telemetry_elasticsearch
restart: always
profiles: ["telemetry"]
ulimits:
memlock:
soft: -1
Expand Down Expand Up @@ -140,6 +141,7 @@ services:
kibana:
image: docker.elastic.co/kibana/kibana:7.16.2
container_name: kibana
profiles: ["telemetry"]
environment:
ELASTICSEARCH_URL: "http://telemetry_elasticsearch:9200"
ELASTICSEARCH_HOSTS: '["http://telemetry_elasticsearch:9200"]'
Expand All @@ -155,6 +157,7 @@ services:
apm-server:
image: docker.elastic.co/apm/apm-server:7.16.2
container_name: apm-server
profiles: ["telemetry"]
user: apm-server
restart: always
command:
Expand Down Expand Up @@ -199,6 +202,7 @@ services:
otel-collector:
image: otel/opentelemetry-collector:latest
container_name: otel-collector
profiles: ["telemetry"]
restart: always
command: "--config=/etc/otel-collector-config.yaml"
volumes:
Expand Down