Session Management Infrastructure #1420
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #2: Session Management Infrastructure
Description
Adds foundational infrastructure for session tracking across all telemetry signals.
This PR includes:
Core Session Utilities
SessionIdentifiers- Data class for session.id and session.previous_idSessionExtensions- Kotlin extensions for adding session IDs to spans/logs/metricsSessionIdentifierFacade- Facade pattern for consistent session accessSessionIdFacade- UUID fallback for session ID generationMetrics Infrastructure
SessionMetricExporterAdapter- Adapter pattern for adding session IDs to metricsKey Addition: This enables session-based metrics analytics - a capability
not present in the iOS or JavaScript SDKs! This allows correlating metrics
like memory usage, network bytes, or performance counters to specific user sessions.
Design Patterns Used
Related PRs
This is part 2 of 3 in a comprehensive session management enhancement:
Dependencies:
Review Strategy:
Type of Change
Checklist
Testing
Additional Context
Comparison with Other Platforms:
This infrastructure establishes the foundation for comprehensive session tracking.
PR 3 integrates this across all instrumentation modules.
Why metrics matter: Session-based metrics enable queries like:
None of the other SDKs can answer these questions today!
References