{
  "name": "TiDB X Starter Dynamic Tracker",
  "description": null,
  "pages": [
    {
      "name": "Overview",
      "description": null,
      "widgets": [
        {
          "title": "",
          "layout": {
            "column": 1,
            "row": 1,
            "width": 12,
            "height": 1
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.markdown"
          },
          "rawConfiguration": {
            "text": "# TiDB X Starter Overview"
          }
        },
        {
          "title": "",
          "layout": {
            "column": 1,
            "row": 2,
            "width": 12,
            "height": 1
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.markdown"
          },
          "rawConfiguration": {
            "text": "## Cluster Performance"
          }
        },
        {
          "title": "Database Time",
          "layout": {
            "column": 1,
            "row": 3,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_database_time`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              },
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_database_time`) FROM Metric FACET sql_type SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "SECONDS"
            }
          }
        },
        {
          "title": "Queries Per Second",
          "layout": {
            "column": 7,
            "row": 3,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_query_per_second`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              },
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_query_per_second`) FROM Metric FACET type SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "COUNT"
            }
          }
        },
        {
          "title": "Average Query Duration",
          "layout": {
            "column": 1,
            "row": 6,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT average(`tidb_cloud.db_average_query_duration`) FROM Metric FACET sql_type SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "SECONDS"
            }
          }
        },
        {
          "title": "Failed Queries Per Second",
          "layout": {
            "column": 7,
            "row": 6,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_failed_queries`) FROM Metric FACET type SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "COUNT"
            }
          }
        },
        {
          "title": "Row Storage Used Bytes",
          "layout": {
            "column": 1,
            "row": 9,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_row_storage_used_bytes`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "BYTES"
            }
          }
        },
        {
          "title": "Columnar Storage Used Bytes",
          "layout": {
            "column": 7,
            "row": 9,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_columnar_storage_used_bytes`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "BYTES"
            }
          }
        },
        {
          "title": "",
          "layout": {
            "column": 1,
            "row": 12,
            "width": 12,
            "height": 1
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.markdown"
          },
          "rawConfiguration": {
            "text": "## Connections"
          }
        },
        {
          "title": "Total Connection",
          "layout": {
            "column": 1,
            "row": 13,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_total_connection`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "COUNT"
            }
          }
        },
        {
          "title": "Active Connections",
          "layout": {
            "column": 7,
            "row": 13,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_active_connections`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "COUNT"
            }
          }
        },
        {
          "title": "Disconnection Count",
          "layout": {
            "column": 1,
            "row": 16,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_disconnections`) FROM Metric FACET result SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "COUNT"
            }
          }
        },
        {
          "title": "",
          "layout": {
            "column": 1,
            "row": 16,
            "width": 12,
            "height": 1
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.markdown"
          },
          "rawConfiguration": {
            "text": "## Command & Transaction"
          }
        },
        {
          "title": "Command Per Second",
          "layout": {
            "column": 1,
            "row": 18,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_command_per_second`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              },
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_command_per_second`) FROM Metric FACET type SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "COUNT"
            }
          }
        },
        {
          "title": "Queries Using Plan Cache OPS",
          "layout": {
            "column": 7,
            "row": 18,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_queries_using_plan_cache_ops`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "COUNT"
            }
          }
        },
        {
          "title": "Transaction Per Second",
          "layout": {
            "column": 1,
            "row": 21,
            "width": 6,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_transaction_per_second`) AS 'Total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              },
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.db_transaction_per_second`) FROM Metric FACET tuple(type, txn_mode) SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "nullValues": {
              "nullValue": "remove"
            },
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "yAxisLeft": {
              "zero": true
            },
            "units": {
              "unit": "COUNT"
            }
          }
        },
        {
          "title": "",
          "layout": {
            "column": 1,
            "row": 20,
            "width": 12,
            "height": 1
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.markdown"
          },
          "rawConfiguration": {
            "text": "## Resource Unit"
          }
        },
        {
          "title": "Resource Group RU",
          "layout": {
            "column": 1,
            "row": 23,
            "width": 12,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.line"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "legend": {
              "enabled": true
            },
            "markers": {
              "displayedTypes": {
                "criticalViolations": false,
                "deployments": true,
                "relatedDeployments": true,
                "warningViolations": false
              }
            },
            "nrqlQueries": [
              {
                "accountIds": [],
                "query": "SELECT sum(`tidb_cloud.resource_manager_resource_request_unit_total`) AS 'total' FROM Metric SINCE 24 HOURS AGO TIMESERIES WHERE instance_name IN ({{instance_name}}) AND instance_id IN ({{instance_id}})"
              }
            ],
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "thresholds": {
              "isLabelVisible": true
            },
            "units": {
              "unit": "COUNT"
            },
            "yAxisLeft": {
              "zero": true
            },
            "yAxisRight": {
              "zero": true
            }
          }
        }
      ]
    }
  ],
  "variables": [
    {
      "name": "instance_name",
      "items": null,
      "defaultValues": [
        {
          "value": {
            "string": "*"
          }
        }
      ],
      "nrqlQuery": {
        "accountIds": [],
        "query": "SELECT uniques(instance_name) FROM Metric WHERE metricName='tidb_cloud.db_database_time'"
      },
      "options": {
        "ignoreTimeRange": false,
        "excluded": false
      },
      "title": "instance_name",
      "type": "NRQL",
      "isMultiSelection": false,
      "replacementStrategy": "STRING"
    },
    {
      "name": "instance_id",
      "items": null,
      "defaultValues": [
        {
          "value": {
            "string": "*"
          }
        }
      ],
      "nrqlQuery": {
        "accountIds": [],
        "query": "SELECT uniques(instance_id) FROM Metric WHERE metricName='tidb_cloud.db_database_time'"
      },
      "options": {
        "ignoreTimeRange": false,
        "excluded": false
      },
      "title": "instance_id",
      "type": "NRQL",
      "isMultiSelection": false,
      "replacementStrategy": "STRING"
    }
  ]
}
