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

Log exception details when Message.type == TMessageType.EXCEPTION #17

Open
Froodulous opened this issue May 25, 2018 · 2 comments
Open

Comments

@Froodulous
Copy link
Contributor

Currently, when a message of type EXCEPTION is returned by a thrift service, the server-side span is tagged as an error. However, no details of the exception are logged to the span. When the SpanProcessor catches an exception, it creates error logs and adds them to the span. Can the library do the same when the exception is returned by thrift? Just the type of the exception being returned would be useful.

@malafeev
Copy link

malafeev commented May 25, 2018

problem that org.apache.thrift.ProcessFunction doesn't do anything with Exception except logging:

catch (Exception ex) {
      LOGGER.error("Internal error processing " + getMethodName(), ex);
      if(!isOneway()) {
        result = new TApplicationException(TApplicationException.INTERNAL_ERROR,
            "Internal error processing " + getMethodName());
        msgType = TMessageType.EXCEPTION;
      }
}

So exception is not accessible from TProtocolDecorator.

@Froodulous
Copy link
Contributor Author

I see. That is a pain. So there's basically no way of getting the details of that exception without extending the ProcessFunction class, and that class is referenced directly by code generated by the thrift compiler. You would need a change to thrift itself to be able to add the details of the exception to the span.

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

No branches or pull requests

2 participants