Skip to content

Commit 0a67ec5

Browse files
committed
sql: fix label for routine started metrics
During 25.4 in ef4acb4 we merged a change to add counters for stmts started and executed in routines. However, for both types we used `sql.count` label which I think is a mistake - we should use `sql.started.count` for "started" and `sql.count` for "executed" (similar to what we do for stmts outside of the routines). Release note: None
1 parent df939a7 commit 0a67ec5

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

docs/generated/metrics/metrics.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ layers:
664664
derivative: NON_NEGATIVE_DERIVATIVE
665665
- name: sql.routine.delete.started.count
666666
exported_name: sql_routine_delete_started_count
667-
labeled_name: 'sql.count{query_type: routine-started-delete}'
667+
labeled_name: 'sql.started.count{query_type: routine-started-delete}'
668668
description: Number of SQL DELETE statements started within routine invocation
669669
y_axis_label: SQL Statements
670670
type: COUNTER
@@ -674,7 +674,7 @@ layers:
674674
how_to_use: This high-level metric reflects workload volume. Monitor this metric to identify abnormal application behavior or patterns over time. If abnormal patterns emerge, apply the metric's time range to the SQL Activity pages to investigate interesting outliers or patterns. For example, on the Transactions page and the Statements page, sort on the Execution Count column. To find problematic sessions, on the Sessions page, sort on the Transaction Count column. Find the sessions with high transaction counts and trace back to a user or application.
675675
- name: sql.routine.delete.started.count.internal
676676
exported_name: sql_routine_delete_started_count_internal
677-
labeled_name: 'sql.count{query_type: routine-started-delete, query_internal: true}'
677+
labeled_name: 'sql.started.count{query_type: routine-started-delete, query_internal: true}'
678678
description: Number of SQL DELETE statements started within routine invocation (internal queries)
679679
y_axis_label: SQL Internal Statements
680680
type: COUNTER
@@ -703,7 +703,7 @@ layers:
703703
derivative: NON_NEGATIVE_DERIVATIVE
704704
- name: sql.routine.insert.started.count
705705
exported_name: sql_routine_insert_started_count
706-
labeled_name: 'sql.count{query_type: routine-started-insert}'
706+
labeled_name: 'sql.started.count{query_type: routine-started-insert}'
707707
description: Number of SQL INSERT statements started within routine invocation
708708
y_axis_label: SQL Statements
709709
type: COUNTER
@@ -713,7 +713,7 @@ layers:
713713
how_to_use: This high-level metric reflects workload volume. Monitor this metric to identify abnormal application behavior or patterns over time. If abnormal patterns emerge, apply the metric's time range to the SQL Activity pages to investigate interesting outliers or patterns. For example, on the Transactions page and the Statements page, sort on the Execution Count column. To find problematic sessions, on the Sessions page, sort on the Transaction Count column. Find the sessions with high transaction counts and trace back to a user or application.
714714
- name: sql.routine.insert.started.count.internal
715715
exported_name: sql_routine_insert_started_count_internal
716-
labeled_name: 'sql.count{query_type: routine-started-insert, query_internal: true}'
716+
labeled_name: 'sql.started.count{query_type: routine-started-insert, query_internal: true}'
717717
description: Number of SQL INSERT statements started within routine invocation (internal queries)
718718
y_axis_label: SQL Internal Statements
719719
type: COUNTER
@@ -742,7 +742,7 @@ layers:
742742
derivative: NON_NEGATIVE_DERIVATIVE
743743
- name: sql.routine.select.started.count
744744
exported_name: sql_routine_select_started_count
745-
labeled_name: 'sql.count{query_type: routine-started-select}'
745+
labeled_name: 'sql.started.count{query_type: routine-started-select}'
746746
description: Number of SQL SELECT statements started within routine invocation
747747
y_axis_label: SQL Statements
748748
type: COUNTER
@@ -752,7 +752,7 @@ layers:
752752
how_to_use: This high-level metric reflects workload volume. Monitor this metric to identify abnormal application behavior or patterns over time. If abnormal patterns emerge, apply the metric's time range to the SQL Activity pages to investigate interesting outliers or patterns. For example, on the Transactions page and the Statements page, sort on the Execution Count column. To find problematic sessions, on the Sessions page, sort on the Transaction Count column. Find the sessions with high transaction counts and trace back to a user or application.
753753
- name: sql.routine.select.started.count.internal
754754
exported_name: sql_routine_select_started_count_internal
755-
labeled_name: 'sql.count{query_type: routine-started-select, query_internal: true}'
755+
labeled_name: 'sql.started.count{query_type: routine-started-select, query_internal: true}'
756756
description: Number of SQL SELECT statements started within routine invocation (internal queries)
757757
y_axis_label: SQL Internal Statements
758758
type: COUNTER
@@ -781,7 +781,7 @@ layers:
781781
derivative: NON_NEGATIVE_DERIVATIVE
782782
- name: sql.routine.update.started.count
783783
exported_name: sql_routine_update_started_count
784-
labeled_name: 'sql.count{query_type: routine-started-update}'
784+
labeled_name: 'sql.started.count{query_type: routine-started-update}'
785785
description: Number of SQL UPDATE statements started within routine invocation
786786
y_axis_label: SQL Statements
787787
type: COUNTER
@@ -791,7 +791,7 @@ layers:
791791
how_to_use: This high-level metric reflects workload volume. Monitor this metric to identify abnormal application behavior or patterns over time. If abnormal patterns emerge, apply the metric's time range to the SQL Activity pages to investigate interesting outliers or patterns. For example, on the Transactions page and the Statements page, sort on the Execution Count column. To find problematic sessions, on the Sessions page, sort on the Transaction Count column. Find the sessions with high transaction counts and trace back to a user or application.
792792
- name: sql.routine.update.started.count.internal
793793
exported_name: sql_routine_update_started_count_internal
794-
labeled_name: 'sql.count{query_type: routine-started-update, query_internal: true}'
794+
labeled_name: 'sql.started.count{query_type: routine-started-update, query_internal: true}'
795795
description: Number of SQL UPDATE statements started within routine invocation (internal queries)
796796
y_axis_label: SQL Internal Statements
797797
type: COUNTER

pkg/sql/exec_util.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ var (
11321132
Help: "Number of SQL SELECT statements started within routine invocation",
11331133
Measurement: "SQL Statements",
11341134
Unit: metric.Unit_COUNT,
1135-
LabeledName: "sql.count",
1135+
LabeledName: "sql.started.count",
11361136
StaticLabels: metric.MakeLabelPairs(metric.LabelQueryType, "routine-started-select"),
11371137
Category: metric.Metadata_SQL,
11381138
HowToUse: "This high-level metric reflects workload volume. Monitor this metric to identify abnormal application behavior or patterns over time. If abnormal patterns emerge, apply the metric's time range to the SQL Activity pages to investigate interesting outliers or patterns. For example, on the Transactions page and the Statements page, sort on the Execution Count column. To find problematic sessions, on the Sessions page, sort on the Transaction Count column. Find the sessions with high transaction counts and trace back to a user or application.",
@@ -1142,7 +1142,7 @@ var (
11421142
Help: "Number of SQL UPDATE statements started within routine invocation",
11431143
Measurement: "SQL Statements",
11441144
Unit: metric.Unit_COUNT,
1145-
LabeledName: "sql.count",
1145+
LabeledName: "sql.started.count",
11461146
StaticLabels: metric.MakeLabelPairs(metric.LabelQueryType, "routine-started-update"),
11471147
Category: metric.Metadata_SQL,
11481148
HowToUse: "This high-level metric reflects workload volume. Monitor this metric to identify abnormal application behavior or patterns over time. If abnormal patterns emerge, apply the metric's time range to the SQL Activity pages to investigate interesting outliers or patterns. For example, on the Transactions page and the Statements page, sort on the Execution Count column. To find problematic sessions, on the Sessions page, sort on the Transaction Count column. Find the sessions with high transaction counts and trace back to a user or application.",
@@ -1152,7 +1152,7 @@ var (
11521152
Help: "Number of SQL INSERT statements started within routine invocation",
11531153
Measurement: "SQL Statements",
11541154
Unit: metric.Unit_COUNT,
1155-
LabeledName: "sql.count",
1155+
LabeledName: "sql.started.count",
11561156
StaticLabels: metric.MakeLabelPairs(metric.LabelQueryType, "routine-started-insert"),
11571157
Category: metric.Metadata_SQL,
11581158
HowToUse: "This high-level metric reflects workload volume. Monitor this metric to identify abnormal application behavior or patterns over time. If abnormal patterns emerge, apply the metric's time range to the SQL Activity pages to investigate interesting outliers or patterns. For example, on the Transactions page and the Statements page, sort on the Execution Count column. To find problematic sessions, on the Sessions page, sort on the Transaction Count column. Find the sessions with high transaction counts and trace back to a user or application.",
@@ -1162,7 +1162,7 @@ var (
11621162
Help: "Number of SQL DELETE statements started within routine invocation",
11631163
Measurement: "SQL Statements",
11641164
Unit: metric.Unit_COUNT,
1165-
LabeledName: "sql.count",
1165+
LabeledName: "sql.started.count",
11661166
StaticLabels: metric.MakeLabelPairs(metric.LabelQueryType, "routine-started-delete"),
11671167
Category: metric.Metadata_SQL,
11681168
HowToUse: "This high-level metric reflects workload volume. Monitor this metric to identify abnormal application behavior or patterns over time. If abnormal patterns emerge, apply the metric's time range to the SQL Activity pages to investigate interesting outliers or patterns. For example, on the Transactions page and the Statements page, sort on the Execution Count column. To find problematic sessions, on the Sessions page, sort on the Transaction Count column. Find the sessions with high transaction counts and trace back to a user or application.",

0 commit comments

Comments
 (0)