Skip to content

Commit 4fc2e5c

Browse files
committed
dial back sampling
1 parent 683eac8 commit 4fc2e5c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/instrumentation-client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ Sentry.init({
1818
tracesSampler: _samplingContext => {
1919
// Check if running in browser environment
2020
if (typeof navigator === 'undefined' || !navigator.userAgent) {
21-
return 1; // Default to sampling if userAgent not available
21+
return 0.3; // Default to 30% sampling if userAgent not available
2222
}
2323

2424
const userAgent = navigator.userAgent;
2525

26-
// Always sample AI agents - we want visibility into how agentic tools consume our docs
26+
// Always sample AI agents - we want full visibility into agentic docs consumption
2727
const isAIAgent = AI_AGENT_PATTERN.test(userAgent);
2828
if (isAIAgent) {
2929
return 1;
@@ -32,8 +32,8 @@ Sentry.init({
3232
// Filter out traditional bots/crawlers
3333
const isBot = BOT_PATTERN.test(userAgent);
3434

35-
// Drop traces for bots (return 0), keep for real users (return 1)
36-
return isBot ? 0 : 1;
35+
// Drop traces for bots, sample 30% of real users (high traffic site)
36+
return isBot ? 0 : 0.3;
3737
},
3838

3939
// Enable logs to be sent to Sentry

0 commit comments

Comments
 (0)