Documentation ¶
Index ¶
- func NewPlugin(opts ...Option) gorm.Plugin
- func Version() string
- type Option
- func WithAttributes(attrs ...attribute.KeyValue) Option
- func WithDBName(name string) Option
- func WithDryRunTx() Option
- func WithQueryFormatter(queryFormatter func(query string) string) Option
- func WithTracerProvider(provider trace.TracerProvider) Option
- func WithoutMetrics() Option
- func WithoutQueryVariables() Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(p *otelPlugin)
func WithAttributes ¶
WithAttributes configures attributes that are used to create a span.
func WithDryRunTx ¶
func WithDryRunTx() Option
WithDryRunTx will add trace spans for "dry run" callback invocations from Gorm. "Dry Run" invocations occur when Gorm is just rendering SQL, but not actually executing it against a database.
func WithQueryFormatter ¶
WithQueryFormatter configures a query formatter
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.