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

PROTO-1720: relay logging #7834

Merged
merged 4 commits into from
Mar 14, 2024
Merged

PROTO-1720: relay logging #7834

merged 4 commits into from
Mar 14, 2024

Conversation

alecsavvy
Copy link
Contributor

@alecsavvy alecsavvy commented Mar 14, 2024

Description

adds more verbose logging and request id tracking to relay
adds better try / catches around the redis helpers as well as txRelay where the app could be throwing
adds better error to string conversion so we can see what actual errors are being logged

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.

@alecsavvy alecsavvy self-assigned this Mar 14, 2024
@alecsavvy alecsavvy requested a review from rickyrombo March 14, 2024 06:48
customError(next, {
name: "INTERNAL_ERROR",
statusCode: StatusCodes.INTERNAL_SERVER_ERROR,
message,
message: coerceErrorToString(e),
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice if it wasn't a string so we could see stack trace somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could try to convert it into an error as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it, the error handler will print a stacktrace now

const statusCode = response.statusCode;
const path: string = route.path
if (!path.includes("health")) {
logger.info(
{ route, method, abi: ctx.ctx.validatedRelayRequest.encodedABI, responseTime, statusCode },
{ requestId, path, method, responseTime, statusCode },
Copy link
Contributor

Choose a reason for hiding this comment

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

no abi?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh good catch, thought I had that in other logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added it into the validation logs so the abi is recorded early and we can track it all by request id

@@ -17,3 +18,12 @@ export const isUserDeactivate = (
JSON.parse(decodedAbi.metadata).data.is_deactivated === true
)
}

export const coerceErrorToString = (e: unknown): string => {
if (isString(e)) return e as string
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is redundant? the next line does this anyway right?

@alecsavvy alecsavvy enabled auto-merge (squash) March 14, 2024 08:18
@alecsavvy alecsavvy merged commit 38cff27 into main Mar 14, 2024
8 of 9 checks passed
@alecsavvy alecsavvy deleted the as/proto-1720-relay-logs branch March 14, 2024 08:23
audius-infra pushed a commit that referenced this pull request Mar 16, 2024
[29de055] [C-4002] Remove all stems buttons in web (#7848) Dylan Jeffers
[a70643a] [C-3967] Migrate common buttons to harmony (#7832) Dylan Jeffers
[181429a] Mjp unlisted tracks (#7860) Marcus Pasell
[5c0017e] Allow querying for unlisted tracks by ID (#7858) Marcus Pasell
[5ab22b0] Move some tasks to new standalone index_sol worker (#7856) Theo Ilie
[9610aa5] Parse more ddex fields (#7854) Michelle Brier
[77078ae] [ONC-52] Self-re-enqueue user_bank and payment_router indexing tasks (#7842) Theo Ilie
[b702fe5] [INF-667] Add create-audius-app (#7846) Sebastian Klingler
[b2c41ba] Bump version to 0.6.60 audius-infra
[b63c0a4] [C-3954] Expand sentry use in sign up (#7830) JD Francis
[920dbde] Add aggregate_monthly_plays_country_backfill (#7835) Steve Perkins
[3c10eda] fix aao error log (#7850) alecsavvy
[10c9574] Fix lint (#7852) Raymond Jacobson
[132307b] Fix micro lamports in jupiter (#7851) Raymond Jacobson
[3acab52] Fix jupiter instruction (#7849) Raymond Jacobson
[09bb489] [⚠️] Use vite swc react (#7845) Raymond Jacobson
[49c0dff] Add amplitude event for account creation (#7844) JD Francis
[0177770] [Protocol Dashboard] Disable Manage delegation button when claim is pending [C-4000] (#7843) nicoback2
[43dcaf6] [Protocol Dashboard] Merge Protocol Dashboard UX Improvements feature branch into main (#7841) nicoback2
[c69674b] [PAY-2557] Add PREMIUM_ALBUMS_ENABLED feature flag (#7840) Reed
[0fa48a8] Bump harmony and consume in examples/react (#7837) Sebastian Klingler
[d68f6e1] fix circular dep (#7839) alecsavvy
[9ec3eda] Remove custom Sentry fingerprint (#7833) Marcus Pasell
[f40d0cb] Fix embed build and use turbo (#7836) Sebastian Klingler
[d48038d] [PAY-2409] Clean up old download code (#7820) Saliou Diallo
[f387341] Bump version to 0.6.59 audius-infra
[94f3fe4] [INF-593] Add react + ts + @audius/sdk example app (#7807) Sebastian Klingler
[38cff27] PROTO-1720: relay logging (#7834) alecsavvy
[751df35] Parse and store all DDEX standard identitiers (#7818) Michelle Brier
[7c77df0] Add more priority fees across all solana transactions (#7831) Raymond Jacobson
[6761fb3] [PAY-2549] Make comms come up by default (#7817) Raymond Jacobson
[898f45a] [C-3743] Fix avatar styles on local (#7824) Dylan Jeffers
[beb893d] .gitsha => gitsha.json (#7827) Marcus Pasell
[40df28e] [C-3957] Remove legacy sign up (#7805) Dylan Jeffers
[f7e8dee] Fix wallet check (#7829) Dylan Jeffers
[f91ac3f] [DVRL-18] - formatting and port warnings (#7823) Sam Gutentag
[f1837b6] Bump mobile app versions for full release (#7826) nicoback2
[c2b49f8] [C-3966] Don't require premium album fields (#7825) Andrew Mendelsohn
[aab8aaa] [INF-668] Remove peerDeps from @audius/harmony (#7822) Sebastian Klingler
[a3a41da] Fix react-native-datepicker on xcode 15.3 (#7816) Dylan Jeffers
[cec7b35] .gitsha: update the correct worker this time (#7821) Marcus Pasell
[a6da7d7] push solana relay in ci (#7806) alecsavvy
[e841490] Add country column to aggregate_monthly_plays (#7801) Steve Perkins
[e6267f1] [ONC-39] Check that signed in user matches wallet (#7812) Raymond Jacobson
[c966eae] [ONC-30] Fix playlist trending filters (#7809) Raymond Jacobson
[7b49daf] [PAY-2546] Fix stems and downloads text variant (#7810) Saliou Diallo
[f694148] [PAY-2518] Fix android bug for combined downloads file in same folder  (#7819) Saliou Diallo
[f7cd6d3] Bump version to 0.6.58 audius-infra
[339deab] [Mobile] ⚠️ Install pending CodePush update upon foregrounding after 1hr [C-3791] (#7661) nicoback2
[be14870] [ONC-46] Fix buy audio slippage (#7813) Raymond Jacobson
[0f8521a] [C-3960] Fix user-generated-text tag (#7815) Dylan Jeffers
[fdf0ade] [C-3965] Fix explore tiles (#7814) Dylan Jeffers
[9f159f5] Fix harmony icon stories (#7800) Dylan Jeffers
[ff70555] [C-3955] Migrate primary buttons to harmony (#7794) Dylan Jeffers
[12fc68a] [ONC-47] Fix playlist/album upload stream gating check (#7811) Raymond Jacobson
[5d8fd5b] Remove idle status in dashboard (#7808) Raymond Jacobson
[13eae32] [C-2459] Remove share sound to tiktok (#7804) Dylan Jeffers
[2c6f989] [ONC-45] Fix small kebab (#7802) Raymond Jacobson
[739eefe] [Web] Fix Send Tip modal header icon and Download Page cloud icons [C-3952] (#7803) nicoback2
[df71a30] Convert @audius/common to vitest, add web tests to CI (#7797) Marcus Pasell
[f11333d] Remove min delegation from identity, update subgraph (#7787) Raymond Jacobson
[a4c6614] Add connect instagram ui (#7796) Raymond Jacobson
[3f3e770] Postgres helper functions for debugging (#7799) Steve Perkins
[1034daa] Bump version to 0.6.57 audius-infra
[e0f7c64] Add .gitsha to .gitignore (#7798) Marcus Pasell
[10299d2] [Discovery] Fix metrics APIs for year time range [C-3956] (#7795) nicoback2
[115303d] Move to 1k gold 10k platinum (#7791) Raymond Jacobson
[cb0ef49] Bump mediorum play logging timeout to 60s (#7786) Theo Ilie
[9641533] [C-3937] Fix new-playlist icon (#7792) Dylan Jeffers
[b991afb] [C-3938] Fix harmony cache for SPA (#7789) Dylan Jeffers
[464a07c] Add user.info.profile scope to tiktok redirect (#7788) Sebastian Klingler
[0e024d5] [C-3887] Update suggested tracks logic to better handle deleted tracks and the race condition (#7785) Kyle Shanks
[0a54eae] @audius/sdk: v3.0.39 audius-infra
[f1d70a2] [INF-663] Fix external package versioning in monorepo (#7783) Sebastian Klingler
[0cf37b7] Hotfix: Serve static .gitsha in cloudflare worker (#7781) Marcus Pasell
[ca152db] Bump version to 0.6.56 audius-infra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants