-
Notifications
You must be signed in to change notification settings - Fork 171
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
Conversation
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)); |
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.
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') { |
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.
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 |
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 test makes sure this is right: https://github.com/openzipkin/zipkin-js/pull/449/files#diff-503c850b99353bea68792242ff75f9edR114
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.
good job!
This PR fixes a comparison with
undefined
and also adds a guard forpartial spans
that have nottimestamp
attribute (because they were already reported).Ping @adriancole