File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments