Skip to main content
Version: Current

Aggregate Session

Mode: Streaming

Description​

note

This page describes the behavior specific to aggregations in the session window. For concepts and configuration common to all time-window aggregations, see Aggregations in time windows.

A session window groups events that belong to one continuous period of activity. Unlike sliding and tumbling windows, a session window does not have a fixed length.

A separate session is maintained for each Group by value.

A session closes when either:

  • End session condition evaluates to true, or
  • the time since the last event for that Group by value exceeds Session timeout.
Session window concept

For simplicity, all events share the same Group by value ("purple")

 

The computed aggregations can be emitted:

  • On each event - enrich the incoming event with the current aggregate. No additional aggregate event is emitted when the session ends.
  • After session end - incoming events do not continue downstream; when the session closes, a new aggregate event is emitted. Variables belonging to the original events, such as #input and #inputMeta, are therefore unavailable downstream.

Parameters and configuration​

Parameters common to all windows are described here.

ParameterDescription
End session conditionExpression evaluated for incoming events. When it evaluates to true, the current session closes. Set it to false if sessions should close only because of inactivity.
Session timeoutAmount of inactivity after which a session closes. The inactivity period is measured separately for each Group by value.
Emit whenDetermines whether incoming events are enriched while the session is active or a new aggregate event is emitted after the session closes.