opentracing

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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) ConnPing

func (ot *OpenTracingInterceptor) ConnPing(ctx context.Context, conn driver.Pinger) (err error)

ConnPing :

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) StmtClose

func (ot *OpenTracingInterceptor) StmtClose(ctx context.Context, conn driver.Stmt) (err error)

StmtClose :

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) TxCommit

func (ot *OpenTracingInterceptor) TxCommit(ctx context.Context, tx driver.Tx) (err error)

TxCommit :

func (*OpenTracingInterceptor) TxRollback

func (ot *OpenTracingInterceptor) TxRollback(ctx context.Context, tx driver.Tx) (err error)

TxRollback :

type TraceOption

type TraceOption func(*TraceOptions)

TraceOption :

func WithAllTraceOptions

func WithAllTraceOptions() TraceOption

WithAllTraceOptions :

func WithArgs

func WithArgs(flag bool) TraceOption

WithArgs :

func WithComponent

func WithComponent(comp string) TraceOption

WithComponent :

func WithDBInstance

func WithDBInstance(instance string) TraceOption

WithDBInstance :

func WithDBType

func WithDBType(dbType string) TraceOption

WithDBType :

func WithDBUser

func WithDBUser(user string) TraceOption

WithDBUser :

func WithExec

func WithExec(flag bool) TraceOption

WithExec :

func WithPrepare

func WithPrepare(flag bool) TraceOption

WithPrepare :

func WithQuery

func WithQuery(flag bool) TraceOption

WithQuery :

func WithRowsClose

func WithRowsClose(flag bool) TraceOption

WithRowsClose :

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 :

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL