-
Notifications
You must be signed in to change notification settings - Fork 569
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
refactor: add metrics for time travel and recent versions #18690
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,6 +143,8 @@ pub struct MetaMetrics { | |
pub old_version_object_count: IntGauge, | ||
/// Total size of objects that is still referenced by non-current versions. | ||
pub old_version_object_size: IntGauge, | ||
/// Total number of objects that is referenced by time travel. | ||
pub time_travel_object_count: IntGauge, | ||
/// Total number of objects that is referenced by current version. | ||
pub current_version_object_count: IntGauge, | ||
/// Total size of objects that is referenced by current version. | ||
|
@@ -206,6 +208,8 @@ pub struct MetaMetrics { | |
pub auto_schema_change_failure_cnt: LabelGuardedIntCounterVec<2>, | ||
pub auto_schema_change_success_cnt: LabelGuardedIntCounterVec<2>, | ||
pub auto_schema_change_latency: LabelGuardedHistogramVec<2>, | ||
|
||
pub time_travel_version_replay_latency: Histogram, | ||
} | ||
|
||
pub static GLOBAL_META_METRICS: LazyLock<MetaMetrics> = | ||
|
@@ -500,6 +504,13 @@ impl MetaMetrics { | |
registry | ||
).unwrap(); | ||
|
||
let time_travel_object_count = register_int_gauge_with_registry!( | ||
"storage_time_travel_object_count", | ||
"total number of objects that is referenced by time travel.", | ||
registry | ||
) | ||
.unwrap(); | ||
|
||
let delta_log_count = register_int_gauge_with_registry!( | ||
"storage_delta_log_count", | ||
"total number of hummock version delta log", | ||
|
@@ -740,6 +751,14 @@ impl MetaMetrics { | |
) | ||
.unwrap(); | ||
|
||
let opts = histogram_opts!( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we monitored the rate (frequency) of fetching time travel version? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it can be derived from time_travel_version_replay_latency. Added to grafana. |
||
"storage_time_travel_version_replay_latency", | ||
"The latency(ms) of replaying a hummock version for time travel", | ||
exponential_buckets(0.01, 10.0, 6).unwrap() | ||
); | ||
let time_travel_version_replay_latency = | ||
register_histogram_with_registry!(opts, registry).unwrap(); | ||
|
||
Self { | ||
grpc_latency, | ||
barrier_latency, | ||
|
@@ -771,6 +790,7 @@ impl MetaMetrics { | |
stale_object_size, | ||
old_version_object_count, | ||
old_version_object_size, | ||
time_travel_object_count, | ||
current_version_object_count, | ||
current_version_object_size, | ||
total_object_count, | ||
|
@@ -814,6 +834,7 @@ impl MetaMetrics { | |
auto_schema_change_success_cnt, | ||
auto_schema_change_latency, | ||
merge_compaction_group_count, | ||
time_travel_version_replay_latency, | ||
} | ||
} | ||
|
||
|
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.
Shall we move this env var to the meta opt instead of implicitly reading an env var here?
And any reason to change from 100 to 10000?
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.
OK
To speed up time travel version replay, i.e. less SELECT queries.