tracing

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 11 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_local_transaction_begin"

	// tx
	TxQuery    = "tx_query"
	TxExecSQL  = "tx_exec_sql"
	TxExecStmt = "tx_exec_stmt"
	TxCommit   = "db_local_transaction_commit"
	TxRollback = "db_local_transaction_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 TracerController

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

func NewTracer

func NewTracer(version string, jaegerEndpoint string) (*TracerController, error)

NewTracer create tracer controller, currently only support jaeger.

func (TracerController) Shutdown

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

type TracingExporter added in v0.3.0

type TracingExporter string
const (
	ConsoleExporter TracingExporter = "console"
	JaegerExporter  TracingExporter = "jaeger"
	ZipkinExporter  TracingExporter = "zipkin"
	OltpExporter    TracingExporter = "oltp"
)

Jump to

Keyboard shortcuts

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