newrelic / node-newrelic

New Relic Node.js agent code base. Developers are welcome to create pull requests here, please see our contributing guidelines. For New Relic technical support, please go to http://support.newrelic.com.
Apache License 2.0
971 stars 399 forks source link

Explore adding an OTEL SDK shim #2608

Closed jsumners-nr closed 1 month ago

jsumners-nr commented 1 month ago

The OpenTelemetry SDK allows for the injection of its constituent parts (context manager, trace provider, metrics provider, etc.). By utilizing this feature, we should be able to add a shim to our agent that would allow us to support utilizing @opentelemetry scoped tracing packages to gain instrumentations for packages we do not support, e.g. knex.

Success for this issue entails:

  1. Being able to load an OTEL tracing module (e.g. @opentelemetry/instrumentation-knex)
  2. Running an app with the instrumented module
  3. Seeing trace data in a New Relic dashboard

The outcome should be a statement on whether or not this is an avenue we would like to continue pursuing.

workato-integration[bot] commented 1 month ago

https://new-relic.atlassian.net/browse/NR-316444

jsumners-nr commented 1 month ago

After discussion with the team, I am closing this issue as "complete." We have a branch at https://github.com/jsumners-nr/node-newrelic/tree/6a9e56472c5cda4c086459df82ebc70c6c0ad29e/lib/instrumentation/otel that has some research details and code outlines. We have determined that it can be a viable path forward, but we need/want to rearchitect some agent internals before doing so.