Skip to content

Handful of document-load fixes#192

Merged
obecny merged 8 commits intoopen-telemetry:masterfrom
johnbley:docload_fixes
Sep 7, 2020
Merged

Handful of document-load fixes#192
obecny merged 8 commits intoopen-telemetry:masterfrom
johnbley:docload_fixes

Conversation

@johnbley
Copy link
Member

@johnbley johnbley commented Sep 1, 2020

Short description of the changes

  • use otel-web's addSpanNetworkEvents rather than a local/modified copy. This pulls in http.request_content_length for free. Adjust event generation logic accordingly.
  • Rename resource fetch spans resourceFetch to mirror documentFetch and bring span names into spec compliance (no raw URLs). I'm open to other suggestions here.
  • Fix missing docload events in Firefox, which sometimes has a fetchStart of 0.

Rather than use a modified copy, adjust event creation code
to use shared routine from otel-web.  This has the pleasant
side effect of also adding http.response_content_length.
Names should not be raw URLs, so I arbitrarily chose 'resourceFetch'
to mirror 'documentFetch' - I'm open to any better suggestions.  Because
the resource url is of course very useful I've put it in the 'http.url'
attribute instead.
…pans

I noticed that in unit and manual tests Firefox would frequently not
emit doc load events.  Turns out that sometimes the fetchStart was 0
and the logic prevented spans from being emitted.  Simply checking
>= 0 rather than > 0 fixes that.
@johnbley johnbley requested a review from a team September 1, 2020 15:56
@codecov
Copy link

codecov bot commented Sep 1, 2020

Codecov Report

Merging #192 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #192      +/-   ##
==========================================
- Coverage   95.22%   95.22%   -0.01%     
==========================================
  Files          93       93              
  Lines        4756     4751       -5     
  Branches      492      492              
==========================================
- Hits         4529     4524       -5     
  Misses        227      227              
Impacted Files Coverage Δ
...telemetry-plugin-document-load/src/documentLoad.ts 97.91% <0.00%> (-0.13%) ⬇️
...y-plugin-document-load/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)

@obecny obecny merged commit 5c81884 into open-telemetry:master Sep 7, 2020
@obecny obecny added the internal label Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants