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.
This is the official Sentry SDK for PHP (sentry-php), a client library that instruments PHP applications for error tracking, exception capture, performance monitoring (tracing, logging, metrics, profiling, and check-ins). The architecture follows a hub-scope pattern: a global SentrySdk facade manages a stack of Hub instances, each holding a Client and Scope. The Client handles event creation, before-send callbacks, sampling, and integration setup. Events are serialized into Sentry envelope format and transmitted via an HTTP transport (cURL) or a local agent socket. The library ships with numerous integrations for PHP frameworks (Monolog, Guzzle, OpenTelemetry, Symfony, Laravel), a custom Options resolver, serializers, aggregation buffers for metrics and logs, and runtime context isolation for long-lived workers (FrankenPHP, RoadRunner). External dependencies include Monolog, PSR-7, OpenTelemetry API, and the Excimer extension for profiling. The SDK is highly configurable via the Options class and supports extensive event enrichment through scopes and event processors.