feat(integrations): Add ContextLines integration for html-embedded JS stack frames#8699
Merged
feat(integrations): Add ContextLines integration for html-embedded JS stack frames#8699
ContextLines integration for html-embedded JS stack frames#8699Conversation
de565e8 to
05b450b
Compare
AbhiPrasad
approved these changes
Aug 1, 2023
|
|
||
| /** Processes an event and adds context lines */ | ||
| public addSourceContext(event: Event): Event { | ||
| const doc = WINDOW.document; |
Contributor
There was a problem hiding this comment.
m: should only run if the current hub has the ContextLines integration.
Member
Author
There was a problem hiding this comment.
Hmm good point. I guess the Node ContextLines integration should have this check as well, right? Seems like we do it in some integrations and in others it's missing.
Contributor
There was a problem hiding this comment.
yeah we need to include the check there too
This was referenced Aug 2, 2023
Member
Author
|
I made some more changes to the new integration after re-checking the Node
|
AbhiPrasad
approved these changes
Aug 2, 2023
ContextLines integration for html-embedded JS stack framesContextLines integration for html-embedded JS stack frames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Well here we go again 😅
This PR adds a "best-effort"
ContextLinesintegration as an optional integration for the browser SDKs to pick up source code of and around stack frames pointing to code that's directly embedded in the current page's html.As outlined in #8656 (comment) and my initial attempt (#8670), there are a number of limitations around this integration. Chances are users end up with context lines off by one or two (and sometimes off by a lot of lines). However, this approach should bring us on par with competitors and hopefully provide some more context around errors that previously didn't have any code in their stack traces.
for the time being, this
closes #8656