tracer: improve
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -98,15 +98,15 @@ type EventOptions struct {
|
||||
// EventOption func signature
|
||||
type EventOption func(o *EventOptions)
|
||||
|
||||
func WithEventLabels(labels ...interface{}) EventOption {
|
||||
func WithEventLabels(kv ...interface{}) EventOption {
|
||||
return func(o *EventOptions) {
|
||||
o.Labels = labels
|
||||
o.Labels = kv
|
||||
}
|
||||
}
|
||||
|
||||
func WithSpanLabels(labels ...interface{}) SpanOption {
|
||||
func WithSpanLabels(kv ...interface{}) SpanOption {
|
||||
return func(o *SpanOptions) {
|
||||
o.Labels = labels
|
||||
o.Labels = kv
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +136,15 @@ func Logger(l logger.Logger) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// NewEventOptions returns default EventOptions
|
||||
func NewEventOptions(opts ...EventOption) EventOptions {
|
||||
options := EventOptions{}
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
return options
|
||||
}
|
||||
|
||||
// NewSpanOptions returns default SpanOptions
|
||||
func NewSpanOptions(opts ...SpanOption) SpanOptions {
|
||||
options := SpanOptions{
|
||||
|
||||
Reference in New Issue
Block a user