Eventum Logo

Eventum

Eventtemplate

Modes

Template picking modes — all, any, chance, spin, chain, and fsm.

The mode field determines how templates are selected for each incoming timestamp.

all

Every template is rendered for every timestamp. Produces N events per timestamp, where N is the number of templates.

event:
  template:
    mode: all
    templates:
      - access_log:
          template: templates/access.jinja
      - error_log:
          template: templates/error.jinja

any

A single template is chosen at random (uniform distribution) for each timestamp.

event:
  template:
    mode: any
    templates:
      - success:
          template: templates/success.jinja
      - error:
          template: templates/error.jinja

chance

A single template is chosen at random with weighted probability. Each template has a chance value — the higher the value relative to others, the more likely it is to be selected.

Extra parameterTypeConstraintsDescription
chancefloatRequired. > 0Relative probability weight.
event:
  template:
    mode: chance
    templates:
      - success:
          template: templates/success.jinja
          chance: 90
      - error:
          template: templates/error.jinja
          chance: 10

spin

Templates are rendered in round-robin order. The first timestamp uses the first template, the second uses the second, and so on, cycling back to the first after the last.

event:
  template:
    mode: spin
    templates:
      - request:
          template: templates/request.jinja
      - response:
          template: templates/response.jinja

chain

Templates are rendered in a fixed order defined by the chain list. All templates in the chain are rendered for every timestamp, in the specified order.

Extra parameterTypeConstraintsDescription
chainlist of stringsRequired. At least one alias.Ordered list of template aliases to render.
event:
  template:
    mode: chain
    chain: [login, browse, checkout, logout]
    templates:
      - login:
          template: templates/login.jinja
      - browse:
          template: templates/browse.jinja
      - checkout:
          template: templates/checkout.jinja
      - logout:
          template: templates/logout.jinja

fsm

Templates represent states in a finite state machine. After each timestamp, the machine evaluates transition conditions to decide the next state. This enables stateful event sequences like user sessions or protocol flows.

How it works:

  1. The machine starts at the template marked initial: true.
  2. That template is rendered, producing an event. During rendering, the template can modify state variables (locals, shared, globals).
  3. After rendering, transitions are evaluated in order — the first transition whose when condition is true fires.
  4. The machine moves to the state named in the to field.
  5. On the next timestamp, the new current template is rendered and the cycle repeats.
  6. If no transition matches, the machine stays in the current state.
Extra parameterTypeDefaultConstraintsDescription
initialbooleanfalseExactly one template must be true.Marks the starting state.
transitionslist of transition configs[]Possible transitions from this state.
event:
  template:
    mode: fsm
    templates:
      - idle:
          template: templates/idle.jinja
          initial: true
          transitions:
            - to: active
              when:
                gt:
                  shared.request_count: 0
      - active:
          template: templates/active.jinja
          transitions:
            - to: idle
              when:
                eq:
                  shared.request_count: 0

For full details on FSM transitions, conditions, and examples, see FSM.

On this page