Skip to content

Commit e358f16

Browse files
committed
fix trace details
fix tracer options name
1 parent 332cee2 commit e358f16

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

options.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
tableConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
2626
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
2727
"github.com/ydb-platform/ydb-go-sdk/v3/log"
28+
"github.com/ydb-platform/ydb-go-sdk/v3/topic/topicoptions"
2829
"github.com/ydb-platform/ydb-go-sdk/v3/trace"
2930
)
3031

@@ -506,6 +507,14 @@ func WithTraceDiscovery(t trace.Discovery, opts ...trace.DiscoveryComposeOption)
506507
}
507508
}
508509

510+
// WithTraceTopic adds configured discovery tracer to Connection
511+
func WithTraceTopic(t trace.Topic, opts ...trace.DiscoveryComposeOption) Option {
512+
return func(ctx context.Context, c *connection) error {
513+
c.topicOptions = append(c.topicOptions, topicoptions.WithTrace(t))
514+
return nil
515+
}
516+
}
517+
509518
// Private technical options for correct copies processing
510519

511520
func withOnClose(onClose func(c *connection)) Option {

topic/topicoptions/topicoptions_reader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,12 @@ func WithGetPartitionStartOffset(f GetPartitionStartOffsetFunc) ReaderOption {
224224
}
225225
}
226226

227-
// WithTracer
227+
// WithReaderTrace
228228
//
229229
// Experimental
230230
//
231231
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
232-
func WithTracer(tracer trace.Topic) ReaderOption {
232+
func WithReaderTrace(tracer trace.Topic) ReaderOption {
233233
return func(cfg *topicreaderinternal.ReaderConfig) {
234234
cfg.Tracer = cfg.Tracer.Compose(tracer)
235235
}

0 commit comments

Comments
 (0)