You can use the Events widget to get analytics based on SQL queries.
When creating this type of widget, you must set values for the following settings:
Tab :
Tenant is the tenant for which data is displayed in the widget. You can select multiple tenants. By default, data is displayed for tenants selected in layout settings.
The upper boundary of the period is not included in the time slice defined by it. In other words, to receive analytics for a whole day, you must configure the period as <Day 1>, 00:00:00 – <Day 2>, 00:00:00 instead of <Day 1>, 00:00:00 – <Day 1>, 23:59:59.
You can also create a query in Builder by clicking .
How to create a query in Builder
Example of search conditions in the query builder
The "metric" and "value" aliases in SQL queries cannot be edited for any type of event analytics widget, except tables.
Aliases in widgets of the Table type can contain Latin and Cyrillic characters, as well as spaces. When using spaces or Cyrillic, the alias must be enclosed in quotation marks: "An alias with a space"
, `Another alias`
.
When displaying data for the previous period, sorting by the count(ID)
parameter may not work correctly. It is recommended to sort by the metric parameter. For example, SELECT count(ID) AS "metric", Name AS "value" FROM `events` GROUP BY Name ORDER BY metric ASC LIMIT 250
.
In the Counter type widgets you must specify the method of data processing for the values of the SELECT
function: count
, max
, min
, avg
, sum
.
Tab :
The tab is displayed if on the tab in the Graph field you have selected one of the following values: Bar chart, Line chart, Date Histogram.
Negative values can be displayed on chart axes. This is due to the scaling of charts on the widget and can be fixed by setting zero as the minimum chart values instead of Auto.
Tab :
When this option is enabled, when a widget displays a large amount of data, horizontal scrolling is not available and all available information is fit into the fixed size of the widget. If there is a lot of data to display, it is recommended to increase the widget size.
Show nulls in legend displays parameters with a null value in the legend for analytics. The toggle switch is turned off by default.