Skip to content

Commit

Permalink
Configure OpenTelemetry services for Django apps
Browse files Browse the repository at this point in the history
Make it easier to test if we set some expected metadata.
  • Loading branch information
tombruijn committed Aug 23, 2024
1 parent 7635b7d commit a96271f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/django4-celery/app/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

def main():
"""Run administrative tasks."""
os.environ["OTEL_SERVICE_NAME"] = "django-app"
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'appsignal_python_opentelemetry.settings')

appsignal.start()
Expand Down
2 changes: 2 additions & 0 deletions python/django4-celery/app/tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import os

import appsignal

Expand All @@ -11,6 +12,7 @@

@worker_process_init.connect(weak=False)
def init_celery_tracing(*args, **kwargs):
os.environ["OTEL_SERVICE_NAME"] = "celery-app"
appsignal.start()


Expand Down

0 comments on commit a96271f

Please sign in to comment.