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

Refactor for future span sending over http #176

Merged
merged 1 commit into from
May 29, 2018

Conversation

ProvoK
Copy link
Contributor

@ProvoK ProvoK commented May 20, 2018

Related to #98
@yurishkuro

Ideally you should not need to change in the crossdock code, because if you do it means your change is not backwards compatible.

I changed it because Reporter and RemoteControlledSampler init changes.

EDIT: reverted changes on RemoteControlledSampler and make io_loop parameter not required in Sender classes (LocalAgentSender handles io_loop=None). This will impact less actual existing codebase (and tests)

@ProvoK ProvoK changed the title Refactor for future span sending over http WIP: Refactor for future span sending over http May 20, 2018
@ProvoK ProvoK force-pushed the send_spans_over_http branch 4 times, most recently from f6eb07b to a4955e1 Compare May 20, 2018 19:42
@coveralls
Copy link

coveralls commented May 20, 2018

Coverage Status

Coverage increased (+0.08%) to 95.43% when pulling dfd6548 on ProvoK:send_spans_over_http into 9429e29 on jaegertracing:master.

from jaeger_client.thrift_gen.agent import Agent


DEFAULT_SAMPLING_PORT = 5778
Copy link
Contributor Author

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)

@ProvoK ProvoK force-pushed the send_spans_over_http branch 2 times, most recently from 1246b60 to 111e096 Compare May 21, 2018 09:04
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.

sorry for the delay, i'll do a full review soon

@@ -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,
Copy link
Contributor

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'),

Copy link
Contributor Author

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!

@ProvoK ProvoK changed the title WIP: Refactor for future span sending over http Refactor for future span sending over http May 25, 2018
@ProvoK
Copy link
Contributor Author

ProvoK commented May 25, 2018

@black-adder no problem, I'll squash commits and fix sign-off missing before merging. Plus, I'm thinking I should test senders.py module in some way

:param self: instance of Config
"""
logger.info('Initializing Jaeger Tracer with UDP reporter')
return LocalAgentSender(
Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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 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

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.

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

@@ -0,0 +1,90 @@
# Copyright (c) 2016 Uber Technologies, Inc.
Copy link
Contributor

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(
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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().
Copy link
Contributor

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

@ProvoK
Copy link
Contributor Author

ProvoK commented May 28, 2018

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>
@black-adder black-adder merged commit 51df6ab into jaegertracing:master May 29, 2018
reporter = Reporter(
channel=channel,
sender=sender,
Copy link
Member

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

doh reverting

Copy link
Member

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.

Copy link
Contributor Author

@ProvoK ProvoK May 31, 2018

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

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.

None yet

4 participants