MCPcopy
hub / github.com/redis/go-redis / newConfig

Function newConfig

extra/redisotel/config.go:61–88  ·  view source on GitHub ↗
(opts ...baseOption)

Source from the content-addressed store, hash-verified

59func (fn option) metrics() {}
60
61func newConfig(opts ...baseOption) *config {
62 conf := &config{
63 dbSystem: "redis",
64 attrs: []attribute.KeyValue{},
65
66 tp: otel.GetTracerProvider(),
67 mp: otel.GetMeterProvider(),
68 dbStmtEnabled: true,
69 callerEnabled: true,
70 filterProcess: DefaultCommandFilter,
71 filterProcessPipeline: func(cmds []redis.Cmder) bool {
72 for _, cmd := range cmds {
73 if DefaultCommandFilter(cmd) {
74 return true
75 }
76 }
77 return false
78 },
79 }
80
81 for _, opt := range opts {
82 opt.apply(conf)
83 }
84
85 conf.attrs = append(conf.attrs, semconv.DBSystemKey.String(conf.dbSystem))
86
87 return conf
88}
89
90func WithDBSystem(dbSystem string) Option {
91 return option(func(conf *config) {

Callers 2

newTracingHookFunction · 0.85
InstrumentMetricsFunction · 0.85

Calls 3

DefaultCommandFilterFunction · 0.85
applyMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected