Package brave.mysql8
Class TracingExceptionInterceptor
java.lang.Object
brave.mysql8.TracingExceptionInterceptor
- All Implemented Interfaces:
com.mysql.cj.exceptions.ExceptionInterceptor
public class TracingExceptionInterceptor extends Object implements com.mysql.cj.exceptions.ExceptionInterceptor
A MySQL exception interceptor that will annotate spans with SQL error codes.
To use it, both TracingQueryInterceptor and TracingExceptionInterceptor must be added by
appending ?queryInterceptors=brave.mysql8.TracingQueryInterceptor&exceptionInterceptors=brave.mysql8.TracingExceptionInterceptor.
-
Constructor Summary
Constructors Constructor Description TracingExceptionInterceptor() -
Method Summary
Modifier and Type Method Description voiddestroy()com.mysql.cj.exceptions.ExceptionInterceptorinit(Properties properties, com.mysql.cj.log.Log log)ExceptioninterceptException(Exception e)UsesThreadLocalSpanas there's no attribute namespace shared between callbacks, but all callbacks happen on the same thread.
-
Constructor Details
-
TracingExceptionInterceptor
public TracingExceptionInterceptor()
-
-
Method Details
-
init
public com.mysql.cj.exceptions.ExceptionInterceptor init(Properties properties, com.mysql.cj.log.Log log)- Specified by:
initin interfacecom.mysql.cj.exceptions.ExceptionInterceptor
-
destroy
public void destroy()- Specified by:
destroyin interfacecom.mysql.cj.exceptions.ExceptionInterceptor
-
interceptException
UsesThreadLocalSpanas there's no attribute namespace shared between callbacks, but all callbacks happen on the same thread. The span will already have been created inTracingQueryInterceptor.Uses
ThreadLocalSpan.CURRENT_TRACERand this interceptor initializes before tracing.- Specified by:
interceptExceptionin interfacecom.mysql.cj.exceptions.ExceptionInterceptor
-