File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ Additionally, the following features are highly encouraged:
32
32
* Non-blocking event submission
33
33
* Basic data sanitization (e.g. filtering out values that look like passwords)
34
34
* Context data helpers
35
+ * Event sampling
35
36
36
37
Usage for End-users
37
38
-------------------
@@ -132,6 +133,20 @@ The resulting POST request would then transmit to::
132
133
.. note :: If any of configuration values are not present, the SDK should notify the user
133
134
immediately that they've misconfigured the SDK.
134
135
136
+ Event Sampling
137
+ --------------
138
+
139
+ SDKs should allow the user to configure what percentage of events are actually
140
+ sent to the server (the rest should be silently ignored). For example:
141
+
142
+ .. sourcecode :: python
143
+
144
+ sample_rate = options.get('sample_rate', 1.0)
145
+
146
+ # assuming random() returns a value between 0.0 (inclusive) and 1.0 (exclusive)
147
+ if random() < sample_rate:
148
+ raven.send(data)
149
+
135
150
Building the JSON Packet
136
151
------------------------
137
152
You can’t perform that action at this time.
0 commit comments