Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstrumentClientWithHooks ¶
InstrumentClientWithHooks starts reporting OpenTelemetry Tracing and Metrics.
Based on https://opentelemetry.io/docs/specs/semconv/database/.
func InstrumentPoolStatsMetrics ¶
InstrumentPoolStatsMetrics starts reporting OpenTelemetry Metrics for the connection pool.
func SetBuckets ¶
func SetBuckets(b []float64)
SetBuckets sets the buckets used for OpenTelemetry metrics. The default buckets of .001, .005, .01, .025, .05, .075, .1, .25, .5, .75, 1, 2.5, 5, 7.5, 10 are used if SetBuckets is not called. The default buckets are finer than the one in the Semantic Conventions.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures the instrumentation.
func DisableMetrics ¶
func DisableMetrics() Option
DisableMetrics tells the hook not to record metrics.
func EnableDBQueryText ¶ added in v0.3.0
func EnableDBQueryText() Option
EnableDBQueryText tells the tracing hook to log raw redis commands.
func WithAttributes ¶
WithAttributes specifies additional attributes to be added to the span.
func WithMeterProvider ¶
func WithMeterProvider(mp metric.MeterProvider) Option
WithMeterProvider configures a metric.Meter used to create instruments.
func WithPoolName ¶
WithPoolName specifies the pool name to use in the attributes.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.