grafana之JAVA自动化配置图表
来源:互联网 发布:mac os 离线升级 编辑:程序博客网 时间:2024/06/06 20:30
以下模板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": "1m", "explicitTags": false, "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.GarbageCollectorImpl.PSScavenge.CollectionTime", "refId": "A", "shouldComputeRate": true, "isCounter": true }, { "aggregator": "none", "alias": "PSScavenge.CollectionCount -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "disableDownsampling": false, "downsampleAggregator": "last", "downsampleFillPolicy": "none", "downsampleInterval": "1m", "explicitTags": false, "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.GarbageCollectorImpl.PSScavenge.CollectionCount", "refId": "B", "shouldComputeRate": true, "isCounter": true }, { "aggregator": "none", "alias": "PSMarkSweep.CollectionTime -> [[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": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "sun.management.GarbageCollectorImpl.PSMarkSweep.CollectionTime", "refId": "C", "shouldComputeRate": true, "isCounter": true }, { "aggregator": "none", "alias": "PSMarkSweep.CollectionCount -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "sum", "downsampleFillPolicy": "none", "downsampleInterval": "1m", "explicitTags": false, "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "sun.management.GarbageCollectorImpl.PSMarkSweep.CollectionCount", "refId": "D", "shouldComputeRate": true, "isCounter": true } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "垃圾回收(GC)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ] }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "fill": 1, "id": 4, "legend": { "alignAsTable": true, "avg": false, "current": true, "max": true, "min": true, "show": 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": "ThreadCount -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "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.ThreadImpl.ThreadCount", "refId": "B" }, { "aggregator": "none", "alias": "PeakThreadCount -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "max", "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.ThreadImpl.PeakThreadCount", "refId": "C" }, { "aggregator": "none", "alias": "DaemonThreadCount -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "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.ThreadImpl.DaemonThreadCount", "refId": "D" } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "线程(Thread)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "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" }, { "collapse": false, "height": 250, "panels": [ { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "fill": 1, "id": 5, "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "aggregator": "none", "alias": "Max -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "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.MemoryPoolImpl.PSEdenSpace.Usage.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.MemoryPoolImpl.PSEdenSpace.Usage.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.MemoryPoolImpl.PSEdenSpace.Usage.committed", "refId": "C" } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "PSEdenSpace", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ] }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "fill": 1, "id": 6, "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "aggregator": "none", "alias": "Max -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "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.MemoryPoolImpl.PSSurvivorSpace.Usage.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.MemoryPoolImpl.PSSurvivorSpace.Usage.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.MemoryPoolImpl.PSSurvivorSpace.Usage.committed", "refId": "C" } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "PSSurvivorSpace", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ] }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "fill": 1, "id": 7, "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "aggregator": "none", "alias": "Max -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "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.MemoryPoolImpl.PSOldGen.Usage.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.MemoryPoolImpl.PSOldGen.Usage.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.MemoryPoolImpl.PSOldGen.Usage.committed", "refId": "C" } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "PSOldGen", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "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" }, { "collapse": false, "height": 250, "panels": [ { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "fill": 1, "id": 8, "legend": { "alignAsTable": true, "avg": false, "current": true, "max": true, "min": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "aggregator": "max", "alias": "RequestCount -> [[tag_instance.id]]", "counterMax": "10", "counterResetValue": "1", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "disableDownsampling": false, "downsampleAggregator": "max", "downsampleFillPolicy": "none", "downsampleInterval": "1m", "explicitTags": false, "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "isCounter": false, "metric": "org.apache.tomcat.util.modeler.BaseModelMBean.http-apr-8080.requestCount", "refId": "A", "shouldComputeRate": true, "isCounter": true }, { "aggregator": "none", "alias": "ErrorCount -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "downsampleFillPolicy": "zero", "downsampleInterval": "1m", "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "org.apache.tomcat.util.modeler.BaseModelMBean.http-apr-8080.errorCount", "refId": "B", "shouldComputeRate": true, "isCounter": true } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "Tomcat请求(Request)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ] }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "decimals": null, "fill": 1, "id": 9, "legend": { "alignAsTable": true, "avg": false, "current": true, "max": true, "min": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "aggregator": "none", "alias": "activeSessions -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "downsampleFillPolicy": "none", "downsampleInterval": "1m", "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "org.apache.tomcat.util.modeler.BaseModelMBean.activeSessions", "refId": "A", "shouldComputeRate": false }, { "aggregator": "none", "alias": "rejectedSessions -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "downsampleFillPolicy": "none", "downsampleInterval": "1m", "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "org.apache.tomcat.util.modeler.BaseModelMBean.rejectedSessions", "refId": "B", "shouldComputeRate": false } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "Tomcat会话(Session)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ] }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "fill": 1, "id": 10, "legend": { "alignAsTable": true, "avg": false, "current": true, "max": true, "min": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "aggregator": "none", "alias": "MaxThreads -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "downsampleFillPolicy": "none", "downsampleInterval": "1m", "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "org.apache.tomcat.util.modeler.BaseModelMBean.http-apr-8080.maxThreads", "refId": "A" }, { "aggregator": "none", "alias": "CurrentThreadCount -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "downsampleFillPolicy": "none", "downsampleInterval": "1m", "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "org.apache.tomcat.util.modeler.BaseModelMBean.http-apr-8080.currentThreadCount", "refId": "B" }, { "aggregator": "none", "alias": "CurrentThreadsBusy -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "last", "downsampleFillPolicy": "none", "downsampleInterval": "1m", "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "iliteral_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "org.apache.tomcat.util.modeler.BaseModelMBean.http-apr-8080.currentThreadsBusy", "refId": "C" } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "Tomcat线程池(ThreadPool)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "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": { "list": [ { "allValue": null, "current": {}, "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": "实例", "multi": true, "name": "instanceId", "options": [], "query": "tag_values(sun.management.MemoryImpl.HeapMemoryUsage.max, instance.id, service.name=${service.name})", "refresh": 2, "regex": "", "sort": 0, "tagValuesQuery": "", "tags": [], "tagsQuery": "", "type": "query", "useTags": false } ] }, "time": { "from": "now-1h", "to": "now" }, "timepicker": { "refresh_intervals": [ "1m", "5m" ], "time_options": [ "5m", "15m", "30m", "1h", "6h", "12h", "1d", "7d" ] }, "timezone": "browser", "title": "${title}", "version": 0 }, "overwrite": false}
效果图:
服务质量
说明:服务质量即web应用接口访问次数、响应时间、错误等,用于查看系统接口调用详情。
模板JSON
{ "dashboard": { "annotations": { "list": [] }, "editable": true, "gnetId": null, "graphTooltip": 0, "hideControls": false, "id": null, "links": [], "refresh": false, "rows": [ { "collapse": false, "height": "250px", "panels": [ { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "fill": 1, "id": 1, "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 7, "stack": false, "steppedLine": false, "targets": [ { "aggregator": "p95", "alias": "接口访问耗时 -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "p95", "downsampleFillPolicy": "none", "downsampleInterval": "", "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "api.call.duration", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "接口响应时间", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ] }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "${datasource}", "fill": 1, "id": 2, "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": true, "show": true, "total": true, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 7, "stack": false, "steppedLine": false, "targets": [ { "aggregator": "sum", "alias": "每秒接口访问量 -> [[tag_instance.id]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "sum", "downsampleFillPolicy": "zero", "downsampleInterval": "1s", "filters": [ { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": true, "tagk": "instance.id", "type": "literal_or" } ], "metric": "api.call.count", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeShift": null, "title": "吞吐量(QPS)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ] }, { "aliasColors": {}, "cacheTimeout": null, "combine": { "label": "Others", "threshold": 0 }, "datasource": "${datasource}", "fontSize": "80%", "format": "short", "id": 3, "interval": null, "legend": { "percentage": true, "show": true, "values": true }, "legendType": "Right side", "links": [], "maxDataPoints": 3, "nullPointMode": "connected", "pieType": "pie", "span": 4, "strokeWidth": 1, "targets": [ { "aggregator": "sum", "alias": "[[tag_errorCode]]", "currentFilterGroupBy": false, "currentFilterKey": "", "currentFilterType": "literal_or", "currentFilterValue": "", "downsampleAggregator": "sum", "downsampleFillPolicy": "none", "downsampleInterval": "all", "filters": [ { "filter": "*", "groupBy": true, "tagk": "errorCode", "type": "wildcard" }, { "filter": "${service.name}", "groupBy": false, "tagk": "service.name", "type": "literal_or" }, { "filter": "$instanceId", "groupBy": false, "tagk": "instance.id", "type": "literal_or" } ], "metric": "api.call.count", "refId": "A" } ], "title": "接口返回错误码", "type": "grafana-piechart-panel", "valueName": "current" } ], "repeat": null, "repeatIteration": null, "repeatRowId": null, "showTitle": false, "title": "Dashboard Row", "titleSize": "h6" } ], "schemaVersion": 14, "style": "dark", "tags": [], "templating": { "list": [ { "allValue": null, "current": {}, "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": "实例", "multi": true, "name": "instanceId", "options": [], "query": "tag_values(api.call.count, instance.id, service.name=${service.name})", "refresh": 2, "regex": "", "sort": 0, "tagValuesQuery": "", "tags": [], "tagsQuery": "", "type": "query", "useTags": false } ] }, "time": { "from": "now-1h", "to": "now" }, "timepicker": { "refresh_intervals": [ "1m", "5m" ], "time_options": [ "5m", "15m", "30m", "1h", "6h", "12h", "1d", "7d" ] }, "timezone": "browser", "title": "${title}", "version": 0 }, "overwrite": false}
效果展示:
阅读全文
0 0
- grafana之JAVA自动化配置图表
- grafana图表配置详解
- 如何安装和配置Grafana绘制美丽的图表从Zabbix在CentOS 7
- opentsdb+grafana安装配置
- 配置grafana详解
- Grafana-zabbix配置模板
- grafana安装配置
- Grafana + Zabbix 安装配置
- Grafana安装配置介绍
- Grafana安装配置介绍
- grafana-大数据图表监控分析框架
- grafana http-api 批量添加图表
- 20160805 笔记之图表配置
- grafana-zabbix图形简单配置
- grafana-zabbix配置图形模板
- grafana
- grafana
- InfluxDB+Grafana搭建和Grafana dashboard的配置
- 蓝牙控制第一天
- 实现图片转字符
- Largest Submatrix of All 1’s
- IDEA 使用Maven 查看依赖树
- MySQL索引和性能优化
- grafana之JAVA自动化配置图表
- 配置安装转载网上的 Apache2 + Gitweb+CGI配置
- 开发遇到的问题
- matlab读写raw二进制数据 bin文件
- C++常见面试题-30道
- Azure上部署的资源公网连通性测试工具-psping
- java 基础
- 使用 libevent 和 libev 提高网络应用性能——I/O模型演进变化史
- 树的子结构