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

fix: fixes undefined comparison and partial span timeout rules. #449

Merged
merged 7 commits into from
Oct 14, 2019

Conversation

jcchavezs
Copy link
Contributor

This PR fixes a comparison with undefined and also adds a guard for partial spans that have not timestamp attribute (because they were already reported).

Ping @adriancole

tracer.letId(id, () => {
// if route is terminated on middleware req.route won't be available
const route = req.route && req.route.path;
tracer.recordRpc(instrumentation.spanNameFromRoute(req.method, route, res.statusCode));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are sure this is being reached, otherwise the integration test suite for httpserver will fail due to span naming.

// TODO(adriancole) refactor so this responsibility isn't in writeSpan
if (!isNew && this.partialSpans.get(id) === 'undefined') {
// Span not found. Could have been expired.
if (!isNew && typeof this.partialSpans.get(id) === 'undefined') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the end we did not need the parenthesis @adriancole

}
};
recorder._writeSpan(rootId, span);
expect(spans).to.be.empty; // eslint-disable-line no-unused-expressions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

good job!

@jcchavezs jcchavezs merged commit aff4120 into master Oct 14, 2019
@jcchavezs jcchavezs deleted the fix_undefined_check branch October 14, 2019 12: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.

2 participants