From 0f5de47a6f4e1317b53e7c3f24f02bf3a466d3e0 Mon Sep 17 00:00:00 2001
From: Yash Sartanpara <119680679+YashSartanpara1@users.noreply.github.com>
Date: Wed, 3 Jul 2024 15:17:58 +0530
Subject: [PATCH 1/3] PMM-13176 Qan Plan tooltip not visible (#1610)
* PMM-13176 Replace tippy with grafana tooltip
* PMM-13176 Remove unused code
* PMM-13176 Add test workaround for react 18 hook
---
.../components/Details/Plan/Plan.styles.ts | 5 +----
.../components/Details/Plan/Plan.test.tsx | 8 ++++++++
.../panel/components/Details/Plan/Plan.tsx | 18 ++++++++----------
3 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.styles.ts b/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.styles.ts
index f8415f7cde..d1e73f602e 100644
--- a/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.styles.ts
+++ b/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.styles.ts
@@ -1,7 +1,7 @@
import { css } from '@emotion/css';
import { GrafanaTheme } from '@grafana/data';
-export const getStyles = ({ spacing, colors }: GrafanaTheme) => ({
+export const getStyles = ({ spacing }: GrafanaTheme) => ({
planWrapper: css`
position: relative;
`,
@@ -10,7 +10,4 @@ export const getStyles = ({ spacing, colors }: GrafanaTheme) => ({
top: ${spacing.sm};
right: ${spacing.sm};
`,
- tippy: css`
- background-color: ${colors.bg2};
- `,
});
diff --git a/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.test.tsx b/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.test.tsx
index b7036246b5..46ed13690f 100644
--- a/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.test.tsx
+++ b/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.test.tsx
@@ -6,6 +6,14 @@ jest.mock('shared/components/helpers/notification-manager');
jest.mock('./Plan.hooks');
describe('Plan::', () => {
+ beforeEach(() => {
+ console.error = jest.fn();
+ // TODO: Grafana Tooltip component uses a react 18 hook - useId
+ // due to enzyme we are currently stuck at react 17, mocking for now
+ // @ts-ignore
+ React.useId = () => '';
+ });
+
it('renders plan query and tooltip', () => {
const { container } = render();
diff --git a/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.tsx b/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.tsx
index f51395fdf5..2af2164a8b 100644
--- a/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.tsx
+++ b/pmm-app/src/pmm-qan/panel/components/Details/Plan/Plan.tsx
@@ -1,8 +1,7 @@
import React, { FC } from 'react';
-import { Icon, useStyles } from '@grafana/ui';
+import { Icon, useStyles, Tooltip } from '@grafana/ui';
import { Overlay } from 'shared/components/Elements/Overlay/Overlay';
import { Highlight } from 'shared/components/Hightlight/Highlight';
-import Tippy from '@tippyjs/react';
import { getStyles } from './Plan.styles';
import { Messages } from './Plan.messages';
import { usePlan } from './Plan.hooks';
@@ -21,16 +20,15 @@ export const Plan: FC = () => {
{plan?.plan || ''}
>
) : (
From 0a8b41617b3093f4d6facbf789849e2812858c0f Mon Sep 17 00:00:00 2001
From: Matej Kubinec <32638572+matejkubinec@users.noreply.github.com>
Date: Thu, 4 Jul 2024 11:19:48 +0200
Subject: [PATCH 2/3] PMM-13147 Update qan plugin configuration (#1608)
---
pmm-app/src/module.ts | 6 +++---
pmm-app/src/plugin.json | 14 +++++---------
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/pmm-app/src/module.ts b/pmm-app/src/module.ts
index 13c8cd1fde..5931dbc9c3 100755
--- a/pmm-app/src/module.ts
+++ b/pmm-app/src/module.ts
@@ -1,3 +1,3 @@
-export class ConfigCtrl {
- static template = 'PMM App
';
-}
+import { AppPlugin } from '@grafana/data';
+
+export const plugin = new AppPlugin();
diff --git a/pmm-app/src/plugin.json b/pmm-app/src/plugin.json
index 2d51026949..675457a6a6 100755
--- a/pmm-app/src/plugin.json
+++ b/pmm-app/src/plugin.json
@@ -17,8 +17,8 @@
"small": "img/pmm-logo.svg",
"large": "img/pmm-logo.svg"
},
- "version": "2.32.0",
- "updated": "2022-11-07"
+ "version": "3.0.0",
+ "updated": "2024-06-20"
},
"includes": [
{
@@ -180,7 +180,7 @@
{
"type": "dashboard",
"name": "NUMA Details",
- "path":"dashboards/OS/NUMA_Details.json"
+ "path": "dashboards/OS/NUMA_Details.json"
},
{
"type": "dashboard",
@@ -192,10 +192,7 @@
"name": "MySQL Group Replication Summary",
"path": "dashboards/MySQL/MySQL_Group_Replication_Summary.json"
},
- { "type": "dashboard",
- "name": "Network Details",
- "path": "dashboards/OS/Network_Details.json"
- },
+ { "type": "dashboard", "name": "Network Details", "path": "dashboards/OS/Network_Details.json" },
{
"type": "dashboard",
"name": "Nodes Compare",
@@ -292,9 +289,8 @@
"path": "dashboards/Experimental/Environments_Overview.json"
}
],
-
"dependencies": {
- "grafanaDependency": ">=7.x.x",
+ "grafanaDependency": ">=10.x.x",
"plugins": []
}
}
From 2e722b784ef8219dc9d4ce0037c0caf1be3b1303 Mon Sep 17 00:00:00 2001
From: Yash Sartanpara <119680679+YashSartanpara1@users.noreply.github.com>
Date: Thu, 11 Jul 2024 14:46:46 +0530
Subject: [PATCH 3/3] PMM-13159 Remove collection details dashboard (#1607)
(#1611)
* PMM-13159 Remove collection details dashboard
* PMM-13159 Trigger checks
---
.../MongoDB_Collection_Details.json | 1170 -----------------
1 file changed, 1170 deletions(-)
delete mode 100644 dashboards/Experimental/MongoDB_Collection_Details.json
diff --git a/dashboards/Experimental/MongoDB_Collection_Details.json b/dashboards/Experimental/MongoDB_Collection_Details.json
deleted file mode 100644
index ff38524500..0000000000
--- a/dashboards/Experimental/MongoDB_Collection_Details.json
+++ /dev/null
@@ -1,1170 +0,0 @@
-{
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "datasource",
- "uid": "grafana"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "target": {
- "limit": 100,
- "matchAny": false,
- "tags": [],
- "type": "dashboard"
- },
- "type": "dashboard"
- },
- {
- "datasource": {
- "type": "datasource",
- "uid": "grafana"
- },
- "enable": true,
- "iconColor": "orange",
- "name": "PMM Annotations",
- "target": {
- "limit": 100,
- "matchAny": true,
- "tags": [
- "pmm_annotation",
- " $service_name"
- ],
- "type": "tags"
- }
- }
- ]
- },
- "editable": false,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 1,
- "id": null,
- "links": [
- {
- "asDropdown": false,
- "icon": "doc",
- "includeVars": true,
- "keepTime": true,
- "tags": [],
- "targetBlank": false,
- "title": "Home",
- "tooltip": "",
- "type": "link",
- "url": "/graph/d/pmm-home/home-dashboard"
- },
- {
- "asDropdown": false,
- "icon": "dashboard",
- "includeVars": true,
- "keepTime": true,
- "tags": [],
- "targetBlank": false,
- "title": "Query Analytics",
- "tooltip": "",
- "type": "link",
- "url": "/graph/d/pmm-qan/pmm-query-analytics"
- },
- {
- "asDropdown": false,
- "icon": "bolt",
- "includeVars": true,
- "keepTime": true,
- "tags": [],
- "targetBlank": false,
- "title": "Compare",
- "tooltip": "",
- "type": "link",
- "url": "/graph/d/mongodb-instance-compare/mongodb-instances-compare"
- },
- {
- "asDropdown": true,
- "icon": "external link",
- "includeVars": true,
- "keepTime": true,
- "tags": [
- "MongoDB"
- ],
- "targetBlank": false,
- "title": "MongoDB",
- "tooltip": "",
- "type": "dashboards",
- "url": ""
- },
- {
- "asDropdown": true,
- "icon": "external link",
- "includeVars": true,
- "keepTime": true,
- "tags": [
- "MongoDB_HA"
- ],
- "targetBlank": false,
- "title": "HA",
- "tooltip": "",
- "type": "dashboards",
- "url": ""
- },
- {
- "asDropdown": true,
- "icon": "external link",
- "includeVars": false,
- "keepTime": true,
- "tags": [
- "Services"
- ],
- "targetBlank": false,
- "title": "Services",
- "tooltip": "",
- "type": "dashboards",
- "url": ""
- },
- {
- "asDropdown": true,
- "icon": "external link",
- "includeVars": false,
- "keepTime": true,
- "tags": [
- "PMM"
- ],
- "targetBlank": false,
- "title": "PMM",
- "tooltip": "",
- "type": "dashboards",
- "url": ""
- }
- ],
- "liveNow": false,
- "panels": [
- {
- "collapsed": false,
- "datasource": "Metrics",
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 0
- },
- "id": 2,
- "panels": [],
- "targets": [
- {
- "datasource": "Metrics",
- "refId": "A"
- }
- ],
- "title": "Largest Collections",
- "type": "row"
- },
- {
- "datasource": "Metrics",
- "description": "Lists the largest collections according to number of documents; helps track growth and look to address possible performance issues.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "custom": {
- "align": "auto",
- "displayMode": "auto",
- "inspect": false
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "short"
- },
- "overrides": [
- {
- "matcher": {
- "id": "byName",
- "options": "Time"
- },
- "properties": [
- {
- "id": "unit",
- "value": "short"
- },
- {
- "id": "decimals",
- "value": 2
- },
- {
- "id": "custom.align"
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 1
- },
- "hideTimeOverride": true,
- "id": 6,
- "links": [],
- "options": {
- "footer": {
- "fields": "",
- "reducer": [
- "sum"
- ],
- "show": false
- },
- "showHeader": true
- },
- "pluginVersion": "9.1.2",
- "targets": [
- {
- "datasource": "Metrics",
- "exemplar": false,
- "expr": "topk(10, avg by (service_name,database,collection) (sum(mongodb_collstats_storageStats_count{service_name=~\"$service_name\"}) by (service_name, database, collection))) > 0",
- "format": "table",
- "instant": true,
- "interval": "5m",
- "intervalFactor": 1,
- "legendFormat": "{{service_name}}.{{ schema }}.{{ table }}",
- "refId": "A",
- "step": 300
- }
- ],
- "timeFrom": "5m",
- "title": "Top 10 Largest Collections by Document Count",
- "transformations": [
- {
- "id": "filterFieldsByName",
- "options": {
- "include": {
- "names": [
- "collection",
- "database",
- "service_name",
- "Value"
- ]
- }
- }
- },
- {
- "id": "organize",
- "options": {
- "excludeByName": {},
- "indexByName": {
- "Value": 3,
- "collection": 1,
- "database": 0,
- "service_name": 2
- },
- "renameByName": {}
- }
- }
- ],
- "type": "table"
- },
- {
- "datasource": "Metrics",
- "description": "Lists the largest collections according to size; helps track growth and assess need to scale or shard.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "custom": {
- "align": "auto",
- "displayMode": "auto",
- "inspect": false
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "bytes"
- },
- "overrides": [
- {
- "matcher": {
- "id": "byName",
- "options": "Time"
- },
- "properties": [
- {
- "id": "unit",
- "value": "short"
- },
- {
- "id": "decimals",
- "value": 2
- },
- {
- "id": "custom.align"
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 1
- },
- "hideTimeOverride": true,
- "id": 10,
- "links": [],
- "options": {
- "footer": {
- "fields": "",
- "reducer": [
- "sum"
- ],
- "show": false
- },
- "showHeader": true
- },
- "pluginVersion": "9.1.2",
- "targets": [
- {
- "datasource": "Metrics",
- "exemplar": false,
- "expr": "topk(10, avg by (service_name,database,collection) (sum(mongodb_collstats_storageStats_size{service_name=~\"$service_name\"}) by (service_name, database, collection))) > 0",
- "format": "table",
- "instant": true,
- "interval": "5m",
- "intervalFactor": 1,
- "legendFormat": "{{service_name}}.{{ schema }}.{{ table }}",
- "refId": "A",
- "step": 300
- }
- ],
- "timeFrom": "5m",
- "title": "Top 10 Largest Collections by Size",
- "transformations": [
- {
- "id": "filterFieldsByName",
- "options": {
- "include": {
- "names": [
- "database",
- "service_name",
- "Value",
- "collection"
- ]
- }
- }
- },
- {
- "id": "organize",
- "options": {
- "excludeByName": {},
- "indexByName": {
- "Value": 3,
- "collection": 1,
- "database": 0,
- "service_name": 2
- },
- "renameByName": {}
- }
- }
- ],
- "type": "table"
- },
- {
- "collapsed": false,
- "datasource": "Metrics",
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 8
- },
- "id": 12,
- "panels": [],
- "repeat": "service_name",
- "targets": [
- {
- "datasource": "Metrics",
- "refId": "A"
- }
- ],
- "title": "Size - $service_name",
- "type": "row"
- },
- {
- "datasource": "Metrics",
- "description": "Provides the names and sizes databases in an instance/cluster",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "never",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "decimals": 2,
- "links": [],
- "mappings": [],
- "min": 0,
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "bytes"
- },
- "overrides": [
- {
- "matcher": {
- "id": "byName",
- "options": "Data + Index Size"
- },
- "properties": [
- {
- "id": "color",
- "value": {
- "fixedColor": "#65C5DB",
- "mode": "fixed"
- }
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 9
- },
- "id": 14,
- "links": [],
- "options": {
- "legend": {
- "calcs": [
- "mean",
- "max",
- "min"
- ],
- "displayMode": "table",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.3.5",
- "targets": [
- {
- "calculatedInterval": "2m",
- "datasource": "Metrics",
- "datasourceErrors": {},
- "errors": {},
- "exemplar": true,
- "expr": "avg by (service_name) (sum(max_over_time(mongodb_collstats_storageStats_size{service_name=~\"$service_name\"}[$interval]) or\nmax_over_time(mongodb_collstats_storageStats_size{service_name=~\"$service_name\"}[5m])))",
- "format": "time_series",
- "interval": "$interval",
- "intervalFactor": 1,
- "legendFormat": "Data + Index Size",
- "metric": "",
- "refId": "A",
- "step": 300
- }
- ],
- "title": "Total Databases Size - $service_name",
- "type": "timeseries"
- },
- {
- "datasource": "Metrics",
- "description": "Lists the most fragmented collections (storage available for reuse) - ranked by size. Address your largest fragmented collections 1st for performance",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "custom": {
- "align": "auto",
- "displayMode": "auto",
- "inspect": false
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "bytes"
- },
- "overrides": [
- {
- "matcher": {
- "id": "byName",
- "options": "Time"
- },
- "properties": [
- {
- "id": "unit",
- "value": "short"
- },
- {
- "id": "decimals",
- "value": 2
- },
- {
- "id": "custom.align"
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 9
- },
- "hideTimeOverride": true,
- "id": 16,
- "links": [],
- "options": {
- "footer": {
- "fields": "",
- "reducer": [
- "sum"
- ],
- "show": false
- },
- "showHeader": true
- },
- "pluginVersion": "9.1.2",
- "targets": [
- {
- "datasource": "Metrics",
- "exemplar": false,
- "expr": "topk(5, avg by (service_name,database,collection) (sum(mongodb_collstats_storageStats_freeStorageSize{service_name=~\"$service_name\"}) by (database, collection, service_name)))",
- "format": "table",
- "instant": true,
- "interval": "5m",
- "intervalFactor": 1,
- "legendFormat": "{{ service_name }} - {{ database }}.{{ collection }}",
- "refId": "A",
- "step": 300
- }
- ],
- "timeFrom": "5m",
- "title": "Top 5 Most Fragmented Collections by Freeable Size - $service_name (MongoDB 5.0+)",
- "transformations": [
- {
- "id": "filterFieldsByName",
- "options": {
- "include": {
- "names": [
- "collection",
- "database",
- "service_name",
- "Value"
- ]
- }
- }
- },
- {
- "id": "organize",
- "options": {
- "excludeByName": {},
- "indexByName": {
- "Value": 3,
- "collection": 1,
- "database": 0,
- "service_name": 2
- },
- "renameByName": {}
- }
- }
- ],
- "type": "table"
- },
- {
- "collapsed": false,
- "datasource": "Metrics",
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 17
- },
- "id": 20,
- "panels": [],
- "targets": [
- {
- "datasource": "Metrics",
- "refId": "A"
- }
- ],
- "title": "Collection Activity",
- "type": "row"
- },
- {
- "datasource": "Metrics",
- "editable": true,
- "error": false,
- "gridPos": {
- "h": 2,
- "w": 24,
- "x": 0,
- "y": 18
- },
- "height": "50px",
- "id": 68,
- "links": [],
- "options": {
- "content": "The next two graphs are available only when `--enable-all-collectors` option is used in pmm-admin. Graph **Top 5 Collection by Documents Changed** displays data only on selecting the Primary node.",
- "mode": "markdown"
- },
- "pluginVersion": "9.1.2",
- "style": {},
- "targets": [
- {
- "datasource": "Metrics",
- "refId": "A"
- }
- ],
- "transparent": true,
- "type": "text"
- },
- {
- "collapsed": false,
- "datasource": "Metrics",
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 20
- },
- "id": 18,
- "panels": [],
- "targets": [
- {
- "datasource": "Metrics",
- "refId": "A"
- }
- ],
- "title": "Documents Read",
- "type": "row"
- },
- {
- "datasource": "Metrics",
- "description": "Show the 5 collections according to read activity",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "never",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "decimals": 2,
- "links": [],
- "mappings": [],
- "min": 0,
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "short"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 24,
- "x": 0,
- "y": 21
- },
- "id": 24,
- "links": [],
- "options": {
- "legend": {
- "calcs": [
- "mean",
- "max",
- "min"
- ],
- "displayMode": "table",
- "placement": "right",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.3.5",
- "targets": [
- {
- "calculatedInterval": "2m",
- "datasource": "Metrics",
- "datasourceErrors": {},
- "errors": {},
- "exemplar": true,
- "expr": "topk(5, avg by (service_name,database,collection) (rate(mongodb_top_queries_count{service_name=~\"$service_name\"}[$interval]))>0) or \ntopk(5, avg by (service_name,database,collection) (irate(mongodb_top_queries_count{service_name=~\"$service_name\"}[5m]))>0)",
- "format": "time_series",
- "interval": "$interval",
- "intervalFactor": 1,
- "legendFormat": "{{service_name}} - {{ database }}.{{ collection }}",
- "metric": "",
- "refId": "A",
- "step": 300
- }
- ],
- "title": "Top 5 Collections by Documents Read",
- "type": "timeseries"
- },
- {
- "collapsed": false,
- "datasource": "Metrics",
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 29
- },
- "id": 22,
- "panels": [],
- "targets": [
- {
- "datasource": "Metrics",
- "refId": "A"
- }
- ],
- "title": "Documents Changed",
- "type": "row"
- },
- {
- "datasource": "Metrics",
- "description": "Show the 5 collections according to write activity",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "never",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "decimals": 2,
- "links": [],
- "mappings": [],
- "min": 0,
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "short"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 24,
- "x": 0,
- "y": 30
- },
- "id": 26,
- "interval": "",
- "links": [],
- "options": {
- "legend": {
- "calcs": [
- "mean",
- "max",
- "min"
- ],
- "displayMode": "table",
- "placement": "right",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.3.5",
- "targets": [
- {
- "calculatedInterval": "2m",
- "datasource": "Metrics",
- "datasourceErrors": {},
- "errors": {},
- "exemplar": true,
- "expr": "topk(5, avg by (service_name,database,collection) (rate(sum by (service_name,database,collection) ((mongodb_top_insert_count{service_name=~\"$service_name\"}) + (mongodb_top_update_count{service_name=~\"$service_name\"}) + (mongodb_top_remove_count{service_name=~\"$service_name\"}))[$interval])>0)) or topk(5, avg by (service_name,database,collection) (irate(sum by (service_name,database,collection) ((mongodb_top_insert_count{service_name=~\"$service_name\"}) + (mongodb_top_update_count{service_name=~\"$service_name\"}) + (mongodb_top_remove_count{service_name=~\"$service_name\"}))[5m]))>0)",
- "format": "time_series",
- "interval": "$interval",
- "intervalFactor": 1,
- "legendFormat": "{{service_name}} - {{ database }}.{{ collection }}",
- "metric": "",
- "refId": "A",
- "step": 300
- }
- ],
- "title": "Top 5 Collections by Documents Changed",
- "type": "timeseries"
- }
- ],
- "refresh": "1m",
- "schemaVersion": 34,
- "style": "dark",
- "tags": [
- "MongoDB",
- "Percona"
- ],
- "templating": {
- "list": [
- {
- "auto": true,
- "auto_count": 200,
- "auto_min": "1s",
- "current": {
- "selected": false,
- "text": "auto",
- "value": "$__auto_interval_interval"
- },
- "hide": 0,
- "label": "Interval",
- "name": "interval",
- "options": [
- {
- "selected": true,
- "text": "auto",
- "value": "$__auto_interval_interval"
- },
- {
- "selected": false,
- "text": "1s",
- "value": "1s"
- },
- {
- "selected": false,
- "text": "5s",
- "value": "5s"
- },
- {
- "selected": false,
- "text": "1m",
- "value": "1m"
- },
- {
- "selected": false,
- "text": "5m",
- "value": "5m"
- },
- {
- "selected": false,
- "text": "1h",
- "value": "1h"
- },
- {
- "selected": false,
- "text": "6h",
- "value": "6h"
- },
- {
- "selected": false,
- "text": "1d",
- "value": "1d"
- }
- ],
- "query": "1s,5s,1m,5m,1h,6h,1d",
- "queryValue": "",
- "refresh": 2,
- "skipUrlSync": false,
- "type": "interval"
- },
- {
- "allValue": ".*",
- "current": {
- "selected": false,
- "text": "All",
- "value": "$__all"
- },
- "definition": "label_values({__name__=~\"mongodb_up\"}, environment)",
- "hide": 0,
- "includeAll": true,
- "label": "Environment",
- "multi": true,
- "name": "environment",
- "options": [],
- "query": {
- "query": "label_values({__name__=~\"mongodb_up\"}, environment)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 5,
- "type": "query"
- },
- {
- "allValue": ".*",
- "current": {
- "selected": false,
- "text": "",
- "value": ""
- },
- "datasource": "Metrics",
- "definition": "label_values(mongodb_up{environment=~\"$environment\"},cluster)",
- "hide": 0,
- "includeAll": true,
- "label": "Cluster",
- "multi": true,
- "name": "cluster",
- "options": [],
- "query": {
- "query": "label_values(mongodb_up{environment=~\"$environment\"},cluster)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 5,
- "type": "query"
- },
- {
- "current": {
- "isNone": true,
- "selected": false,
- "text": "None",
- "value": ""
- },
- "datasource": "Metrics",
- "definition": "label_values(mongodb_mongod_replset_my_state{cluster=~\"$cluster\"}, set)",
- "hide": 0,
- "includeAll": false,
- "label": "Replica Set",
- "multi": true,
- "name": "replset",
- "options": [],
- "query": {
- "query": "label_values(mongodb_mongod_replset_my_state{cluster=~\"$cluster\"}, set)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 5,
- "type": "query"
- },
- {
- "current": {
- "selected": false,
- "text": "None",
- "value": ""
- },
- "datasource": "Metrics",
- "definition": "label_values(mongodb_up{environment=~\"$environment\",cluster=~\"$cluster\",node_name=~\"$node_name\"}, service_name)",
- "hide": 0,
- "includeAll": false,
- "label": "Service Name",
- "multi": true,
- "name": "service_name",
- "options": [],
- "query": {
- "query": "label_values(mongodb_up{environment=~\"$environment\",cluster=~\"$cluster\",node_name=~\"$node_name\"}, service_name)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 5,
- "type": "query"
- },
- {
- "current": {
- "selected": false,
- "text": "None",
- "value": ""
- },
- "datasource": "Metrics",
- "definition": "label_values(mongodb_up{environment=~\"$environment\",cluster=~\"$cluster\"}, node_name)",
- "hide": 2,
- "includeAll": false,
- "label": "Node Name",
- "multi": true,
- "name": "node_name",
- "options": [],
- "query": {
- "query": "label_values(mongodb_up{environment=~\"$environment\",cluster=~\"$cluster\"}, node_name)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 5,
- "type": "query"
- }
- ]
- },
- "time": {
- "from": "now-12h",
- "to": "now"
- },
- "timepicker": {
- "collapse": false,
- "enable": true,
- "hidden": false,
- "notice": false,
- "now": true,
- "refresh_intervals": [
- "5s",
- "10s",
- "30s",
- "1m",
- "5m",
- "15m",
- "30m",
- "1h",
- "2h",
- "1d"
- ],
- "status": "Stable",
- "time_options": [
- "5m",
- "15m",
- "1h",
- "6h",
- "12h",
- "24h",
- "2d",
- "7d",
- "30d"
- ],
- "type": "timepicker"
- },
- "timezone": "",
- "title": "MongoDB Collection Details",
- "uid": "mongodb-collection-details",
- "version": 1,
- "weekStart": ""
-}