Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim vdeturckheim/hooked.js Secret
Created Nov 12, 2017

Embed
What would you like to do?
'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
You can’t perform that action at this time.