File tree Expand file tree Collapse file tree 7 files changed +8
-31
lines changed
Expand file tree Collapse file tree 7 files changed +8
-31
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,12 @@ jobs:
4040 ${{ runner.os }}-gradle-
4141
4242 - name : Initialize CodeQL
43- uses : github/codeql-action/init@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # pin@v2
43+ uses : github/codeql-action/init@32dc499307d133bb5085bae78498c0ac2cf762d5 # pin@v2
4444 with :
4545 languages : ${{ matrix.language }}
4646
4747 - run : |
4848 ./gradlew assemble
4949
5050 - name : Perform CodeQL Analysis
51- uses : github/codeql-action/analyze@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # pin@v2
51+ uses : github/codeql-action/analyze@32dc499307d133bb5085bae78498c0ac2cf762d5 # pin@v2
Original file line number Diff line number Diff line change 2121### Fixes
2222
2323- Leave ` inApp ` flag for stack frames undecided in SDK if unsure and let ingestion decide instead ([ #2547 ] ( https://github.com/getsentry/sentry-java/pull/2547 ) )
24+ - Allow ` 0.0 ` error sample rate ([ #2573 ] ( https://github.com/getsentry/sentry-java/pull/2573 ) )
2425- Use the same hub in WebFlux exception handler as we do in WebFilter ([ #2566 ] ( https://github.com/getsentry/sentry-java/pull/2566 ) )
2526
2627## 6.14.0
Original file line number Diff line number Diff line change @@ -3794,7 +3794,6 @@ public final class io/sentry/util/SampleRateUtils {
37943794 public fun <init> ()V
37953795 public static fun isValidProfilesSampleRate (Ljava/lang/Double;)Z
37963796 public static fun isValidSampleRate (Ljava/lang/Double;)Z
3797- public static fun isValidSampleRate (Ljava/lang/Double;Z)Z
37983797 public static fun isValidTracesSampleRate (Ljava/lang/Double;)Z
37993798 public static fun isValidTracesSampleRate (Ljava/lang/Double;Z)Z
38003799}
Original file line number Diff line number Diff line change @@ -814,7 +814,7 @@ public void setProxy(@Nullable Proxy proxy) {
814814 }
815815
816816 /**
817- * Sets the sampleRate Can be anything between 0.01 and 1.0 or null (default), to disable it.
817+ * Sets the sampleRate Can be anything between 0.0 and 1.0 or null (default), to disable it.
818818 *
819819 * @param sampleRate the sample rate
820820 */
@@ -823,7 +823,7 @@ public void setSampleRate(Double sampleRate) {
823823 throw new IllegalArgumentException (
824824 "The value "
825825 + sampleRate
826- + " is not valid. Use null to disable or values > 0.0 and <= 1.0." );
826+ + " is not valid. Use null to disable or values >= 0.0 and <= 1.0." );
827827 }
828828 this .sampleRate = sampleRate ;
829829 }
Original file line number Diff line number Diff line change 77public final class SampleRateUtils {
88
99 public static boolean isValidSampleRate (@ Nullable Double sampleRate ) {
10- return isValidSampleRate (sampleRate , true );
11- }
12-
13- public static boolean isValidSampleRate (@ Nullable Double sampleRate , boolean allowNull ) {
14- if (sampleRate == null ) {
15- return allowNull ;
16- }
17-
18- return !(sampleRate .isNaN () || sampleRate > 1.0 || sampleRate <= 0.0 );
10+ return isValidRate (sampleRate , true );
1911 }
2012
2113 public static boolean isValidTracesSampleRate (@ Nullable Double tracesSampleRate ) {
Original file line number Diff line number Diff line change @@ -91,11 +91,6 @@ class SentryOptionsTest {
9191 assertFailsWith<IllegalArgumentException > { SentryOptions ().sampleRate = - 0.0000000000001 }
9292 }
9393
94- @Test
95- fun `when setSampling is set to exactly 0, setter throws` () {
96- assertFailsWith<IllegalArgumentException > { SentryOptions ().sampleRate = 0.0 }
97- }
98-
9994 @Test
10095 fun `when setTracesSampleRate is set to exactly 0, value is set` () {
10196 val options = SentryOptions ().apply {
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ class SampleRateUtilTest {
1717 }
1818
1919 @Test
20- fun `rejects 0 for sample rate` () {
21- assertFalse (SampleRateUtils .isValidSampleRate(0.0 ))
20+ fun `accepts 0 for sample rate` () {
21+ assertTrue (SampleRateUtils .isValidSampleRate(0.0 ))
2222 }
2323
2424 @Test
@@ -46,16 +46,6 @@ class SampleRateUtilTest {
4646 assertFalse(SampleRateUtils .isValidSampleRate(Double .NEGATIVE_INFINITY ))
4747 }
4848
49- @Test
50- fun `accepts null sample rate if told so` () {
51- assertTrue(SampleRateUtils .isValidSampleRate(null , true ))
52- }
53-
54- @Test
55- fun `rejects null sample rate if told so` () {
56- assertFalse(SampleRateUtils .isValidSampleRate(null , false ))
57- }
58-
5949 @Test
6050 fun `accepts 0 for traces sample rate` () {
6151 assertTrue(SampleRateUtils .isValidTracesSampleRate(0.0 ))
You can’t perform that action at this time.
0 commit comments