Repository navigation
Error breakdown: error call paths keyed by RPC status (Python + Go) - #71
Merged
Merged
Conversation
Add --errorBreakdown {origins,propToRoot} and --errorBreakdownRoot
{trace,analysis}: light mode writes error-breakdown.json, the call paths
ending in an error, keyed by RPC protocol and status code, with counts and
exemplars.
- origins reports every erroring span with no erroring child; propToRoot
only errors that propagate to the root (the computePropToRootGraph walk).
- trace root is the trace's own root span, or a virtual
[INCOMPLETE_TRACE]virtual_root over orphaned spans; analysis root is the
one chosen for -s/-a.
- A span errors if parseForErrorReturn flags it or its status code
signals failure (HTTP >= 400, else non-zero). Protocol/status come from
standard tags; deployment-specific hints are empty-by-default span_utils
lists (HTTP_COMPONENTS, TCHANNEL_MARKER_TAGS, TCHANNEL_STATUS_TAGS,
YARPC_STATUS_TAGS, IGNORED_ROOT_OPS).
- The walk runs during Graph construction, before sanitization drops
out-of-range spans. Critical-path outputs are unchanged.
The Go port matches byte-for-byte: goldens for every conformance fixture
(both modes) and new test_cases/error_breakdown/ fixtures (all four
mode/root combinations); difftest -strict also compares the file.
Fix: process() passed {} to getMetrics, so the --errorAnalysis
errors-propagated-to-root flame graph was always empty; it now uses
computePropToRootGraph(), which gains tests.
difftest golden mode now checks only the conformance fixtures, like
generate_goldens.py. Gazelle adds the missing light_test.go to
go/crisp:crisp_test.
Co-authored-by: Cursor <cursoragent@cursor.com>
lollllcat
force-pushed
the
go-port/error-breakdown
branch
from
September 24, 2026 21:30
18b3eab to
b6b967a
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.
Error breakdown: error call paths keyed by RPC status (Python + Go)
Adds an error breakdown to both implementations: which call paths end in an error, keyed by RPC protocol and status code, with counts and exemplars.
crisp-trace --file t.json -s svc -a op --lightMode --errorBreakdown origins # or propToRoot crisp-go --file t.json -s svc -a op --lightMode --errorBreakdown origins --errorBreakdownRoot traceWrites
error-breakdown.jsonnext to the trace. The full spec is in the new CONFORMANCE.md section "Error breakdown".Semantics
originsreports every erroring span with no erroring child (it traverses successful spans too).propToRootonly reports errors that reach the root: a successful RPC span stops the walk. This is the existingGraph.computePropToRootGraphwalk.trace(the default) starts at the trace's own root span. If no span lacks a parent, a virtual[INCOMPLETE_TRACE]virtual_rootnode parents the orphaned spans.analysisstarts at the root chosen for-s/-a.parseForErrorReturnflags it or its status code signals failure (HTTP>= 400, otherwise non-zero). Protocol and status come from standard tags (http.response.status_code,http.status_code,grpc.status_code,rpc.grpc.status_code,rpc.yarpc.status_code+rpc.transport, ...). A gRPC status name such asgrpc.status = "UNAVAILABLE"sets only the protocol.span_utilslists, all empty by default:HTTP_COMPONENTS,TCHANNEL_MARKER_TAGS,TCHANNEL_STATUS_TAGS,YARPC_STATUS_TAGS,IGNORED_ROOT_OPS.Graphconstruction, before timeline sanitization drops out-of-range (clock-skewed) spans. Critical-path outputs are unchanged, and every existingconformance.*golden is byte-identical.Fix
process()passed{}togetMetrics, so the--errorAnalysisflame graph of errors propagated to the root was always empty. It now passescomputePropToRootGraph(), which also gains tests.--errorBreakdownoutside light mode now logs a warning and is ignored, instead of being computed and never written.Tests
error-breakdown-{origins,propToRoot}.json. Seven newtest_cases/error_breakdown/fixtures (status codes, orphans, multiple roots, a sanitized child, propagation cases) cover all four mode/root combinations.scripts/generate_goldens.pyproduces both sets and checks determinism.difftest -strictalso compareserror-breakdown.jsonwhen both templates pass the flag: 40/40 in both modes.difftest -mode goldennow checks only the conformance fixtures (asgenerate_goldens.pydoes). Gazelle added the missinglight_test.gotogo/crisp:crisp_test.Validation:
scripts/ci-local.sh(837 passed,test.shclean),bazel test //...(37/37),go vet ./..., anddifftestin golden mode (33/33) and strict corpus mode in both breakdown modes (40/40).About 7k of the added lines are golden JSON.