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

✨ network error removal #930

Merged
merged 5 commits into from
Jul 12, 2021
Merged

Conversation

amortemousque
Copy link
Collaborator

@amortemousque amortemousque commented Jul 8, 2021

Motivation

RUM errors are not the best way to trigger attention for network requests with a bad status code. We already collect that information within RUM resources. By stopping the generation of RUM errors for these resources, we simplify the value proposition of RUM errors.

Changes

  • Put console, network and runtime error tracking in separated files
  • Stop RUM network error when remove-network-errors flag is enabled

Testing

Unit, Locally


I have gone over the contributing documentation.

@amortemousque amortemousque requested a review from a team as a code owner July 8, 2021 16:03
@@ -18,3 +20,5 @@ export class Observable<T> {
this.observers.forEach((observer) => observer(data))
}
}

export type ErrorObservable = Observable<RawError>
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this type has its place there. I think, either:

  • put it in a new domain/error/types.ts
  • put it in tools/error
  • replace ErrorObservable with Observable<RawError> everywhere

Copy link
Contributor

Choose a reason for hiding this comment

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

I would simply use Observable<RawError> because it's already used in some places

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, using Observable is probably easier and still well express the intent.

packages/core/src/domain/error/trackNetworkError.spec.ts Outdated Show resolved Hide resolved
if (initConfiguration.forwardErrorsToLogs !== false) {
trackConsoleError(errorObservable)
trackRuntimeError(errorObservable)
trackNetworkError(configuration, errorObservable, configuration.isEnabled('remove-network-errors'))
Copy link
Member

Choose a reason for hiding this comment

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

When releasing V3, I don't think we'll remove errors for aborted requests for logs, so this extra parameter may be removed. Nonetheless, we can leave it here until we get confirmation from @hdelaby

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I think this decision does not impact this PR since we are still in V2. Maybe it can be added to the v3 release plan when @hdelaby will confirm.

Copy link
Contributor

@webNeat webNeat left a comment

Choose a reason for hiding this comment

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

Good job!

@codecov-commenter
Copy link

Codecov Report

Merging #930 (6fa27e4) into main (e1146d2) will increase coverage by 0.02%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #930      +/-   ##
==========================================
+ Coverage   88.99%   89.02%   +0.02%     
==========================================
  Files          80       82       +2     
  Lines        3863     3864       +1     
  Branches      865      865              
==========================================
+ Hits         3438     3440       +2     
+ Misses        425      424       -1     
Impacted Files Coverage Δ
packages/logs/src/boot/startLogs.ts 72.91% <0.00%> (-3.18%) ⬇️
...omain/rumEventsCollection/error/errorCollection.ts 70.37% <0.00%> (-12.24%) ⬇️
...ackages/core/src/domain/error/trackNetworkError.ts 96.15% <96.15%> (ø)
...ackages/core/src/domain/error/trackConsoleError.ts 100.00% <100.00%> (ø)
...ackages/core/src/domain/error/trackRuntimeError.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 e1146d2...6fa27e4. Read the comment docs.

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.

4 participants