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.
We're thrilled to announce a significant update to the Sentry-Bridge package. This update focuses on refining the codebase and introducing some highly requested features. Let's dive into the details:
More Control with Configuration
You can now set up your Sentry settings using environment variables or a config file. This includes your Sentry DSN, sample rates, whether to send default personally identifiable information (PII), and details about your environment and release version.
Via env variables
SENTRY_DSN
: Specify your Sentry Data Source Name (DSN).SENTRY_SAMPLE_RATE
: Define the rate at which to sample events (e.g., 0.4).SENTRY_TRACES_SAMPLE_RATE
: Set the rate for tracing samples (e.g., 1.0).SENTRY_SEND_DEFAULT_PII
: Choose whether to send default personally identifiable information (true/false).SENTRY_ENVIRONMENT
: Set the environment (e.g., 'develop'). You can alternatively useAPP_ENV
.SENTRY_RELEASE
: Define the release version (e.g., '1.0.0'). Alternatively, useAPP_VERSION
.Via config file
Offers similar settings as environment variables, with the added flexibility of a PHP array format for more complex configurations.
Custom Integrations Made Easy
The update introduces a streamlined way to register application-specific integrations via
Spiral\Sentry\Bootloader\ClientBootloader
. This makes it straightforward to add custom functionalities tailored to your application's needs.Example of registering a custom integration:
Advanced Container Bindings
For developers seeking deeper integration and control, we've introduced new container bindings:
Sentry\Options
: A configuration container for fine-tuning Sentry client settings.Sentry\State\HubInterface
: Provides access to Sentry's state and context management.Sentry\ClientInterface
: Facilitates direct interactions with the Sentry client.These bindings offer granular control over the Sentry client, catering to advanced use cases.
Enhanced Request Integrations
We've improved how Sentry interacts with HTTP requests. The package now includes a more sophisticated integration using
Sentry\Integration\RequestIntegration
. This enhancement ensures that Sentry captures comprehensive information about application requests.Moreover, we've added the
Spiral\Sentry\Http\SetRequestIpMiddleware
. This middleware is crucial for collecting user IP addresses whensend_default_pii
is enabled. It's an optional but powerful feature for those needing detailed user insights.