DBMON-6617 Add CPU time and CPU wait to ClickHouse DBM payloads#23882
Draft
jenny-chung wants to merge 3 commits into
Draft
DBMON-6617 Add CPU time and CPU wait to ClickHouse DBM payloads#23882jenny-chung wants to merge 3 commits into
jenny-chung wants to merge 3 commits into
Conversation
Contributor
|
Contributor
Validation ReportAll 21 validations passed. Show details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Surfaces CPU consumption alongside the existing wall-clock duration in both ClickHouse DBM pipelines.
statements.py(aggregated query metrics): addscpu_us,cpu_wait_us, and a derivedmean_cpu_usper query signature. Sourced fromsum(ProfileEvents['OSCPUVirtualTimeMicroseconds'])andsum(ProfileEvents['OSCPUWaitMicroseconds'])over the collection window. Multi-node Cloud merge logic sums both new fields across nodes.query_completions.py(per-execution samples): addscpu_usandcpu_wait_usper individual query execution.Both fields are in microseconds. No new configuration, no new agent-emitted metrics; these fields flow only through the existing DBM payloads via
database_monitoring_query_metricsanddatabase_monitoring_query_activity.Motivation
DBMON-6617.
DBM collects completed queries and query metrics from the
system.query_logtable on ClickHouse. However, we do not collect the CPU time per query today, and this is an ask from a few of our customers.ClickHouse records per-query CPU usage in
system.query_logvia theProfileEventsmap column:OSCPUVirtualTimeMicroseconds— total CPU time consumed across all threads working on the query.OSCPUWaitMicroseconds— CPU wait time (runnable but not on-CPU).This PR surfaces both values as
cpu_usandcpu_wait_usin the DBM payloads.Review checklist (to be filled by reviewers)