Skip to content

Modernize SDK to v1.1.0 (reliability, client API, transport, tooling) - #29

Draft
melekr wants to merge 14 commits into
masterfrom
improvements/sdk-modernization
Draft

Modernize SDK to v1.1.0 (reliability, client API, transport, tooling)#29
melekr wants to merge 14 commits into
masterfrom
improvements/sdk-modernization

Conversation

@melekr

@melekr melekr commented Aug 4, 2026

Copy link
Copy Markdown

Modernize backtrace-go (v1.1.0)

This brings the SDK up to a production-ready state. It fixes long-standing reliability bugs, adds the features expected from a modern error-reporting SDK and rebuilds the tooling around it.

Fixes

  • Contains Improvements/prod hardening #30

  • Submissions had no HTTP timeout : an unreachable endpoint hung the sender and eventually blocked every Report() call.
    There's now a real transport (30s timeout, status/429 handling) behind a bounded queue that drops and counts instead of blocking.

  • About half of all panic reports were lost to a channel race. Panics are now flushed deterministically before re-panicking, and retry a full queue instead of being dropped.

  • FinishSendingReports killed the sender permanently and deadlocked on a second call. Replaced by Flush(timeout)/Close, kept as an alias.

  • Data races on the global Options/attributes map, report UUIDs, Windows stack paths split at the drive letter, parser panics on unusual frames, and a CI matrix that couldn't build (Go 1.18 vs go.mod 1.22).

New

  • Instance API: bt.NewClient(Config). The legacy global API still works unchanged, same wire format.
  • BeforeSend hook (fails closed: a panicking hook drops the report rather than sending it half-scrubbed), sampling, error-chain capture, and a bthttp middleware for net/http panic capture.
  • File attachments (multipart, 10 MiB/file cap) and breadcrumbs, delivered both as an annotation and as the bt-breadcrumbs-0 attachment the Backtrace UI reads.
  • Source context is now limited to lines around each frame instead of uploading whole files (ContextLineCount was dead code before).
  • Richer default attributes: build/VCS info, runtime stats, module list, env vars with secrets redacted.

ref: BT-7421

@melekr melekr self-assigned this Aug 4, 2026
melekr added 5 commits August 4, 2026 11:48
…p, bt-breadcrumbs

- A panicking BeforeSend hook now drops the report instead of sending it half scrubbed. The drop is counted in DroppedReports
- Attachment 10 MiB cap enforced at read time.
- Breadcrumbs also sent as the bt-breadcrumbs-0 attachment the Backtrace UI reads: scrubbing the annotation in BeforeSend suppresses it
- Token redacted in 2-segment submit.backtrace.io paths and in transport errors (*url.Error embeds the full URL)
- Tests: multipart test server, panic-report queue-full retry, Flush retry after full queue, attachment collision cases
Trailing-slash endpoints no longer produce "//post" : an endpoint carrying a query string together with Token is rejected at NewClient (previously produced a malformed submission URL and silently dropped every report).
wmic is removed from Windows 11 24H2 / Server 2025. Shared reg-output parser for the GUID and CPU probes, with unit tests.
@melekr

melekr commented Aug 4, 2026

Copy link
Copy Markdown
Author
  • Add a LICENSE file [ ]

- Trace() fails gracefully when a stub tracer (macOS) returns no command instead of crashing the process in the exec goroutine
- Env-var redaction broadened (PASS/KEY/DSN/COOKIE/SESSION/SIGNATURE/ BEARER/CONN) plus value shape detection of URL-embedded credentials
- Retry-After capped at 5 minutes; token redaction extended to aliased submit-shaped URLs and NewClient error messages
- All Client methods are safe no-ops on a nil receiver, as documented
melekr and others added 6 commits August 7, 2026 17:15
panic containment, bounded lifecycle, privacy budgets
An error-reporting SDK must never become the incident. 

After this change the SDK cannot crash, hang, or leak from the host
application: every path that executes application code is
panic-contained (including re-entrant loggers and typed-nil errors),
every wait is bounded and cancellable, every payload component has a
byte budget, and no credential can reach a log, error string, or report
annotation.
@melekr
melekr requested a review from KishanPRao August 17, 2026 16:28
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.

1 participant