-
Notifications
You must be signed in to change notification settings - Fork 773
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(instrumentation): Add allowUrls config option to web instrumentation #4938
base: main
Are you sure you want to change the base?
feat(instrumentation): Add allowUrls config option to web instrumentation #4938
Conversation
* @param url | ||
* @param allowedUrls | ||
*/ | ||
export function isUrlAllowed( |
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.
nit / fyi: as your introducing a new function to core, technically the xhr and fetch WILL require that they depend on this new version being released before they can consume this new function.
Generally, all versions are bumped together, but it might be worth calling out (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.
Called out the new function in core in the main changelog, but I'm not 100% sure if it's the right spot for the call out
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.
Sorry-- fixed a merge conflict and seems like it need reapproval
Which problem is this PR solving?
This change provides easier control over which urls should have spans created for it. It can also be used with
ignoreUrls
for more granular control.Fixes #4899
Short description of the changes
Added
allowUrls
as a config option to both theXMLHttpRequestInstrumentation
andFetchInstrumentation
classes.Addition of the
isUrlAllowed
function in the core package that both the fetch and xhr instrumentation will depend on.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
opentelemetry-web
examples (fetch
andxml-http-request
) to accept multiple URLs. Then I added theallowUrls
config option on the instrumentation set up and verified that traces were being created (or not created).Checklist: