Skip to content

feat(core): Add ModuleMetadata integration - #8475

Merged
AbhiPrasad merged 10 commits into
getsentry:developfrom
timfish:feat/module-metadata-integration
Jul 13, 2023
Merged

feat(core): Add ModuleMetadata integration#8475
AbhiPrasad merged 10 commits into
getsentry:developfrom
timfish:feat/module-metadata-integration

Conversation

@timfish

@timfish timfish commented Jul 8, 2023

Copy link
Copy Markdown
Collaborator

This PR:

  • Adds the ModuleMetadata integration that fetches metadata injected via bundler plugins and attaches is to the module_metadata property of every StackFrame.
    • This can later be used in beforeSend or another integration to route events depending on the metadata.
    • This integration is
      • Exported separately from @sentry/core (ie. not in Integrations) so it doesn't get included in default bundles
      • Exported separately from @sentry/browser so that it can be used without depending directly on core
  • Uses the beforeEnvelope hook to strip the module_metadata property from stack frames
  • Adds a test to ensure module_metadata is available in beforeSend and is stripped before sending

@timfish
timfish marked this pull request as ready for review July 10, 2023 12:56
Comment thread packages/core/src/envelope.ts Outdated
@timfish
timfish requested a review from lforst July 10, 2023 12:59
@timfish
timfish requested a review from AbhiPrasad July 13, 2023 14:00
Comment thread packages/core/src/integrations/metadata.ts Outdated
@AbhiPrasad
AbhiPrasad merged commit 2b4121f into getsentry:develop Jul 13, 2023
@timfish
timfish deleted the feat/module-metadata-integration branch July 13, 2023 21:40
@0131LWG

0131LWG commented Nov 16, 2023

Copy link
Copy Markdown

Problem:
I am currently using moduleMetadata in my project. However, I have observed that when using both Vite and Webpack simultaneously, the moduleMetadata property seems to be ineffective. I am wondering if this is a lack of support for such a configuration.

Expected Behavior:
I expected the moduleMetadata property to work as intended even when using both Vite and Webpack in my project.

Steps to Reproduce:
Use moduleMetadata in a project.
Set up the project to use both Vite and Webpack concurrently.
Observe the behavior of the moduleMetadata property.

Current Behavior:
The moduleMetadata property does not seem to have any effect when both Vite and Webpack are in use.

Environment:

Node.js version: 16.18.1
Package manager (npm/yarn): mainApplication:pnpm 8.5.0 subApplication:yarn 1.22.19
Operating System: windows

Dependencies Versions:
mainApplication:
"vue": "3.2.36",
"vite": "^2.5.6",
"@sentry/vite-plugin": "^2.10.0",
"@sentry/vue": "^7.80.0",
"qiankun": "^2.4.2",

subApplication:
"vue": "3.2.36",
"@sentry/vue": "^7.80.0",
"@sentry/webpack-plugin": "^2.10.0",

Note:
If the lack of support is intentional, it would be helpful to mention it in the documentation to prevent others from attempting similar configurations unknowingly.

@lforst

lforst commented Nov 16, 2023

Copy link
Copy Markdown
Contributor

@0131LWG Please open a new issue with concrete reproduction steps. You current description is not specific enough for us to reproduce. Thanks!

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.

4 participants