Event manager

Overview

The event manager helps the user in this task by automatically duplicating specified metrics and adding the relevant time overrides, aliases and time aligns.

Description

This feature is optional, it can be enabled or disabled by clicking on the appropriate toggle button.

../_images/event-manager-ui.png
../_images/event-manager-csv.png
  1. The toggle button that allows the user to enable or disable the feature

  2. Event manager can be configured with the UI (by default) or with a CSV format.

  3. Rename metrics with aliases corresponding to the event name (by default set to true)

  4. Tag metrics (by default set to true). When set to true, the metrics will be returned with the tag “_event” having as value the name of the event

  5. Apply a time align to data from events (by default set to Align start)

    • No align: The timestamp of data is not modified

    • Align start: The timestamp of each data point is shifted as if all events would have started at query start time

    • Align end: The timestamp of each data point is shifted as if all events would have finished at query end time

  6. Add an event, the user can add as many events as he wants

  7. UI for building an event. An event has a name and a time range that works as all the other time ranges of the UI

  8. Load event from CSV. Note that changing form CSV ` to `Build with UI automatically translates all events from CSV in the UI

Usage in API

The event manager is specified in an object at the root of the query with the key event_sourcing.

It has four parameters.

  • rename_metrics: true or false

  • apply_tag: true of false

  • time_align: there is three possible values, no_align, align_start or align_end

  • events: an array of event

An event has two parameters.

  • name: the name of the event

  • time range

    • start_relative: The relative start time is the current date and time minus the specified value and unit. Possible unit values are “milliseconds”, “seconds”, “minutes”, “hours”, “days”, “weeks”, “months”, and “years”. For example, if the start time is 5 minutes, the query will return all matching data points for the last 5 minutes.

    • start_absolute: The time in milliseconds.

    • end_relative: The relative end time is the current date and time minus the specified value and unit. Possible unit values are “milliseconds”, “seconds”, “minutes”, “hours”, “days”, “weeks”, “months”, and “years”. For example, if the start time is 30 minutes and the end time is 10 minutes, the query returns matching data points that occurred between the last 30 minutes up to and including the last 10 minutes. If not specified, the end time is assumed to be the current date and time.

    • end_absolute: The time in milliseconds. This must be later in time than the start time. If not specified, the end time is assumed to be the current date and time.

Note : You must specify either start_absolute or start_relative but not both. Similarly, you may specify either end_absolute or end_relative but not both. If neither end times are specified the current date and time are used.

{
    "start_relative": {
        "value": "12",
        "unit": "hours"
    },
    "metrics": [
        {
          "name": "metric 1"
        }
    ],
    "event_sourcing": {
        "rename_metrics": false,
        "apply_tag": true,
        "time_align": "align_start",
        "events": [
          {
            "name": "event 1",
            "timerange": {
              "end_absolute": null,
              "start_relative": {
                "value": "3",
                "unit": "hours"
              }
            }
          }
        ]
    }
}