Skip to content

Conversation

mydea
Copy link
Member

@mydea mydea commented Jul 22, 2024

As mentioned in here: #12912 (comment) there is no way today to exclude/include esm modules when preloading today.

This PR adds the option to pass registerEsmLoaderHooks as option to preloadOpenTelemetry, which allows to exclude/include packages there as well. Users can then write their own custom preload script and configure this there, if wanted.

Naming

I chose to use the same option naming here than for init, although the semantics are a bit different - here we can't actually disable the wrapping (because that's the only reason to even call this). We can also use a different name if we want, but I thought this would maybe be easier to understand that this is the same thing 🤔

@mydea mydea requested review from AbhiPrasad and timfish July 22, 2024 08:27
@mydea mydea self-assigned this Jul 22, 2024
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and agree on keeping the name aligned with the init option.

Users can then write their own custom preload script and configure this there, if wanted.

Sounds fair, given this won't be a widely used option. We should just make sure to document this because right now, we only show how to set integrations and debug via env variables.

@mydea mydea merged commit 81e20c3 into develop Jul 22, 2024
@mydea mydea deleted the fn/otel-preload branch July 22, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants