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

Firestore: Improve debug logging of GrpcConnection and WebChannelConnection #7076

Merged
merged 3 commits into from
Mar 2, 2023

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Mar 1, 2023

This PR improves the debug logs of GrpcConnection and WebChannelConnection to make it easier to make sense out of the logs.

First, each log message now contains a unique ID to make it easier to trace the life of an RPC from beginning to end. These "IDs" are 10-digit strings containing a hexadecimal value (e.g. "0x2344821f").

Second, each log message tags itself as "GrpcConnection" or "WebChannelConnection" rather than both using the generic "Connection" tag. This change helps point to the right place in the source code when trying to correlate log messages with its line of code.

Third, each log message now contains the name of its RPC. Previously, both "Listen" and "Write" streams would have their logs intertwined with no way to tell them apart. Now, the log line clearly indicates which RPC is pertains to.

@dconeybe dconeybe self-assigned this Mar 1, 2023
@changeset-bot
Copy link

changeset-bot bot commented Mar 1, 2023

🦋 Changeset detected

Latest commit: b53446c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Patch
firebase Patch
@firebase/firestore-compat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 1, 2023

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (d5d78cb)Merge (ce57d22)Diff
    browser274 kB274 kB+301 B (+0.1%)
    esm5341 kB341 kB+632 B (+0.2%)
    main548 kB549 kB+843 B (+0.2%)
    module274 kB274 kB+301 B (+0.1%)
    react-native274 kB274 kB+301 B (+0.1%)
  • @firebase/firestore-lite

    TypeBase (d5d78cb)Merge (ce57d22)Diff
    browser87.3 kB87.4 kB+168 B (+0.2%)
    esm5105 kB105 kB+189 B (+0.2%)
    main149 kB149 kB+537 B (+0.4%)
    module87.3 kB87.4 kB+168 B (+0.2%)
    react-native87.5 kB87.6 kB+168 B (+0.2%)
  • bundle

    12 size changes

    TypeBase (d5d78cb)Merge (ce57d22)Diff
    firestore (Persistence)281 kB282 kB+302 B (+0.1%)
    firestore (Query Cursors)220 kB220 kB+302 B (+0.1%)
    firestore (Query)217 kB218 kB+302 B (+0.1%)
    firestore (Read data once)205 kB205 kB+302 B (+0.1%)
    firestore (Realtime updates)207 kB207 kB+302 B (+0.1%)
    firestore (Transaction)188 kB189 kB+302 B (+0.2%)
    firestore (Write data)188 kB188 kB+302 B (+0.2%)
    firestore-lite (Query Cursors)81.2 kB81.4 kB+168 B (+0.2%)
    firestore-lite (Query)77.4 kB77.6 kB+168 B (+0.2%)
    firestore-lite (Read data once)59.7 kB59.8 kB+168 B (+0.3%)
    firestore-lite (Transaction)84.3 kB84.5 kB+168 B (+0.2%)
    firestore-lite (Write data)69.2 kB69.3 kB+168 B (+0.2%)

  • firebase

    TypeBase (d5d78cb)Merge (ce57d22)Diff
    firebase-compat.js747 kB747 kB+302 B (+0.0%)
    firebase-firestore-compat.js321 kB321 kB+302 B (+0.1%)
    firebase-firestore-lite.js94.0 kB94.2 kB+144 B (+0.2%)
    firebase-firestore.js323 kB323 kB+302 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/h2x0nh5c8t.html
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 1, 2023

Size Analysis Report 1

This report is too large (462,003 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/7jt7UnQp4z.html
@dconeybe dconeybe requested a review from milaGGL March 2, 2023 00:13
@dconeybe dconeybe requested a review from milaGGL March 2, 2023 02:26
Copy link
Contributor

@milaGGL milaGGL left a comment

Choose a reason for hiding this comment

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

LGTM

@dconeybe dconeybe merged commit e2bf2ec into master Mar 2, 2023
@dconeybe dconeybe deleted the dconeybe/ConnectionDebugLogImprovements branch March 2, 2023 19:02
@google-oss-bot google-oss-bot mentioned this pull request Mar 14, 2023
@firebase firebase locked and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants