Distributed tracing library
Distributed tracing library inspired by zipkin.
This modules includes no graphing functionality, however the image on this page was generated with traces-graph. By using
traces.get(cycle) you can generate your own reports.
Traces works by collecting "cycles", which consist of one or more trace
calls enabling you to report on the durations of any given subset of a cycle. For
example an image upload "cycle" may look something like the following, where each
aspect of this request/response cycled may be "traced" for inspection. Because of
this association each
Cycle must have its own "id", which may be unique identifier,
allowing traces cross-process.
var cycle = require'traces';var http = require'http';var id = 0;httpcreateServervar trace = cycle'upload' id++;// request comes in, start streaming datatracestart'request';tracestart'upload';// upload completetraceend'upload';// resizetracestart'resize';// resize completetraceend'resize';// respondtraceend'request';
trace(1) executable is provided with this module, and serves as the in-memory "database" from which your nodes converse via axon. In the future persistence via pluggable stores may be supported.
To enable a cycle you may use the TRACE environment variable. For example
to enable all probes simply use
TRACE="*", to enable only chat related cycles
TRACE=chat, for several use spaces or commas
TRACE=chat,request. You may also use wildcards such as
and negation via
TRACE="* -chat" to say "everything except chat".
Clear all results collected.
Clear results collected for
Fetch all traces for
cycle and invoke
The json returned is formatted as follows, keyed by the cycle id.
Initialize a new Tracer with the given
Trace start of
type with optional
Trace end of
type with optional
(The MIT License)
Copyright (c) 2012 TJ Holowaychuk <firstname.lastname@example.org>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.