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 groupBy value.

A session closes when either:

  • endSessionCondition evaluates to true, or
  • the time since the last event for that groupBy value exceeds sessionTimeout.
Session window concept

For simplicity, all events share the same groupBy 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
endSessionConditionExpression 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.
sessionTimeoutAmount of inactivity after which a session closes. The inactivity period is measured separately for each groupBy value.
emitWhenDetermines whether incoming events are enriched while the session is active or a new aggregate event is emitted after the session closes.