Skip to content

Releases: go-coldbrew/errors

v0.2.15

11 Apr 07:56
06ce8d6

Choose a tag to compare

What's New

  • Drop-in replacement for stdlib errors: Re-export Is, As, Unwrap, Join, and ErrUnsupported from the standard library
  • AsType generic re-export: Available behind //go:build go1.26 build tag
  • Standalone Cause(err) error function: Walks the Unwrap chain to find the root cause — works on any error, not just ErrorExt
  • Bounded traversal: Cause uses a max depth guard to protect against cyclic Unwrap chains
  • Updated package documentation and examples

v0.2.14

09 Apr 07:19
25cb915

Choose a tag to compare

Add goleak test coverage, guard InitRollbar on empty token, bump Go to 1.25.9

v0.2.13

04 Apr 14:51
9a99787

Choose a tag to compare

perf: fast-path in validateTraceID for already-valid trace IDs

v0.2.12

04 Apr 12:14
8099f41

Choose a tag to compare

chore: bump options to v0.3.0 and log to v0.3.0 for unified RequestContext

v0.2.11

04 Apr 09:19
c7a2b89

Choose a tag to compare

security: validate client-supplied trace IDs, add SetTraceIDValidator for custom validation

v0.2.10

03 Apr 17:11
e40523f

Choose a tag to compare

perf: add SetTraceIdWithValue, cache OTEL span lookup

v0.2.9

03 Apr 07:48
f456431

Choose a tag to compare

What's Changed

  • feat: link ColdBrew trace ID to OTEL span — sets coldbrew.trace_id attribute on the OTEL span, including on early-return path
  • chore: bump go-coldbrew/log v0.2.7 → v0.2.8 (slog default)
  • fix: Makefile bench regex (^$^$$)

v0.2.8

02 Apr 15:13
c46c89c

Choose a tag to compare

What's Changed

  • fix: race-safe asyncSem — replaced bare channel variable with atomic.Pointer[chan struct{}] + sync.Once guard
  • fix: atomic shouldNotify — converted customError.shouldNotify from bool to atomic.Bool to fix data race in concurrent NotifyAsync
  • fix: safe type assertion in GetTraceId — comma-ok idiom prevents panic on non-string tracerID value
  • Default async notification concurrency reduced from 1000 to 20
  • Makefile bench regex fix (^$^$$)

v0.2.7

31 Mar 10:54
bf7870a

Choose a tag to compare

What's Changed

Lazy stack trace capture (6.5x faster error creation)

Replaces eager per-frame stack capture with batch PC capture and deferred symbolization.

Benchmark results (Apple M1 Pro):

Benchmark Before After Improvement
errors.New 3500 ns / 1600 B / 19 allocs 540 ns / 392 B / 6 allocs 6.5x faster, 75% less memory
New + StackFrame() 3500 ns / 1600 B / 19 allocs 1250 ns / 824 B / 9 allocs 2.8x faster, 49% less memory
NewDeepStack (32 frames) 40500 ns / 17 KB / 125 allocs 1060 ns / 392 B / 6 allocs 38x faster, 98% less memory

Changes

  • Batch PC capture: single runtime.Callers() replaces loop of runtime.Caller(i) + runtime.FuncForPC(pc)
  • Lazy symbolization: StackFrame() resolves frames on first access via sync.Once + runtime.CallersFrames
  • Default depth: reduced from 64 to 16 frames (configurable via SetMaxStackDepth, accepts [1, 256])
  • Thread-safe config: SetMaxStackDepth uses atomic.Int32, SetBaseFilePath uses atomic.Value
  • Frame capping: resolveFrames caps output at captured PC count to handle inlining expansion
  • basePath snapshot: captured at error creation time, not resolution time — eliminates races
  • Pointer receivers: all customError methods (required by sync.Once)

Compatibility

  • Callers() []uintptr — unchanged
  • StackFrame() []StackFrame — same output, now lazy
  • Sentry, Rollbar, Airbrake notifiers — all work unchanged

v0.2.6

28 Mar 09:11
c1f9b08

Choose a tag to compare

Changes

  • Migrate notifier from OpenTracing to OTEL trace context
  • Application correlation ID (GetTraceId) takes precedence over OTEL span trace ID
  • Error notifications now include both traceId (correlation) and otelTraceId (distributed trace)
  • Remove opentracing-go dependency
  • Bump go-coldbrew/tracing to v0.2.0