File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ function setupFaro() {
1414 const faroAppEnvironment = config . faro_app_environment || 'production' ;
1515 const faroInstrumentationEnableReplay =
1616 config . faro_instrumentation_enable_replay === 'true' ;
17+ const faroSessionSampleRate = config . faro_session_sample_rate
18+ ? parseFloat ( config . faro_session_sample_rate )
19+ : 1.0 ;
1720
1821 if ( ! url ) {
1922 console . warn ( 'Grafana Faro is not configured.' ) ;
@@ -39,7 +42,9 @@ function setupFaro() {
3942 ) ;
4043 }
4144
42- console . log ( `Initializing Grafana Faro to '${ url } '` ) ;
45+ console . log (
46+ `Initializing Grafana Faro to '${ url } ' with session sample rate ${ faroSessionSampleRate } ` ,
47+ ) ;
4348 initializeFaro ( {
4449 url,
4550 app : {
@@ -49,6 +54,10 @@ function setupFaro() {
4954 environment : faroAppEnvironment ,
5055 } ,
5156 instrumentations,
57+ sessionTracking : {
58+ enabled : true ,
59+ samplingRate : faroSessionSampleRate ,
60+ } ,
5261 } ) ;
5362 } )
5463 . catch ( ( e ) => {
You can’t perform that action at this time.
0 commit comments