Documentation ¶
Index ¶
Constants ¶
View Source
const ( QueryAttribute = "gorm.query" TableAttribute = "gorm.table" )
Attributes recorded on the span for the queries.
Variables ¶
View Source
var (
// Operation is the type of query (SELECT, INSERT, UPDATE, DELETE)
Operation, _ = tag.NewKey("gorm.operation")
// Table name of the target database table
Table, _ = tag.NewKey("gorm.table")
)
Tags applied to measures
View Source
var (
QueryCount = stats.Int64("opencensus.io/gorm/query_count", "Number of queries started", stats.UnitDimensionless)
)
Measures
View Source
var ( QueryCountView = &view.View{ Name: "opencensus.io/gorm/query_count", Description: "Count of queries started", TagKeys: []tag.Key{Operation, Table}, Measure: QueryCount, Aggregation: view.Count(), } )
Functions ¶
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.
Click to show internal directories.
Click to hide internal directories.