Skip to main content
The database provides a monitor and alert solution by using Prometheus and Grafana. This allows you to visualize the running of your cluster, facilitating monitoring and troubleshooting.

Overview

The database provides a Prometheus-compatible information collection interface. Prometheus can retrieve metric information of the database by connecting to the HTTP ports of BE and FE nodes and storing the information in its own time-series database. Grafana can then use Prometheus as a data source to visualize the metric information. By using the dashboard templates provided by the database, you can easily monitor your cluster and set alerts for it with Grafana. MA-1 Follow these steps to integrate your cluster with Prometheus and Grafana:
  1. Install necessary components - Prometheus and Grafana.
  2. Understand the core monitoring metrics of the database.
  3. Set alert channel and alert rule.

Step 1: Install Monitoring Components

The default ports of Prometheus and Grafana do not conflict with those of the database. However, it is recommended to deploy them on a different server from that of your clusters for production. This reduces the risk of resource conflicts and avoids potential alert failure due to the server’s abnormal shutdown. Additionally, please note that Prometheus and Grafana cannot monitor their own service’s availability. Therefore, in a production environment, it is recommended to use Supervisor to set up a heartbeat service for them. The following tutorial deploys monitoring components on the monitoring node (IP: 192.168.110.23) using the root OS user. They monitor the following cluster (which uses default ports). When setting up a monitoring service for your own cluster based on this tutorial, you only need to replace the IP addresses.
NOTE Prometheus and Grafana can only monitor FE, BE, and CN nodes, not Broker nodes.

1.1 Deploy Prometheus

1.1.1 Download Prometheus

For the database, you only need to download the installation package of the Prometheus server. Download the package to the monitoring node. Click here to download Prometheus. Take the LTS version v2.45.0 as an example, click the package to download it. MA-2 Alternatively, you can download it using the wget command:
After the download is complete, upload or copy the installation package to the directory /opt on the monitoring node.

1.1.2 Install Prometheus

  1. Navigate to /opt and decompress the Prometheus installation package.
  2. For ease of management, rename the decompressed directory to prometheus.
  3. Create a data storage path for Prometheus.
  4. For ease of management, you can create a system service startup file for Prometheus.
    Add the following content to the file:
    Then, save and exit the editor.
    NOTE If you deploy Prometheus under a different path, please make sure to synchronize the path in the ExecStart command in the file above. Additionally, the file configures the expiration conditions for Prometheus data storage to be “30 days or more” or “greater than 30 GB”. You can modify this according to your needs.
  5. Modify the Prometheus configuration file prometheus/prometheus.yml. This file has strict requirements for the format of the content. Please pay special attention to spaces and indentation when making modifications.
    Add the following content to the file:
    Note Please note that Prometheus is unable to detect the service changes (targets) after the cluster has been scaled in or out. For example, for clusters deployed on AWS, you can grant the EC2 instance that hosts the Prometheus service the ec2:DescribeInstances and ec2:DescribeTags permissions, and add the ec2_sd_configs and relabel_configs properties to prometheus/prometheus.yml. For detailed instructions, see Appendix - Enable Service Detection for Prometheus. After you have modified the configuration file, you can use promtool to verify whether the modification is valid.
    The following prompt indicates that the check has passed. You can then proceed.
  6. Start Prometheus.
  7. Check the status of Prometheus.
    If Active: active (running) is returned, it indicates that Prometheus has started successfully. You can also use netstat to check the status of the default Prometheus port (9090).
  8. Set Prometheus to start on boot.
Other commands:
  • Stop Prometheus.
  • Restart Prometheus.
  • Reload configurations on runtime.
  • Disable start on boot.

1.1.3 Access Prometheus

You can access the Prometheus Web UI through a browser, and the default port is 9090. For the monitoring node in this tutorial, you need to visit 192.168.110.23:9090. On the Prometheus homepage, navigate to Status —> Targets in the top menu. Here, you can see all the monitored nodes for each group job configured in the prometheus.yml file. Usually, the status of all nodes should be UP, indicating that the service communication is normal. MA-3 At this point, Prometheus is configured and set up. For more detailed information, you can refer to the Prometheus Documentation.

1.2 Deploy Grafana

1.2.1 Download Grafana

Click here to download Grafana. Alternatively, you can use the wget command to download the Grafana RPM installation package.

1.2.2 Install Grafana

  1. Use the yum command to install Grafana. This command will automatically install the dependencies required for Grafana.
  2. Start Grafana.
  3. Check the status of Grafana.
    If Active: active (running) is returned, it indicates that Grafana has started successfully. You can also use netstat to check the status of the default Grafana port (3000).
  4. Set Grafana to start on boot.
Other commands:
  • Stop Grafana.
  • Restart Grafana.
  • Disable start on boot.
For more information, refer to the Grafana Documentation.

1.2.3 Access Grafana

You can access the Grafana Web UI through a browser, and the default port is 3000. For the monitoring node in this tutorial, you need to visit 192.168.110.23:3000. The default username and password required for login are both set to admin. Upon the initial login, Grafana will prompt you to change the default login password. If you want to skip this for now, you can click Skip. Then, you will be re-directed to the Grafana Web UI homepage. MA-4

1.2.4 Configure data sources

Click on the menu button in the upper-left corner, expand Administration, and then click Data sources. MA-5 On the page that appears, click Add data source, and then choose Prometheus. MA-6 MA-7 To integrate Grafana with your Prometheus service, you need to modify the following configuration:
  • Name: The name of the data source. You can customize the name for the data source. MA-8
  • Prometheus Server URL: The URL of the Prometheus server, which, in this tutorial, is http://192.168.110.23:9090. MA-9
After the configuration is complete, click Save & Test to save and test the configuration. If Successfully queried the Prometheus API is displayed, it means the data source is accessible. MA-10

1.2.5 Configure Dashboard

  1. Download the corresponding Dashboard template based on your version.
    NOTE The template file needs to be uploaded through the Grafana Web UI. Therefore, you need to download the template file to the machine you use to access Grafana, not the monitoring node itself.
  2. Configure the Dashboard template. Click on the menu button in the upper-left corner and click Dashboards. MA-11 On the page that appears, expand the New button and click Import. MA-12 On the new page, click on Upload Dashboard JSON file and upload the template file you downloaded earlier. MA-13 After uploading the file, you can rename the Dashboard. By default, it is named StarRocks Overview. Then, select the data source, which is the one you created earlier (starrocks_monitor). Then, click Import. MA-14 After the import is complete, you should see the database Dashboard displayed. MA-15

1.2.6 Monitor the database via Grafana

Log in to the Grafana Web UI, click on the menu button in the upper-left corner, and click Dashboards. MA-16 On the page that appears, select the database Overview from the General directory. MA-17 After you enter the database monitoring Dashboard, you can manually refresh the page in the upper-right corner or set the automatic refresh interval for monitoring the cluster status. MA-18

Step 2: Understand the core monitoring metrics

To accommodate the needs of development, operations, DBA, and more, the database provides a wide range of monitoring metrics. This section only introduces some important metrics commonly used in business and their alert rules. For other metric details, please refer to Monitoring Metrics.

2.1 Metrics for FE and BE status

2.2 Metrics for query failure

2.3 Metrics for external operation failure

2.4 Metrics for internal operation failure

2.5 Metrics for service availability

2.6 Metrics for system load

Step 3: Configure alert via Email

3.1 Configure SMTP service

Grafana supports various alerting solutions, such as email and webhooks. This tutorial uses email as an example. To enable email alerting, you first need to configure SMTP information in Grafana, allowing Grafana to send emails to your mailbox. Most commonly used email providers support SMTP services, and you need to enable SMTP service for your email account and obtain an authorization code. After completing these steps, modify the Grafana configuration file on the node where Grafana is deployed.
Example:
You need to modify the following configuration items:
  • enabled: Whether to allow Grafana to send email alerts. Set this item to true.
  • host: The SMTP server address and port for your email, separated by a colon (:). Example: smtp.gmail.com:465.
  • user: SMTP username.
  • password: The authorization password obtained after enabling SMTP.
  • skip_verify: Whether to skip SSL verification for the SMTP server. Set this item to true.
  • from_address: The email address used to send alert emails.
After the configuration is complete, restart Grafana.

3.2 Create alert channel

You need to create an alert channel (Contact Point) in Grafana to specify how to notify contacts when an alert is triggered.
  1. Log in to the Grafana Web UI, click on the menu button in the upper-left corner, expand Alerting, and select Contact Points. On the Contact points page, click Add contact point to create a new alert channel. MA-19
  2. In the Name field, customize the name of the contact point. Then, in the Integration dropdown list, select Email. MA-20
  3. In the Addresses field, enter the email addresses of the contacts to receive the alert. If there are multiple email addresses, separate the addresses using semicolons (;), commas (,), or line breaks. The configurations on the page can be left with their default values except for the following two items:
    • Single email: When enabled, if there are multiple contacts, the alert will be sent to them through a single email. It’s recommended to enable this item.
    • Disable resolved message: By default, when the issue causing the alert is resolved, Grafana sends another notification notifying the service recovery. If you don’t need this recovery notification, you can disable this item. It’s not recommended to disable this option.
  4. After the configuration is complete, click the Test button in the upper-right corner of the page. In the prompt that appears, click Sent test notification. If your SMTP service and address configuration are correct, the target email account should receive a test email with the subject “TestAlert Grafana”. Once you confirm that you can receive the test alert email successfully, click the Save contact point button at the bottom of the page to complete the configuration. MA-21 MA-22
You can configure multiple notification methods for each contact point through “Add contact point integration”, which will not be detailed here. For more details about Contact Points, you can refer to the Grafana Documentation For subsequent demonstration, let’s assume that in this step, you have created two contact points, “StarRocksDev” and “StarRocksOp”, using different email addresses.

3.3 Set notification policies

Grafana uses notification policies to associate contact points with alert rules. Notification policies use matching labels to provide a flexible way to route different alerts to different contacts, allowing for alert grouping during O&M.
  1. Log in to the Grafana Web UI, click on the menu button in the upper-left corner, expand Alerting, and select Notification policies. MA-23
  2. On the Notification policies page, click the more (…) icon to the right of Default policy and click Edit to modify the Default policy. MA-24 MA-25 Notification policies use a tree-like structure, and the Default policy represents the default root policy for notification. When no other policies are set, all alert rules will default to matching this policy. It will then use the default contact point configured within it for notifications.
    1. In the Default contact point field, select the contact point you created previously, for example, “StarRocksOp”.
    2. Group by is a key concept in Grafana Alerting, grouping alert instances with similar characteristics into a single funnel. This tutorial does not involve grouping, and you can use the default setting. MA-26
    3. Expand the Timing options field and configure Group wait, Group interval, and Repeat interval.
      • Group wait: The time waiting for the initial notification to send after the new alert creates a new group. Default 30 seconds.
      • Group interval: The interval at which alerts are sent for an existing group. Defaults to 5 minutes, which means that notifications will not be sent to this group any sooner than 5 minutes since the previous alert was sent. This means that notifications will not be sent any sooner than 5 minutes (default) since the last batch of updates were delivered, regardless of whether the alert rule interval for those alert instances was lower. Default 5 minutes.
      • Repeat interval: The waiting time to resend an alert after they have successfully been sent. The interval at which alerts are sent for an existing group. Defaults to 5 minutes, which means that notifications will not be sent to this group any sooner than 5 minutes since the previous alert was sent.
      You can configure the parameters as shown below so that Grafana will send the alert by these rules: 0 seconds (Group wait) after the alert conditions are met, Grafana will send the first alert email. After that, Grafana will re-send the alert every 1 minute (Group interval + Repeat interval). MA-27
      NOTE The previous paragraph uses “meeting the alert conditions” rather than “reaching the alert threshold” to avoid false alerts. It’s recommended to set the alert to be triggered a certain duration of time after the threshold has been reached.
  3. After the configuration is complete, click Update default policy.
  4. If you need to create a nested policy, click on New nested policy on the Notification policies page. Nested policies use labels to define matching rules. The labels defined in a nested policy can be used as conditions to match when configuring alert rules later. The following example configures a label as Group=Development_team. MA-28 In the Contact point field, select “StarRocksDev”. This way, when configuring alert rules with the label Group=Development_team, “StarRocksDev” is set to receive the alerts. You can have the nested policy inherit the timing options from the parent policy. After the configuration is complete, click Save policy to save the policy. MA-29
If you are interested in the details of notification policies or if your business has more complex alerting scenarios, you can refer to the Grafana Documentation for more information.

3.4 Define alert rules

After setting up notification policies, you also need to define alert rules for the database. Log in to the Grafana Web UI, and search for and navigate to the previously configured the database Overview Dashboard. MA-30 MA-31

3.4.1 FE and BE status alert rule

For a cluster, the status of all FE and BE nodes must be alive. Any node with a status of DEAD should trigger an alert. The following example uses the Frontends Status and Backends Status metrics under the database Overview to monitor FE and BE status. As you can configure multiple clusters in Prometheus, note that the Frontends Status and Backends Status metrics are for all clusters that you have registered.
Configure the alert rule for FE
Follow these procedures to configure alerts for Frontends Status:
  1. Click on the More (…) icon to the right of the Frontends Status monitoring item, and click Edit. MA-32
  2. On the new page, choose Alert, then click Create alert rule from this panel to enter the rule creation page. MA-33
  3. Set the rule name in the Rule name field. The default value is the title of the monitoring metric. If you have multiple clusters, you can add the cluster name as a prefix for differentiation, for example, “[PROD]Frontends Status”. MA-34
  4. Configure the alert rule as follows.
    1. Choose Grafana managed alert.
    2. For section B, modify the rule as (up{group="fe"}).
    3. Click on the delete icon on the right of section A to remove section A.
    4. For section C, modify the Input field to B.
    5. For section D, modify the condition to IS BELOW 1.
    After completing these settings, the page will appear as shown below: MA-35
Click to view detailed instructions Configuring alert rules in Grafana typically involves three steps:
  1. Retrieve the metric values from Prometheus through PromQL queries. PromQL is a data query DSL language developed by Prometheus, and it is also used in the JSON templates of Dashboards. The expr property of each monitoring item corresponds to the respective PromQL. You can click Run queries on the rule settings page to view the query results.
  2. Apply functions and modes to process the result data from the above queries. Usually, you need to use the Last function to retrieve the latest value and use Strict mode to ensure that if the returned value is non-numeric data, it can be displayed as NaN.
  3. Set rules for the processed query results. Taking FE as an example, if the FE node status is alive, the output result is 1. If the FE node is down, the result is 0. Therefore, you can set the rule to IS BELOW 1, meaning an alert will be triggered when this condition occurs.
  4. Set up alert evaluation rules. According to the Grafana documentation, you need to configure the frequency for evaluating alert rules and the frequency at which their status changes. In simple terms, this involves configuring “how often to check with the alert rules” and “how long the abnormal state must persist after detection before triggering the alert (to avoid false alerts caused by transient spikes)”. Each Evaluation group contains an independent evaluation interval to determine the frequency of checking the alert rules. You can create a new folder named PROD specifically for the database production cluster and create a new Evaluation group 01 within it. Then, configure this group to check every 10 seconds, and trigger the alert if the anomaly persists for 30 seconds. MA-36
    NOTE The previously mentioned “Disable resolved message” option in the alert channel configuration section, which controls the timing of sending emails for cluster service recovery, is also influenced by the “Evaluate every” parameter above. In other words, when Grafana performs a new check and detects that the service has recovered, it sends an email to notify the contacts.
  5. Add alert annotations. In the Add details for your alert rule section, click Add annotation to configure the content of the alert email. Please note not to modify the Dashboard UID and Panel ID fields. MA-37 In the Choose drop-down list, select Description, and add the descriptive content for the alert email, for example, “FE node in your database production cluster failed, please check!”
  6. Match notification policies. Specify the notification policy for the alert rule. By default, all alert rules match the Default policy. When the alert condition is met, Grafana will use the “StarRocksOp” contact point in the Default policy to send alert messages to the configured email group. MA-38 If you want to use a nested policy, set the Label field to the corresponding nested policy, for example, Group=Development_team. Example: MA-39 When the alert condition is met, emails will be sent to “StarRocksDev” instead of “StarRocksOp” in the Default policy.
  7. Once all configurations are complete, click Save rule and exit. MA-40
Test alert trigger
You can manually stop an FE node to test the alert. At this point, the heart-shaped symbol to the right of Frontends Status will change from green to yellow and then to red. Green: Indicates that during the last periodic check, the status of each instance of the metric item was normal, and no alert was triggered. The green status does not guarantee that the current node is in normal status. There may be a delay in status change after a node service anomaly, but typically, the delay is not in the order of minutes. MA-41 Yellow: Indicates that during the last periodic check, an instance of the metric item was found abnormal, but the abnormal state duration has not yet reached the “Duration” configured above. At this point, Grafana will not send an alert and will continue periodic checks until the abnormal state duration reaches the configured “Duration”. During this period, if the status is restored, the symbol will change back to green. MA-42 Red: When the abnormal state duration reaches the configured “Duration”, the symbol changes to red, and Grafana will send an email alert. The symbol will remain red until the abnormal state is resolved, at which point it will change back to green. MA-43
Manually pause Alerts
Suppose the anomaly requires an extended period for resolution or the alerts are continuously triggered for some reasons other than anomaly. You can temporarily pause the evaluation of the alert rule to prevent Grafana from persistently sending alert emails. Navigate to the Alert tab corresponding to the metric item on the Dashboard and click the edit icon: MA-44 In the Alert Evaluation Behavior section, toggle the Pause Evaluation switch to the ON position. MA-45
NOTE After pausing the evaluation, you will receive an email notifying you that the service is restored.
Configure the alert rule for BE
You can follow the above process to configure alert rules for BE. Editing the configuration for the metric item Backends Status:
  1. In the Set an alert rule name section, configure the name as “[PROD]Backends Status”.
  2. In the Set a query and alert condition section, set PromSQL to (up{group="be"}), and use the same settings as those in the FE alert rule for other items.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “BE node in your database production cluster failed, please check! Stack information for BE failure will be printed in the BE log file be.out. You can identify the cause based on the logs”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.

3.4.2 Query alert rule

The metric item for query failures is Query Error under Query Statistic. Configure the alert rule for the metric item “Query Error” as follows:
  1. In the Set an alert rule name section, configure the name as “[PROD] Query Error”.
  2. In the Set a query and alert condition section, remove section B. Set Input in section A to C. In section C, use the default value for PromQL, which is rate(starrocks_fe_query_err{job="StarRocks_Cluster01"}[1m]), representing the number of failed queries per minute divided by 60s. This includes both failed queries and queries that exceeded the timeout limit. Then, in section D, configure the rule as A IS ABOVE 0.05.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “High query failure rate, please check the resource usage or configure query timeout reasonably. If queries are failing due to timeouts, you can adjust the query timeout by setting the system variable query_timeout”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.

3.4.3 User operation failure alert rule

This item monitors the rate of Schema Change operation failures, corresponding to the metric item Schema Change under BE tasks. It should be configured to alert when greater than 0.
  1. In the Set an alert rule name section, configure the name as “[PROD] Schema Change”.
  2. In the Set a query and alert condition section, remove section A. Set Input in section C to B. In section B, use the default value for PromQL, which is irate(starrocks_be_engine_requests_total{job="StarRocks_Cluster01", type="create_rollup", status="failed"}[1m]), representing the number of failed Schema Change tasks per minute divided by 60s. Then, in section D, configure the rule as C IS ABOVE 0.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “Failed Schema Change tasks detected, please check promptly. You can increase the memory limit available for Schema Change by adjusting the BE configuration parameter memory_limitation_per_thread_for_schema_change, which is set to 2GB by default”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.

3.4.4 the database operation failure alert rule

BE Compaction Score
This item corresponds to BE Compaction Score under Cluster Overview, and is used to monitor the compaction pressure on the cluster.
  1. In the Set an alert rule name section, configure the name as “[PROD] BE Compaction Score”.
  2. In the Set a query and alert condition section, configure the rule in section C as B IS ABOVE 0. You can use default values for other items.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “High compaction pressure. Please check whether there are high-frequency or high concurrency loading tasks and reduce the loading frequency. If the cluster has sufficient CPU, memory, and I/O resources, consider adjusting the cluster compaction strategy”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.
Clone
This item corresponds to Clone in BE tasks and is mainly used to monitor replica balancing or replica repair operations within the database, which usually should not fail.
  1. In the Set an alert rule name section, configure the name as “[PROD] Clone”.
  2. In the Set a query and alert condition section, remove section A. Set Input in section C to B. In section B, use the default value for PromQL, which is irate(starrocks_be_engine_requests_total{job="StarRocks_Cluster01", type="clone", status="failed"}[1m]), representing the number of failed Clone tasks per minute divided by 60s. Then, in section D, configure the rule as C IS ABOVE 0.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “Detected a failure in the clone task. Please check the cluster BE status, disk status, and network status”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.

3.4.5 Service availability alert rule

This item monitors the metadata log count in BDB, corresponding to the Meta Log Count monitoring item under Cluster Overview.
  1. In the Set an alert rule name section, configure the name as “[PROD] Meta Log Count”.
  2. In the Set a query and alert condition section, configure the rule in section C as B IS ABOVE 100000. You can use default values for other items.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “Detected that the metadata count in FE BDB is significantly higher than the expected value, which can indicate a failed Checkpoint operation. Please check whether the Xmx heap memory configuration in the FE configuration file fe.conf is reasonable”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.

3.4.6 System overload alert rule

BE CPU Idle
This item monitors the CPU idle rate on BE nodes.
  1. In the Set an alert rule name section, configure the name as “[PROD] BE CPU Idle”.
  2. In the Set a query and alert condition section, configure the rule in section C as B IS BELOW 10. You can use default values for other items.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “Detected that BE CPU load is consistently high. It will impact other tasks in the cluster. Please check whether the cluster is abnormal or if there is a CPU resource bottleneck”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.
BE Memory
This item corresponds to BE Mem under BE, monitoring the memory usage on BE nodes.
  1. In the Set an alert rule name section, configure the name as “[PROD] BE Mem”.
  2. In the Set a query and alert condition section, configure PromSQL as starrocks_be_process_mem_bytes{job="StarRocks_Cluster01"}/(<be_mem_limit>*1024*1024*1024), where <be_mem_limit> needs to be replaced with the current BE node’s available memory limit, that is, the server’s memory size multiplied by the value of the BE configuration item mem_limit. Example: starrocks_be_process_mem_bytes{job="StarRocks_Cluster01"}/(49*1024*1024*1024). Then, in section C, configure the rule as B IS ABOVE 0.9.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “Detected that BE memory usage is consistently high. To prevent query failure, please consider expanding memory size or adding BE nodes”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.
Disks Avail Capacity
This item corresponds to Disk Usage under BE, monitoring the remaining space ratio in the directory where the BE storage path is located.
  1. In the Set an alert rule name section, configure the name as “[PROD] Disks Avail Capacity”.
  2. In the Set a query and alert condition section, configure the rule in section C as B`` IS BELOW 0.2. You can use default values for other items.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “Detected that BE disk available space is below 20%, please release disk space or expand the disk”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.
FE JVM Heap Stat
This item corresponds to Cluster FE JVM Heap Stat under Overview, monitoring the proportion of FE’s JVM memory usage to FE heap memory limit.
  1. In the Set an alert rule name section, configure the name as “[PROD] FE JVM Heap Stat”.
  2. In the Set a query and alert condition section, configure the rule in section C as B IS ABOVE 80. You can use default values for other items.
  3. In the Alert evaluation behavior section, choose the PROD directory and Evaluation group 01 created earlier, and set the duration to 30 seconds.
  4. In the Add details for your alert rule section, click Add annotation, select Description, and input the alert content, for example, “Detected that FE heap memory usage is high, please adjust the heap memory limit in the FE configuration file fe.conf”.
  5. In the Notifications section, configure Labels the same as the FE alert rule. If Labels are not configured, Grafana will use the Default policy and send alert emails to the “StarRocksOp” alert channel.

Appendix

Enable Service Detection for Prometheus

You can enable Service Detection for Prometheus so that it can automatically detect the services (nodes) after the cluster is scaled in or out. Note The following section uses AWS as an example.
  1. Grant the EC2 instance that hosts your Prometheus service the following permissions using IAM Policy:
    For detailed instructions of authentication to AWS resources, see Authenticate to AWS resources. With these permissions, Prometheus is able to list the instances and their tags in the region.
  2. Add the ec2_sd_configs and relabel_configs sections to prometheus/prometheus.yml. Example:

Q&A

Q: Why can’t the Dashboard detect anomalies?

A: Grafana Dashboard relies on the system time of the server it is hosted on to fetch values for monitoring items. If the Grafana Dashboard page remains unchanged after a cluster anomaly, you can check if the servers’ system clock is synchronized and then perform cluster time calibration.

Q: How can I implement alert grading?

A: Taking the Query Error item as an example, you can create two alert rules for it with different alert thresholds. For example:
  • Risk Level: Set the failure rate greater than 0.05, indicating a risk. Send the alert to the development team.
  • Severity Level: Set the failure rate greater than 0.20, indicating a severity. At this point, the alert notification will be sent to both the development and operations teams simultaneously.

Q: How can I retrieve more detailed metrics, including table-level metrics, materialized view metrics, and connection statistics with user labels?

A: By default, the /metrics endpoint collects metrics in a minified mode to minimize performance impact. To retrieve detailed metrics, you need to add specific parameters to the request and provide Basic Authentication credentials for a user with ADMIN privileges. Supported Parameters:
  • with_table_metrics=all: Collects all table-level metrics.
  • with_materialized_view_metrics=all: Collects all materialized view metrics.
  • with_user_connections=all: Collects connection statistics categorized by user labels.
Authentication Requirement: These parameters take effect only when the request includes valid Basic Authentication credentials for an ADMIN user. If the request is anonymous or the user lacks ADMIN privileges, these parameters are ignored, and only default metrics are returned. Example Curl Command:
Prometheus Configuration Example: To enable detailed metric collection in Prometheus, configure params and basic_auth in your prometheus.yml:
Note Collecting all table and materialized view metrics may increase the load on the FE node. Use these parameters with caution in large-scale environments.