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

✨ [RUMF-770] Disable tracing for cancelled requests #635

Merged
merged 5 commits into from
Dec 1, 2020

Conversation

webNeat
Copy link
Contributor

@webNeat webNeat commented Nov 24, 2020

Motivation

Do not trace cancelled requests because they lack backend information.

Changes

Set request.traceId to undefined if the request was cancelled.

Testing

Added unit tests to ensure that traceId is removed from the LifeCycleEventType.REQUEST_COMPLETED event when the request.status == 0.


I have gone over the contributing documentation.

@webNeat webNeat requested a review from a team as a code owner November 24, 2020 17:12
@codecov-io
Copy link

codecov-io commented Nov 25, 2020

Codecov Report

Merging #635 (428c510) into master (f8c339b) will increase coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #635      +/-   ##
==========================================
+ Coverage   87.78%   87.93%   +0.15%     
==========================================
  Files          56       56              
  Lines        2578     2577       -1     
  Branches      556      555       -1     
==========================================
+ Hits         2263     2266       +3     
+ Misses        315      311       -4     
Impacted Files Coverage Δ
packages/rum/src/domain/requestCollection.ts 87.87% <100.00%> (+9.50%) ⬆️
packages/rum/src/domain/tracing/tracer.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8c339b...428c510. Read the comment docs.

packages/rum/src/domain/tracing/tracer.ts Outdated Show resolved Hide resolved
packages/rum/src/domain/tracing/tracer.ts Outdated Show resolved Hide resolved
packages/rum/src/domain/requestCollection.ts Outdated Show resolved Hide resolved
packages/rum/src/domain/requestCollection.ts Outdated Show resolved Hide resolved
webNeat and others added 2 commits November 26, 2020 13:28
Copy link
Contributor

@bcaudan bcaudan left a comment

Choose a reason for hiding this comment

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

👍

@webNeat webNeat merged commit 98adfcf into master Dec 1, 2020
@webNeat webNeat deleted the amine/not-trace-cancelled-requests branch December 1, 2020 16:39
@buenjybar
Copy link
Contributor

Hi guys,

I was trying out the latest version of today the lib ( 2.2.1 ) and,
Unfortunately, I can still see some errors related to "canceled XHR requests"

XHR error GET https://URL/..
It is happening on both LOG and RUM libs

attached some screenshots

  1. image
  2. image

@BenoitZugmeyer
Copy link
Member

This is expected. This PR disables traces for those requests, but they are still considered as errors. Could you provide more information about your issue/use-case?

@buenjybar
Copy link
Contributor

Ok,
I understand you will still log them as an error, and it is ok since you are following HTTP error standards, here
This can bring some confusion to the support team when investigating bugs, ( I could add a pipeline to downgrade this error code:0 to Warnings level )
People think it is a legit HTTP error but it is actually part of our code ( we cancel the request and trigger a new one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants