diff --git a/big/alerting/analyze-alert-rules.mdx b/big/alerting/analyze-alert-rules.mdx index 8fa93692e..bd7f4931e 100644 --- a/big/alerting/analyze-alert-rules.mdx +++ b/big/alerting/analyze-alert-rules.mdx @@ -55,7 +55,7 @@ To make the interaction between the Business Engine and Grafana more transparent To review the Grafana data frame in the Business Studio: 1. Open the alert rule of interest. -2. Optionally, on the **Alert settings** tab confirm the alert rule is assigned to the dashboard(2.1) and panel(2.2) of interest. +2. Optionally, on the **Alert settings** page confirm the alert rule is assigned to the dashboard(2.1) and panel(2.2) of interest. 3. Open the **Data preview** tab. 4. Optionally, verify the dashboard variable (data frame filter) is set up to the necessary value. 5. Review the Grafana data frame in the Business Studio. @@ -66,7 +66,7 @@ To review the Grafana data frame in the Business Studio: A Grafana data frame can be reviewed as a code by clicking on the **View as code** button. diff --git a/big/alerting/datasources/index.mdx b/big/alerting/datasources/index.mdx new file mode 100644 index 000000000..cfc987051 --- /dev/null +++ b/big/alerting/datasources/index.mdx @@ -0,0 +1,12 @@ +--- +tags: + - Business Alerting +--- + +# Data Sources + +This section provides examples of some supported data sources. Please note that the Business Intelligence platform supports most backend data sources available in Grafana. On this page, we started to collect examples of the most popular ones. + +| Data Source Example | Description | +| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| [PostgreSQL](../datasources/postgresql) | Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance | diff --git a/big/alerting/datasources/loki.mdx b/big/alerting/datasources/loki.mdx new file mode 100644 index 000000000..83347dcbf --- /dev/null +++ b/big/alerting/datasources/loki.mdx @@ -0,0 +1,8 @@ +--- +tags: + - Business Alerting +--- + +import Image from "@theme/Image"; + +# Loki diff --git a/big/alerting/datasources/postgresql.mdx b/big/alerting/datasources/postgresql.mdx new file mode 100644 index 000000000..f0455d50f --- /dev/null +++ b/big/alerting/datasources/postgresql.mdx @@ -0,0 +1,130 @@ +--- +tags: + - Business Alerting +--- + +import Image from "@theme/Image"; + +# PostgreSQL + +The following example demonstrates configuring a Grafana, Business Studio, and PostgreSQL cluster to work with alerts. + +## Grafana + +Follow provided instruction to configure Time Series panel with dashboard variable. + +### Time Series panel + + + +1. Create a panel in a Grafana instance and select the pre-configured PostgreSQL datasource. In this example, it is called **Timescale**. +2. Specify an SQL query. In this example, we fetch two column data frame with **time** and **value** fields. The alerts configured via Business Studio supports Grafana dashboard variables. So, in addition to the time range parameter(**\_\_timeFilter**), we added another one. It is a dashboard variable named **metric** (see the image below for more details about the **metric** configuration). + +```sql +SELECT time, value +FROM metrics +WHERE name=${metric:sqlstring} and $__timeFilter(time) +ORDER BY 1 +``` + +The Grafana data frame looks as follows (those are not exact values that represented on the picture above). + +| time | value | +| ------------------- | ----- | +| 2025-02-10 11:30:19 | 97.3 | +| 2025-02-10 11:30:29 | 97.3 | +| 2025-02-10 11:30:39 | 97.6 | +| 2025-02-10 11:30:49 | 98.0 | +| 2025-02-10 11:30:59 | 98.5 | +| 2025-02-10 11:31:09 | 99.1 | +| 2025-02-10 11:31:59 | 20.5 | +| 2025-02-10 11:32:09 | 20.7 | +| 2025-02-10 11:32:19 | 20.8 | + +3. Specify one possible value. In this example, it is a device name - **Tampa South 124**. +4. Select the **Time series** visualization panel. +5. The **Thresholds** section has many tiers: - below 30 (green area on the panel), - from 30 to 60 (blue area on the panel), - from 60 to 70 (yellow area on the panel), - from 70 to 80 (orange area on the panel), - above 80 (red area on the panel). +6. The look of the created time series visualization. + - Horizontal color areas are the threshold sections. + - Vertical blue lines are the annotations created by Grafana as was instructed by the Business Studio. + +### Dashboard variable + + + +1. **Metric** is a dashboard variable name. +2. **Query** is the dashboard variable type. +3. The dashboard variable takes data from the connected PostgreSQL data source. +4. The query that populated the dashboard variable requests the listing of all unique device names. + +```sql +select distinct name from metrics +``` + +5. In the **Preview of values**, all fetched values are shown. Further in the example, we use one value **Tampa South 124**. + +## Business Studio + +Open Business Studio and add an alert rule. To follow up on the triggered event check alert history and data preview. + +### Alert rule configuration + +To add an alert rule, you can follow the [general instructions](/big/alerting/manage-alert-rules/#add-a-new-rule) or review the suggested example below. + +After an alert rule is added, you can open the **Alert settings** page to review its configuration. + + + +- **Details** + - **Title** is set to **Metric Threshold with Tampa 124 Override**. + - **Schedule** is kept by default which is every minute. +- **Target** + - **Dashboard** is set to **Metrics** Grafana dashboard. + - **Panel** is set to **One Time Series**. +- **Time Range** + - **Source** is set to take the Grafana **Dashboard** time range. +- **Execution**->**Variable** is set to use the dashboard variable **metric**. This means that query will be run for every variable value separately. +- **Variable values** is set to **All**. Here, you can specify a subset of a dashboard variable values if you do not need all of them. + + + +- **Evaluation** + - **Type** is set to **Thresholds** to instruct the Business Studio to get configured thresholds from the specified Grafana dashboard. + - **Allowed range** is set to from below 30 up to 70. The top boundary is not specified; it comes from the lower boundary of the next range. + - **Apply to**. Applying to one (the last value) is enough for this example. +- **Overrides**. When the **Execution** -> **Variable** is populated with a dashboard variable name, the **Overrides** section appears. In this example, the **Tampa Sount 124** device has a specific allowed range below 30. Anything above 30 triggers the alert rule. +- **Action** + - **Actions**. In the case of a triggered alert rule, two actions are triggered - writing into the Business Engine container logs and creating a file on a designated server/location with the details of the triggered event. + - **Add Annotation**. With every triggered alert event, an annotation is created and displayed on the Grafana dashboard (a light blue vertical line on the time series visualization). + +### Alert history + +On the **Alert history** page, the Business Studio displays the alert rule status changes. + + + +### Data preview + +On the **data preview** page you have a Grafana data frame. Specify a dashboard variable in the provided drop-down if needed. + + + +You can also review the payload submitted into the alert action "as-is". diff --git a/big/alerting/datasources/prometheus.mdx b/big/alerting/datasources/prometheus.mdx new file mode 100644 index 000000000..2aee338d6 --- /dev/null +++ b/big/alerting/datasources/prometheus.mdx @@ -0,0 +1,8 @@ +--- +tags: + - Business Alerting +--- + +import Image from "@theme/Image"; + +# Prometheus diff --git a/big/alerting/manage-alert-rules.mdx b/big/alerting/manage-alert-rules.mdx index 0a1be9dde..a274f3990 100644 --- a/big/alerting/manage-alert-rules.mdx +++ b/big/alerting/manage-alert-rules.mdx @@ -22,16 +22,16 @@ Use the **Alert rules** tab to manage alert rules. Here you can: ## Alert rules states -To temporate pause alert execution click on **Pause** icon for the specific alert rule. Alert can be started anytime to resume execution. +To temporate pause alert execution, click on the **Pause** icon for the specific alert rule. Alert can be started anytime to resume execution. ## Alert rules statuses Right after an alert is created it becomes **Active** and **Scheduled**. After modification, the alert status changes to **Scheduled** if it requires reexecution with a new set of parameters. -- **Scheduled**. The alert is scheduled, but never run yet with a current set of parameters. This status is assigned right after the alert is created or modified by the user and API. -- **OK**. The alert has been run and the thresholds are NOT breached and the Regex pattern is NOT found. -- **Alerting**. The alert has been run and the thresholds are being breached or the Regex pattern is found. -- **Error**. Something is wrong which could be the query, annotation or action. +- **Scheduled**. The alert is scheduled but has never run with a current set of parameters. This status is assigned right after the user and API create or modify the alert. +- **OK**. The alert has been run, the thresholds are NOT breached, and the Regex pattern is NOT found. +- **Alerting**. The alert has been run, the thresholds are breached, or the Regex pattern is found. +- **Error**. Something is wrong, such as the query, annotation, or action. ### Flow schema @@ -52,11 +52,16 @@ The **Add a new rule** window looks as follows: src="/img/big/business-alerting/new-rule.png" /> + + The new alert rule/edit window has the following configuration elements to specify: - **Details** - **Title** is an alert name. - - **Schedule** is a frequency of how often the rule should run. Here you can select from the ready-to-use templates and adjust if needed. Alternatively, use a CRON expression to make your schedule as complex as needed. + - **Schedule** is a frequency of how often the rule should run. Here, you can select from the ready-to-use templates and adjust if needed. Alternatively, use a Cron expression to make your schedule as complex as needed. - **Target** - **Dashboard** is a drop-down populated from the connected Grafana dashboard listing. - **Panel** is a drop-down populated from the selected dashboard. @@ -66,26 +71,56 @@ The new alert rule/edit window has the following configuration elements to speci - **Evaluation**. It could be set to: - **Thresholds**. The alert examines the data against thresholds set in the panel options. - **Regex Pattern**. The alert examines the specified fields (optional) and searches the specified pattern. -- **Event** - - **Result sample size**. This parameter lets you specify how many rows in an alert result should be randomly picked up for saving and your analysis. The choice is between: - - **All Values** and **Percentage**. - - The **Results sample size** parameter is not applicable for the **Last value**. +- **Execution**. This section appears if the selected dashboard has configured Grafana dashboard variables. You can specify a variable name to be taken into account with each query. +- **Variable values**. This section appears at the same time as the **Execution**. Here, you can specify the exact dashboard variable values for the query. This parameter is useful when you do not want to use all variable values. +- **Event**. This section appears when the **Evaluation**->**Apply to** is set to **All values** or **Maximum Allowed**. + - **Result sample size**. It lets you specify how many rows in an alert result should be randomly picked up for saving and your analysis. - **Action** - **Actions**. Select from the drop-down list of the existing, pre-configured action APIs. - **Add Annotation**: - **Panel** to create and attach an annotation to a panel. - - **Dashboard** to create and attach an annotation to a dashboard (i.e., all panels of this dashboard), - - **Disabled** to disable the creation of any annotation following the alert rule breach. + - **Dashboard** to create and attach an annotation to a dashboard (i.e., all panels of this dashboard). + - **Disabled** to disable the creation of any annotation following the triggered alert rule. ### Schedule -Select from the templates and adjust if needed or specify a CRON expression to make your schedule as complex as needed. +Select from the templates and adjust if needed, or specify a CRON expression to make your schedule as complex as required. + +### Grafana dashboard variables + +The Business Studio alert rules can incorporate Grafana dashboard variables and be specific for certain conditions. + +For instance, you can create the same alert rule for all your devices but make it distinctive for the actual threshold values. + +Below is the general description of such a configuration. You can find the detailed data sources examples in dedicated parts of this documentation. + +When in the **Target**->**Dashboard** parameter, you specify a dashboard containing dashboard variables, two more sections appear: + +- **Execution**. Here, you can specify a dashboard variable to use in each alert rule query. +- **Variable values**. Here, you can specify the subset of dashboard variable values that should be used in the alert rule execution. + + +When a dashboard variable is specified in the **Execution**->**Variable** parameter, the **Overrides** section appears. Here, you can identify specific thresholds for each dashboard variable value individually. + + + +In the described example, the alert rules should be triggered when the observable data is above 70. (values in the ranges from below 30, above 30, above 60, and below 70 are allowed). + +For only one device with the name **Tampa South 124**, the allowed range is below 30. Any value above 30 triggers the alert rule. + ## Multi-frames The Business Engine supports multi-frame data sets. That means that the alert rule assigned to a dashboard and panel will be applied to all data frames fetched from the connected data source. @@ -102,4 +137,4 @@ The Business Engine supports multi-frame data sets. That means that the alert ru Support of Grafana transformation is in beta state. This is due to the number of existing transformations. ::: -Grafana transformations are supported. However, please, note, that Grafana offers a large number of transformations, hence, there is a chance that some of them will not work correctly. +Grafana transformations are supported. However, please note that Grafana offers many transformations; hence, there is a chance that some of them will not work correctly. diff --git a/big/index.mdx b/big/index.mdx index 1bf1b2c28..ac41a0b68 100644 --- a/big/index.mdx +++ b/big/index.mdx @@ -48,9 +48,17 @@ Such architecture allows users: There is a possibility of facilitating all Grafana instances version control, new Grafana dashboard propagation (for instance, from the DEV to QA to production), etc. +## Users + +The Business Studio interface accommodates two types of users - **Business** and **Technical**. You can always switch between them in profile settings (the feature is coming soon). + +- Business users have sleeker interfaces; those can be internal company users as well as customers. They can focus on creating alert rules and actions, provide a quick analysis and signal about critical errors if necessary. +- Technical users have more functionality available for deeper troubleshooting, such as payloads, Grafana data frame views, etc. Those users are not shy about working with clusters and docker containers. + ## Some features at a glance -- [Monaco Code editor to create sophisticated alert messages](/big/studio/manage-alert-actions/#add-a-new-action) +- [Use Grafana dashboard variables and overrides in the alert rule configuration](/big/alerting/manage-alert-rules/#grafana-dashboard-variables) +- [Monaco Code editor to create sophisticated alert messages](/big/studio/actions/#add-a-new-action) - [Simplified schedule configuration](/big/alerting/manage-alert-rules/#add-a-new-rule) - [Simplified connection configuration](/big/studio/manage-business-engines/#environment) - [Review Grafana data frames in the Business Studio](/big/alerting/analyze-alert-rules/#review-grafana-data-frames-in-the-business-studio) diff --git a/big/studio/manage-alert-actions.mdx b/big/studio/actions/index.mdx similarity index 95% rename from big/studio/manage-alert-actions.mdx rename to big/studio/actions/index.mdx index 8eab8b7fd..cc28f5bb6 100644 --- a/big/studio/manage-alert-actions.mdx +++ b/big/studio/actions/index.mdx @@ -7,7 +7,7 @@ import Image from "@theme/Image"; # Actions -Use the [**Actions**](/big/studio/manage-business-engines/#actions) tab to manage actions. Here you can: +Use the Actions tab to manage actions for the selected Business Engine. Here you can: 1. Add a new action. 2. Delete an existing action. diff --git a/big/studio/actions/json.mdx b/big/studio/actions/json.mdx new file mode 100644 index 000000000..c362e3862 --- /dev/null +++ b/big/studio/actions/json.mdx @@ -0,0 +1,8 @@ +--- +tags: + - Business Studio +--- + +import Image from "@theme/Image"; + +# JSON Server diff --git a/big/studio/actions/logs.mdx b/big/studio/actions/logs.mdx new file mode 100644 index 000000000..6cad0b7b4 --- /dev/null +++ b/big/studio/actions/logs.mdx @@ -0,0 +1,8 @@ +--- +tags: + - Business Studio +--- + +import Image from "@theme/Image"; + +# Logs diff --git a/big/studio/actions/node-red.mdx b/big/studio/actions/node-red.mdx new file mode 100644 index 000000000..5cb9bbe96 --- /dev/null +++ b/big/studio/actions/node-red.mdx @@ -0,0 +1,8 @@ +--- +tags: + - Business Studio +--- + +import Image from "@theme/Image"; + +# Node-RED diff --git a/big/studio/manage-business-engines.mdx b/big/studio/manage-business-engines.mdx index 02088a1ab..e86cc37b8 100644 --- a/big/studio/manage-business-engines.mdx +++ b/big/studio/manage-business-engines.mdx @@ -61,7 +61,7 @@ To learn more about alert rules, please refer to this documentation's [**Alert r The **Actions** tab helps to configure actions, which are the set of steps that are triggered by an expected event. The most common scenario is when an action is triggered after an alert rule is broken, but it is just one of the possible scenarios. -To learn more about actions, please refer to this documentation's [**Actions**](/big/studio/manage-alert-actions/) section. +To learn more about actions, please refer to this documentation's [**Actions**](/big/studio/actions/) section. ## Environment diff --git a/blog/big/2024-12-31-big-2.2.0/index.mdx b/blog/big/2024-12-31-big-2.2.0/index.mdx index c7bfbdd34..168643b2a 100644 --- a/blog/big/2024-12-31-big-2.2.0/index.mdx +++ b/blog/big/2024-12-31-big-2.2.0/index.mdx @@ -138,7 +138,7 @@ The new alert rule/edit window has the following configuration elements to speci - **Add Annotation** option. - specify **Panel** to create and attach an annotation to a panel, - specify **Dashboard** to create and attach an annotation to a dashboard (i.e. all panels of this dashboard), - - specify **Disabled** to disable the creation of any annotation following the alert rule breach. + - specify **Disabled** to disable the creation of any annotation following the triggered alert rule. ### Manage alert actions diff --git a/config/big_sidebar.ts b/config/big_sidebar.ts index 346e5786f..4efb6004e 100644 --- a/config/big_sidebar.ts +++ b/config/big_sidebar.ts @@ -22,7 +22,20 @@ const sidebars: SidebarsConfig = { { items: [ "studio/manage-business-engines", - "studio/manage-alert-actions", + { + items: [ + // "studio/actions/logs", + // "studio/actions/json", + // "studio/actions/node-red", + ], + label: "Actions", + type: "category", + link: { + type: "doc", + id: "studio/actions/index", + }, + }, + "studio/support", ], label: "Business Studio", @@ -68,6 +81,19 @@ const sidebars: SidebarsConfig = { "alerting/analyze-alert-rules", "alerting/variables", "alerting/thresholds", + { + items: [ + "alerting/datasources/postgresql", + // "alerting/datasources/prometheus", + // "alerting/datasources/loki", + ], + label: "Data Sources", + type: "category", + link: { + type: "doc", + id: "alerting/datasources/index", + }, + }, ], label: "Business Alerting", type: "category", diff --git a/static/img/big/business-alerting/bs-alert-conf-part1.png b/static/img/big/business-alerting/bs-alert-conf-part1.png new file mode 100644 index 000000000..4c978a7e1 Binary files /dev/null and b/static/img/big/business-alerting/bs-alert-conf-part1.png differ diff --git a/static/img/big/business-alerting/bs-alert-conf-part2.png b/static/img/big/business-alerting/bs-alert-conf-part2.png new file mode 100644 index 000000000..1dfa5480b Binary files /dev/null and b/static/img/big/business-alerting/bs-alert-conf-part2.png differ diff --git a/static/img/big/business-alerting/data-preview.png b/static/img/big/business-alerting/data-preview.png new file mode 100644 index 000000000..930534fbc Binary files /dev/null and b/static/img/big/business-alerting/data-preview.png differ diff --git a/static/img/big/business-alerting/exec.png b/static/img/big/business-alerting/exec.png new file mode 100644 index 000000000..be4ce37c6 Binary files /dev/null and b/static/img/big/business-alerting/exec.png differ diff --git a/static/img/big/business-alerting/execution-var-values.png b/static/img/big/business-alerting/execution-var-values.png new file mode 100644 index 000000000..184495e85 Binary files /dev/null and b/static/img/big/business-alerting/execution-var-values.png differ diff --git a/static/img/big/business-alerting/history.png b/static/img/big/business-alerting/history.png new file mode 100644 index 000000000..c579b1be1 Binary files /dev/null and b/static/img/big/business-alerting/history.png differ diff --git a/static/img/big/business-alerting/overrides.png b/static/img/big/business-alerting/overrides.png new file mode 100644 index 000000000..820767471 Binary files /dev/null and b/static/img/big/business-alerting/overrides.png differ diff --git a/static/img/big/business-alerting/postgres-grafana-dash-var.png b/static/img/big/business-alerting/postgres-grafana-dash-var.png new file mode 100644 index 000000000..055f38c95 Binary files /dev/null and b/static/img/big/business-alerting/postgres-grafana-dash-var.png differ diff --git a/static/img/big/business-alerting/postgres-grafana-timeseries.png b/static/img/big/business-alerting/postgres-grafana-timeseries.png new file mode 100644 index 000000000..83ecedded Binary files /dev/null and b/static/img/big/business-alerting/postgres-grafana-timeseries.png differ diff --git a/static/img/big/business-alerting/preview.png b/static/img/big/business-alerting/preview.png new file mode 100644 index 000000000..f14ab7999 Binary files /dev/null and b/static/img/big/business-alerting/preview.png differ diff --git a/static/img/big/platform.png b/static/img/big/platform.png index bf980cfad..3adf417f5 100644 Binary files a/static/img/big/platform.png and b/static/img/big/platform.png differ