diff --git a/docs/generated/metrics/metrics.html b/docs/generated/metrics/metrics.html index e772a6531780..4d8f7d88dc8f 100644 --- a/docs/generated/metrics/metrics.html +++ b/docs/generated/metrics/metrics.html @@ -1561,6 +1561,10 @@ APPLICATIONsql.copy.nonatomic.started.count.internalNumber of non-atomic COPY SQL statements started (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE APPLICATIONsql.copy.started.countNumber of COPY SQL statements startedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE APPLICATIONsql.copy.started.count.internalNumber of COPY SQL statements started (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE +APPLICATIONsql.crud_query.countNumber of SQL SELECT, INSERT, UPDATE, DELETE statements successfully executedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE +APPLICATIONsql.crud_query.count.internalNumber of SQL SELECT, INSERT, UPDATE, DELETE statements successfully executed (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE +APPLICATIONsql.crud_query.started.countNumber of SQL SELECT, INSERT, UPDATE, DELETE statements startedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE +APPLICATIONsql.crud_query.started.count.internalNumber of SQL SELECT, INSERT, UPDATE, DELETE statements started (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE APPLICATIONsql.ddl.countNumber of SQL DDL statements successfully executedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE APPLICATIONsql.ddl.count.internalNumber of SQL DDL statements successfully executed (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE APPLICATIONsql.ddl.started.countNumber of SQL DDL statements startedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE @@ -1676,10 +1680,10 @@ APPLICATIONsql.pre_serve.mem.curCurrent memory usage for SQL connections prior to routing the connection to the target SQL serverMemoryGAUGEBYTESAVGNONE APPLICATIONsql.pre_serve.mem.maxMemory usage for SQL connections prior to routing the connection to the target SQL serverMemoryHISTOGRAMBYTESAVGNONE APPLICATIONsql.pre_serve.new_connsNumber of SQL connections created prior to routing the connection to the target SQL serverConnectionsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE -APPLICATIONsql.query.countNumber of SQL queries executedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE -APPLICATIONsql.query.count.internalNumber of SQL queries executed (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE -APPLICATIONsql.query.started.countNumber of SQL queries startedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE -APPLICATIONsql.query.started.count.internalNumber of SQL queries started (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE +APPLICATIONsql.query.countNumber of SQL operations started including queries, and transaction control statementsSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE +APPLICATIONsql.query.count.internalNumber of SQL operations started including queries, and transaction control statements (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE +APPLICATIONsql.query.started.countNumber of SQL operations started including queries, and transaction control statementsSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE +APPLICATIONsql.query.started.count.internalNumber of SQL operations started including queries, and transaction control statements (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE APPLICATIONsql.restart_savepoint.countNumber of `SAVEPOINT cockroach_restart` statements successfully executedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE APPLICATIONsql.restart_savepoint.count.internalNumber of `SAVEPOINT cockroach_restart` statements successfully executed (internal queries)SQL Internal StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE APPLICATIONsql.restart_savepoint.release.countNumber of `RELEASE SAVEPOINT cockroach_restart` statements successfully executedSQL StatementsCOUNTERCOUNTAVGNON_NEGATIVE_DERIVATIVE diff --git a/pkg/sql/conn_executor.go b/pkg/sql/conn_executor.go index ead2b0e60bc7..f9996e9ce514 100644 --- a/pkg/sql/conn_executor.go +++ b/pkg/sql/conn_executor.go @@ -4435,6 +4435,8 @@ type StatementCounters struct { UpdateCount telemetry.CounterWithMetric InsertCount telemetry.CounterWithMetric DeleteCount telemetry.CounterWithMetric + // CRUDQueryCount includes all 4 CRUD statements above. + CRUDQueryCount telemetry.CounterWithMetric // Transaction operations. TxnBeginCount telemetry.CounterWithMetric @@ -4499,6 +4501,8 @@ func makeStartedStatementCounters(internal bool) StatementCounters { getMetricMeta(MetaInsertStarted, internal)), DeleteCount: telemetry.NewCounterWithMetric( getMetricMeta(MetaDeleteStarted, internal)), + CRUDQueryCount: telemetry.NewCounterWithMetric( + getMetricMeta(MetaCRUDStarted, internal)), DdlCount: telemetry.NewCounterWithMetric( getMetricMeta(MetaDdlStarted, internal)), CopyCount: telemetry.NewCounterWithMetric( @@ -4542,6 +4546,8 @@ func makeExecutedStatementCounters(internal bool) StatementCounters { getMetricMeta(MetaInsertExecuted, internal)), DeleteCount: telemetry.NewCounterWithMetric( getMetricMeta(MetaDeleteExecuted, internal)), + CRUDQueryCount: telemetry.NewCounterWithMetric( + getMetricMeta(MetaCRUDExecuted, internal)), DdlCount: telemetry.NewCounterWithMetric( getMetricMeta(MetaDdlExecuted, internal)), CopyCount: telemetry.NewCounterWithMetric( @@ -4562,12 +4568,16 @@ func (sc *StatementCounters) incrementCount(ex *connExecutor, stmt tree.Statemen sc.TxnBeginCount.Inc() case *tree.Select: sc.SelectCount.Inc() + sc.CRUDQueryCount.Inc() case *tree.Update: sc.UpdateCount.Inc() + sc.CRUDQueryCount.Inc() case *tree.Insert: sc.InsertCount.Inc() + sc.CRUDQueryCount.Inc() case *tree.Delete: sc.DeleteCount.Inc() + sc.CRUDQueryCount.Inc() case *tree.CommitTransaction: sc.TxnCommitCount.Inc() case *tree.RollbackTransaction: diff --git a/pkg/sql/exec_util.go b/pkg/sql/exec_util.go index 55ce0f7652f3..057cf70cd005 100644 --- a/pkg/sql/exec_util.go +++ b/pkg/sql/exec_util.go @@ -833,7 +833,7 @@ var ( // Below are the metadata for the statement started counters. MetaQueryStarted = metric.Metadata{ Name: "sql.query.started.count", - Help: "Number of SQL queries started", + Help: "Number of SQL operations started including queries, and transaction control statements", Measurement: "SQL Statements", Unit: metric.Unit_COUNT, } @@ -885,6 +885,12 @@ var ( Measurement: "SQL Statements", Unit: metric.Unit_COUNT, } + MetaCRUDStarted = metric.Metadata{ + Name: "sql.crud_query.started.count", + Help: "Number of SQL SELECT, INSERT, UPDATE, DELETE statements started", + Measurement: "SQL Statements", + Unit: metric.Unit_COUNT, + } MetaSavepointStarted = metric.Metadata{ Name: "sql.savepoint.started.count", Help: "Number of SQL SAVEPOINT statements started", @@ -949,7 +955,7 @@ var ( // Below are the metadata for the statement executed counters. MetaQueryExecuted = metric.Metadata{ Name: "sql.query.count", - Help: "Number of SQL queries executed", + Help: "Number of SQL operations started including queries, and transaction control statements", Measurement: "SQL Statements", Unit: metric.Unit_COUNT, } @@ -1001,6 +1007,12 @@ var ( Measurement: "SQL Statements", Unit: metric.Unit_COUNT, } + MetaCRUDExecuted = metric.Metadata{ + Name: "sql.crud_query.count", + Help: "Number of SQL SELECT, INSERT, UPDATE, DELETE statements successfully executed", + Measurement: "SQL Statements", + Unit: metric.Unit_COUNT, + } MetaSavepointExecuted = metric.Metadata{ Name: "sql.savepoint.count", Help: "Number of SQL SAVEPOINT statements successfully executed", diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx index 3f5269e36faa..cf1c1795b8e8 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx @@ -30,12 +30,12 @@ export default function (props: GraphDashboardProps) { return [ @@ -60,6 +60,11 @@ export default function (props: GraphDashboardProps) { title="Deletes" nonNegativeRate /> + , diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx index dcae25ab7407..424d21ba55a4 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx @@ -137,12 +137,12 @@ export default function (props: GraphDashboardProps) { , @@ -166,6 +166,11 @@ export default function (props: GraphDashboardProps) { title="Deletes" nonNegativeRate /> + , diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx index ae924b08b8f3..c627352b74e4 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx @@ -10,7 +10,7 @@ import { useSelector } from "react-redux"; import { Link } from "react-router-dom"; import { createSelector } from "reselect"; -import { Tooltip, Anchor } from "src/components"; +import { Anchor, Tooltip } from "src/components"; import { nodeStatusesSelector, nodeSumsSelector } from "src/redux/nodes"; import { howAreCapacityMetricsCalculated } from "src/util/docs"; import { EventBox } from "src/views/cluster/containers/events"; @@ -18,11 +18,11 @@ import { Metric } from "src/views/shared/components/metricQuery"; import { SummaryBar, SummaryLabel, + SummaryMetricsAggregator, SummaryMetricStat, SummaryStat, SummaryStatBreakdown, SummaryStatMessage, - SummaryMetricsAggregator, } from "src/views/shared/components/summaryBar"; /** @@ -145,28 +145,7 @@ export default function (props: ClusterSummaryProps) { > - - -