Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Use opentracing 2.0 #206

Merged
merged 18 commits into from
Apr 27, 2019

Conversation

mihau
Copy link
Contributor

@mihau mihau commented Aug 8, 2018

This pull request bumps opntracing to 2.0 and implements changes needed for api compatibility (mainly regarding scope managers). I assumed compatibility with 2.x only, but maybe it would be possible to run it with 1.x as well, not sure if that is a good idea though.
I used ThreadLocalScopeManager from opentracing as a default scope manager.

The tests may fail because of an opentracing issue I fixed in opentracing/opentracing-python#97

Resolves #199

@mihau mihau force-pushed the feature/opentracing-2.0-support branch from 1a86904 to 21e1ae5 Compare August 8, 2018 13:34
@mihau mihau mentioned this pull request Aug 8, 2018
Copy link
Contributor

@black-adder black-adder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for getting started on this!

jaeger_client/tracer.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
jaeger_client/tracer.py Show resolved Hide resolved
@mihau mihau force-pushed the feature/opentracing-2.0-support branch from beb54a7 to 54c5e78 Compare August 9, 2018 13:35
Copy link

@tovin07 tovin07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this PR, I just have some small comments.

tests/test_api.py Show resolved Hide resolved
jaeger_client/tracer.py Outdated Show resolved Hide resolved
jaeger_client/tracer.py Outdated Show resolved Hide resolved
jaeger_client/tracer.py Outdated Show resolved Hide resolved
Michał Szymański added 4 commits April 12, 2019 16:50
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
@mihau mihau force-pushed the feature/opentracing-2.0-support branch from 028213f to 6a15518 Compare April 12, 2019 14:59
Co-Authored-By: mihau <mszymanski@vewd.com>
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
@mihau mihau force-pushed the feature/opentracing-2.0-support branch from 5b4a6f3 to ef0dc0c Compare April 12, 2019 15:06
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
@mihau mihau force-pushed the feature/opentracing-2.0-support branch from 549df3e to e58ffd0 Compare April 12, 2019 15:13
Michał Szymański added 2 commits April 12, 2019 21:30
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
@mihau mihau force-pushed the feature/opentracing-2.0-support branch from dcb03ab to dbd47f8 Compare April 12, 2019 19:45
@codecov
Copy link

codecov bot commented Apr 12, 2019

Codecov Report

Merging #206 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #206      +/-   ##
==========================================
+ Coverage   94.63%   94.65%   +0.02%     
==========================================
  Files          25       25              
  Lines        1902     1910       +8     
  Branches      256      257       +1     
==========================================
+ Hits         1800     1808       +8     
  Misses         67       67              
  Partials       35       35
Impacted Files Coverage Δ
jaeger_client/tracer.py 99.34% <100%> (+0.03%) ⬆️
jaeger_client/config.py 91.66% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9771cc9...b4e2d10. Read the comment docs.

@mihau
Copy link
Contributor Author

mihau commented Apr 12, 2019

I've spotted an issue with what I believe is a problem of opentracing-python tests, which led me to overriding a test in this commit.
I opened an issue in opentracing-python to figure out what to do with it.

jaeger_client/config.py Outdated Show resolved Hide resolved
setup.py Outdated
@@ -40,7 +40,7 @@
'threadloop>=1,<2',
'thrift',
'tornado>=4.3,<5',
'opentracing>=1.2.2,<2',
'opentracing>=2.0,<3.0',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pleasantly surprised that crossdock test works with 'opentracing_instrumentation>=2,<3'

@yurishkuro
Copy link
Member

Aside from the scope manager passed as class vs. instance, this lgtm otherwise (i.e. WIP can be removed).

@mihau
Copy link
Contributor Author

mihau commented Apr 24, 2019

@yurishkuro and how do you feel about this commit do we leave it, or do we get it fixed in python-opentracing first?

@yurishkuro
Copy link
Member

yurishkuro commented Apr 24, 2019

I think it's ok to leave it. Is there a ticket for opentracing-python? We should added it to the comments under // TODO remove after {ticket} is fixed

Michał Szymański added 2 commits April 24, 2019 22:06
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
@mihau mihau force-pushed the feature/opentracing-2.0-support branch from bef78c5 to be9a70c Compare April 24, 2019 20:30
@mihau
Copy link
Contributor Author

mihau commented Apr 24, 2019

Ok, cool. I've added the TODO note. Removing the WIP status.

@mihau mihau changed the title WIP Use opentracing 2.0 Use opentracing 2.0 Apr 24, 2019
Signed-off-by: Michał Szymański <mszymanski@vewd.com>

:return: Returns an already-started Span instance.
"""
parent = child_of

if self.active_span is not None and not ignore_active_span:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it also needs and not parent, because if child_of is passed explicitly, the active span should not be inherited (or am I mistaken?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right, it makes sense. Although one could use ignore_active_span together with child_of to pass it explicitly. Not exactly intuitive but still an option. The tests don't seem to enforce it in any way (maybe it would be appropriate to add one to do so?).
I added the condition, you might find the formatting controversial (multiline if), let me know if you prefer a different way.

jaeger_client/tracer.py Outdated Show resolved Hide resolved
tests/test_api.py Outdated Show resolved Hide resolved
Michał Szymański and others added 6 commits April 26, 2019 18:59
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
Signed-off-by: Michał Szymański <mszymanski@vewd.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@yurishkuro yurishkuro merged commit 5a237ce into jaegertracing:master Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support OpenTracing-2.0.0
5 participants