feat(datastore): name every transaction for metrics (#1719 stack: 2/3)
This part gives every transaction a symbolic name and publishes its hold time and outcome through the transaction envelope.
datastore.RunInTx and runInSQLTx take a required name, defer metrics.InstrumentTx and mark a failed Commit with CommitFailedError.
Every caller passes its own constant from the new tx_names.go catalog, including the npm-remote TxRunner seam and the accounting drain fan-out, which wraps its own BeginTx.
TestEveryTransactionIsNamed pins one name per call site, and the composition root seeds every catalog name on both families at startup.
Integration tests pin the outcomes the failure paths book: a failed BeginTx books none, and the drain fan-out books one rolled_back when its enqueue fails.
The S03-B spec rows for the two families, the "Transaction metrics" section of docs/dev/database-query-patterns.md and the two transaction rows in docs/dev/observability.md land here, with the behavior they describe; !3532 (merged) rebases to drop its copy of those docs.
The signature change must reach every caller in one part, so the callers and their tests cannot split further; the spec edit conflicts with open !3531 (merged), and whichever lands second rebases.
Stack
This merge request is part 2 of 3 of one reviewed change (vespian_gl/issue-1719-publish-transaction-duration-and-outcome), split into a stack so each part is reviewable on its own. Merge the parts in this order, bottom first:
- !3545 (merged) feat(metrics): add the transaction metric families (#1719 (closed) stack: 1/3)
- !3546 (merged) feat(datastore): name every transaction for metrics (#1719 (closed) stack: 2/3) (this merge request)
- !3532 (merged) feat(lifecycle): meter the tombstone transaction (#1719 (closed) stack: 3/3)
It targets !3545 (merged), the part below it, which merges first. !3532 (merged), the part above it, targets this one and merges after it.
Related to #1719 (closed)
This is a bot message