census-instrumentation / opencensus-node

A stats collection and distributed tracing framework
https://opencensus.io
Apache License 2.0
273 stars 96 forks source link

Dependency on deprecated continuation-local-storage #792

Open oleg-codaio opened 4 years ago

oleg-codaio commented 4 years ago

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

Latest (https://github.com/census-instrumentation/opencensus-node/blob/master/packages/opencensus-core/package.json has a dependency on CLS)

What version of Node are you using?

v12

What did you do?

Using pm2 (https://pm2.keymetrics.io/), which depends on @opencensus/core internally.

What did you expect to see?

No deprecation warnings.

What did you see instead?

The following warning:

DeprecationWarning: Socket.prototype._handle is deprecated

coming from continuation-local-storage's use of async-listener, which polyfills a removed API with another deprecated API. This package should be migrated to use cls-hooked instead, which uses supported async hooks APIs.

Additional context

Migration should be trivial.

mayurkale22 commented 4 years ago

If you are feeling motivated, maybe you can attempt to write solution and open a PR.

oleg-codaio commented 4 years ago

Yup! I'm going to take a stab at it -- just wanted to open an issue, first.

oleg-codaio commented 4 years ago

Ok, I gave it a shot: https://github.com/census-instrumentation/opencensus-node/pull/793.