Skip to content

Sessions - Provide more options to control session creation #18921

Description

@Angelodaniel

Problem Statement

Observation - Session instrumentation handler does start sessions for each new URL state
Problem - webviews use URL to pass information between native app and webview, this triggers a lot of “fake” sessions and consumes unnecessary data.

Link to source:

addHistoryInstrumentationHandler(({ from, to }) => {
// Don't create an additional session for the initial route or if the location did not change
if (from !== undefined && from !== to) {
startSession({ ignoreDuration: true });
captureSession();
}

Solution Brainstorm

This integration should support configuration options similar to how breadcrumbsIntegration works. The integration could accept options like:

interface BrowserSessionOptions { 
  // Disable automatic session creation on URL changes
  trackUrlChanges?: boolean;    
  // Or provide a callback to determine if session should be created 
  shouldCreateSession?: (from: string, to: string) => boolean;
}

Additional Context

Currently it's only possible to disable session tracking completely.

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions