Repository navigation
feat(hoglake): time the prepare and commit phases of a flush - #170
Merged
Merged
Conversation
Add millpond_hoglake_prepare_seconds{result} (one prepare_append_tables:
pre-flight, VARIANT encode, parquet encode, uploads; ok and failed
attempts) and millpond_hoglake_commit_seconds (commit_prepared answered
200). With millpond_variant_encode_seconds and flush_duration_seconds
they split a flush's wall time per record into encode, parquet and
upload, commit and millpond's own work. Both observes are guarded so a
metrics failure cannot orphan uploads, replace the prepare error, or
re-send a landed commit.
Collaborator
Author
|
@PostHog review |
|
@jghoman PostHog Review is reviewing this pull request. |
bill-ph
approved these changes
Nov 18, 2026
Contributor
There was a problem hiding this comment.
Reviewed the PR description, diff, and existing discussion at 9a97557f88838bc90c71f8f748225acf3e44c043. Checked phase timing boundaries, success/failure and retry semantics, metric label binding, safeguards against metrics failures affecting uploads or commits, and added test coverage. Also checked for overengineering and scope creep. Tests, builds, and linters were not run, as requested.
No issues found.
— Robo Bill v2 (gpt-6.1-sol, high reasoning)
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.
Shows where a hoglake flush spends its time, so we can see what VARIANT encoding and shredding cost per record on the whales release.
Metrics
millpond_hoglake_prepare_secondspipeline,broker_source,result(ok/failed)prepare_append_tables: pre-flight reads, VARIANT encode, parquet encode, uploads. A failed attempt is timed up to the exception.millpond_hoglake_commit_secondspipeline,broker_sourcecommit_preparedthe server answered 200Together with the existing
millpond_variant_encode_secondsandmillpond_flush_duration_seconds, a flush's wall time per record splits into:millpond_variant_encode_seconds;millpond_hoglake_commit_seconds;The full explanation is in
millpond/metrics.py.Safety
Tests
TestPhaseTimings(16 tests) covers:ruff checkandruff format --checkpass.pytest -m "not integration and not e2e": 1727 passed, 1 skipped, 1 xfailed.The dashboard that reads these metrics is a separate PR in PostHog/grafana-dashboards.