You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/environment-variables.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,7 @@ Your Tusk Drift API key, required when using Tusk Cloud for storing and managing
110
110
111
111
This will securely store your auth key for future replay sessions.
112
112
113
-
## TUSK_SAMPLING_RATE
113
+
## TUSK_RECORDING_SAMPLING_RATE
114
114
115
115
Controls the base recording rate used during trace collection.
116
116
@@ -123,14 +123,16 @@ Controls the base recording rate used during trace collection.
123
123
124
124
```bash
125
125
# Record all requests (100%)
126
-
TUSK_SAMPLING_RATE=1.0 python app.py
126
+
TUSK_RECORDING_SAMPLING_RATE=1.0 python app.py
127
127
128
128
# Record 10% of requests
129
-
TUSK_SAMPLING_RATE=0.1 python app.py
129
+
TUSK_RECORDING_SAMPLING_RATE=0.1 python app.py
130
130
```
131
131
132
132
If `recording.sampling.mode: adaptive` is enabled in `.tusk/config.yaml`, this environment variable still only changes the base rate; adaptive load shedding remains active.
133
133
134
+
`TUSK_RECORDING_SAMPLING_RATE` is the canonical variable, but `TUSK_SAMPLING_RATE` is still accepted as a backward-compatible alias.
135
+
134
136
For more details on sampling rate configuration methods and precedence, see the [Initialization Guide](./initialization.md#configure-sampling-rate).
Copy file name to clipboardExpand all lines: docs/initialization.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ Create an initialization file or add the SDK initialization to your application
74
74
<td><code>sampling_rate</code></td>
75
75
<td><code>float</code></td>
76
76
<td><code>None</code></td>
77
-
<td>Override the base sampling rate (0.0 - 1.0) for recording. Takes precedence over <code>TUSK_SAMPLING_RATE</code> and config file base-rate settings. Does not change <code>recording.sampling.mode</code>.</td>
77
+
<td>Override the base sampling rate (0.0 - 1.0) for recording. Takes precedence over <code>TUSK_RECORDING_SAMPLING_RATE</code> and config file base-rate settings. Does not change <code>recording.sampling.mode</code>.</td>
78
78
</tr>
79
79
</tbody>
80
80
</table>
@@ -183,7 +183,8 @@ Sampling configuration is resolved in two layers:
Set the `TUSK_SAMPLING_RATE` environment variable to override the base sampling rate:
211
+
Set the `TUSK_RECORDING_SAMPLING_RATE` environment variable to override the base sampling rate:
211
212
212
213
```bash
213
214
# Development - record everything
214
-
TUSK_SAMPLING_RATE=1.0 python app.py
215
+
TUSK_RECORDING_SAMPLING_RATE=1.0 python app.py
215
216
216
217
# Production - sample 10% of requests
217
-
TUSK_SAMPLING_RATE=0.1 python app.py
218
+
TUSK_RECORDING_SAMPLING_RATE=0.1 python app.py
218
219
```
219
220
221
+
`TUSK_SAMPLING_RATE` is still supported as a backward-compatible alias, but new setups should prefer `TUSK_RECORDING_SAMPLING_RATE`.
222
+
220
223
### Method 3: Configuration File
221
224
222
225
Use the nested `recording.sampling` config to choose `fixed` vs `adaptive` mode and set the base/minimum rates.
@@ -276,7 +279,7 @@ recording:
276
279
<td><code>sampling.base_rate</code></td>
277
280
<td><code>float</code></td>
278
281
<td><code>1.0</code></td>
279
-
<td>The base sampling rate (0.0 - 1.0). This is the preferred config key and can be overridden by <code>TUSK_SAMPLING_RATE</code> or the <code>sampling_rate</code> init parameter.</td>
282
+
<td>The base sampling rate (0.0 - 1.0). This is the preferred config key and can be overridden by <code>TUSK_RECORDING_SAMPLING_RATE</code> or the <code>sampling_rate</code> init parameter.</td>
0 commit comments