File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ type config struct {
19
19
tp trace.TracerProvider
20
20
tracer trace.Tracer
21
21
22
- dbStmtEnabled bool
23
- callerEnabled bool
22
+ dbStmtEnabled bool
23
+ callerEnabled bool
24
+ commandExclusions []string
24
25
25
26
// Metrics options.
26
27
@@ -54,13 +55,13 @@ func (fn option) metrics() {}
54
55
55
56
func newConfig (opts ... baseOption ) * config {
56
57
conf := & config {
57
- dbSystem : "redis" ,
58
- attrs : []attribute.KeyValue {},
59
-
60
- tp : otel .GetTracerProvider (),
61
- mp : otel .GetMeterProvider (),
62
- dbStmtEnabled : true ,
63
- callerEnabled : true ,
58
+ dbSystem : "redis" ,
59
+ attrs : []attribute.KeyValue {},
60
+ commandExclusions : [] string {},
61
+ tp : otel .GetTracerProvider (),
62
+ mp : otel .GetMeterProvider (),
63
+ dbStmtEnabled : true ,
64
+ callerEnabled : true ,
64
65
}
65
66
66
67
for _ , opt := range opts {
@@ -124,6 +125,13 @@ func WithCallerEnabled(on bool) TracingOption {
124
125
})
125
126
}
126
127
128
+ // WithCommandExclusions tells the tracing hook to exclude the specified redis commands.
129
+ func WithCommandExclusions (exclusions []string ) TracingOption {
130
+ return tracingOption (func (conf * config ) {
131
+ conf .commandExclusions = exclusions
132
+ })
133
+ }
134
+
127
135
//------------------------------------------------------------------------------
128
136
129
137
type MetricsOption interface {
You can’t perform that action at this time.
0 commit comments