Management of Monitoring Dashboards
TOC
Function Overview
The platform provides powerful dashboard management functionality designed to replace traditional Grafana tools, offering users a more comprehensive and flexible monitoring experience. This feature aggregates various monitoring data from within the platform, presenting a unified monitoring view that significantly enhances your configuration efficiency.
Main Features
- Supports configuring custom monitoring dashboards for both business views and platform views.
- Enables viewing publicly shared dashboards configured in platform views from business views, with data isolated based on the namespace to which the business belongs.
- Supports managing panels within the dashboard, allowing users to add, delete, modify panels, zoom in/out panels, and move panels through drag-and-drop.
- Allows setting custom variables within the dashboard for filtering query data.
- Supports configuring groups within the dashboard for managing the panels. Groups can be displayed repeatedly based on custom variables.
- Supported panel types include: trend、step line chart、bar chart、horizontal bar chart、bar gauge chart、gauge chart、table、stat chart、XY chart、pie chart、text.
- One-click import feature for Grafana dashboards.
Advantages
- Supports user-customized monitoring scenarios without being constrained by predefined templates, truly achieving a personalized monitoring experience.
- Provides a rich array of visualization options, including line charts, bar charts, pie charts, and flexible layout and styling options.
- Integrates seamlessly with the platform's role permissions, allowing business views to define their own monitoring dashboards while ensuring data isolation.
- Deep integration with various functionalities of the container platform, enabling instant access to monitoring data for containers, networks, storage, etc., providing users with comprehensive performance observation and fault diagnosis.
- Fully compatible with Grafana dashboard JSON, allowing easy migration from Grafana for continued use.
Use Cases
- IT Operations Management: As part of the IT operations team, you can use the monitoring dashboards to unify the display and management of various performance metrics of the container platform, such as CPU, memory, network traffic, etc. By customizing monitoring reports and alert rules, you can promptly detect and pinpoint system issues, enhancing operational efficiency.
- Application Performance Analysis: For application developers and testers, monitoring dashboards offer various rich visualization options to intuitively display application running states and resource consumption. You can customize dedicated monitoring views tailored to different application scenarios to deeply analyze application performance bottlenecks and provide a basis for optimization.
- Multi-Cluster Management: For users managing multiple container clusters, monitoring dashboards can aggregate monitoring data from disparate clusters, allowing you to grasp the overall operational state of the system at a glance.
- Fault Diagnosis: When a system issue occurs, monitoring dashboards provide you with comprehensive performance data and analytical tools to quickly pinpoint the root cause of the problem. You can swiftly view fluctuations in relevant monitoring metrics based on alert information for in-depth fault analysis.
Prerequisites
Currently, monitoring dashboards only support viewing monitoring data collected by monitoring components installed in the platform. Therefore, you should prepare as follows before configuring a monitoring dashboard:
- Ensure that the cluster for which you want to configure the monitoring dashboard has monitoring components installed, specifically the ACP Monitor with Prometheus or ACP Monitor with VictoriaMetrics plugin.
- Ensure that the data you wish to display on the dashboard has been collected by the monitoring components.
Relationship Between Monitoring Dashboards and Monitoring Components
- Monitoring dashboard resources are stored in the Kubernetes cluster. You can switch views between different clusters using the Cluster tab at the top.
- Monitoring dashboards depend on the monitoring components in the cluster for querying data sources. Therefore, before using monitoring dashboards, ensure that the current cluster has successfully installed monitoring components and that they are operating normally.
- The monitoring dashboard will default to requesting monitoring data from the corresponding cluster. If you install the VictoriaMetrics plugin in proxy mode in the cluster, we will request the storage cluster for you to query the corresponding data for this cluster without the need for special configuration.
Manage Dashboards
A dashboard is a collection composed of one or more panels, organized and arranged in one or more rows to provide a clear view of relevant information. These panels can query raw data from data sources and transform it into a series of visual effects supported by the platform.
Create a Dashboard
- Click Create Dashboard, reference the following instructions to configure relevant parameters.
- After adding, click Create to finish creating the dashboard. Next, you need to add variables, add panels, and add groups to complete the overall layout design.
Import Dashboard
The platform supports direct import of Grafana JSON to convert it into a monitoring dashboard for display.
- Currently, only Grafana JSON of version V8+ is supported; lower versions will be prohibited from being imported.
- If any panels within the imported dashboard are not within the platform's supported scope, they may be displayed as unsupported panel types, but you can modify the panel's settings to achieve normal display.
- After importing the dashboard, you can perform any management actions as usual, which will not differ from panels created in the platform.
Add Variables
-
In the variable form area, click Add.
-
Click OK to add one or more variables.
Add Pannels
Tip: You can customize the size of a panel by clicking the lower right corner; click anywhere on the panel to rearrange the order of the panels.
- Click Add Panel, reference the following instructions to configure relevant parameters.
-
Panel Preview: The area will dynamically display the data information corresponding to the added metrics.
-
Add Metric: Configure the panel title and monitoring metrics in this area.
-
Adding Method: Supports using built-in metrics or using natively customized metrics. Both methods will take the union and be effective simultaneously.
- Built-in Metrics: Select commonly used metrics and legend parameters built into the platform to display the data information under the current panel.
- Note: All metrics added to the panel must have a unified unit; it is not possible to add metrics with multiple units to one panel.
- Native: Customize the metric unit, metric expression, and legend parameters. The metric expression follows PromQL syntax; for details, please refer to PromQL Official Documentation.
- Built-in Metrics: Select commonly used metrics and legend parameters built into the platform to display the data information under the current panel.
-
Legend Parameters: Control the names corresponding to the curves in the panels. Text or templates can be used:
- Rule: The input value must be in the format
{{.xxxx}}; for example,{{.hostname}}will replace it with the value corresponding to the hostname label returned by the expression. - Tip: If you input an incorrectly formatted legend parameter, the names corresponding to the curves in the panel will be displayed in their original format.
- Rule: The input value must be in the format
-
Instant Switch: When the Instant switch is turned on, it will query instant values through Prometheus's Query interface and sort them, as in statistical charts and gauge charts. If off, it will use the
query_rangemethod to calculate, querying a series of data over a specific time period. -
Panel Settings: Supports selecting different panel types for visualizing metric data. Please refer to Manage Panels.
-
Click Save to complete adding the panels.
-
You can add one or more panels within the dashboard.
-
After adding the panels, you can use the following operations to ensure the display and size of the panels meet your expectations.
- Click the lower right corner of the panel to customize its size.
- Click anywhere on the panel to rearrange the order of the panels.
-
After adjusting, click the Save button on the dashboard page to save your modifications.
Add Groups
Groups are logical dividers within the dashboard that can group panels together.
- Click the Add Panel drop-down menu > Add Group, and reference the following instructions to configure relevant parameters.
- Group: The name of the group.
- Repeat: Supports disabling repeats or selecting variables for the current panels.
- Disable Repeat: Do not select a variable, and use the default created group.
- Parameter Variables: Select the variables created in the current panels, and the monitoring dashboard will generate a row of identical sub-groups for each corresponding value of the variable. Sub-groups do not support modifications, deletions, or moving of the panels.
- After adding the group, you can perform the following operations on the group to manage the panel display within the dashboard.
- Groups can be collapsed or expanded to hide part of the content in the dashboard. Panels within collapsed groups will not send queries.
- Move the panel into the group to allow that panel to be managed by that group. The group will manage all panels between it and the next group.
- When a group is folded, you can also move all panels managed by that group together.
- The folding and unfolding of groups also constitutes an adjustment to the dashboard. If you want to maintain this state when reopening this dashboard next time, please click the Save button.
Switch Dashboards
Set the created custom monitoring dashboard as the main dashboard. When re-entering the monitoring dashboard feature, the main dashboard data will be displayed by default.
-
In the left navigation bar, click Operations Center > Monitoring > Monitoring Dashboards.
-
By default, the main monitoring dashboard is entered. Click Switch Dashboard.
-
You can find dashboards by filtering through labels or searching by name, and switch main dashboards via the Main Dashboard switch.
Other Operations
You can click the operation button on the right side of the dashboard page to perform actions on the dashboard as needed.
Manage Panels
The platform provides various visualization methods to support different use cases. This chapter will mainly introduce these panel types, configuration options, and usage methods.
Panel Description
Panel Configuration Description
General Parameters
Special Parameters for Panels
Create Monitoring Dashboards via CLI
-
Create a new YAML configuration file named
example-dashboard.yaml. -
Add the MonitorDashboard resource to the YAML file and submit it. The following example creates a monitoring dashboard named demo-v2-dashboard1:
Common Functions and Variables
Common Functions
When defining query settings, besides using PromQL to set queries, the platform provides some common functions as follows for your reference in customizing query settings.
Common Variables
While defining query settings, you can combine common functions into variables to quickly define custom variables. Here are some common variable definitions available for your reference:
Variable Use Case One
Using the query_result(query) function to query the value: node_load5, and extract the IP.
-
In Query Settings, fill in
query_result(node_load5). -
In the Variable Value Preview area, the preview example is
node_load5{container="node-exporter",endpoint="metrics",host_ip="192.168.178.182",instance="192.168.178.182:9100"}. -
In Regular Expression, fill in
/.*instance="(.*?):.*/to filter the value. -
In the Variable Value Preview area, the preview example is
192.168.176.163.
Variable Use Case Two
-
Add the first variable: namespace, using the query_result(query) function to query the value:
kube_namespace_labels, and extract the namespace.-
Query Settings:
query_result(kube_namespace_labels). -
Variable Value Preview:
kube_namespace_labels{container="exporter-kube-state", endpoint="kube-state-metrics", instance="12.3.188.121:8080", job="kube-state", label_cpaas_io_project="cpaas-system", namespace="cert-manager", pod="kube-prometheus-exporter-kube-state-55bb6bc67f-lpgtx", project="cpaas-system", service="kube-prometheus-exporter-kube-state"}. -
Regular Expression:
/.+namespace=\"(.*?)\".*/. -
In the Variable Value Preview area, the preview example includes multiple namespaces such as
argocd,cpaas-system, and more.
-
-
Add the second variable: deployment, and reference the variable created earlier:
-
Query Settings:
kube_deployment_spec_replicas{namespace=~"$namespace"}. -
Regular Expression:
/.+deployment="(.*?)",.*/.
-
-
Add a panel to the current dashboard and reference the previously added variables, for example:
-
Metric Name: pod Memory Usage under Compute Components.
-
Key-Value Pair:
kind:Deployment,name:$deployment,namespace:$namespace.
-
-
Once you have added the panels and saved them, you can view the corresponding panel information on the dashboard homepage.
Notes When Using Built-in Metrics
The following metrics use custom variables namespace, name, and kind, which do not support multiple selections or selecting all.
namespaceonly supports selecting a specific namespace;nameonly supports three types of computing components:deployment,daemonset,statefulset;kindonly supports specifying one of the types:Deployment,DaemonSet,StatefulSet.
-
workload.cpu.utilization -
workload.memory.utilization -
workload.network.receive.bytes.rate -
workload.network.transmit.bytes.rate -
workload.gpu.utilization -
workload.gpu.memory.utilization -
workload.vgpu.utilization -
workload.vgpu.memory.utilization