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

Reduce logging in production builds #20694

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Sep 1, 2023

Explanation

Our logger middleware can be quite noisy in production, logging all RPC requests. It has been updated to have more condensed logs in production builds, but preserving the existing logging for development builds.

A few error logs in the method handling middleware have been suppressed in production as well. They were redundant anyway.

This fixes https://github.com/MetaMask/MetaMask-planning/issues/1281

Manual Testing Steps

  • Use the test dapp. See that the logs are the same as before on a development build (yarn start or yarn start:test). But on non-development builds they have less detail (and there is no longer a separate log entry for errors).

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@Gudahtt Gudahtt force-pushed the reduce-logging-in-production-builds branch from 21c7a20 to 40533c5 Compare September 1, 2023 17:02
@Gudahtt Gudahtt marked this pull request as ready for review September 1, 2023 17:28
@Gudahtt Gudahtt requested a review from a team as a code owner September 1, 2023 17:28
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Patch coverage: 25.00% and project coverage change: -0.01% ⚠️

Comparison is base (52f4936) 68.82% compared to head (e046338) 68.82%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20694      +/-   ##
===========================================
- Coverage    68.82%   68.82%   -0.01%     
===========================================
  Files          997      997              
  Lines        38931    38934       +3     
  Branches     10447    10454       +7     
===========================================
  Hits         26794    26794              
- Misses       12137    12140       +3     
Files Changed Coverage Δ
app/scripts/lib/createLoggerMiddleware.js 19.05% <0.00%> (-3.17%) ⬇️
...ib/rpc-method-middleware/createMethodMiddleware.js 57.35% <60.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [40533c5]
Page Load Metrics (1512 ± 27 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint106158129147
domContentLoaded1414158015125727
load1414158115125727
domInteractive1414158015125727
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 35 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@Gudahtt Gudahtt force-pushed the reduce-logging-in-production-builds branch 3 times, most recently from 67d7cfa to 1645c41 Compare September 1, 2023 18:32
@metamaskbot
Copy link
Collaborator

Builds ready [1645c41]
Page Load Metrics (1590 ± 49 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1031751392311
domContentLoaded14651860159010149
load14661860159010149
domInteractive14651860158910149
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@FrederikBolding FrederikBolding self-requested a review September 4, 2023 08:54
Copy link
Member

@FrederikBolding FrederikBolding left a comment

Choose a reason for hiding this comment

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

LGTM

Our logger middleware can be quite noisy in production, logging all RPC
requests. It has been updated to have more condensed logs in production
builds, but preserving the existing logging for development builds.
@Gudahtt Gudahtt force-pushed the reduce-logging-in-production-builds branch from 1645c41 to e046338 Compare September 4, 2023 12:29
@Gudahtt Gudahtt added the release-blocker This bug is blocking the next release label Sep 4, 2023
Copy link
Contributor

@montelaidev montelaidev left a comment

Choose a reason for hiding this comment

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

Lgtm

@Gudahtt Gudahtt merged commit 20f654a into develop Sep 4, 2023
@Gudahtt Gudahtt deleted the reduce-logging-in-production-builds branch September 4, 2023 13:05
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2023
@metamaskbot metamaskbot added the release-11.1.0 Issue or pull request that will be included in release 11.1.0 label Sep 4, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [e046338]
Page Load Metrics (1755 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint117184152189
domContentLoaded15881947175410651
load15881947175510651
domInteractive15881947175410651
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@gauthierpetetin gauthierpetetin added release-11.0.0 Issue or pull request that will be included in release 11.0.0 and removed release-11.1.0 Issue or pull request that will be included in release 11.1.0 labels Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.0.0 Issue or pull request that will be included in release 11.0.0 release-blocker This bug is blocking the next release team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants