Propagate error categories to SGP spans - #486
Conversation
Capture ADK failures and preserve producer ownership metadata so SGP can distinguish application, platform, and unknown errors. Co-authored-by: Cursor <cursoragent@cursor.com>
|
This PR is targeting The
See |
| # SGP and agentex-native span stores. | ||
| SPAN_ERROR_KEY = "__error__" | ||
|
|
||
| ErrorCategory = Literal["application", "platform", "unknown"] |
There was a problem hiding this comment.
Do we have this mapping anywhere? How are we deciding what counts as a platform failure versus an application failure?
| # SGP and agentex-native span stores. | ||
| SPAN_ERROR_KEY = "__error__" | ||
|
|
||
| ErrorCategory = Literal["application", "platform", "unknown"] |
There was a problem hiding this comment.
Also, rn any exception can opt into error_category via a bare getattr-checked attribute.. there's no shared base class, protocol, or documented convention pointing producers to this. Could we add a small CategorizedError/PlatformError/ApplicationError base so this is discoverable and type-checked, rather than an implicit attribute contract someone has to know to add
Summary
application,platform, orunknownerror_categorymetadata alongside SGPstatus=ERROR, while remaining compatible with the currentscale-gp-betaSDKTest plan
.venv/bin/pytest -n 0 tests/lib/core/tracing/test_span_error.py tests/lib/adk/test_tracing_module.py.venv/bin/pytest -n 0 tests/lib/core/tracing/processors/test_sgp_tracing_processor.py.venv/bin/ruff checkon changed files.venv/bin/pyright --pythonpath .venv/bin/pythonon changed implementation filesMade with Cursor
Greptile Summary
This PR propagates normalized error ownership into SGP tracing spans.
application,platform, orunknown.error_categorymetadata to errored SGP spans with legacy fallback behavior.Confidence Score: 5/5
The PR appears safe to merge with no actionable correctness or security issues identified.
The changed paths preserve original exception propagation, normalize invalid or missing categories predictably, remain compatible with legacy error records, and attach the category to errored SGP spans.
Important Files Changed
unknown.Reviews (1): Last reviewed commit: "feat: propagate error categories to SGP ..." | Re-trigger Greptile