2.4.0 • Published 9 years ago

trail-agent v2.4.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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

2.4.0

9 years ago

2.3.0

9 years ago

2.2.0

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago