Repository navigation
Modernize SDK to v1.1.0 (reliability, client API, transport, tooling) - #29
Merged
Merged
Conversation
…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.
Contributor
Author
|
- 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
3 tasks done
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.
## Summary Upgrades all actions in `tests.yml` to their latest releases and pins each to a full commit SHA. All three now run on Node 24, which removes the Node 20 deprecation warnings. | Action | Before | After | |---|---|---| | `actions/checkout` | `v4` | `v7.0.1` (`3d3c42e`) | | `actions/setup-go` | `v5` | `v7.0.0` (`b7ad1da`) | | `golangci/golangci-lint-action` | `v8` | `v9.3.0` (`ba0d7d2`) | ## Notes - Pinning to SHAs protects against a tag being moved to different code. The `# vX.Y.Z` comments keep versions readable and work with Dependabot/Renovate.
Add the value normaliser that the following commits wire into the client. It turns whatever the application passes as an attribute or breadcrumb value into a detached graph of nil, bool, string, int64, uint64, float64, []interface{} and map[string]interface{}, on the caller’s goroutine.
Conversion follows encoding/json: time.Time, json.Marshaler,encoding.TextMarshaler, error values and structs keep a useful form.Every user method runs behind panic containment.
Depth, value count and bytes are enforced while walking: an oversizedslice, map or byte slice stops being visited and ends in one marker.
copyModel gives a report its own copy of shared values.
Unit tests, and FuzzFreezeValue added to the CI fuzz list.
…nline parts - Never follow a redirect: a 307/308 would replay the report to another host. A caller-supplied http.Client is copied, not mutated, and its idle connections are never closed. - The SDK's own client uses a clone of http.DefaultTransport, so closing its idle connections at shutdown leaves the application's alone. - Attached files are admitted before the inline breadcrumb part, which shares the attachment budgets and keeps its name when a file has the same one. - Diagnostics name attachments by file name, and error text from a caller-supplied client is formatted behind panic containment.
…ounting - Values passed to Report, SetAttribute(s), AddBreadcrumb and Config.Attributes are normalised when the call returns, so a queued report never shares a map or slice with the caller. The package-level SetAttribute(s) normalise at store time. - BeforeSend: the hook sees value-model types, edits its own copy of the report, and its removals stick. Only the report id is restored; what the submission format requires is repaired. - Config: explicit limits have ceilings, a negative MaxErrorDepth still disables chain capture, and the hosted endpoint forms are validated. - Environment capture: EnvVars allowlist, MaxEnvVars and MaxEnvBytes. - A forced shutdown skips queued work (new Shutdown drop reason), and a report on a closed client is rejected before any capture. - macOS: ioreg by absolute path with capped output.
- A panic in a Tracer method, or in the HTTP client used for snapshot uploads (Trace, Put, PutDir), becomes an error wrapping the new ErrTracerCallback. A nil or typed-nil tracer is rejected with an ordinary error. - Recover never lets a tracer failure replace the application's panic. PanicOnKillFailure is still honoured by Trace, and by Recover when it does not re-panic. - The trace lock is released before any logging. - Snapshot uploads never follow a redirect; diagnostics name snapshots by file name.
- Source files are opened through os.Root handles, so a symbolic link or ".." that leaves a configured root is refused at open time. Roots that cannot be opened fail closed. - A root and a stack frame may name the same directory through different symbolic links (/tmp and /private/tmp); both forms are matched.
- The writer handed to handlers offers Flusher and Hijacker when the wrapped writer, or one behind its Unwrap, supports them, and Pusher and ReaderFrom when the wrapped writer has them itself. CloseNotifier is never offered. - Flushes and hijacks are tracked, including those made through http.ResponseController: a swallowed panic never appends a 500 to a started response or writes to a hijacked connection.
KishanPRao
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
FinishSendingReportskilled the sender permanently and deadlocked on a second call. Replaced byFlush(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
bt.NewClient(Config). The legacy global API still works unchanged, same wire format.BeforeSendhook (fails closed: a panicking hook drops the report rather than sending it half-scrubbed), sampling, error-chain capture, and abthttpmiddleware for net/http panic capture.breadcrumbs-0attachment the Backtrace UI reads.ContextLineCountwas dead code before).updates : (review follow-up)
freeze.go).BeforeSendhas a written contract: model types, its own copy, removals stick.bthttp: the response writer keepsFlusher/HijackerbehindUnwrapand trackshttp.ResponseControllercalls.ErrTracerCallback;Recoverkeeps the application's panic andPanicOnKillFailure.SourceRootsconfined withos.Root; limits have ceilings;EnvVarsallowlist.updates: (23-11-2026)
error.messagecapped, oversized reports trimmed,ReportData.ErrorforBeforeSend.runtime/metrics.ReportContext,ReportPanic,ReportAndRecoverPanic,SetDefaultClient.ReportPanicValueAndFlushnow takes a context (breaking, seeMIGRATION.md).ReportsPerMinute, pause after repeated network failures.MonitorCrashes: reports crashesrecovercan't catch.bthttp: per-request scopes,ReportStatus,SetRoute,NewTransport.btslog:log/sloghandler.MIGRATION.md, README sections, MITLICENSE.ref: BT-7421, BT-8145, BT-8154