-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(nextjs-insights): add endpoint to transform EAP response into array / tree structure #88665
feat(nextjs-insights): add endpoint to transform EAP response into array / tree structure #88665
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #88665 +/- ##
=========================================
Coverage 87.75% 87.75%
=========================================
Files 10013 10044 +31
Lines 567352 569283 +1931
Branches 22297 22297
=========================================
+ Hits 497860 499577 +1717
- Misses 69075 69289 +214
Partials 417 417 |
…ed span description
|
||
def _separate_span_description_info(self, response): | ||
# Regex to split string into '{component_type}{space}({path})' | ||
pattern = re.compile(r"^(.*?)\s+\((.*?)\)$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is potentially vulnerable to redos: re.compile(r"^(.*?)\s+\((.*?)\)$").match(('\t' * 50000) + ')')
Are we limiting the length of the description somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I don't know off the top of my head if we do limit it and didn't find anything in the spec - I know we limit all strings generally though; I'll check what the limit is and rethink the regex somehow if it's an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo it's fine if we limit the length here once more before we pass it to the regex. That way we don't depend on any upstream logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think EAP should have some size limit on it as well - would like to have those two to be consistent if we do a check here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked with ingest regarding size limits - this is trimmed to 8192 characters, and the other point to be made here is that the regex is only needed until we have separate fields from the SDK, so I think we can go ahead with this. I may refactor this to use string splitting instead soon though, just for performance and robustness.
could you provide more color as to what the end product result is? will this be generalized to other modules or is this next.js specific? |
@JoshFerge the goal is to replicate the tree of server side rendered backend components in insights - which for now is pretty Next.js specific. We had a debate about doing this on the frontend vs the backend, but since there is a plan for EAP to support arrays at some point (which will make querying and aggregating this type of data easier) we wanted to do the intermediate solution that will cause the least troubles in migrating later - which is the backend. No plans for generalization at this point, but if the feature gets adopeted well, I can see us doing this for other platforms as well in a similar way. Are there specific concerns you'd like to see addressed? |
got it, that makes sense. mind just adding a note about this in the docstring? just want to make sure future folks understand the context of the endpoint. when you do migrate, will this endpoint still be necessary? |
@JoshFerge yeah I'll add that - good point. The endpoint will not be needed once the feature exists in EAP and the feature can be migrated over. |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
…ray / tree structure (#88665)
nextjs.function.component_type
andnextjs.function.path