Documentation
¶
Index ¶
- func BasicCommandFilter(cmd redis.Cmder) bool
- func DefaultCommandFilter(cmd redis.Cmder) bool
- func InstrumentMetrics(rdb redis.UniversalClient, opts ...MetricsOption) error
- func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error
- type MetricsOption
- type Option
- type TracingOption
- func WithCallerEnabled(on bool) TracingOption
- func WithCommandFilter(filter func(cmd redis.Cmder) bool) TracingOption
- func WithCommandsFilter(filter func(cmds []redis.Cmder) bool) TracingOption
- func WithDBStatement(on bool) TracingOption
- func WithDialFilter(on bool) TracingOption
- func WithTracerProvider(provider trace.TracerProvider) TracingOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicCommandFilter ¶ added in v9.14.1
func BasicCommandFilter(cmd redis.Cmder) bool
BasicCommandFilter filters out AUTH commands from tracing. Deprecated: use DefaultCommandFilter instead.
func DefaultCommandFilter ¶ added in v9.16.0
func DefaultCommandFilter(cmd redis.Cmder) bool
DefaultCommandFilter filters out AUTH commands from tracing.
func InstrumentMetrics ¶
func InstrumentMetrics(rdb redis.UniversalClient, opts ...MetricsOption) error
InstrumentMetrics starts reporting OpenTelemetry Metrics.
Based on https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-metrics.md
func InstrumentTracing ¶
func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error
Types ¶
type MetricsOption ¶
type MetricsOption interface {
// contains filtered or unexported methods
}
func WithCloseChan ¶ added in v9.12.0
func WithCloseChan(closeChan chan struct{}) MetricsOption
func WithMeterProvider ¶
func WithMeterProvider(mp metric.MeterProvider) MetricsOption
WithMeterProvider configures a metric.Meter used to create instruments.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithAttributes ¶
WithAttributes specifies additional attributes to be added to the span.
func WithDBSystem ¶
type TracingOption ¶
type TracingOption interface {
// contains filtered or unexported methods
}
func WithCallerEnabled ¶ added in v9.11.0
func WithCallerEnabled(on bool) TracingOption
WithCallerEnabled tells the tracing hook to log the calling function, file and line.
func WithCommandFilter ¶ added in v9.14.1
func WithCommandFilter(filter func(cmd redis.Cmder) bool) TracingOption
WithCommandFilter allows filtering of commands when tracing to omit commands that may have sensitive details like passwords.
func WithCommandsFilter ¶ added in v9.16.0
func WithCommandsFilter(filter func(cmds []redis.Cmder) bool) TracingOption
WithCommandsFilter allows filtering of pipeline commands when tracing to omit commands that may have sensitive details like passwords in a pipeline.
func WithDBStatement ¶
func WithDBStatement(on bool) TracingOption
WithDBStatement tells the tracing hook to log raw redis commands.
func WithDialFilter ¶ added in v9.16.0
func WithDialFilter(on bool) TracingOption
WithDialFilter enables or disables filtering of dial commands.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) TracingOption
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.