Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure CompositeQueryLogic error codes are sent to metrics #2399

Merged
merged 7 commits into from
Jul 3, 2024

Conversation

lbschanno
Copy link
Collaborator

The query metrics API expects QueryExceptions to be found in the cause of the original exception passed to BaseQueryMetric.setError(Throwable). In the case of CompositeQueryLogic, due to the additional wrapping of exceptions passed from its defined internal logics in a CompositeLogicException, query exceptions were not in the expected place in the stack hierarchy.

Update the CompositeLogicException to identify any QueryExceptions present in the stacks of exception arguments, and ensure that they are either already a QueryException, or that if they contain a QueryException in the stack, that they are subsequently wrapped in a CompositeRaisedQueryException with a copy of the desired error code.

Fixes #2340

The query metrics API expects QueryExceptions to be found in the cause
of the original exception passed to BaseQueryMetric.setError(Throwable).
In the case of CompositeQueryLogic, due to the additional wrapping of
exceptions passed from its defined internal logics in a
CompositeLogicException, query exceptions were not in the expected place
in the stack hierarchy.

Update the CompositeLogicException to identify any QueryExceptions
present in the stacks of exception arguments, and ensure that they are
either already a QueryException, or that if they contain a
QueryException in the stack, that they are subsequently wrapped in a
CompositeRaisedQueryException with a copy of the desired error code.

Fixes #2340
@lbschanno
Copy link
Collaborator Author

An alternative approach here would be to modify the query metrics service to search beyond the first cause in an exception's stack trace when searching for a QueryException to extract an error code from. If that approach is preferred, I will close this PR and create one for the query metrics service with that change.

@ivakegg ivakegg merged commit 00cce87 into integration Jul 3, 2024
3 checks passed
@ivakegg ivakegg deleted the bugfix/compositeQueryErrorCode branch July 3, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Where O where did my Error Code go
3 participants