以下模板JSON均是配置好dashbord后,view json得到。然后参数自定义传递。
JAVA接口设计
JVM
说明:JVM即JAVA应用的堆、栈、线程等信息,用于监控应用生命周期内一些异常等。
模板JSON
{
"dashboard": {
"annotations": {
"list": []
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"hideControls": false,
"id": null,
"links": [],
"refresh": "1m",
"rows": [
{
"collapse": false,
"height": 470,
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${datasource}",
"description": "",
"fill": 1,
"id": 1,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"show": true,
"sortDesc": true,
"total": false,
"values": true },
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
],
"spaceLength": 10,
"span": 6,
"stack": false,
"steppedLine": false,
"targets": [
{
"aggregator": "none",
"alias": "Max -> [[tag_instance.id]]",
"currentFilterGroupBy": false,
"currentFilterKey": "service.version",
"currentFilterType": "wildcard",
"currentFilterValue": "*",
"currentTagKey": "service.version",
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"downsampleInterval": "1m",
"filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ],
"hide": false,
"metric": "sun.management.MemoryImpl.HeapMemoryUsage.max",
"refId": "A" },
{
"aggregator": "none",
"alias": "Used -> [[tag_instance.id]]",
"currentFilterGroupBy": false,
"currentFilterKey": "",
"currentFilterType": "literal_or",
"currentFilterValue": "",
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"downsampleInterval": "1m",
"filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ],
"metric": "sun.management.MemoryImpl.HeapMemoryUsage.used",
"refId": "B" },
{
"aggregator": "none",
"alias": "Committed -> [[tag_instance.id]]",
"currentFilterGroupBy": false,
"currentFilterKey": "",
"currentFilterType": "literal_or",
"currentFilterValue": "",
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"downsampleInterval": "1m",
"filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ],
"metric": "sun.management.MemoryImpl.HeapMemoryUsage.committed",
"refId": "C" }
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "堆内存使用(HeapMemoryUsage)",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual" },
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [] },
"yaxes": [
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true },
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true }
]
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${datasource}",
"description": "",
"fill": 1,
"id": 2,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"show": true,
"sortDesc": true,
"total": false,
"values": true },
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
],
"spaceLength": 10,
"span": 6,
"stack": false,
"steppedLine": false,
"targets": [
{
"aggregator": "none",
"alias": "Max -> [[tag_instance.id]]",
"currentFilterGroupBy": false,
"currentFilterKey": "",
"currentFilterType": "literal_or",
"currentFilterValue": "",
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"downsampleInterval": "1m",
"filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ],
"hide": false,
"metric": "sun.management.MemoryImpl.NonHeapMemoryUsage.max",
"refId": "A" },
{
"aggregator": "none",
"alias": "Used -> [[tag_instance.id]]",
"currentFilterGroupBy": false,
"currentFilterKey": "",
"currentFilterType": "literal_or",
"currentFilterValue": "",
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"downsampleInterval": "1m",
"filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ],
"metric": "sun.management.MemoryImpl.NonHeapMemoryUsage.used",
"refId": "B" },
{
"aggregator": "none",
"alias": "Committed -> [[tag_instance.id]]",
"currentFilterGroupBy": false,
"currentFilterKey": "",
"currentFilterType": "literal_or",
"currentFilterValue": "",
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"downsampleInterval": "1m",
"filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ],
"metric": "sun.management.MemoryImpl.NonHeapMemoryUsage.committed",
"refId": "C" }
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "非堆内存使用(NonHeapMemoryUsage)",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual" },
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [] },
"yaxes": [
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true },
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true }
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
},
{
"collapse": false,
"height": 444,
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${datasource}",
"fill": 1,
"id": 3,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"rightSide": false,
"show": true,
"total": false,
"values": true },
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 1,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "/.*Count.*/",
"yaxis": 2 }
],
"spaceLength": 10,
"span": 6,
"stack": false,
"steppedLine": false,
"targets": [
{
"aggregator": "none",
"alias": "PSScavenge.CollectionTime -> [[tag_instance.id]]",
"currentFilterGroupBy": false,
"currentFilterKey": "",
"currentFilterType": "literal_or",
"currentFilterValue": "",
"disableDownsampling": false,
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"downsampleInterval":