-
Notifications
You must be signed in to change notification settings - Fork 9
docs(analytics): document transaction-commit-time metric #572
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
base: main
Are you sure you want to change the base?
Changes from all commits
38b14bb
3408176
daf8ab9
1771f0a
f2fd67a
c2abfaf
05d974b
d90edac
a4cca36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -55,10 +55,8 @@ Example raw entry: | |||||||||||||||||||||||
| "metric": "bytes-sent", | ||||||||||||||||||||||||
| "path": "search_by_conditions", | ||||||||||||||||||||||||
| "type": "operation", | ||||||||||||||||||||||||
| "median": 202, | ||||||||||||||||||||||||
| "mean": 202, | ||||||||||||||||||||||||
| "p95": 202, | ||||||||||||||||||||||||
| "p90": 202, | ||||||||||||||||||||||||
| "distribution": [202], | ||||||||||||||||||||||||
| "count": 1 | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
|
|
@@ -169,6 +167,41 @@ Harper automatically tracks the following metrics for all services. Applications | |||||||||||||||||||||||
| | `bytes-received` | node.database | `replication` | `blob` | bytes | Bytes received for blob replication | | ||||||||||||||||||||||||
| | `replication-latency` | node.database.table | | `ingest` | ms | Time difference from source commit timestamp to local time | | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ### Storage Metrics | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| <VersionBadge version="v5.2.0" /> | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| | `metric` | `path` | `method` | `type` | Unit | Description | | ||||||||||||||||||||||||
| | ------------------------- | ------ | -------- | ------ | ---- | ------------------------------------------------------------------- | | ||||||||||||||||||||||||
| | `transaction-commit-time` | | | | ms | RocksDB write-commit duration, submit to settle, per commit attempt | | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| `transaction-commit-time` is recorded on the RocksDB asynchronous commit path only; it is not | ||||||||||||||||||||||||
| emitted for LMDB-backed databases, and not for the synchronous `commitSync()` path used during | ||||||||||||||||||||||||
| transaction-log replay. Each sample covers one commit attempt, not one logical write transaction — a | ||||||||||||||||||||||||
| transient-conflict retry re-issues the commit and records its own sample, so `count` can exceed the | ||||||||||||||||||||||||
| number of logical writes. A sample is only recorded once an attempt settles, so a commit that is | ||||||||||||||||||||||||
| still outstanding contributes nothing yet. Raw entries (`hdb_raw_analytics`) carry `mean`, | ||||||||||||||||||||||||
| `distribution`, and `count`; percentiles (`median`, `p90`, `p95`, `p99`, `p999`) are only available on | ||||||||||||||||||||||||
| the per-minute aggregate (`hdb_analytics`) once raw entries are rolled up — query the aggregate table | ||||||||||||||||||||||||
| for percentile-based alerting. It shares a timebase with the RocksDB storage engine's overload guard, | ||||||||||||||||||||||||
| which times only the commit attempt it arms: when a tracked outstanding commit on a thread exceeds | ||||||||||||||||||||||||
| `storage.maxTransactionQueueTime` (default 45s), Harper rejects new record updates and publishes on | ||||||||||||||||||||||||
|
Comment on lines
+187
to
+188
Member
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. Two things here. Separately, "times only the commit attempt it arms" carries the same single-slot assumption as the paragraph below (see my other comment) — on
Suggested change
|
||||||||||||||||||||||||
| that thread with `Outstanding write transactions have too long of queue, please try again later` | ||||||||||||||||||||||||
| (HTTP 503) — deletes and writes applied from a canonical source (e.g. replication or a caching | ||||||||||||||||||||||||
| source) bypass this check. The guard tracks at most one outstanding commit per thread: a retry | ||||||||||||||||||||||||
| issued while the prior attempt still holds that slot (a coordinated retry, or an early backoff | ||||||||||||||||||||||||
| retry) recommits before the slot clears and is never armed, so a wedge there won't trip the 503; a | ||||||||||||||||||||||||
| later, backoff-delayed retry recommits after the slot clears and is tracked like a fresh attempt. | ||||||||||||||||||||||||
|
Comment on lines
+191
to
+194
Member
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. This documents a bug that The single-slot description is an accurate read of I'd delete it rather than version-qualify it.
Suggested change
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| A rising `p99`/`p999` signals commits are taking longer to drain — from write volume, large | ||||||||||||||||||||||||
| transactions, or a saturated storage volume — and is a useful early warning to shed or throttle write | ||||||||||||||||||||||||
| load. But the metric shares only a timebase with the guard, not its population: a wedged commit | ||||||||||||||||||||||||
| contributes no sample until it settles, and an early retry that wedges can go untracked by the guard | ||||||||||||||||||||||||
| entirely (see above). Don't treat this distribution as a leading indicator on its own — watch the | ||||||||||||||||||||||||
| server log for the "Rejecting writes on this thread" error the guard emits when it does trip, and | ||||||||||||||||||||||||
| don't rely solely on percentiles trending toward `storage.maxTransactionQueueTime`. Tune the | ||||||||||||||||||||||||
| threshold against a baseline for your workload. | ||||||||||||||||||||||||
|
Comment on lines
+198
to
+203
Member
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. Follow-on from the retry-slot paragraph above: this clause depends on it and is false on
Suggested change
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ### Resource Usage Metrics | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| | `metric` | Key attributes | Other | Unit | Description | | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
The percentile list reads as exhaustive, but the aggregator emits nine, not five (
resources/analytics/write.ts:983-984:p1, p10, p25, median, p75, p90, p95, p99, p999). Since this sentence is specifically teaching the raw-vs-aggregate split, an incomplete list undercuts the point it's making.