Skip to content
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(opentelemetry-instrumentation-document-load): Add access to performance resource timing object for custom attributes #1529

Merged

Conversation

pkanal
Copy link
Contributor

@pkanal pkanal commented Jun 6, 2023

Which problem is this PR solving?

Allows access to the PerformanceResourceTiming object for resourceFetch spans to add custom attributes to the resourceFetch span. This would allow for the ability to add extra span attributes to resourceFetch spans like some common resource timing metrics.

Short description of the changes

  • Added a function _addCustomAttributesOnResourceSpan that replaces _addCustomAttributesOnSpan when resourceFetch spans are created.
  • _addCustomAttributesOnResourceSpan takes an additional resource argument that passes PerformanceResourceTiming information for each resource to the applyCustomAttributesOnSpan callback.

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #1529 (638c97a) into main (8499b16) will decrease coverage by 0.08%.
The diff coverage is 88.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1529      +/-   ##
==========================================
- Coverage   96.13%   96.06%   -0.08%     
==========================================
  Files          14       14              
  Lines         906      914       +8     
  Branches      197      199       +2     
==========================================
+ Hits          871      878       +7     
- Misses         35       36       +1     
Impacted Files Coverage Δ
...strumentation-document-load/src/instrumentation.ts 98.13% <88.88%> (-0.86%) ⬇️

@pkanal pkanal force-pushed the pkanal/add-resource-to-custom-attrs branch from b134314 to e402fde Compare June 6, 2023 20:48
@pkanal pkanal marked this pull request as ready for review June 6, 2023 21:05
@pkanal pkanal requested a review from a team June 6, 2023 21:05
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 🙂
Just a few nits from my side :)

@pkanal pkanal merged commit 7c7294c into open-telemetry:main Jun 28, 2023
@pkanal pkanal deleted the pkanal/add-resource-to-custom-attrs branch June 28, 2023 15:04
@dyladan dyladan mentioned this pull request Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants