-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CorrelationContext.getCurrentContext() returning undefined when deeply nested #296
Comments
The general guidance here is to use For this particular case (bluebird) you can also choose to patch zone.js directly with bluebird support: https://github.com/angular/zone.js/blob/master/NON-STANDARD-APIS.md#user-content-currently-supported-non-standard-common-apis |
When attempting to apply the patch for appInsights.setup(config.appInsightsKey)
.start();
var Bluebird = require('bluebird');
require('zone.js/dist/zone-bluebird');
Zone[Zone['__symbol__']('bluebird')] (Bluebird); I am getting the exception: |
This looks to me like you're seeing the effects of multiple versions of zone.js being loaded. Notably the version of zone.js currently depended on in this SDK does not include the bluebird patch files or the |
Since we depend on an older version of Zone.js, I think the only option forward is to use |
Simply wrapping the middleware |
Closing this as Zone.js has been deprecated in favor of cls-hooked, so this is likely no longer an issue |
Our auto-collected dependencies are inconsistently being correlated to the request (operation).
It appears that
CorrelationContext.getCurrentContext()
is working properly if called directly within the middleware (express) but if called further down (within callbacks and/or promises) it is returningundefined
.I have hacked in a workaround using
continuation-local-storage
:We have all auto-collection enabled:
We use
bluebird
promises heavily, which may affect how the underlying zones function.The text was updated successfully, but these errors were encountered: