feat!: use modern diagnostics_channel API#2407
feat!: use modern diagnostics_channel API#2407secondfry wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
|
Hi @secondfry thanks for contributing to opentelemetry :) IMHO the change you propose is the way to go since the API is deprecated but I would prefer not to drop support for node versions if possible. Have you thought to use the Cheers |
|
@secondfry did you have time to think about my suggestion on nodejs support? |
|
Hi @secondfry If you have no bandwidth I can take this one although I'd go for not dropping support of Node.js versions |
|
@secondfry this PR includes your proposal along a few changes to keep compatibility |
|
@david-luna I'm terribly sorry for not following through with requested changes and thank you so much for your PR |
Which problem is this PR solving?
I'm observing that
instrumentation-undicidoes not work in Node.js 18.16.0 if code was started with no Internet access. I nailed it down to usage ofchannel.subscribe(onMessage)which was deprecated in Node.js 18.7.0.Interestingly enough new API does not pass tests on all Node.js versions between 18.7.0 and 18.18.2. I think this is related to nodejs/node#47520. Thus I'm setting minimal engine version to 18.19.0.
Short description of the changes
Use diagnostics_channel.subscribe(name, onMessage) instead of channel.subscribe(onMessage).