Documentation
¶
Index ¶
- Constants
- func After(ctx context.Context, driverName, tableName string, rowsAffected int64, ...)
- func Before(ctx context.Context, spanName string, tx *xorm.Engine) (context.Context, *xorm.Session)
- func BeforeWithSession(ctx context.Context, spanName string, session *xorm.Session) (context.Context, *xorm.Session)
- func Initialize(db *xorm.Engine, opts ...Option)
- type Option
- func WithAttributes(attrs ...attribute.KeyValue) Option
- func WithDBName(name string) Option
- func WithDriverName(driverName string) Option
- func WithQueryFormatter(queryFormatter func(query string) string) Option
- func WithTableName(name string) Option
- func WithTracerProvider(provider trace.TracerProvider) Option
- func WithoutMetrics() Option
- func WithoutQueryVariables() Option
Constants ¶
View Source
const ( CreatAsSpanName = "xorm:create" // Insert QueryAsSpanName = "xorm:query" // Get or Find CountAsSpanName = "xorm:count" // Count SumAsSpanName = "xorm:sum" // Sum, Sums, SumsInt DeleteAsSpanName = "xorm:delete" // Delete UpdateAsSpanName = "xorm:update" // Update RowAsSpanName = "xorm:row" // Rows or Iterate RawAsSpanName = "xorm:raw" // the raw SQL execution: Query or Exec a SQL string )
Variables ¶
This section is empty.
Functions ¶
func After ¶
func After(ctx context.Context, driverName, tableName string, rowsAffected int64, tx *xorm.Session, txErr error, opts ...Option)
After collects the trace data after session actions.
func BeforeWithSession ¶
func BeforeWithSession(ctx context.Context, spanName string, session *xorm.Session) (context.Context, *xorm.Session)
BeforeWithSession uses the ctx,spanName,session to start tracer, creates session.
func Initialize ¶
Initialize initializes the trace,metric.
Types ¶
type Option ¶
type Option func(p *plugin)
func WithAttributes ¶
WithAttributes configures attributes that are used to create a span.
func WithDriverName ¶
WithDriverName configures a db.system attribute.
func WithQueryFormatter ¶
WithQueryFormatter configures a query formatter
func WithTableName ¶
WithTableName configures a db.sql.table attribute.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider configures a tracer provider that is used to create a tracer.
func WithoutMetrics ¶
func WithoutMetrics() Option
WithoutMetrics prevents DBStats metrics from being reported.
func WithoutQueryVariables ¶
func WithoutQueryVariables() Option
WithoutQueryVariables configures the db.statement attribute to exclude query variables
Click to show internal directories.
Click to hide internal directories.