tracing

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceParentHeader = "traceparent"

	// service
	HTTPProxyService = "http_proxy_service"

	// distributed transaction filter
	DTHttpFilterPreHandle   = "dt_http_filter_pre_handle"
	DTHttpFilterPostHandle  = "dt_http_filter_post_handle"
	DTMysqlFilterPreHandle  = "dt_mysql_filter_pre_handle"
	DTMysqlFilterPostHandle = "dt_mysql_filter_post_handle"

	// global transcation span name.
	GlobalTransactionBegin    = "global_transaction_begin"
	GlobalTransactionEnd      = "global_transaction_end"
	GlobalTransactionCommit   = "global_transaction_commit"
	GlobalTransactionRollback = "global_transaction_rollback"

	// branch transaction.
	BranchTransactionRegister = "branch_transaction_register"
	BranchTransactionEnd      = "branch_transaction_end"

	// executor
	ExecutorFetchBeforeImage = "executor_fetch_before_image"
	ExecutorFetchAfterImage  = "executor_fetch_after_image"
	Executable               = "executable"

	// mysql command
	MySQLListenerComQuery       = "mysql_listener_com_query"
	MySQLListenerComStmtExecute = "mysql_listener_com_stmt_execute"

	// single db
	SDBComQuery       = "sdb_com_query"
	SDBComStmtExecute = "sdb_com_stmt_execute"

	// read write splitting
	RWSComQuery       = "rws_com_query"
	RWSComStmtExecute = "rws_com_stmt_execute"

	// sharding
	SHDComQuery       = "shd_com_query"
	SHDComStmtExecute = "shd_com_stmt_execute"

	// db
	DBUse                   = "db_use"
	DBQuery                 = "db_query"
	DBExecSQL               = "db_exec_sql"
	DBExecStmt              = "db_exec_stmt"
	DBExecFieldList         = "db_exec_field_list"
	DBLocalTransactionBegin = "db_tx_begin"
	DBXAStart               = "db_xa_start"

	// group
	GroupQuery            = "group_query"
	GroupExecute          = "group_execute"
	GroupTransactionBegin = "group_tx_begin"

	// tx
	TxQuery            = "tx_query"
	TxExecSQL          = "tx_exec_sql"
	TxExecStmt         = "tx_exec_stmt"
	TxCommit           = "db_tx_commit"
	TxRollback         = "db_tx_rollback"
	TxReleaseSavePoint = "db_tx_release_savepoint"
	TxXAPrepare        = "db_xa_prepare"

	// group tx
	GroupTxQuery    = "group_tx_query"
	GroupTxExecSQL  = "group_tx_exec_sql"
	GroupTxExecStmt = "group_tx_exec_stmt"
	GroupTxCommit   = "group_tx_commit"
	GroupTxRollback = "group_tx_rollback"

	// conn
	ConnQuery       = "conn_com_query"
	ConnStmtExecute = "conn_com_stmt_exec"
)

Variables

This section is empty.

Functions

func BuildContextFromSQLHint added in v0.3.0

func BuildContextFromSQLHint(ctx context.Context, stmt ast.Node) context.Context

func GetTraceSpan

func GetTraceSpan(ctx context.Context, spanName string) (context.Context, trace.Span)

func RecordErrorSpan

func RecordErrorSpan(span trace.Span, err error)

Types

type Exporter added in v0.4.1

type Exporter string
const (
	ConsoleExporter Exporter = "console"
	JaegerExporter  Exporter = "jaeger"
	ZipkinExporter  Exporter = "zipkin"
)

type TracerController

type TracerController struct {
	// contains filtered or unexported fields
}

func NewTracer

func NewTracer(version string, traceExporter Exporter, endpoint *string) (*TracerController, error)

NewTracer create tracer controller, support jaeger, zipkin, console

func (TracerController) Shutdown

func (p TracerController) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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