使用grafana展示kairosdb数据
近使用grafana展示opentsd中的heapster监控数据,但是grafana配置opentsdb模板时,query查询tag_values时出现问题,后因为一系列问题,剑神老大决定使用kairosdb,kairosdb果然比opentsd好使啊,文件类型为.json 可以直接导入使用,细节需要自己更改
{undefined
"__inputs": [
{undefined
"name": "DS_KAIROSDB",
"label": "Kairosdb",
"description": "",
"type": "datasource",
"pluginId": "grafana-kairosdb-datasource",
"pluginName": "KairosDB"
}
],
"__requires": [
{undefined
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "4.4.3"
},
{undefined
"type": "datasource",
"id": "grafana-kairosdb-datasource",
"name": "KairosDB",
"version": "2.0.1"
},
{undefined
"type": "panel",
"id": "graph",
"name": "Graph",
"version": ""
}
],
"annotations": {undefined
"list": []
},
"editMode": false,
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"hideControls": false,
"id": null,
"links": [],
"rows": [
{undefined
"collapse": false,
"height": "250px",
"panels": [
{undefined
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_KAIROSDB}",
"fill": 1,
"id": 1,
"legend": {undefined
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"span": 12,
"stack": false,
"steppedLine": false,
"targets": [
{undefined
"addFilterTagMode": false,
"addGroupByMode": false,
"alias": "cpu_usage_rate ( container_name=$_tag_group_container_name )",
"aliasMode": "default",
"currentGroupByType": "tag",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"exOuter": false,
"groupBy": {undefined
"tagKey": "",
"timeInterval": "1s"
},
"groupByTags": [
"container_name"
],
"hide": false,
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"isGroupByValid": true,
"isTagGroupBy": false,
"isTimeGroupBy": false,
"isValueGroupBy": false,
"metric": "cpu_usage_rate",
"refId": "A",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod_container"
]
}
},
{undefined
"addFilterTagMode": false,
"addGroupByMode": false,
"alias": "cpu_limit ( container_name=$_tag_group_container_name )",
"aliasMode": "default",
"currentGroupByType": "tag",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"tagKey": "",
"timeInterval": "1s"
},
"groupByTags": [
"container_name"
],
"hide": false,
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"isGroupByValid": true,
"isTagGroupBy": false,
"isTimeGroupBy": false,
"isValueGroupBy": false,
"metric": "cpu_limit",
"refId": "B",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod_container"
]
}
},
{undefined
"addFilterTagMode": false,
"addGroupByMode": false,
"alias": "cpu_request ( container_name=$_tag_group_container_name )",
"aliasMode": "default",
"currentGroupByType": "tag",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"tagKey": "",
"timeInterval": "1s"
},
"groupByTags": [
"container_name"
],
"hide": false,
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"isGroupByValid": true,
"isTagGroupBy": false,
"isTimeGroupBy": false,
"isValueGroupBy": false,
"metric": "cpu_request",
"refId": "C",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod_container"
]
}
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "CPU $nameSpace $podName",
"tooltip": {undefined
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {undefined
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{undefined
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{undefined
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
},
{undefined
"collapse": false,
"height": 250,
"panels": [
{undefined
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_KAIROSDB}",
"fill": 1,
"id": 2,
"legend": {undefined
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"span": 12,
"stack": false,
"steppedLine": false,
"targets": [
{undefined
"addFilterTagMode": false,
"addGroupByMode": false,
"alias": "memory_usage ( container_name=$_tag_group_container_name )",
"aliasMode": "default",
"currentGroupByType": "tag",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"tagKey": "",
"timeInterval": "1s"
},
"groupByTags": [
"container_name"
],
"hide": false,
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"isGroupByValid": true,
"isTagGroupBy": false,
"isTimeGroupBy": false,
"isValueGroupBy": false,
"metric": "memory_usage",
"refId": "A",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod_container"
]
}
},
{undefined
"addFilterTagMode": false,
"addGroupByMode": false,
"alias": "memory_limit ( container_name=$_tag_group_container_name )",
"aliasMode": "default",
"currentGroupByType": "tag",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"tagKey": "",
"timeInterval": "1s"
},
"groupByTags": [
"container_name"
],
"hide": false,
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"isGroupByValid": true,
"isTagGroupBy": false,
"isTimeGroupBy": false,
"isValueGroupBy": false,
"metric": "memory_limit",
"refId": "B",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod_container"
]
}
},
{undefined
"addFilterTagMode": false,
"addGroupByMode": false,
"alias": "memory_request ( container_name=$_tag_group_container_name )",
"aliasMode": "default",
"currentGroupByType": "tag",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"tagKey": "",
"timeInterval": "1s"
},
"groupByTags": [
"container_name"
],
"hide": false,
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"isGroupByValid": true,
"isTagGroupBy": false,
"isTimeGroupBy": false,
"isValueGroupBy": false,
"metric": "memory_request",
"refId": "C",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod_container"
]
}
},
{undefined
"addFilterTagMode": false,
"addGroupByMode": false,
"alias": "memory_working_set ( container_name=$_tag_group_container_name )",
"aliasMode": "default",
"currentGroupByType": "tag",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"tagKey": "",
"timeInterval": "1s"
},
"groupByTags": [
"container_name"
],
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"isGroupByValid": true,
"isTagGroupBy": false,
"isTimeGroupBy": false,
"isValueGroupBy": false,
"metric": "memory_working_set",
"refId": "D",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod_container"
]
}
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Memory $nameSpace $podName",
"tooltip": {undefined
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {undefined
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{undefined
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{undefined
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
},
{undefined
"collapse": false,
"height": 250,
"panels": [
{undefined
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_KAIROSDB}",
"fill": 1,
"id": 3,
"legend": {undefined
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"span": 12,
"stack": false,
"steppedLine": false,
"targets": [
{undefined
"addFilterTagMode": false,
"alias": "network_tx_rate",
"aliasMode": "default",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"timeInterval": "1s"
},
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"metric": "network_tx_rate",
"refId": "A",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod"
]
}
},
{undefined
"addFilterTagMode": false,
"alias": "network_rx_rate",
"aliasMode": "default",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"timeInterval": "1s"
},
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"metric": "network_rx_rate",
"refId": "B",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod"
]
}
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Network $nameSpace $podName",
"tooltip": {undefined
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {undefined
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{undefined
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{undefined
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
},
{undefined
"collapse": false,
"height": 250,
"panels": [
{undefined
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_KAIROSDB}",
"fill": 1,
"id": 4,
"legend": {undefined
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"span": 12,
"stack": false,
"steppedLine": false,
"targets": [
{undefined
"addFilterTagMode": false,
"alias": "filesystem_usage",
"aliasMode": "default",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"timeInterval": "1s"
},
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"metric": "filesystem_usage",
"refId": "A",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod"
]
}
},
{undefined
"addFilterTagMode": false,
"alias": "filesystem_limit",
"aliasMode": "default",
"currentTagKey": "",
"currentTagValue": "",
"downsampling": "avg",
"errors": {},
"groupBy": {undefined
"timeInterval": "1s"
},
"horAggregator": {undefined
"factor": "1",
"percentile": "0.75",
"samplingRate": "1s",
"trim": "both",
"unit": "millisecond"
},
"metric": "filesystem_limit",
"refId": "B",
"tags": {undefined
"namespace_name": [
"$nameSpace"
],
"pod_name": [
"$podName"
],
"type": [
"pod"
]
}
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Filesystem $nameSpace $podName",
"tooltip": {undefined
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {undefined
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{undefined
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{undefined
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
}
],
"schemaVersion": 14,
"style": "dark",
"tags": [],
"templating": {undefined
"list": [
{undefined
"allValue": null,
"current": {},
"datasource": "${DS_KAIROSDB}",
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "nameSpace",
"options": [],
"query": "tag_values(memory_limit,namespace_name)",
"refresh": 1,
"regex": "",
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{undefined
"allValue": null,
"current": {},
"datasource": "${DS_KAIROSDB}",
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "podName",
"options": [],
"query": "tag_values(memory_limit,pod_name)",
"refresh": 1,
"regex": "",
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {undefined
"from": "now-1h",
"to": "now"
},
"timepicker": {undefined
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "heapsterDashboard2",
"version": 7
}
相关文章