-
Notifications
You must be signed in to change notification settings - Fork 821
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(sdk-trace-web): ignore unavailable span network events #2457
feat(sdk-trace-web): ignore unavailable span network events #2457
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2457 +/- ##
==========================================
+ Coverage 92.56% 92.71% +0.14%
==========================================
Files 134 137 +3
Lines 4871 4997 +126
Branches 1036 1058 +22
==========================================
+ Hits 4509 4633 +124
- Misses 362 364 +2
|
I don't remember who, but it was already like this and it has been changed to explicitly log such information too |
And zero also can mean "instantaneous", "was in cache", "not applicable", or "legitimately 0" (e.g., there were no redirects so redirectStart == I think that for this piece of tech, our telemetry should report whatever the browser says with minimal processing, and let downstream/backend/easier-to-modify components deal with normalization/truncation/processing if desired (e.g., throwing away absurd times like "that page took 6 years or -5 hours to load", or declaring that "no redirects happened so the redirect timing is not |
Unfortunately I don't think we can always be sure that 0 equals missing value. One example is Firefox which for security reasons reduces precision. It is possible that you have sub 2ms or 100ms(or more depending on settings) connect time which will show up as 0. Here is this reproduced in a non localhost page: There are cases where we know that timings will be missing eg:
In those cases we can predict that the timings will be missing and sanitize them server side. Although not sending them at all could save some bandwidth. If it is not possible for someone to have that processing maybe make this configurable? That seems a bit of an overkill tho. |
@johnbley @m-tu Thanks for clarification. I was not aware how complex this matter is. |
Which problem is this PR solving?
When doing cross-origin XHR/Fetch requests browsers expect Timing-Allow-Origin HTTP header to explicitly allow getting network performance timings. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin for more.
Right now, on such cross-origin requests, we record all events with negative timings (relative to the span creation time).
It can be often misleading and can contribute to invalid metrics when calculating same event from multiple spans.
Short description of the changes
Network events equal
0
are not recorded.