Closed Bug 2020962 Opened 7 months ago Closed 4 months ago

Implement Session Lifecycle and State Management

Categories

(Data Platform and Tools :: Glean: SDK, task, P1)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: travis_, Assigned: travis_)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [glean-sdk-jira])

Attachments

(3 files)

Implement the session state machine in the SDK, including:

  • Lifecycle modes (AUTO default, LIFECYCLE, MANUAL)
  • Handling of active/inactive signals
  • Inactivity timeout behavior
  • Cold restart handling
  • Session start/end transitions

Includes generation and management of:

  • session_id (UUIDv4)
  • session_seq
  • event_seq

Modify event recording to:

  • Attach structured session metadata to in-session events
  • Emit session_start and session_end synthetic events
  • Include effective session sample rate in metadata
  • Update payload schema and documentation accordingly.

Implement:

  • Deterministic session sampling decision at session start
  • Gating of in-session telemetry when sampled out
  • Runtime session_sample_rate configuration (init + remote override)
  • out_of_session exemption behavior
  • Diagnostic metric (glean.sessions_seen) for observability

Includes tests for sampling semantics and metadata correctness.

Blocks: 2020963

Assuming sequential execution and ~16 weeks total duration starting March 16, 2026, here are the expected completion dates:

Step 1: Design Finalization & Architecture Approval (3 weeks)
Expected completion: April 6, 2026

Step 2: SDK/parser/pipeline implementation (estimate 6-8 weeks)

  • Core Session State Machine Implementation
  • Per-Session Sampling & Diagnostics
  • Payload Schema & Metadata Integration
    Expected completion: May 18, 2026

Step 3: Performance & Payload Impact Validation (2 weeks)
Includes Bug 2020967
Expected completion: June 8, 2026

Step 4: ETL Modeling & Pilot Rollout (3 weeks)
Includes Bug 2020968, Bug 2020970
Expected completion: June 30, 2026

Overall projected completion: July 6, 2026
(Flows will follow in a separate, later phase: Bug 2020971)

Priority: -- → P2
Priority: P2 → P1
Assignee: nobody → tlong
Duplicate of this bug: 1997336

I originally had the wrong bug for the schema updates, they are now linked here properly

Status: NEW → ASSIGNED

Pipeline schema PR is queued for review, which usually doesn't take long. After that lands I will need to update the copy of the schema in the SDK PR, then it and the glean_parser PRs can land. Then releases cut for Glean and glean_parser, vendoring, and collecting data for validation. I expect to get this stuff landed and released/vendored next week.

Blocks: 2020967

All PRs are reviewed except the pipeline schema additions. I'll push for review on it as it needs to land first, then the other two PRs updated with the schema from the pipeline generator and then they can land too.

After landing, it will take about a week to begin to have enough data to start validating the session metadata, then a day or two to complete the initial validation. Validation will continue through vendoring into consuming applications to ensure everything is working as expected.

Once validation is completed, then work on Flow-ids and the associated metadata will begin.

Everything has landed. Tomorrow I will work on cutting a Glean release and then we will be collecting data for the next steps of validation, and checking the payload size impact, etc.

Closing this as FIXED and moving onto the next bugs in the tree

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: