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 {
1919 tp trace.TracerProvider
2020 tracer trace.Tracer
2121
22- dbStmtEnabled bool
23- callerEnabled bool
22+ dbStmtEnabled bool
23+ callerEnabled bool
24+ commandExclusions []string
2425
2526 // Metrics options.
2627
@@ -54,13 +55,13 @@ func (fn option) metrics() {}
5455
5556func newConfig (opts ... baseOption ) * config {
5657 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 ,
6465 }
6566
6667 for _ , opt := range opts {
@@ -124,6 +125,13 @@ func WithCallerEnabled(on bool) TracingOption {
124125 })
125126}
126127
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+
127135//------------------------------------------------------------------------------
128136
129137type MetricsOption interface {
You can’t perform that action at this time.
0 commit comments