concurix
The Concurix Node.js tracer.
Instruments your code in two ways:
- Instruments all of your (and 3rd-party) javascript functions in order to build flame graphs of your synchronous code.
- Wraps key asynchronous functions to trace transactions crossing the event-loop boundary.
The data is collected as your application runs, aggregated and sent periodically to the Concurix service where you can analyze and track your application over time at http://concurix.com
The net result is the ability to track execution across asynchronous boundaries in your application, I.e. see a http request against your Node.js server from start-to-finish, with flame graphs of the js code and transaction timinigs for things like database queries.
It provides a holistic view of what your Node.js application is doing, with only a single require statement.
API
var concurix = require("concurix")(options)
Before any other require statements in your main entry code, require("concurix")
to install the instrumentation, and provide your account key. You can get an account key at Concurix.com.
E.g.
var concurix = require("concurix")({
accountKey: "YOUR ACCOUNT KEY",
email: "your@email.address"
})
Note that this will not currently be able to instrument ANY functions that are defined in the file where concurix
is required. For applications that define most logic in the entry js file, the best way to work around this is to use a wrapper when you want to run with the tracer that requires your file after starting instrumentation, e.g.:
var concurix = require("concurix")({
accountKey: "YOUR ACCOUNT KEY",
email: "your@email.address"
})
require("your_main_entrypoint.js")
Options:
var DEFAULT_CONFIG = {
"accountKey": "YOUR ACCOUNT KEY",
"email": "your@email.address",
"archiveInterval": 60000,
"instrument": true,
"trace": true,
"transactions": true,
"follow_links": true,
"enable_cca": false,
"wrap_core": true,
"wrap_timers": true,
"wrap_process": true,
"wrap_dns": true,
"wrap_fs": true,
"wrap_http": true,
"wrap_zlib": true,
"wrap_redis": true,
"wrap_native": true,
"blacklist": []
}
Running with the default options is suggested.
Blacklisting:
The blacklist can be used to prevent instrumentation of specific files. It expects a list of file globs, and if the filename of the module being require
d matches, it will skip it. E.g.
"blacklist": [
"*/foo.js",
"*node_modules/foo/*",
]
Tagging:
Waterfalls can be "tagged" manually for grouping or search in the UI by using the tag()
method. E.g.
var concurix = require("concurix")(options)
function setWidget(bar) {
concurix.tracer.tag("setting widget " + bar)
}
Some tagging is done automatically for pre-wrapped modules.
Custom Metrics:
The concurix tracer includes the http://npm.im/statware module and can send custom metrics to be stored with your trace files.
var concurix = require("concurix")(options)
var metrics = concurix.metrics()
metrics.increment("widgets")
See the http://npm.im/statware documentation for more information.
For more information, see Concurix.com
LICENSE
Concurix Terms of Service