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

Bring up to latest OT spec (and more) #79

Merged
merged 23 commits into from Jan 9, 2017
Merged

Bring up to latest OT spec (and more) #79

merged 23 commits into from Jan 9, 2017

Conversation

bhs
Copy link
Contributor

@bhs bhs commented Jan 6, 2017

This is a big PR. The only sane way to review will be by commit, though even that is difficult. I'm happy to go through it interactively.

This change is needed for two main reasons:

  • LightStep's impl was not up to date with the latest OT interfaces and idioms
  • Key:Value logging data was not encoded in the most modern way which resulted in hacks down the pipe

I introduced some not-strictly-necessary breaking changes since we essentially had to in order to be OT-friendly. These were intended to make library init more conventional (as much as I could find a convention in other OSS libs) and to remove some LightStep-specific extensions in certain places.

There is still work to be done here... biggest items while they're still in my cache:

  • Remove as much deadcode as possible from the remaining codebase (there's definitely plenty of stuff there)
  • Along these lines, refactor what's left, and perhaps split tracer_imp.js into smaller pieces
  • Fix or remove the XHR instrumentation (parentage does not work AFAICT)
  • Fix the final report-on-window-close that I do not think is working correctly anymore

There is also internal documentation (outside of this repo) that will need to be updated.

@bhs bhs requested a review from bcronin January 6, 2017 22:27

queryUserInfo(span, username, function(err, user) {
if (err) {
span.imp().exception('Error in queryUserInfo', err);
span.exception('Error in queryUserInfo', err);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this and make it a standard log call instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing.

@@ -135,6 +138,7 @@ function queryUserInfo(parentSpan, username, callback) {
});

// In parallel, query the recent events activity for the user
console.log(json.received_events_url);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking: is this intentional or a debug statement that didn't get removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

debug statement, thanks -- removing.

@@ -51,7 +51,7 @@
"istanbul": "^0.4.4",
"json-loader": "^0.5.4",
"mocha": "^2.3.4",
"opentracing": "^0.11.0",
"opentracing": "^0.13.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest locking this to a specific version: i.e., remove the caret and make it "opentracing": "0.13.0".

}
fields.push(new crouton_thrift.KeyValue({
Key : keyStr,
Value : valStr,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is null a valid value for Value? Or should we skip the push entirely? I don't recall off the top of my head how Thrift and the collector process a value of null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

at line 48 above we early-exit from the _each... i.e., we drop.

@bhs
Copy link
Contributor Author

bhs commented Jan 9, 2017

@bcronin please take a look when you get a chance. I found a few minor issues with more careful testing. This could be polished further but IMO it's worth merging this to have a version of the LightStep lib that's up-to-date OT-wise.

<script src="http://docs.lightstep.com/dist/opentracing-javascript/current/opentracing-browser.min.js"></script>
<script src="http://docs.lightstep.com/dist/lightstep-tracer-javascript/current/lightstep-tracer.min.js"
<script src=".../opentracing-browser.min.js"></script>
<script src=".../lightstep-tracer.min.js"
Copy link
Contributor

Choose a reason for hiding this comment

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

The ... threw me off as it wasn't obviously that wasn't literally what should be there. I might suggest simply leaving it as <script src="opentracing-browser.min.js"></script> and leaving it to the reader to set the URL to the context-specific URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense. I have done

<script src="PATH/TO/opentracing-browser.min.js"></script>
<script src="PATH/TO/lightstep-tracer.min.js"

@bhs bhs merged commit 7790a87 into master Jan 9, 2017
@bhs bhs deleted the bhs/modernize_logging branch January 9, 2017 17:25
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.

None yet

2 participants