Skip to content

fix(logger): send the context fields of a Sentry report in sentryExtras - #1521

Merged
Woody4618 merged 2 commits into
solana-foundation:masterfrom
hoodieshq:fix/logger-sentry-extras
Nov 27, 2026
Merged

Woody4618 merged 2 commits into
solana-foundation:masterfrom
hoodieshq:fix/logger-sentry-extras

Conversation

@askov

@askov askov commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Sends the context fields of every Logger call that reports to Sentry in sentryExtras, and makes a plain field in such a call a type error. A [log-drain] Loki push failed: 500 event in Sentry carries no response body. Logger sends only sentryExtras to Sentry, and the route passed the body as a plain detail field.

Changes

  • Passes the Loki response body in sentryExtras in app/api/log-drain/route.ts.
  • Narrows the Logger context type in app/shared/lib/logger.ts, so a context with sentry accepts only sentryExtras.
  • Narrows the Logger.panic context to sentryExtras.
  • Moves the plain fields of every Logger.error and Logger.warn call that reports to Sentry into sentryExtras.
  • Removes the console-only url field from the failed-transaction log in use-row-transaction.ts.

Behavior Changes

  • A Sentry event from Logger.error or Logger.warn now carries the fields of the call, such as address, signature, query, reason and status.
  • A [log-drain] Loki push failed event now carries the first 300 characters of the Loki response body as detail.
  • The console line of a call that reports to Sentry no longer prints those fields.

Type of change

  • Bug fix

Testing

The change has no visible effect in the browser. The specs cover the shape of the Logger calls.

Related Issues

Closes HOO-3017

Checklist

  • My code follows the project's style guidelines
  • I have added tests that prove my fix/feature works
  • All checks pass locally (pnpm test, pnpm lint, pnpm typecheck)
  • I have run build:info script to update build information

`Logger` sends only `sentryExtras` to Sentry, so the event for a rejected
push had the status code and no response body.
`Logger` sends only `sentryExtras` to Sentry, so 30 calls reported an event
without the address, query or reason they passed as a plain field. The
context type accepts `sentry` only with `sentryExtras`.
@vercel

vercel Bot commented Nov 27, 2026

Copy link
Copy Markdown

@askov is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issue was found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue was found.

Summary

Moves diagnostic fields into sentryExtras so Sentry receives them.

  • Sentry reports now carry the context from their log calls.
  • Loki failures now include the response text in Sentry.

askov explicitly identified the loss of these fields from console output, and removal of the transaction log’s console-only url, as intentional.

Reviews (1) · Last reviewed commit: "fix(logger): reject a plain field in a c..." · Reviewed by Greptile

@Woody4618
Woody4618 added this pull request to the merge queue Nov 27, 2026
Merged via the queue into solana-foundation:master with commit 99f172a Nov 27, 2026
12 of 13 checks passed
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.

3 participants