Skip to content

Commit e26c219

Browse files
authored
Merge pull request #829 from DataDog/0.21-dev
Release 0.21.0
2 parents 513cd2c + 5907da2 commit e26c219

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1076
-853
lines changed

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,17 +327,17 @@ jobs:
327327
steps:
328328
- checkout
329329
- *restore_cache_step
330-
- run: TOX_SKIP_DIST=False tox -e 'elasticsearch_contrib-{py27,py34,py35,py36}-elasticsearch{16,17,18,23,24,51,52,53,54,63}' --result-json /tmp/elasticsearch.results
331-
- run: TOX_SKIP_DIST=False tox -e 'elasticsearch_contrib-{py27,py34,py35,py36}-elasticsearch1{100}' --result-json /tmp/elasticsearch1.results
332-
- run: TOX_SKIP_DIST=False tox -e 'elasticsearch_contrib-{py27,py34,py35,py36}-elasticsearch2{50}' --result-json /tmp/elasticsearch2.results
333-
- run: TOX_SKIP_DIST=False tox -e 'elasticsearch_contrib-{py27,py34,py35,py36}-elasticsearch5{50}' --result-json /tmp/elasticsearch5.results
330+
- run:
331+
command: |
332+
tox -e 'elasticsearch_contrib-{py27,py34,py35,py36}-elasticsearch{16,17,18,23,24,51,52,53,54,63}' \
333+
-e 'elasticsearch_contrib-{py27,py34,py35,py36}-elasticsearch1{100}' \
334+
-e 'elasticsearch_contrib-{py27,py34,py35,py36}-elasticsearch2{50}' \
335+
-e 'elasticsearch_contrib-{py27,py34,py35,py36}-elasticsearch5{50}' \
336+
--result-json /tmp/elasticsearch.results
334337
- persist_to_workspace:
335338
root: /tmp
336339
paths:
337340
- elasticsearch.results
338-
- elasticsearch1.results
339-
- elasticsearch2.results
340-
- elasticsearch5.results
341341
- *save_cache_step
342342

343343
falcon:

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @DataDog/apm-python

ddtrace/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .tracer import Tracer
55
from .settings import config
66

7-
__version__ = '0.20.4'
7+
__version__ = '0.21.0'
88

99
# a global tracer instance with integration settings
1010
tracer = Tracer()

ddtrace/api.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# project
88
from .encoding import get_encoder, JSONEncoder
99
from .compat import httplib, PYTHON_VERSION, PYTHON_INTERPRETER, get_connection_response
10+
from .utils.deprecation import deprecated
1011

1112

1213
log = logging.getLogger(__name__)
@@ -159,23 +160,9 @@ def send_traces(self, traces):
159160
log.debug("reported %d traces in %.5fs", len(traces), time.time() - start)
160161
return response
161162

162-
def send_services(self, services):
163-
if not services:
164-
return
165-
s = {}
166-
for service in services:
167-
s.update(service)
168-
data = self._encoder.encode_services(s)
169-
response = self._put(self._services, data)
170-
171-
# the API endpoint is not available so we should downgrade the connection and re-try the call
172-
if response.status in [404, 415] and self._fallback:
173-
log.debug('calling endpoint "%s" but received %s; downgrading API', self._services, response.status)
174-
self._downgrade()
175-
return self.send_services(services)
176-
177-
log.debug("reported %d services", len(services))
178-
return response
163+
@deprecated(message='Sending services to the API is no longer necessary', version='1.0.0')
164+
def send_services(self, *args, **kwargs):
165+
return
179166

180167
def _put(self, endpoint, data, count=0):
181168
conn = httplib.HTTPConnection(self.hostname, self.port)

ddtrace/compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
PYTHON_VERSION_INFO = sys.version_info
2020
PY2 = sys.version_info[0] == 2
21+
PY3 = sys.version_info[0] == 3
2122

2223
# Infos about python passed to the trace agent through the header
2324
PYTHON_VERSION = platform.python_version()
@@ -34,6 +35,7 @@
3435
Queue = six.moves.queue.Queue
3536
iteritems = six.iteritems
3637
reraise = six.reraise
38+
reload_module = six.moves.reload_module
3739

3840
stringify = six.text_type
3941
string_type = six.string_types[0]

ddtrace/contrib/aiohttp/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
Integration settings are attached to your application under the ``datadog_trace``
2121
namespace. You can read or update them as follows::
2222
23-
# activates distributed tracing for all received requests
24-
app['datadog_trace']['distributed_tracing_enabled'] = True
23+
# disables distributed tracing for all received requests
24+
app['datadog_trace']['distributed_tracing_enabled'] = False
2525
2626
Available settings are:
2727
2828
* ``tracer`` (default: ``ddtrace.tracer``): set the default tracer instance that is used to
2929
trace `aiohttp` internals. By default the `ddtrace` tracer is used.
3030
* ``service`` (default: ``aiohttp-web``): set the service name used by the tracer. Usually
3131
this configuration must be updated with a meaningful name.
32-
* ``distributed_tracing_enabled`` (default: ``False``): enable distributed tracing during
32+
* ``distributed_tracing_enabled`` (default: ``True``): enable distributed tracing during
3333
the middleware execution, so that a new span is created with the given ``trace_id`` and
3434
``parent_id`` injected via request headers.
3535

ddtrace/contrib/aiohttp/middlewares.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,12 @@ def trace_app(app, tracer, service='aiohttp-web'):
117117
app[CONFIG_KEY] = {
118118
'tracer': tracer,
119119
'service': service,
120-
'distributed_tracing_enabled': False,
120+
'distributed_tracing_enabled': True,
121121
}
122122

123123
# the tracer must work with asynchronous Context propagation
124124
tracer.configure(context_provider=context_provider)
125125

126-
# configure the current service
127-
tracer.set_service_info(
128-
service=service,
129-
app='aiohttp',
130-
app_type=AppTypes.web,
131-
)
132-
133126
# add the async tracer middleware as a first middleware
134127
# and be sure that the on_prepare signal is the last one
135128
app.middlewares.insert(0, trace_middleware)

ddtrace/contrib/bottle/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
app = bottle.Bottle()
1010
plugin = TracePlugin(service="my-web-app")
1111
app.install(plugin)
12-
13-
To enable distributed tracing::
14-
15-
plugin = TracePlugin(service="my-web-app", distributed_tracing=True)
1612
"""
1713

1814
from ...utils.importlib import require_modules

ddtrace/contrib/bottle/trace.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# stdlib
55
import ddtrace
6-
from ddtrace.ext import http, AppTypes
6+
from ddtrace.ext import http
77

88
# project
99
from ...constants import EVENT_SAMPLE_RATE_KEY
@@ -17,15 +17,10 @@ class TracePlugin(object):
1717
name = 'trace'
1818
api = 2
1919

20-
def __init__(self, service='bottle', tracer=None, distributed_tracing=None):
20+
def __init__(self, service='bottle', tracer=None, distributed_tracing=True):
2121
self.service = service
2222
self.tracer = tracer or ddtrace.tracer
2323
self.distributed_tracing = distributed_tracing
24-
self.tracer.set_service_info(
25-
service=service,
26-
app='bottle',
27-
app_type=AppTypes.web,
28-
)
2924

3025
def apply(self, callback, route):
3126

ddtrace/contrib/django/apps.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
from .templates import patch_template
1111
from .middleware import insert_exception_middleware, insert_trace_middleware
1212

13-
from ...ext import AppTypes
14-
15-
1613
log = logging.getLogger(__name__)
1714

1815

@@ -39,13 +36,6 @@ def ready(self):
3936
tracer.writer.api.hostname = settings.AGENT_HOSTNAME
4037
tracer.writer.api.port = settings.AGENT_PORT
4138

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-
4939
if settings.AUTO_INSTRUMENT:
5040
# trace Django internals
5141
insert_trace_middleware()

0 commit comments

Comments
 (0)