Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim
Created November 12, 2017 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdeturckheim/8361364ec9a795df7507def2e85673da to your computer and use it in GitHub Desktop.
Save vdeturckheim/8361364ec9a795df7507def2e85673da to your computer and use it in GitHub Desktop.
'use strict';
const AsyncHooks = require('async_hooks');
process.apm = process.apm || {};
const Context = require('./context');
const instrumentation = require('./instrumentation/index');
const hook = AsyncHooks.createHook({
init(asyncId, type, triggerAsyncId) {
Context.init(asyncId, type, triggerAsyncId);
},
destroy(asyncId) {
Context.destroy(asyncId);
}
});
hook.enable();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment