Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HTTP transport module #23

Merged
merged 1 commit into from
Jul 15, 2016
Merged

Conversation

jquatier
Copy link
Contributor

Fixes #15. I modeled most of this after the scribe and kafka loggers. Basically, there is just an internal queue that gets checked every second for new spans. If there are spans, it batches them up in a single JSON post (an array) and sends them to a configurable HTTP endpoint.

Let me know if you'd like any changes made! I've tested this on a Restify-based service and I also added unit / integration tests.

@jquatier
Copy link
Contributor Author

jquatier commented Jul 14, 2016

I ticked the version number in the lerna.json file to 0.2.3 since there are changes in the core zipkin module. One thing I noticed is that the restify instrumentation that was published is already on 0.2.3 in NPM, but in github its still 0.2.2. Anyway, let me know if I did that right.

}
}).then((response) => {
if (response.status === 202) {
this.queue.length = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about truncating the queue in every case, regardless of whether the request succeeds or not? We don't require consistency in Zipkin trace data. My concern is that if the zipkin server is down, the posting would fail, and this.queue would never be emptied, leading to a memory leak.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. I'll take care of this and the other items today. Thanks!

@eirslett
Copy link
Contributor

eirslett commented Jul 14, 2016

Great work! The lerna thing was my mistake, lerna didn't publish the project properly last time I tried. I'll fix it when I release :)

@codefromthecrypt
Copy link
Member

codefromthecrypt commented Jul 15, 2016 via email

this.endpoint = endpoint;
this.queue = [];

setInterval(() => {
Copy link
Collaborator

@sveisvei sveisvei Jul 15, 2016

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.

That's a good point! I'll make the change.

@sveisvei
Copy link
Collaborator

👍 lgtm

@jquatier
Copy link
Contributor Author

All feedback has been addressed, and it looks like the travis build is back so 👍

@eirslett
Copy link
Contributor

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants