feat: Add Throughput and Lag Metrics Per Topic - #21
Merged
Conversation
TopicMetrics records produced and consumed against a topic. Lag is log end offset minus the consumer's committed offset. Rates use a sliding window of circular time buckets. Restores DeadLetterQueue barrel exports dropped by the work-queue merge.
ThomasHartDev
force-pushed
the
thomas/feat/metrics
branch
from
September 4, 2026 19:32
e539a52 to
b109312
Compare
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.
Operators live on two numbers: how far a consumer is behind the log, and how fast the topic is moving. This adds TopicMetrics for that.
produced appends a 0-based offset. consumed advances that consumer's commit. Lag is logEndOffset minus committedOffset, so billing and search on the same topic can report different lag and different oldest-message age. Produce and consume rates are a sliding window of circular time buckets. A burst that then goes quiet reports 0 without wiping the lifetime offsets.
Puts the DeadLetterQueue re-exports back on the package barrel. The work-queue merge dropped them and typecheck has been failing the existing DLQ tests.
Closes #20.