-
Notifications
You must be signed in to change notification settings - Fork 4.1k
metric: add labels for sql.*.started.count
#151946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
| StaticLabels: metric.MakeLabelPairs(metric.LabelQueryType, "started-select"), | ||
| Essential: true, | ||
| Category: metric.Metadata_SQL, | ||
| 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.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you say anything more specific about started vs other metrics that would be helpful here?
I'm also not sure this metric is "essential". Most customers use the executed metrics to count QPS so we should justify why they should also pay attention to these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I searched Slack and found only 2 threads that explicitly mentioned using the started metrics for troubleshooting:
- https://cockroachlabs.slack.com/archives/C02119Q1G05/p1623169882143700?thread_ts=1623161302.135100&cid=C02119Q1G05
- https://cockroachlabs.slack.com/archives/C0713QV7XHP/p1714432731834549
Additionally, the started metrics was introduced in #37264, which also introduced the executed metrics as a claimed more useful one.
So maybe we should close it for now until receiving explicit ask for this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the "Essential:true" field per offline discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that "started" shouldn't be essential.
7b76724 to
fc51076
Compare
dhartunian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
dhartunian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM I realized this needs an edit.
pkg/sql/exec_util.go
Outdated
| Help: "Number of SQL UPDATE statements started", | ||
| Measurement: "SQL Statements", | ||
| Unit: metric.Unit_COUNT, | ||
| LabeledName: "sql.count", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I was mistaken: these counts should not be aggregated along with other sql.count metrics because "started" and "executed" should not be added together.
This should be sql.started.count with label update for example.
yuzefovich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuzefovich reviewed 2 of 2 files at r2, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @dhartunian and @ZhouXing19)
-- commits line 10 at r2:
nit: this needs an update.
| StaticLabels: metric.MakeLabelPairs(metric.LabelQueryType, "started-select"), | ||
| Essential: true, | ||
| Category: metric.Metadata_SQL, | ||
| 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.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that "started" shouldn't be essential.
fc51076 to
d62f304
Compare
|
Does this need to get into 25.4? |
d62f304 to
5692dac
Compare
|
@dhartunian Can I ask for another look? Thanks! |
Previously, only metrics for *executed* `SELECT|UPDATE|DELETE|INSERT` statements are labeled, while their *started* equivalent are not labeled. This commit is to label these metrics. Ref cockroachdb#143536 Release note (ops change): sql.select.started.count, sql.insert.started.count, sql.update.started.count, sql.delete.started.count are now labeled with sql.started.count. <what was there before: Previously, ...> <why it needed to change: This was inadequate because ...> <what you did about it: To address this, this patch ...>
5692dac to
c19c6df
Compare
|
TFTR! |
Previously, only metrics for executed
SELECT|UPDATE|DELETE|INSERTstatements are labeled, while their started equivalent are not labeled. This commit is to label these metrics. Since they are not frequently used metrics, they are not marked as Essential.Fixes: #152074
Release note (ops change):
sql.select.started.count,sql.insert.started.count,sql.update.started.count,sql.delete.started.countare now labeled withsql.started.count.