Skip to content

Commit

Permalink
deps: cdumay-opentracing==0.1.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
cdumay committed Sep 25, 2018
1 parent 1b636e9 commit bca34d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.10
0.1.11
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
package_dir={'': 'src'},
test_suite="cdumay_rest_client.tests",
extras_require={
'opentracing': ['cdumay-opentracing>=0.1.3']
'opentracing': ['cdumay-opentracing>=0.1.8']
}
)
6 changes: 5 additions & 1 deletion src/cdumay_rest_client/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ def extract_tags(cls, obj):
:return: Tags to add on span
:rtype: dict
"""
return dict([(attr, obj.get(attr, None)) for attr in cls.TAGS])
return dict(
[("request.{}".format(attr), obj.get(attr, None)) for attr in
cls.TAGS]
)


class OpentracingRESTClient(RESTClient):
def _request_wrapper(self, **kwargs):
with opentracing.tracer.start_span(
obj=kwargs, span_factory=RESTClientRequestSpan) as span:
RESTClientRequestSpan.inject(span, kwargs)
span.obj = requests.request(**kwargs)
return span.obj

0 comments on commit bca34d4

Please sign in to comment.