-
Notifications
You must be signed in to change notification settings - Fork 156
Refactor for future span sending over http #176
Conversation
f6eb07b
to
a4955e1
Compare
715e034
to
514a0d8
Compare
from jaeger_client.thrift_gen.agent import Agent | ||
|
||
|
||
DEFAULT_SAMPLING_PORT = 5778 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default should probably be moved to constants
.
Actually is defined only in config
(and here ofc)
1246b60
to
111e096
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the delay, i'll do a full review soon
crossdock/server/endtoend.py
Outdated
@@ -65,8 +66,13 @@ def __init__(self): | |||
init_sampler = cfg.sampler | |||
channel = self.local_agent_sender | |||
|
|||
sender = UDPSender( | |||
io_loop=channel.io_loop, | |||
host=cfg.local_agent_reporting_host, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here use the host port from local_agent_sender:
host=os.getenv('AGENT_HOST', 'jaeger-agent'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh gawd it was the problem! I was really struggling.Thanks!
@black-adder no problem, I'll squash commits and fix sign-off missing before merging. Plus, I'm thinking I should test |
:param self: instance of Config | ||
""" | ||
logger.info('Initializing Jaeger Tracer with UDP reporter') | ||
return LocalAgentSender( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said earlier here I would like to split responsibility between LocalAgentSender
and LocalAgentHttp
(which actually just perform an HTTP call for the sampling). I could do the separation in this PR, I removed in order to keep the changes small.
This would remove the need of the sampling_port
argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did all but this one. This will touch a lot of things (Sampler and Config), so it's probably better do it in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, can we add tests to cover the new functions in jaeger_client/senders.py? Also, you're going to have to sign off on all your commits, you can do that by squashing all your commits and signing it and then doing a force push
jaeger_client/senders.py
Outdated
@@ -0,0 +1,90 @@ | |||
# Copyright (c) 2016 Uber Technologies, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that should be 2018, looks like there's something wrong with the license script
:param self: instance of Config | ||
""" | ||
logger.info('Initializing Jaeger Tracer with UDP reporter') | ||
return LocalAgentSender( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
jaeger_client/senders.py
Outdated
def send(self, batch): | ||
""" | ||
Send batch of spans out via thrift transport. Any exceptions thrown | ||
will be caught above in the exception handler of _submit(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of the comments need updating like here
46ab59a
to
d004867
Compare
Tomorrow I'm going to add some unit test for sender.py and fix a documentation line in the reporter class |
`Reporter` now delegate span sending to new `Sender` classes . Signed-off-by: vitto <vittorio.camisa@gmail.com>
d004867
to
dfd6548
Compare
reporter = Reporter( | ||
channel=channel, | ||
sender=sender, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@black-adder renaming the field is a breaking change. Are you sure this can be merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh reverting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's find a way to let this PR to get merged, but in backwards compatible way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did changes to make it backwards compatible. Should I open another PR?
edit: Still I don't like much the workaround I did. If you got better ideas I'm open
This reverts commit 51df6ab.
Related to #98
@yurishkuro
I changed it because
Reporter
andRemoteControlledSampler
init changes.EDIT: reverted changes on
RemoteControlledSampler
and makeio_loop
parameter not required inSender
classes (LocalAgentSender
handles io_loop=None). This will impact less actual existing codebase (and tests)