Skip to content

Commit 17fe786

Browse files
committed
Fix initialization order in Django app
1 parent 996ba2f commit 17fe786

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ddtrace/contrib/django/apps.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ def ready(self):
3131
if settings.TAGS:
3232
tracer.set_tags(settings.TAGS)
3333

34-
# define the service details
35-
tracer.set_service_info(
36-
app='django',
37-
app_type=AppTypes.web,
38-
service=settings.DEFAULT_SERVICE,
39-
)
40-
4134
# configure the tracer instance
4235
# TODO[manu]: we may use configure() but because it creates a new
4336
# AgentWriter, it breaks all tests. The configure() behavior must
@@ -46,6 +39,13 @@ def ready(self):
4639
tracer.writer.api.hostname = settings.AGENT_HOSTNAME
4740
tracer.writer.api.port = settings.AGENT_PORT
4841

42+
# define the service details
43+
tracer.set_service_info(
44+
app='django',
45+
app_type=AppTypes.web,
46+
service=settings.DEFAULT_SERVICE,
47+
)
48+
4949
if settings.AUTO_INSTRUMENT:
5050
# trace Django internals
5151
insert_exception_middleware()

0 commit comments

Comments
 (0)