opentelemetry-lambda icon indicating copy to clipboard operation
opentelemetry-lambda copied to clipboard

Conflict with others lambda layers

Open srenault opened this issue 2 years ago • 1 comments

This issue is related to opentelemetry-lamba for NodeJS. My project is using Sentry to report all unhandled errors. We integrated Sentry into our project by using the official lambda layer. On top of it, we included this opentelemetry-lambda layer and we run into some issues. I was interested in the auto instrumentation opentelemetry provides, more specifically the one that collects traces regarding all http outgoing calls. It was not working and I figured out it was related to https://opentelemetry.io/blog/2022/troubleshooting-nodejs/#enable-before-require. Afer some investigation, I understand sentry code was required before opentelemetry, mainly because of this https://github.com/open-telemetry/opentelemetry-lambda/blob/main/nodejs/packages/layer/scripts/otel-handler#L3.

Are there is any reasons why we don't define the ordering that way?

export NODE_OPTIONS="--require /opt/wrapper.js ${NODE_OPTIONS}"

srenault avatar Sep 26 '22 09:09 srenault

It used to be that way, but was changed to allow the wrapper itself to be configured. Perhaps there's a third way?

export NODE_OPTIONS="${OTEL_WRAPPER_OPTIONS} --require /opt/wrapper.js ${NODE_OPTIONS}"

Aneurysm9 avatar Sep 27 '22 22:09 Aneurysm9

This issue was marked stale. It will be closed in 30 days without additional activity.

github-actions[bot] avatar May 19 '24 03:05 github-actions[bot]

Closed as inactive. Feel free to reopen if this issue is still relevant.

github-actions[bot] avatar Jun 23 '24 03:06 github-actions[bot]