-
-
Notifications
You must be signed in to change notification settings - Fork 465
Open
Labels
Description
Problem Statement
The Sentry SDK documentation lists SENTRY_SAMPLE_RATE as an expected environment variable that SDKs should support. This variable controls the percentage of error events sent to Sentry (0.0 to 1.0).
The Java SDK currently supports all other expected environment variables:
- ✓
SENTRY_DSN - ✓
SENTRY_RELEASE - ✓
SENTRY_ENVIRONMENT - ✓
SENTRY_TRACES_SAMPLE_RATE - ✓
SENTRY_PROFILES_SAMPLE_RATE - ✓
SENTRY_DEBUG - ❌
SENTRY_SAMPLE_RATE(missing)
Current Behavior
The SentryOptions class has a sampleRate property that can be set programmatically via options.setSampleRate(), but ExternalOptions.from() does not read this property from the properties provider.
Expected Behavior
Users should be able to set SENTRY_SAMPLE_RATE environment variable to configure error event sampling.
Solution
Add the following to ExternalOptions:
- Add a
sampleRatefield - Read it in
from()viapropertiesProvider.getDoubleProperty("sample-rate") - Merge it in
SentryOptions.merge()
Reactions are currently unavailable