Class TraceJdbcEventListener
java.lang.Object
com.p6spy.engine.event.JdbcEventListener
com.p6spy.engine.event.SimpleJdbcEventListener
org.springframework.cloud.sleuth.instrument.jdbc.TraceJdbcEventListener
- All Implemented Interfaces:
org.springframework.core.Ordered
public class TraceJdbcEventListener
extends com.p6spy.engine.event.SimpleJdbcEventListener
implements org.springframework.core.Ordered
Listener to represent each connection and sql query as a span.
- Since:
- 3.1.0
- Author:
- Arthur Gavlyukovskiy
-
Field Summary
FieldsFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionTraceJdbcEventListener(org.springframework.beans.factory.BeanFactory beanFactory, DataSourceNameResolver dataSourceNameResolver, List<TraceType> traceTypes, boolean includeParameterValues, List<TraceListenerStrategySpanCustomizer<? super CommonDataSource>> customizers) TraceJdbcEventListener(Tracer tracer, DataSourceNameResolver dataSourceNameResolver, List<TraceType> traceTypes, boolean includeParameterValues, List<TraceListenerStrategySpanCustomizer<? super CommonDataSource>> customizers) -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidonAfterAnyExecute(com.p6spy.engine.common.StatementInformation statementInformation, long timeElapsedNanos, SQLException e) voidonAfterCommit(com.p6spy.engine.common.ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e) voidonAfterConnectionClose(com.p6spy.engine.common.ConnectionInformation connectionInformation, SQLException e) voidonAfterExecuteUpdate(com.p6spy.engine.common.PreparedStatementInformation statementInformation, long timeElapsedNanos, int rowCount, SQLException e) voidonAfterExecuteUpdate(com.p6spy.engine.common.StatementInformation statementInformation, long timeElapsedNanos, String sql, int rowCount, SQLException e) voidonAfterGetConnection(com.p6spy.engine.common.ConnectionInformation connectionInformation, SQLException e) voidonAfterResultSetClose(com.p6spy.engine.common.ResultSetInformation resultSetInformation, SQLException e) voidonAfterRollback(com.p6spy.engine.common.ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e) voidonAfterStatementClose(com.p6spy.engine.common.StatementInformation statementInformation, SQLException e) voidonBeforeAnyExecute(com.p6spy.engine.common.StatementInformation statementInformation) voidonBeforeGetConnection(com.p6spy.engine.common.ConnectionInformation connectionInformation) voidonBeforeResultSetNext(com.p6spy.engine.common.ResultSetInformation resultSetInformation) Methods inherited from class com.p6spy.engine.event.SimpleJdbcEventListener
onAfterAddBatch, onAfterAddBatch, onAfterAnyAddBatch, onAfterExecute, onAfterExecute, onAfterExecuteBatch, onAfterExecuteQuery, onAfterExecuteQuery, onBeforeAddBatch, onBeforeAddBatch, onBeforeAnyAddBatch, onBeforeExecute, onBeforeExecute, onBeforeExecuteBatch, onBeforeExecuteQuery, onBeforeExecuteQuery, onBeforeExecuteUpdate, onBeforeExecuteUpdateMethods inherited from class com.p6spy.engine.event.JdbcEventListener
onAfterCallableStatementSet, onAfterGetResultSet, onAfterPreparedStatementSet, onAfterResultSetGet, onAfterResultSetGet, onAfterResultSetNext, onAfterSetAutoCommit, onBeforeCommit, onBeforeRollback, onBeforeSetAutoCommit, onConnectionWrapped
-
Field Details
-
ORDER
public static final int ORDERBean order.- See Also:
-
-
Constructor Details
-
TraceJdbcEventListener
public TraceJdbcEventListener(Tracer tracer, DataSourceNameResolver dataSourceNameResolver, List<TraceType> traceTypes, boolean includeParameterValues, List<TraceListenerStrategySpanCustomizer<? super CommonDataSource>> customizers) -
TraceJdbcEventListener
public TraceJdbcEventListener(org.springframework.beans.factory.BeanFactory beanFactory, DataSourceNameResolver dataSourceNameResolver, List<TraceType> traceTypes, boolean includeParameterValues, List<TraceListenerStrategySpanCustomizer<? super CommonDataSource>> customizers)
-
-
Method Details
-
onBeforeGetConnection
public void onBeforeGetConnection(com.p6spy.engine.common.ConnectionInformation connectionInformation) - Overrides:
onBeforeGetConnectionin classcom.p6spy.engine.event.JdbcEventListener
-
onAfterGetConnection
public void onAfterGetConnection(com.p6spy.engine.common.ConnectionInformation connectionInformation, SQLException e) - Overrides:
onAfterGetConnectionin classcom.p6spy.engine.event.JdbcEventListener
-
onBeforeAnyExecute
public void onBeforeAnyExecute(com.p6spy.engine.common.StatementInformation statementInformation) - Overrides:
onBeforeAnyExecutein classcom.p6spy.engine.event.SimpleJdbcEventListener
-
onAfterAnyExecute
public void onAfterAnyExecute(com.p6spy.engine.common.StatementInformation statementInformation, long timeElapsedNanos, SQLException e) - Overrides:
onAfterAnyExecutein classcom.p6spy.engine.event.SimpleJdbcEventListener
-
onBeforeResultSetNext
public void onBeforeResultSetNext(com.p6spy.engine.common.ResultSetInformation resultSetInformation) - Overrides:
onBeforeResultSetNextin classcom.p6spy.engine.event.JdbcEventListener
-
onAfterExecuteUpdate
public void onAfterExecuteUpdate(com.p6spy.engine.common.PreparedStatementInformation statementInformation, long timeElapsedNanos, int rowCount, SQLException e) - Overrides:
onAfterExecuteUpdatein classcom.p6spy.engine.event.SimpleJdbcEventListener
-
onAfterExecuteUpdate
public void onAfterExecuteUpdate(com.p6spy.engine.common.StatementInformation statementInformation, long timeElapsedNanos, String sql, int rowCount, SQLException e) - Overrides:
onAfterExecuteUpdatein classcom.p6spy.engine.event.SimpleJdbcEventListener
-
onAfterStatementClose
public void onAfterStatementClose(com.p6spy.engine.common.StatementInformation statementInformation, SQLException e) - Overrides:
onAfterStatementClosein classcom.p6spy.engine.event.JdbcEventListener
-
onAfterResultSetClose
public void onAfterResultSetClose(com.p6spy.engine.common.ResultSetInformation resultSetInformation, SQLException e) - Overrides:
onAfterResultSetClosein classcom.p6spy.engine.event.JdbcEventListener
-
onAfterCommit
public void onAfterCommit(com.p6spy.engine.common.ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e) - Overrides:
onAfterCommitin classcom.p6spy.engine.event.JdbcEventListener
-
onAfterRollback
public void onAfterRollback(com.p6spy.engine.common.ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e) - Overrides:
onAfterRollbackin classcom.p6spy.engine.event.JdbcEventListener
-
onAfterConnectionClose
public void onAfterConnectionClose(com.p6spy.engine.common.ConnectionInformation connectionInformation, SQLException e) - Overrides:
onAfterConnectionClosein classcom.p6spy.engine.event.JdbcEventListener
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-