Skip to content

Commit c975305

Browse files
authored
Merge pull request #1257 from zhammer/patch-1
Use DATADOG_SERVICE_NAME environment variable as default tornado service name
2 parents b0a1434 + 730d46c commit c975305

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ddtrace/contrib/tornado/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ def log_exception(self, typ, value, tb):
9292
The available settings are:
9393
9494
* ``default_service`` (default: `tornado-web`): set the service name used by the tracer. Usually
95-
this configuration must be updated with a meaningful name.
95+
this configuration must be updated with a meaningful name. Can also be configured via the
96+
``DATADOG_SERVICE_NAME`` environment variable.
9697
* ``tags`` (default: `{}`): set global tags that should be applied to all spans.
9798
* ``enabled`` (default: `True`): define if the tracer is enabled or not. If set to `false`, the
9899
code is still instrumented but no spans are sent to the APM agent.

ddtrace/contrib/tornado/application.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import ddtrace
24

35
from tornado import template
@@ -17,7 +19,7 @@ def tracer_config(__init__, app, args, kwargs):
1719
# default settings
1820
settings = {
1921
'tracer': ddtrace.tracer,
20-
'default_service': 'tornado-web',
22+
'default_service': os.getenv('DATADOG_SERVICE_NAME', 'tornado-web'),
2123
'distributed_tracing': True,
2224
'analytics_enabled': None
2325
}

0 commit comments

Comments
 (0)