Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DefaultViews = ocgorm.DefaultViews
)
Functions ¶
func RecordStats ¶
RecordStats records database statistics for provided sql.DB at the provided interval. You should defer execution of this function after you establish connection to the database `if err == nil { ocgorm.RecordStats(db, 5*time.Second); }
func RegisterAllViews ¶
func RegisterAllViews()
RegisterAllViews registers all ocgorm views to enable collection of stats.
func RegisterCallbacks ¶
RegisterCallbacks registers the necessary callbacks in Gorm's hook system for instrumentation.
Types ¶
type AllowRoot ¶
type AllowRoot bool
AllowRoot allows creating root spans in the absence of existing spans.
type DefaultAttributes ¶
DefaultAttributes sets attributes to each span.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option allows for managing ocgorm configuration using functional options.
func StartOptions ¶
func StartOptions(o trace.StartOptions) Option
StartOptions configures the initial options applied to a span.
type OptionFunc ¶
type OptionFunc func(c *callbacks)
OptionFunc converts a regular function to an Option if it's definition is compatible.