impl(o11y): [wip] introduce error.type'#4148
Conversation
diegomarquezp
commented
Mar 16, 2026
- impl(o11y): introduce error.type
- docs: add javadoc for error type logic
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the observability capabilities by introducing a new Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new observability attribute error.type to provide a more specific, low-cardinality classification of errors. The core logic is implemented in ObservabilityUtils.extractErrorType, which determines the error type based on a clear priority: ErrorInfo.reason, server error codes, specific client-side exceptions, and then fallbacks. The changes are well-supported by comprehensive unit tests in SpanTracerTest and integration tests in ITOtelTracing for both gRPC and HTTP/JSON transports, which is great to see.
My review includes one suggestion for a minor code simplification. Overall, this is a solid implementation.
| if (exceptionName != null && !exceptionName.isEmpty()) { | ||
| return exceptionName; | ||
| } |
There was a problem hiding this comment.
The check exceptionName != null is redundant. Class.getSimpleName() never returns null; it returns an empty string for anonymous classes, which is already handled by !exceptionName.isEmpty(). You can simplify this condition.
| if (exceptionName != null && !exceptionName.isEmpty()) { | |
| return exceptionName; | |
| } | |
| if (!exceptionName.isEmpty()) { | |
| return exceptionName; | |
| } |
References
- This comment aligns with the principle of avoiding redundant null checks, similar to how validation within
ApiTracerContextshould be relied upon to prevent unnecessary checks.
|
|




