Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

node-trail-agent NPM version build status Test coverage

Distributed tracing agent for Node.js

Installation

npm install --save trail-agent

Usage

Install other instrument libraries

npm install --save trail-instrument-redis

Initialize agent

var agent = require('trail-agent')
agent.instrument(['trail-instrument-redis'])
agent.setRecorder((span) => {
    console.log(span)
})

Record in anywhere else

var agent = require('trail-agent')
let span = agent.start()
setTimeout(() => {
    span.setTag('key', 'value')
    span.finish()
})

Instrument library

To instrument library, you should provide a module with

  • target: indicate targeting module name.
  • wrap(agent, module): method with trail-agent instance and target module as arguments, return wrapped module.
  • unwrap(): method to unwrap method wrapped by wrap(), intention of this method is unwrap method in tests.

Common tags

  • protocol
  • host
  • status

License

MIT

About

Distributed tracing agent for Node.js

Resources

License

Packages

No packages published