Repository navigation
fix(metrics): export every labelled series from startup; release 0.1.1 - #13
Merged
Merged
Conversation
added 2 commits
November 3, 2026 21:54
prometheus_client emits a labelled series only after its first observation. A freshly started adapter therefore exported no ocr_documents_total, ocr_pages_total, ocr_errors_total or ocr_page_seconds at all, and the Grafana panels built on them showed "No data" instead of zero until the next document -- in practice most of the time, since the hosts reboot for kernel updates every few days and OCR traffic is sporadic. Create the children for every known label value in Metrics.__init__: the two page sources, the document statuses a run can end in, and every error type.
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
prometheus_clientemits a labelled series only after its first observation. A freshly started adapter therefore exported noocr_documents_total,ocr_pages_total,ocr_errors_totalorocr_page_secondsat all, and the Grafana panels built on them showed "No data" instead of zero until the next document. In practice that is most of the time: the hosts reboot for kernel updates every few days and OCR traffic is sporadic.Metrics.__init__now creates the children for every known label value: the two page sources, the document statuses a run can end in, and everyAdapterErrortype. A restart shows as a counter reset rather than a gap.Release
The second commit is the 0.1.1 release: version, CHANGELOG section, README and example pins,
uv.lock. After the merge, tagv0.1.1onmainto build and push the image.🤖 Generated with Claude Code