MySQL_Table_Statistics.json 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. {
  2. "annotations": {
  3. "list": []
  4. },
  5. "editable": true,
  6. "gnetId": null,
  7. "hideControls": true,
  8. "id": null,
  9. "links": [
  10. {
  11. "asDropdown": true,
  12. "icon": "external link",
  13. "includeVars": true,
  14. "keepTime": true,
  15. "tags": [
  16. "OS"
  17. ],
  18. "targetBlank": true,
  19. "title": "OS",
  20. "type": "dashboards"
  21. },
  22. {
  23. "asDropdown": true,
  24. "icon": "external link",
  25. "includeVars": true,
  26. "keepTime": true,
  27. "tags": [
  28. "MySQL"
  29. ],
  30. "targetBlank": true,
  31. "title": "MySQL",
  32. "type": "dashboards"
  33. },
  34. {
  35. "asDropdown": true,
  36. "icon": "external link",
  37. "includeVars": true,
  38. "keepTime": true,
  39. "tags": [
  40. "HA"
  41. ],
  42. "targetBlank": true,
  43. "title": "HA",
  44. "type": "dashboards"
  45. }
  46. ],
  47. "refresh": false,
  48. "rows": [
  49. {
  50. "collapse": false,
  51. "height": "250px",
  52. "panels": [
  53. {
  54. "columns": [
  55. {
  56. "text": "Current",
  57. "value": "current"
  58. }
  59. ],
  60. "datasource": "Prometheus",
  61. "editable": true,
  62. "error": false,
  63. "fontSize": "100%",
  64. "height": "",
  65. "hideTimeOverride": true,
  66. "id": 49,
  67. "links": [],
  68. "pageSize": null,
  69. "scroll": false,
  70. "showHeader": true,
  71. "sort": {
  72. "col": 1,
  73. "desc": true
  74. },
  75. "span": 6,
  76. "styles": [
  77. {
  78. "colorMode": null,
  79. "colors": [
  80. "rgba(245, 54, 54, 0.9)",
  81. "rgba(237, 129, 40, 0.89)",
  82. "rgba(50, 172, 45, 0.97)"
  83. ],
  84. "dateFormat": "YYYY-MM-DD HH:mm:ss",
  85. "decimals": null,
  86. "pattern": "/.*/",
  87. "thresholds": [],
  88. "type": "number",
  89. "unit": "short"
  90. }
  91. ],
  92. "targets": [
  93. {
  94. "expr": "topk(10, sum(mysql_info_schema_table_rows{instance=\"$host\"}) by (schema, table)) > 0",
  95. "interval": "5m",
  96. "intervalFactor": 1,
  97. "legendFormat": "{{ schema }}.{{ table }}",
  98. "refId": "A",
  99. "step": 300
  100. }
  101. ],
  102. "timeFrom": "5m",
  103. "title": "Largest Tables by Row Count",
  104. "transform": "timeseries_aggregations",
  105. "type": "table"
  106. },
  107. {
  108. "columns": [
  109. {
  110. "text": "Current",
  111. "value": "current"
  112. }
  113. ],
  114. "datasource": "Prometheus",
  115. "editable": true,
  116. "error": false,
  117. "fontSize": "100%",
  118. "height": "",
  119. "hideTimeOverride": true,
  120. "id": 51,
  121. "links": [],
  122. "pageSize": null,
  123. "scroll": false,
  124. "showHeader": true,
  125. "sort": {
  126. "col": 1,
  127. "desc": true
  128. },
  129. "span": 6,
  130. "styles": [
  131. {
  132. "colorMode": null,
  133. "colors": [
  134. "rgba(245, 54, 54, 0.9)",
  135. "rgba(237, 129, 40, 0.89)",
  136. "rgba(50, 172, 45, 0.97)"
  137. ],
  138. "dateFormat": "YYYY-MM-DD HH:mm:ss",
  139. "decimals": null,
  140. "pattern": "/.*/",
  141. "thresholds": [],
  142. "type": "number",
  143. "unit": "bytes"
  144. }
  145. ],
  146. "targets": [
  147. {
  148. "expr": "topk(10, sum(mysql_info_schema_table_size{instance=\"$host\", component!=\"data_free\"}) by (schema, table)) > 0",
  149. "interval": "5m",
  150. "intervalFactor": 1,
  151. "legendFormat": "{{ schema }}.{{ table }}",
  152. "refId": "A",
  153. "step": 300
  154. }
  155. ],
  156. "timeFrom": "5m",
  157. "title": "Largest Tables by Size",
  158. "transform": "timeseries_aggregations",
  159. "type": "table"
  160. }
  161. ],
  162. "repeat": null,
  163. "repeatIteration": null,
  164. "repeatRowId": null,
  165. "showTitle": false,
  166. "title": "New row",
  167. "titleSize": "h6"
  168. },
  169. {
  170. "collapse": false,
  171. "height": "250px",
  172. "panels": [
  173. {
  174. "aliasColors": {
  175. "Data + Index Size": "#65C5DB"
  176. },
  177. "bars": false,
  178. "datasource": "Prometheus",
  179. "decimals": 2,
  180. "editable": true,
  181. "error": false,
  182. "fill": 2,
  183. "grid": {},
  184. "id": 54,
  185. "legend": {
  186. "alignAsTable": false,
  187. "avg": false,
  188. "current": false,
  189. "hideEmpty": false,
  190. "max": false,
  191. "min": false,
  192. "rightSide": false,
  193. "show": true,
  194. "total": false,
  195. "values": false
  196. },
  197. "lines": true,
  198. "linewidth": 2,
  199. "links": [],
  200. "nullPointMode": "null",
  201. "percentage": false,
  202. "pointradius": 5,
  203. "points": false,
  204. "renderer": "flot",
  205. "seriesOverrides": [],
  206. "span": 6,
  207. "stack": false,
  208. "steppedLine": false,
  209. "targets": [
  210. {
  211. "calculatedInterval": "2m",
  212. "datasourceErrors": {},
  213. "errors": {},
  214. "expr": "sum(mysql_info_schema_table_size{instance=\"$host\", component!=\"data_free\"})",
  215. "interval": "$interval",
  216. "intervalFactor": 1,
  217. "legendFormat": "Data + Index Size",
  218. "metric": "",
  219. "refId": "A",
  220. "step": 300
  221. },
  222. {
  223. "calculatedInterval": "2m",
  224. "datasourceErrors": {},
  225. "errors": {},
  226. "expr": "sum(mysql_info_schema_table_size{instance=\"$host\", component=\"data_free\"})",
  227. "interval": "$interval",
  228. "intervalFactor": 1,
  229. "legendFormat": "Freeable Size",
  230. "metric": "",
  231. "refId": "B",
  232. "step": 300
  233. }
  234. ],
  235. "thresholds": [],
  236. "timeFrom": null,
  237. "timeShift": null,
  238. "title": "Total Database Size",
  239. "tooltip": {
  240. "msResolution": false,
  241. "shared": true,
  242. "sort": 0,
  243. "value_type": "individual"
  244. },
  245. "type": "graph",
  246. "xaxis": {
  247. "mode": "time",
  248. "name": null,
  249. "show": true,
  250. "values": []
  251. },
  252. "yaxes": [
  253. {
  254. "format": "bytes",
  255. "logBase": 1,
  256. "max": null,
  257. "min": 0,
  258. "show": true
  259. },
  260. {
  261. "format": "short",
  262. "logBase": 1,
  263. "max": null,
  264. "min": 0,
  265. "show": true
  266. }
  267. ]
  268. },
  269. {
  270. "columns": [
  271. {
  272. "text": "Current",
  273. "value": "current"
  274. }
  275. ],
  276. "datasource": "Prometheus",
  277. "editable": true,
  278. "error": false,
  279. "fontSize": "100%",
  280. "height": "",
  281. "hideTimeOverride": true,
  282. "id": 50,
  283. "links": [],
  284. "pageSize": null,
  285. "scroll": false,
  286. "showHeader": true,
  287. "sort": {
  288. "col": 1,
  289. "desc": true
  290. },
  291. "span": 6,
  292. "styles": [
  293. {
  294. "colorMode": null,
  295. "colors": [
  296. "rgba(245, 54, 54, 0.9)",
  297. "rgba(237, 129, 40, 0.89)",
  298. "rgba(50, 172, 45, 0.97)"
  299. ],
  300. "dateFormat": "YYYY-MM-DD HH:mm:ss",
  301. "decimals": null,
  302. "pattern": "/.*/",
  303. "thresholds": [],
  304. "type": "number",
  305. "unit": "bytes"
  306. }
  307. ],
  308. "targets": [
  309. {
  310. "expr": "topk(5, sum(mysql_info_schema_table_size{instance=\"$host\", component=\"data_free\"}) by (schema, table)) > 0",
  311. "interval": "5m",
  312. "intervalFactor": 1,
  313. "legendFormat": "{{ schema }}.{{ table }}",
  314. "refId": "A",
  315. "step": 300
  316. }
  317. ],
  318. "timeFrom": "5m",
  319. "title": "Most Fragmented Tables by Freeable Size",
  320. "transform": "timeseries_aggregations",
  321. "type": "table"
  322. }
  323. ],
  324. "repeat": null,
  325. "repeatIteration": null,
  326. "repeatRowId": null,
  327. "showTitle": false,
  328. "title": "Pie",
  329. "titleSize": "h6"
  330. },
  331. {
  332. "collapse": false,
  333. "height": "50px",
  334. "panels": [
  335. {
  336. "content": "The next two graphs are available only for [Percona Server](https://www.percona.com/doc/percona-server/5.6/diagnostics/user_stats.html) and [MariaDB](https://mariadb.com/kb/en/mariadb/user-statistics/) and require `userstat` variable turned on.",
  337. "datasource": "Prometheus",
  338. "editable": true,
  339. "error": false,
  340. "height": "50px",
  341. "id": 44,
  342. "links": [],
  343. "mode": "markdown",
  344. "span": 12,
  345. "style": {},
  346. "title": "",
  347. "transparent": true,
  348. "type": "text"
  349. }
  350. ],
  351. "repeat": null,
  352. "repeatIteration": null,
  353. "repeatRowId": null,
  354. "showTitle": true,
  355. "title": "Table Activity",
  356. "titleSize": "h6"
  357. },
  358. {
  359. "collapse": false,
  360. "height": "250px",
  361. "panels": [
  362. {
  363. "aliasColors": {},
  364. "bars": false,
  365. "datasource": "Prometheus",
  366. "decimals": 2,
  367. "editable": true,
  368. "error": false,
  369. "fill": 2,
  370. "grid": {},
  371. "id": 48,
  372. "legend": {
  373. "alignAsTable": true,
  374. "avg": true,
  375. "current": false,
  376. "hideEmpty": false,
  377. "max": false,
  378. "min": false,
  379. "rightSide": true,
  380. "show": true,
  381. "sort": "avg",
  382. "sortDesc": true,
  383. "total": false,
  384. "values": true
  385. },
  386. "lines": true,
  387. "linewidth": 2,
  388. "links": [],
  389. "nullPointMode": "null",
  390. "percentage": false,
  391. "pointradius": 5,
  392. "points": false,
  393. "renderer": "flot",
  394. "seriesOverrides": [],
  395. "span": 12,
  396. "stack": false,
  397. "steppedLine": false,
  398. "targets": [
  399. {
  400. "calculatedInterval": "2m",
  401. "datasourceErrors": {},
  402. "errors": {},
  403. "expr": "topk(5, rate(mysql_info_schema_table_statistics_rows_read_total{instance=\"$host\"}[$interval])>0) or topk(5, irate(mysql_info_schema_table_statistics_rows_read_total{instance=\"$host\"}[5m])>0)",
  404. "interval": "$interval",
  405. "intervalFactor": 1,
  406. "legendFormat": "{{ schema }}.{{ table }}",
  407. "metric": "",
  408. "refId": "A",
  409. "step": 300
  410. }
  411. ],
  412. "thresholds": [],
  413. "timeFrom": null,
  414. "timeShift": null,
  415. "title": "Top Tables by Rows Read",
  416. "tooltip": {
  417. "msResolution": false,
  418. "shared": true,
  419. "sort": 0,
  420. "value_type": "individual"
  421. },
  422. "type": "graph",
  423. "xaxis": {
  424. "mode": "time",
  425. "name": null,
  426. "show": true,
  427. "values": []
  428. },
  429. "yaxes": [
  430. {
  431. "format": "short",
  432. "logBase": 1,
  433. "max": null,
  434. "min": 0,
  435. "show": true
  436. },
  437. {
  438. "format": "short",
  439. "logBase": 1,
  440. "max": null,
  441. "min": 0,
  442. "show": true
  443. }
  444. ]
  445. }
  446. ],
  447. "repeat": null,
  448. "repeatIteration": null,
  449. "repeatRowId": null,
  450. "showTitle": false,
  451. "title": "Rows read",
  452. "titleSize": "h6"
  453. },
  454. {
  455. "collapse": false,
  456. "height": "250px",
  457. "panels": [
  458. {
  459. "aliasColors": {},
  460. "bars": false,
  461. "datasource": "Prometheus",
  462. "decimals": 2,
  463. "editable": true,
  464. "error": false,
  465. "fill": 2,
  466. "grid": {},
  467. "id": 42,
  468. "legend": {
  469. "alignAsTable": true,
  470. "avg": true,
  471. "current": false,
  472. "hideEmpty": false,
  473. "hideZero": false,
  474. "max": false,
  475. "min": false,
  476. "rightSide": true,
  477. "show": true,
  478. "sort": "avg",
  479. "sortDesc": true,
  480. "total": false,
  481. "values": true
  482. },
  483. "lines": true,
  484. "linewidth": 2,
  485. "links": [],
  486. "nullPointMode": "null",
  487. "percentage": false,
  488. "pointradius": 5,
  489. "points": false,
  490. "renderer": "flot",
  491. "seriesOverrides": [],
  492. "span": 12,
  493. "stack": false,
  494. "steppedLine": false,
  495. "targets": [
  496. {
  497. "calculatedInterval": "2m",
  498. "datasourceErrors": {},
  499. "errors": {},
  500. "expr": "topk(5, rate(mysql_info_schema_table_statistics_rows_changed_total{instance=\"$host\"}[$interval])>0) or topk(5, irate(mysql_info_schema_table_statistics_rows_changed_total{instance=\"$host\"}[5m])>0)",
  501. "interval": "$interval",
  502. "intervalFactor": 1,
  503. "legendFormat": "{{ schema }}.{{ table }}",
  504. "metric": "",
  505. "refId": "A",
  506. "step": 300
  507. }
  508. ],
  509. "thresholds": [],
  510. "timeFrom": null,
  511. "timeShift": null,
  512. "title": "Top Tables by Rows Changed",
  513. "tooltip": {
  514. "msResolution": false,
  515. "shared": true,
  516. "sort": 0,
  517. "value_type": "individual"
  518. },
  519. "type": "graph",
  520. "xaxis": {
  521. "mode": "time",
  522. "name": null,
  523. "show": true,
  524. "values": []
  525. },
  526. "yaxes": [
  527. {
  528. "format": "short",
  529. "logBase": 1,
  530. "max": null,
  531. "min": 0,
  532. "show": true
  533. },
  534. {
  535. "format": "short",
  536. "logBase": 1,
  537. "max": null,
  538. "min": 0,
  539. "show": true
  540. }
  541. ]
  542. }
  543. ],
  544. "repeat": null,
  545. "repeatIteration": null,
  546. "repeatRowId": null,
  547. "showTitle": false,
  548. "title": "New row",
  549. "titleSize": "h6"
  550. },
  551. {
  552. "collapse": false,
  553. "height": "250px",
  554. "panels": [
  555. {
  556. "columns": [
  557. {
  558. "text": "Current",
  559. "value": "current"
  560. }
  561. ],
  562. "datasource": "Prometheus",
  563. "editable": true,
  564. "error": false,
  565. "fontSize": "100%",
  566. "height": "",
  567. "hideTimeOverride": true,
  568. "id": 53,
  569. "links": [],
  570. "pageSize": null,
  571. "scroll": false,
  572. "showHeader": true,
  573. "sort": {
  574. "col": 1,
  575. "desc": true
  576. },
  577. "span": 6,
  578. "styles": [
  579. {
  580. "colorMode": null,
  581. "colors": [
  582. "rgba(50, 172, 45, 0.97)",
  583. "rgba(237, 129, 40, 0.89)",
  584. "rgba(245, 54, 54, 0.9)"
  585. ],
  586. "dateFormat": "YYYY-MM-DD HH:mm:ss",
  587. "decimals": 2,
  588. "pattern": "/.*/",
  589. "thresholds": [
  590. "95",
  591. "98"
  592. ],
  593. "type": "number",
  594. "unit": "percentunit"
  595. }
  596. ],
  597. "targets": [
  598. {
  599. "expr": "topk(10, mysql_info_schema_auto_increment_column{instance=\"$host\"} / mysql_info_schema_auto_increment_column_max{instance=\"$host\"})",
  600. "interval": "5m",
  601. "intervalFactor": 1,
  602. "legendFormat": "{{ schema }}.{{ table }}",
  603. "refId": "A",
  604. "step": 300
  605. }
  606. ],
  607. "timeFrom": "5m",
  608. "title": "Top Tables by Auto Increment Usage",
  609. "transform": "timeseries_aggregations",
  610. "type": "table"
  611. }
  612. ],
  613. "repeat": null,
  614. "repeatIteration": null,
  615. "repeatRowId": null,
  616. "showTitle": false,
  617. "title": "New row",
  618. "titleSize": "h6"
  619. }
  620. ],
  621. "schemaVersion": 13,
  622. "sharedCrosshair": true,
  623. "style": "dark",
  624. "tags": [
  625. "MySQL",
  626. "Percona"
  627. ],
  628. "templating": {
  629. "list": [
  630. {
  631. "allFormat": "glob",
  632. "auto": true,
  633. "auto_count": 200,
  634. "auto_min": "1s",
  635. "current": {
  636. "text": "auto",
  637. "value": "$__auto_interval"
  638. },
  639. "datasource": "Prometheus",
  640. "hide": 0,
  641. "includeAll": false,
  642. "label": "Interval",
  643. "multi": false,
  644. "multiFormat": "glob",
  645. "name": "interval",
  646. "options": [
  647. {
  648. "selected": true,
  649. "text": "auto",
  650. "value": "$__auto_interval"
  651. },
  652. {
  653. "selected": false,
  654. "text": "1s",
  655. "value": "1s"
  656. },
  657. {
  658. "selected": false,
  659. "text": "5s",
  660. "value": "5s"
  661. },
  662. {
  663. "selected": false,
  664. "text": "1m",
  665. "value": "1m"
  666. },
  667. {
  668. "selected": false,
  669. "text": "5m",
  670. "value": "5m"
  671. },
  672. {
  673. "selected": false,
  674. "text": "1h",
  675. "value": "1h"
  676. },
  677. {
  678. "selected": false,
  679. "text": "6h",
  680. "value": "6h"
  681. },
  682. {
  683. "selected": false,
  684. "text": "1d",
  685. "value": "1d"
  686. }
  687. ],
  688. "query": "1s,5s,1m,5m,1h,6h,1d",
  689. "refresh": 2,
  690. "type": "interval"
  691. },
  692. {
  693. "allFormat": "glob",
  694. "allValue": null,
  695. "datasource": "Prometheus",
  696. "hide": 0,
  697. "includeAll": false,
  698. "label": "Host",
  699. "multi": false,
  700. "multiFormat": "regex values",
  701. "name": "host",
  702. "query": "label_values(mysql_up, instance)",
  703. "refresh": 1,
  704. "refresh_on_load": false,
  705. "regex": "",
  706. "sort": 1,
  707. "tagValuesQuery": null,
  708. "tagsQuery": null,
  709. "type": "query"
  710. }
  711. ]
  712. },
  713. "time": {
  714. "from": "now-12h",
  715. "to": "now"
  716. },
  717. "timepicker": {
  718. "collapse": false,
  719. "enable": true,
  720. "notice": false,
  721. "now": true,
  722. "refresh_intervals": [
  723. "5s",
  724. "10s",
  725. "30s",
  726. "1m",
  727. "5m",
  728. "15m",
  729. "30m",
  730. "1h",
  731. "2h",
  732. "1d"
  733. ],
  734. "status": "Stable",
  735. "time_options": [
  736. "5m",
  737. "15m",
  738. "1h",
  739. "6h",
  740. "12h",
  741. "24h",
  742. "2d",
  743. "7d",
  744. "30d"
  745. ],
  746. "type": "timepicker"
  747. },
  748. "timezone": "browser",
  749. "title": "MySQL Table Statistics",
  750. "version": 0
  751. }