-
Notifications
You must be signed in to change notification settings - Fork 898
feat(instrumentation): Add allowUrls config option to web instrumentation #4938
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
Conversation
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4938 +/- ##
=======================================
Coverage 93.17% 93.18%
=======================================
Files 315 315
Lines 8086 8094 +8
Branches 1617 1619 +2
=======================================
+ Hits 7534 7542 +8
Misses 552 552
|
@pichlermarc Hi, all tests are now passing. Could I get another review and/or be placed in the merge queue? Thanks! |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR was closed because it has been stale for 14 days with no activity. |
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: