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.
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:
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.
Parameter | Description |
---|---|
Folder | The folder where the dashboard resides; you can input or select an existing folder. |
Label | Label for the monitoring dashboard; you can quickly find existing dashboards by filtering through the top labels during the switch. |
Set as Main Dashboard | If enabled, this will set the current dashboard as the main dashboard upon successful creation; when re-entering the monitoring dashboard feature, the main dashboard data will be displayed by default. |
Variables | Add variables when creating the dashboard to reference as metric parameters in the added panels, which can also be used as filters on the dashboard homepage. |
The platform supports direct import of Grafana JSON to convert it into a monitoring dashboard for display.
Query
Variables of type Query
allow you to filter data based on the feature dimensions of time series. The query expression can be specified to dynamically calculate and generate query results.
Parameter | Description |
---|---|
Query Settings | When defining query settings, besides using PromQL to query time series, the platform also provides some common variables and functions. Reference Common Functions and Variables. |
Regular Expression | By using regular expressions, you can filter out the desired values from the content returned by the variable queries. This makes each option name in the variable more expected. You can preview if the filtered values meet expectations in Variable Value Preview. |
Selection Settings | - Multiple Selection: When selected from the top filters on the dashboard homepage, allows the selection of multiple options simultaneously. You need to reference this variable in the query expression of the panels to view the data corresponding to the variable value. - All: If checked, an option containing All will be enabled in the filter options to select all variable data. |
Constant
Constant Variables are static variables with fixed values that remain unchanged throughout the dashboard, commonly used for storing environment identifiers, fixed thresholds, or configuration parameters that need to be referenced across multiple panels without displaying as filter options.
Parameter | Description |
---|---|
Constant Value | The value of the constant variable. |
Custom
Custom Variables allow users to define a predefined list of static options that appear as dropdown filters on the dashboard, commonly used for manual selection of specific services, teams, or categories without requiring dynamic data queries.
Parameter | Description |
---|---|
Custom Settings | Enter option values separated by commas, using the format display_name : value for each option (e.g., Production : prod, Staging : stage, Development : dev), or simply list values directly if display name equals value. |
Textbox
Textbox Variables are variables that allow users to enter text directly, commonly used for specifying specific values or parameters that do not require dynamic data queries.
Parameter | Description |
---|---|
Textbox Value | The default value of the textbox variable. |
Add multiple panels to the currently created monitoring dashboard to display data information for different resources.
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.
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.
Legend Parameters: Control the names corresponding to the curves in the panels. Text or templates can be used:
{{.xxxx}}
; for example, {{.hostname}}
will replace it with the value corresponding to the hostname label returned by the expression.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_range
method 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.
After adjusting, click the Save button on the dashboard page to save your modifications.
Groups are logical dividers within the dashboard that can group panels together.
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.
You can click the operation button on the right side of the dashboard page to perform actions on the dashboard as needed.
Operation | Description |
---|---|
YMAL | Opens the actual CR resource code of the dashboard stored in the Kubernetes cluster. You can modify all content in the dashboard by editing parameters in the YAML. |
Export Expression | You can export the metrics and corresponding query expressions used in the current dashboard in CSV format. |
Copy | Copies the current dashboard; you can edit the panels as needed and save it as a new dashboard. |
Settings | Modifies the basic information of the current dashboard, such as changing labels and adding more variables. |
Delete | Deletes the current monitoring dashboard. |
The platform provides various visualization methods to support different use cases. This chapter will mainly introduce these panel types, configuration options, and usage methods.
No. | Panel Name | Description | Suggested Use Cases |
---|---|---|---|
1 | Trend Chart | Displays the trend of data over time via one or more line segments. | Shows trends over time, such as changes in CPU utilization, memory usage, etc. |
2 | Step Line Chart | Builds on the line chart by connecting data points with horizontal and vertical segments to form a step-like structure. | Suitable for displaying the timestamps of discrete events, such as the number of alerts. |
3 | Bar Chart | Uses vertical rectangular bars to represent the magnitude of data, where the height of the bars represents value. | Bar charts are intuitive for comparing value differences, beneficial for discovering patterns and anomalies, suitable for scenarios focusing on value changes, such as the number of pods, number of nodes, etc. |
4 | Horizontal Bar Chart | Similar to the bar chart but uses horizontal rectangular bars to represent data. | When there are many data dimensions, horizontal bar charts can better utilize spatial layout and improve readability. |
5 | Gauge Chart | Uses half or ring shapes to represent the current value of an indicator and its proportion of the total. | Intuitively reflects the current status of key monitoring indicators, such as system CPU utilization and memory usage. It is recommended to use alert thresholds with color changes to indicate abnormal conditions. |
6 | Gauge Bar Chart | Uses vertical rectangular bars to display the current value of indicators and their proportion. | Intuitively reflects the current status of key indicators, such as target completion progress and system load. When multiple categories of the same indicator exist, the gauge bar chart is more recommended, such as available disk space or utilization. |
7 | Pie Chart | Uses sectors to display the proportional relationship of parts to the whole. | Suitable for demonstrating the composition of overall data across different dimensions, such as the proportions of 4XX, 3XX, and 2XX response codes over a period. |
8 | Table | Organizes data in a row-column format, making it easy to view and compare specific values. | Suitable for displaying structured multi-dimensional data, such as detailed information of nodes, detailed information of pods, etc. |
9 | Stat Chart | Displays the current value of a single key indicator, typically requiring textual explanation. | Suitable for showing real-time values of important monitoring indicators, such as numbers of pods, number of nodes, current alert count, etc. |
10 | Scatter Plot | Uses Cartesian coordinates to plot a series of data points, reflecting the correlation between two variables. | Suitable for analyzing relationships between two indicators, discovering patterns such as linear correlation and clustering through the distribution of data points, helping unearth relationships between metrics. |
11 | Text Card | Displays key textual information in a card format, usually containing a title and a brief description. | Suitable for presenting textual information, such as panel descriptions and troubleshooting explanations. |
Parameter | Description |
---|---|
Basic Information | Select the appropriate panel type based on the selected metric data and add titles and descriptions; you can add one or more links, which can be quickly accessed by selecting the corresponding link name next to the title. |
Standard Settings | Units used for native metric data. Additionally, gauge charts and gauge bars also support configuring the Total Value field, which will display as the percentage of Current Value/Total Value in the chart. |
Tooltips | Tooltips are the display switch for real-time data when hovering over the panels and support selected sorting. |
Threshold Parameters | Configure the threshold switch for the panels; when enabled, the threshold will be shown in selected colors in the panels, allowing for threshold sizing. |
Value | Set the calculation method for values, such as the most recent value or minimal value. This configuration option is only applicable to stat charts and gauge charts. |
Value Mapping | Redefine specified values, ranges,regex or special such as defining 100 as full load. This configuration option is only applicable to stat charts, tables, and gauge charts. |
Panel Type | Parameter | Description |
---|---|---|
Trend Chart | Graph Style | You can choose between a line chart or an area chart as the display style; line charts focus more on reflecting the trend changes of indicators, while area charts draw more attention to changes in total and partial proportions. Choose based on your actual needs. |
Gauge Chart | Gauge Chart Settings | Show Direction: When you need to view multiple metrics in a single chart, you can set whether these metrics are arranged horizontally or vertically. Unit Redefinition: You can set independent units for each metric; if not set, the platform will display units from the Standard Settings. |
Stat Chart | Stat Chart Settings | Show Direction: When you need to view multiple metrics in a single chart, you can set whether these metrics are arranged horizontally or vertically. Graph Mode: You can add a graph to the stat chart to display the trend of the metric over time. |
Pie Chart | Pie Chart Settings | Maximum Number of Slices: You can set this parameter to reduce the number of slices in the pie chart to lessen the interference of categories with comparatively low proportions but high quantities. Excess slices will be merged and displayed as Others. Label Display Fields: You can set the fields displayed in the pie chart labels. |
Pie Chart | Graph Style | You can choose either pie or donut as the display style. |
Table | Table Settings | Hide Columns: You can reduce the number of columns in the table with this parameter to focus on some primary column information. Column Alignment: You can modify the alignment of data within the column using this parameter. Display Name and Unit: You can modify the column names and units used through this parameter. |
Text Card | Graph Style | Style: You can choose to edit the content you wish to display in the text card in either a rich-text editing box or HTML. |
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:
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.
Function | Purpose |
---|---|
label_names() | Returns all labels in Prometheus, e.g., label_names(). |
label_values(label) | Returns all selectable values for the label name in all monitored metrics in Prometheus, e.g., label_values(job). |
label_values(metric, label) | Returns all selectable values for the label name in the specified metric in Prometheus, e.g., label_values(up, job). |
metrics(metric) | Returns all metric names that satisfy the defined regex pattern in the metric field, e.g., metrics(cpaas_active). |
query_result(query) | Returns the query result for the specified Prometheus query, e.g., query_result(up). |
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 Name | Query Function | Regular Expression |
---|---|---|
cluster | label_values(cpaas_cluster_info,cluster) | - |
node | label_values(node_load1, instance) | /(.*?):.*/ |
namespace | query_result(kube_namespace_labels) | /.*namespace=\"(.*?)\".*/ |
deployment | label_values(kube_deployment_spec_replicas{namespace="$namespace"}, deployment) | - |
daemonset | label_values(kube_daemonset_status_number_ready{namespace="$namespace"}, daemonset) | - |
statefulset | label_values(kube_statefulset_replicas{namespace="$namespace"}, statefulset) | - |
pod | label_values(kube_pod_info{namespace=~"$namespace"}, pod) | - |
vmcluster | label_values(up, vmcluster) | - |
daemonset | label_values(kube_daemonset_status_number_ready{namespace="$namespace"}, daemonset) | - |
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
.
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.
The following metrics use custom variables namespace
, name
, and kind
, which do not support multiple selections or selecting all.
namespace
only supports selecting a specific namespace;name
only supports three types of computing components: deployment
, daemonset
, statefulset
;kind
only 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