Panel types for dashboards
Panel types for dashboards
监视仪表板中支持以下面板类型.
要将面积图面板类型添加到仪表盘,请查看以下样本仪表盘文件:
请注意以下属性:
从版本 12.8开始,y 轴值将根据数据自动缩放. 以前,它总是从 0 开始.
Anomaly chart
在 GitLab 12.5 中引入 .
要将异常图表面板类型添加到仪表盘,请添加恰好具有 3 个指标的面板.
第一个指标代表当前状态,第二个和第三个指标分别代表上限和下限:
panel_groups:
- group: 'Group Title'
panels:
- type: anomaly-chart
title: "Chart Title"
metrics:
- id: anomaly_requests_normal
query_range: 'http_requests_total'
label: "# of Requests"
unit: "count"
metrics:
- id: anomaly_requests_upper_limit
query_range: 10000
label: "Max # of requests"
unit: "count"
metrics:
- id: anomaly_requests_lower_limit
query_range: 2000
label: "Min # of requests"
unit: "count"
请注意以下属性:
Property | Type | Required | Description |
---|---|---|---|
type | string | required | 异常面板类型必须为anomaly-chart |
query_range | yes | required | 对于异常面板类型,必须在每个指标中使用 . |
要将条形图添加到仪表板,请查看以下样本仪表板文件:
请注意以下属性:
Column chart
要将列面板类型添加到仪表板,请查看以下样本仪表板文件:
dashboard: 'Dashboard Title'
panel_groups:
- group: 'Group title'
panels:
- title: "Column"
type: "column"
metrics:
- id: 1024_memory
unit: MB
label: "Memory Usage"
请注意以下属性:
Property | Type | Required | Description |
---|---|---|---|
type | string | yes | 要渲染的面板类型. 对于列面板类型,设置为column |
query_range | yes | yes | 对于列面板类型,必须使用范围查询 |
在 GitLab 12.8 中引入 .
要将堆叠的列面板类型添加到仪表板,请查看以下样本仪表板文件:
Single Stat
dashboard: 'Dashboard Title'
panel_groups:
- group: 'Group Title'
panels:
- title: "Single Stat"
type: "single-stat"
metrics:
query: 'max(go_memstats_alloc_bytes{job="prometheus"})'
unit: MB
label: "Total"
请注意以下属性:
Property | Type | Required | Description |
---|---|---|---|
type | string | yes | 要渲染的面板类型. 对于单一统计信息面板类型,设置为single-stat |
field | string | no | 面板显示指标的值. 要使面板显示标签的值,请在该键中放置标签的名称. |
query | string | yes | For single stat panel types, you must use an |
在 GitLab 12.8 中 .
有时需要将查询结果表示为 100 中的百分比值.您可以在面板定义的根部使用max_value
属性:
例如,如果查询值为53.6
,则将%
添加为单位将得出53.6%
的单个统计值,但是如果查询的最大期望值为120
,则该值为44.6%
. 添加max_value
会导致显示正确的百分比值.
Heatmaps
在 GitLab 12.5 中 .
要将热图面板类型添加到仪表板,请查看以下样本仪表板文件:
dashboard: 'Dashboard Title'
panel_groups:
- group: 'Group Title'
panels:
- title: "Heatmap"
type: "heatmap"
metrics:
- id: 10
query: 'sum(rate(nginx_upstream_responses_total{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[60m])) by (status_code)'
unit: req/sec
请注意以下属性: