-
Notifications
You must be signed in to change notification settings - Fork 539
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(instrumenation-document-load): Add custom attributes to document load #1414
feat(instrumenation-document-load): Add custom attributes to document load #1414
Conversation
762ddb1
to
1a46b04
Compare
1a46b04
to
31fa293
Compare
Could this not be accomplished by using a custom processor? |
I see that this can be achieved with custom processors. The difference is that with custom processor , all spans will have to be intercepted and modified accordingly , filtering based on some span properties. This will only apply to document load instrumentation spans. There is a similar implementation for fetch and xhr to add custom attributes. If using custom processors is the choice for all scenarios, we may have to deprecate the fetch and xhr apply custom attributes functionality too. |
I see, makes sense since there is already a precedence for this. All the other instrumentations use the name |
…/Abinet18/opentelemetry-js-contrib into AddCustomAttributes_DocumentLoad
Can this be merged ? |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1414 +/- ##
==========================================
+ Coverage 96.06% 96.13% +0.06%
==========================================
Files 14 14
Lines 890 906 +16
Branches 192 197 +5
==========================================
+ Hits 855 871 +16
Misses 35 35
|
Which problem is this PR solving?
Adding custom attributes to the Document load instrumentation spans (documentLoad, documentFetch, resourceFetch)
Cloned from #1238
Short description of the changes
This adds a configuration to the document load instrumentation which takes a map of span type to a function that can access the corresponding span and add some attributes to it. By providing the function as a config while registering the DocumentLoad instrumentation will allow for such addition of some vendor specific attributes to the spans.