The sentry-ruby repository is the official SDK for Ruby, designed for error tracking, performance monitoring, and distributed tracing. It functions as an instrumentation layer that captures exceptions, transactions, logs, and metrics from Ruby applications and transmits them to the Sentry backend. The architecture follows a Hub/Scope/Client pattern, ensuring thread and fiber isolation for context management across concurrent requests. It supports a wide range of integrations including Rails, Sidekiq, Resque, and OpenTelemetry, making it a central piece of observability infrastructure for the Ruby ecosystem. The SDK manages the full lifecycle of telemetry data, from capture to transport. It implements sophisticated sampling logic to maintain consistent sampling rates across distributed services using deterministic algorithms. The transport layer handles rate limiting, compression, and envelope serialization, ensuring efficient communication with the Sentry server. The codebase is structured as a monorepo with a core gem (sentry-ruby) and modular integrations (sentry-rails, sentry-sidekiq, etc.), allowing for targeted updates and version compatibility testing across multiple Ruby and framework versions. Data flows from the application through the SDK's Scope and Client, where events are processed, sampled, and buffered before being sent via HTTP or Spotlight. The system supports structured logging and metrics collection, adhering to the Sentry Logs Protocol. It includes robust testing infrastructure with matrix testing across Ruby versions (2.7-4.0) and framework versions (Rails 5.2-8.1.3), ensuring stability and compatibility. The SDK is actively maintained with recent commits and issue triage, reflecting its critical role in production environments.
Oops is a Go library for structured error handling that serves as a drop-in replacement for the standard error type. It provides a fluent builder pattern to attach rich contextual information (error codes, domains, tags, key-value attributes, user/tenant data, HTTP request/response, timestamps, durations, hints, ownership) to errors, along with automatic stack trace capture and optional source code fragment extraction. The library implements the standard error interface, supports error wrapping and chaining, panic recovery, assertions, and integrates with major Go logging libraries (zap, zerolog, logrus, slog) via separate formatter packages. Its architecture centers on an immutable option chain (functional options) that defers stack frame symbolization to first read, minimizing allocation overhead for errors that are created but never inspected. Key entry points are the package-level functions (Wrap, Wrapf, New, Errorf, Join, Recover, Recoverf, Assert, Assertf) and the OopsErrorBuilder chainable methods. External dependencies are minimal: only github.com/oklog/ulid/v2, github.com/samber/lo, and go.opentelemetry.io/otel/trace for optional OpenTelemetry span context extraction. The codebase is well-tested, benchmarked, and follows Go best practices with comprehensive linting and security scanning.
Boost.Stacktrace is a production-grade C++ library for capturing, storing, and printing backtraces (call stacks). It provides a header-only core with optional compiled backends that leverage platform-specific mechanisms: `_Unwind_Backtrace` (POSIX), `backtrace()` (glibc), `libbacktrace`, `addr2line`, or Windows Debug Engine (`dbgeng`). The library offers signal-safe raw dump functions, human-readable frame decoding (function names, source file, line number), and the ability to capture stacktraces at the point an exception is thrown via `from_current_exception()`. The design is modular, with separate compiled libraries for each backend and a no-op backend to disable tracing. The codebase is well-structured, heavily tested across compilers and platforms, and actively maintained. It demonstrates deep knowledge of C++ runtime internals, particularly in the exception interception implementation that hooks into `__cxa_allocate_exception` or uses vectored exception handlers on Windows. While the library itself is the reusable asset, several internal utilities (e.g., address base computation from `/proc/self/maps`, `dladdr` abstraction) embody patterns useful in other debugging and profiling tools.