Documentation
¶
Index ¶
- func NewInterceptor(opts ...TraceOption) instrumented.Interceptor
- type OpenTracingInterceptor
- func (ot *OpenTracingInterceptor) ConnBeginTx(ctx context.Context, conn driver.ConnBeginTx, opts driver.TxOptions) (tx driver.Tx, err error)
- func (ot *OpenTracingInterceptor) ConnPing(ctx context.Context, conn driver.Pinger) (err error)
- func (ot *OpenTracingInterceptor) ConnPrepareContext(ctx context.Context, conn driver.ConnPrepareContext, query string) (stmt driver.Stmt, err error)
- func (ot *OpenTracingInterceptor) MaybeStartSpanFromContext(ctx context.Context, operationName string) (opentracing.Span, context.Context)
- func (ot *OpenTracingInterceptor) ResultLastInsertId(ctx context.Context, result driver.Result) (id int64, err error)
- func (ot *OpenTracingInterceptor) ResultRowsAffected(ctx context.Context, result driver.Result) (affected int64, err error)
- func (ot *OpenTracingInterceptor) RowsNext(ctx context.Context, rows driver.Rows, dest []driver.Value) (err error)
- func (ot *OpenTracingInterceptor) StmtClose(ctx context.Context, conn driver.Stmt) (err error)
- func (ot *OpenTracingInterceptor) StmtExecContext(ctx context.Context, conn driver.StmtExecContext, query string, ...) (result driver.Result, err error)
- func (ot *OpenTracingInterceptor) StmtQueryContext(ctx context.Context, conn driver.StmtQueryContext, query string, ...) (rows driver.Rows, err error)
- func (ot *OpenTracingInterceptor) TxCommit(ctx context.Context, tx driver.Tx) (err error)
- func (ot *OpenTracingInterceptor) TxRollback(ctx context.Context, tx driver.Tx) (err error)
- type TraceOption
- func WithAllTraceOptions() TraceOption
- func WithArgs(flag bool) TraceOption
- func WithComponent(comp string) TraceOption
- func WithDBInstance(instance string) TraceOption
- func WithDBType(dbType string) TraceOption
- func WithDBUser(user string) TraceOption
- func WithExec(flag bool) TraceOption
- func WithPrepare(flag bool) TraceOption
- func WithQuery(flag bool) TraceOption
- func WithRowsClose(flag bool) TraceOption
- type TraceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInterceptor ¶
func NewInterceptor(opts ...TraceOption) instrumented.Interceptor
NewInterceptor :
Types ¶
type OpenTracingInterceptor ¶
type OpenTracingInterceptor struct {
instrumented.NullInterceptor
// contains filtered or unexported fields
}
OpenTracingInterceptor :
func (*OpenTracingInterceptor) ConnBeginTx ¶
func (ot *OpenTracingInterceptor) ConnBeginTx(ctx context.Context, conn driver.ConnBeginTx, opts driver.TxOptions) (tx driver.Tx, err error)
ConnBeginTx :
func (*OpenTracingInterceptor) ConnPrepareContext ¶
func (ot *OpenTracingInterceptor) ConnPrepareContext(ctx context.Context, conn driver.ConnPrepareContext, query string) (stmt driver.Stmt, err error)
ConnPrepareContext :
func (*OpenTracingInterceptor) MaybeStartSpanFromContext ¶
func (ot *OpenTracingInterceptor) MaybeStartSpanFromContext(ctx context.Context, operationName string) (opentracing.Span, context.Context)
MaybeStartSpanFromContext :
func (*OpenTracingInterceptor) ResultLastInsertId ¶
func (ot *OpenTracingInterceptor) ResultLastInsertId(ctx context.Context, result driver.Result) (id int64, err error)
ResultLastInsertId :
func (*OpenTracingInterceptor) ResultRowsAffected ¶
func (ot *OpenTracingInterceptor) ResultRowsAffected(ctx context.Context, result driver.Result) (affected int64, err error)
ResultRowsAffected :
func (*OpenTracingInterceptor) RowsNext ¶
func (ot *OpenTracingInterceptor) RowsNext(ctx context.Context, rows driver.Rows, dest []driver.Value) (err error)
RowsNext :
func (*OpenTracingInterceptor) StmtExecContext ¶
func (ot *OpenTracingInterceptor) StmtExecContext(ctx context.Context, conn driver.StmtExecContext, query string, args []driver.NamedValue) (result driver.Result, err error)
StmtExecContext :
func (*OpenTracingInterceptor) StmtQueryContext ¶
func (ot *OpenTracingInterceptor) StmtQueryContext(ctx context.Context, conn driver.StmtQueryContext, query string, args []driver.NamedValue) (rows driver.Rows, err error)
StmtQueryContext :
func (*OpenTracingInterceptor) TxRollback ¶
TxRollback :
type TraceOptions ¶
type TraceOptions struct {
// Component is a component name in opentracing
// component: value
Component string
// DBInstance is a db instance name in opentracing
// db.instance: value
DBInstance string
// DBType is a db type in opentracing
// db.type: value
DBType string
// DBUser is a db user in opentracing
// db.user: value
DBUser string
// Ping is a flag to log the ping
Ping bool
// Prepare is a flag to log the prepare stmt
Prepare bool
// RowsNext is a flag to log the rows next
RowsNext bool
RowsClose bool
RowsAffected bool
LastInsertID bool
// when Query is true, it will log all the query statement
Query bool
// when Exec is true, it will log all the exec statement
Exec bool
BeginTx bool
TxCommit bool
TxRollback bool
// when Args is true, it will log all the arguments of the query
Args bool
}
TraceOptions :
Click to show internal directories.
Click to hide internal directories.