Skip to content

Commit

Permalink
grafana: add detailed memory usage for each instance (#18679)
Browse files Browse the repository at this point in the history
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
  • Loading branch information
Zejun Li and ti-srebot authored Jul 20, 2020
1 parent 803854c commit 809df28
Showing 1 changed file with 215 additions and 1 deletion.
216 changes: 215 additions & 1 deletion metrics/grafana/tidb.json
Original file line number Diff line number Diff line change
Expand Up @@ -3464,6 +3464,194 @@
"title": "Server",
"type": "row"
},
{
"collapsed": true,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 3
},
"id": 208,
"panels": [
{
"aliasColors": {},
"bars": true,
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_TEST-CLUSTER}",
"description": "The memory usage details of the TiDB process.",
"editable": true,
"error": false,
"fill": 0,
"grid": {},
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 4
},
"id": 206,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"rightSide": false,
"show": true,
"sideWidth": null,
"total": false,
"values": false
},
"lines": false,
"linewidth": 1,
"links": [],
"maxPerRow": 3,
"nullPointMode": "null",
"percentage": false,
"pluginVersion": "6.1.6",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeat": "instance",
"repeatDirection": "h",
"seriesOverrides": [
{
"alias": "alloc-from-os",
"fill": 3,
"lines": true,
"stack": false
},
{
"alias": "gc-threshold",
"bars": false,
"color": "#C4162A",
"lines": true,
"linewidth": 2,
"stack": false
},
{
"alias": "gc",
"bars": false,
"color": "#C4162A",
"hideTooltip": true,
"legend": false,
"pointradius": 3,
"points": true,
"stack": false
}
],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"expr": "process_resident_memory_bytes{instance=~\"$instance\"}",
"format": "time_series",
"hide": false,
"intervalFactor": 1,
"legendFormat": "alloc-from-os",
"refId": "A"
},
{
"expr": "go_memstats_next_gc_bytes{instance=~\"$instance\"} / 2",
"format": "time_series",
"hide": false,
"intervalFactor": 1,
"legendFormat": "estimate-inuse",
"refId": "H"
},
{
"expr": "go_memstats_heap_alloc_bytes{instance=~\"$instance\"} - go_memstats_next_gc_bytes{instance=~\"$instance\"} / 2",
"format": "time_series",
"hide": false,
"intervalFactor": 1,
"legendFormat": "estimate-garbage",
"refId": "C"
},
{
"expr": "go_memstats_heap_idle_bytes{instance=~\"$instance\"} - go_memstats_heap_released_bytes{instance=~\"$instance\"} + go_memstats_heap_inuse_bytes{instance=~\"$instance\"} - go_memstats_heap_alloc_bytes{instance=~\"$instance\"}",
"format": "time_series",
"hide": false,
"intervalFactor": 1,
"legendFormat": "reserved-by-go",
"refId": "B"
},
{
"expr": "go_memstats_stack_sys_bytes{instance=~\"$instance\"} + go_memstats_mspan_sys_bytes{instance=~\"$instance\"} + go_memstats_mcache_sys_bytes{instance=~\"$instance\"} + go_memstats_buck_hash_sys_bytes{instance=~\"$instance\"} + go_memstats_gc_sys_bytes{instance=~\"$instance\"} + go_memstats_other_sys_bytes{instance=~\"$instance\"}",
"format": "time_series",
"hide": false,
"intervalFactor": 1,
"legendFormat": "used-by-go",
"refId": "D"
},
{
"expr": "go_memstats_next_gc_bytes{instance=~\"$instance\"}",
"format": "time_series",
"hide": false,
"intervalFactor": 1,
"legendFormat": "gc-threshold",
"refId": "E"
},
{
"expr": "(clamp_max(idelta(go_memstats_last_gc_time_seconds{instance=~\"$instance\"}[1m]), 1) * go_memstats_next_gc_bytes{instance=~\"$instance\"}) > 0",
"format": "time_series",
"hide": false,
"intervalFactor": 1,
"legendFormat": "gc",
"refId": "F"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$instance",
"tooltip": {
"msResolution": true,
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "bytes",
"label": "",
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": "",
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"title": "Instance Memory Detail",
"type": "row"
},
{
"collapsed": true,
"datasource": null,
Expand Down Expand Up @@ -12113,7 +12301,33 @@
"style": "dark",
"tags": [],
"templating": {
"list": []
"list": [
{
"allValue": null,
"current": {
"text": "All",
"value": "$__all"
},
"datasource": "${DS_TEST-CLUSTER}",
"definition": "label_values(process_start_time_seconds{job=\"tidb\"}, instance)",
"hide": 2,
"includeAll": true,
"label": "instance",
"multi": false,
"name": "instance",
"options": [],
"query": "label_values(process_start_time_seconds{job=\"tidb\"}, instance)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-1h",
Expand Down

0 comments on commit 809df28

Please sign in to comment.