feat(metrics): split aether_decode_errors_total by reason#109
Merged
Conversation
Replace single IntCounter with IntCounterVec labelled by reason (unknown_topic / malformed_payload / insufficient_topics). decode_log now returns Result<PoolEvent, DecodeReason> so the reason propagates to record_decode_failure.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
IntCounterwithIntCounterVeclabelled byreasondecode_lognow returnsResult<PoolEvent, DecodeReason>so the reason propagates end-to-endunknown_topic(benign, high-volume in discovery mode),malformed_payload(real data-integrity bug — page on spikes),insufficient_topics(upstream producer bug)Files Changed
crates/ingestion/src/event_decoder.rsDecodeReasonenum +as_str(); changedecode_log+ all inner decoders to returnResult<PoolEvent, DecodeReason>; add 3 new reason-label tests (malformed,unknown,reason label contract)crates/grpc-server/src/metrics.rsIntCounter→IntCounterVecwithreasonlabel;inc_decode_errors(&str); render test asserts all three label seriescrates/grpc-server/src/provider.rsrecord_decode_failurenow takesDecodeReason; trace log includesreasonfield; two new end-to-end tests (malformed_payload,insufficient_topics) in addition to the updatedunknown_topictestcrates/integration-tests/tests/anvil_fork_test.rsOptiontoResultAcceptance Criteria
aether_decode_errors_total{reason="..."}emits at least the three labels (unknown_topic,malformed_payload,insufficient_topics)DecodeReasonunit tests) AND at the provider level (end-to-endprocess_logstests)aether_decode_errors_total{reason="malformed_payload"} 1), not just metric presencecargo test --workspace --release+cargo clippy --workspace --release --all-targets -- -D warningsclean on touched cratesreason— tracked separately when dashboards PR lands (per issue spec)Test plan
cargo build -p aether-ingestion -p aether-grpc-server --release— cleancargo test --workspace --release— all tests pass (72 ingestion, 64 grpc-server, rest of workspace)cargo clippy --workspace --release --all-targets -- -D warnings— no warningstest_decode_sync_malformed_payload,test_decode_v3_swap_malformed_payload,test_decode_reason_label_strings,test_process_logs_malformed_payload_reason_label,test_process_logs_insufficient_topics_reason_labeltest_process_logs_decode_failure_increments_counternow asserts thereason="unknown_topic"series specificallyCloses #92