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

LogRocket: Enable network logging #90845

Merged
merged 4 commits into from
May 21, 2024
Merged

Conversation

Initsogar
Copy link
Contributor

@Initsogar Initsogar commented May 17, 2024

Resolves https://github.com/Automattic/jetpack-backup-team/issues/485

Important

LogRocket is currently disabled in production. The purpose of this PR is to be ready for when we decide to enable it.

Proposed Changes

Why are these changes being made?

  • To explore the full potential of LogRocket trial, we need to capture network logs. For privacy reasons, we are sanitizing any request and response body.

Testing Instructions

  • Spin up a Jetpack Cloud Live branch and append ?flags=ad-tracking,logrocket to the URL to enable the feature flags.
  • Enable debug logs using the developer console:
    localStorage.setItem( 'debug', 'calypso:*' );
  • Filter console and network tabs by logrocket
  • Navigate to the Backup or Settings page and ensure you see these debug records:
    CleanShot 2024-04-08 at 00 04 11@2x
  • Check on Network tab that there is API calls to LogRocket including a request payload similar to this:
    CleanShot 2024-05-20 at 19 15 31@2x

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented May 17, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~87 bytes added 📈 [gzipped])

name                 parsed_size           gzip_size
entry-subscriptions       +147 B  (+0.0%)      +46 B  (+0.0%)
entry-stepper             +147 B  (+0.0%)      +47 B  (+0.0%)
entry-main                +147 B  (+0.0%)      +47 B  (+0.0%)
entry-login               +147 B  (+0.0%)      +47 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • editing-toolkit
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/logrocket-enable-network-logging on your sandbox.

@Initsogar Initsogar requested a review from a team May 21, 2024 00:40
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 21, 2024
@Initsogar Initsogar marked this pull request as ready for review May 21, 2024 00:40
Copy link
Contributor

@jwebbdev jwebbdev left a comment

Choose a reason for hiding this comment

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

Looks reasonable, I had some issues testing the change because I could see request events getting logged, but saw some examples from @Initsogar that had the Authorization nulled out.

@Initsogar Initsogar merged commit 376c0ca into trunk May 21, 2024
14 checks passed
@Initsogar Initsogar deleted the add/logrocket-enable-network-logging branch May 21, 2024 23:09
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 21, 2024
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.

None yet

3 participants