Skip to content

Commit 334ec31

Browse files
author
Emanuele Palazzetti
committed
[aiobotocore] update response attributes so Pin.get_from() can retrieve the Pin instance
1 parent 2f44df1 commit 334ec31

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ddtrace/contrib/aiobotocore/patch.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ def unpatch():
3333
class WrappedClientResponseContentProxy(wrapt.ObjectProxy):
3434
def __init__(self, body, pin, parent_span):
3535
super(WrappedClientResponseContentProxy, self).__init__(body)
36-
self.__pin = pin
37-
self.__parent_span = parent_span
36+
self._self_pin = pin
37+
self._self_parent_span = parent_span
3838

3939
@asyncio.coroutine
4040
def read(self, *args, **kwargs):
4141
# async read that must be child of the parent span operation
42-
operation_name = '{}.read'.format(self.__parent_span.name)
42+
operation_name = '{}.read'.format(self._self_parent_span.name)
4343

44-
with self.__pin.tracer.start_span(operation_name, child_of=self.__parent_span) as span:
44+
with self._self_pin.tracer.start_span(operation_name, child_of=self._self_parent_span) as span:
4545
# inherit parent attributes
46-
span.resource = self.__parent_span.resource
47-
span.span_type = self.__parent_span.span_type
48-
span.meta = dict(self.__parent_span.meta)
46+
span.resource = self._self_parent_span.resource
47+
span.span_type = self._self_parent_span.span_type
48+
span.meta = dict(self._self_parent_span.meta)
4949

5050
result = yield from self.__wrapped__.read(*args, **kwargs) # noqa: E999
5151
span.set_tag('Length', len(result))

0 commit comments

Comments
 (0)