MySQL_User_Statistics.json 26 KB

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