-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(opentelemetry): Remove usage of parseUrl
#15954
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
Conversation
size-limit report 📦
|
lforst
left a comment
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.
Love this! One of the changes looks a tiny bit sus/buggy.
| fragment: string | undefined; | ||
| hasRoute: boolean; | ||
| } { | ||
| ): [parsedUrl: ReturnType<typeof parseStringToURLObject>, httpRoute: string | undefined] { |
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.
can we get the httpRoute logic out of here somehow? It seems like all we do is read the http.route attribute and return it.
|
|
||
| if (!urlPath) { | ||
| if (!parsedUrl) { | ||
| return { ...getUserUpdatedNameAndSource(name, attributes), op: opParts.join('.') }; |
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.
h: If we have an httpRoute but no parsedUrl we would return the original name here. I don't know if that is desired.
|
Will come back to this when I get more time. |
resolves #15939
parseUrlis expensive, so let's refactor to remove it. This makes the change for the opentelemetry package.Removal of
getSanitizedUrlStringandstripUrlQueryAndFragmentshould also help with performance as we no longer have the js regex to compute.