Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Merge 2b1844f into b6d84fe
Browse files Browse the repository at this point in the history
  • Loading branch information
yurishkuro committed Mar 2, 2017
2 parents b6d84fe + 2b1844f commit 8bbbbc8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ var opts = {
http.request(opts, function (res) {
res.setEncoding('utf8');
res.on('error', function (err) {
span.logEvent('request_error', err);
// assuming no retries, mark the span as failed
span.setTag(opentracing.Tags.ERROR, true);
span.log({'event': 'error', 'error.object': err);
span.finish();
});
res.on('data', function (chunk) {
span.logEvent('data_received', chunk);
span.log({'event': 'data_received', 'data': chunk});
});
res.on('end', function(err) {
span.logEvent('request_end', err);
res.on('end', function() {
span.log({'event': 'request_end'});
span.finish();
});
}).end();
Expand Down
7 changes: 7 additions & 0 deletions src/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export default class Tracer {
* childOf: parent.context(),
* });
*
* // Start a new async (FollowsFrom) Span:
* var child = Tracer.startSpan('Subroutine', {
* references: [
* opentracing.followsFrom(parent.context())
* ],
* });
*
* @param {string} name - the name of the operation.
* @param {object} [fields] - the fields to set on the newly created span.
* @param {string} [fields.operationName] - the name to use for the newly
Expand Down

0 comments on commit 8bbbbc8

Please sign in to comment.