grafana dashboard 展示pod status 写出 json
时间: 2023-08-22 15:10:08 浏览: 195
以下是一个展示Pod状态的Grafana Dashboard中的JSON代码示例,其中使用Prometheus作为数据源和PromQL查询语言来检索Pod状态信息:
```
{
"dashboard": {
"id": null,
"title": "Pod Status",
"timezone": "browser",
"editable": true,
"rows": [
{
"title": "Running Pods",
"height": "300px",
"panels": [
{
"title": "Running Pods",
"type": "graph",
"datasource": "Prometheus",
"targets": [
{
"expr": "sum(kube_pod_status_phase{phase=\"Running\"})",
"legendFormat": "Running Pods"
}
],
"yaxes": [
{
"format": "short"
},
{
"format": "short"
}
],
"xaxis": {},
"yaxis": {},
"grid": {},
"tooltip": {},
"legend": {
"show": true
},
"aliasColors": {},
"seriesOverrides": []
}
]
}
],
"schemaVersion": 22,
"version": 0,
"links": [],
"gnetId": null
},
"folderId": null,
"overwrite": false
}
```
您可以将此JSON代码添加到Grafana的Dashboard设置中,以创建一个展示Pod状态的Dashboard。您可能需要根据自己的数据源和查询语言进行适当的修改。
阅读全文