tracer: allow to skip span recording

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-05-04 19:18:12 +03:00
parent cc0f24e012
commit b08f5321b0
1 changed files with 7 additions and 0 deletions

View File

@ -85,6 +85,7 @@ func (sk SpanKind) String() string {
type SpanOptions struct {
Labels []interface{}
Kind SpanKind
Record bool
}
// SpanOption func signature
@ -116,6 +117,12 @@ func WithSpanKind(k SpanKind) SpanOption {
}
}
func WithSpanRecord(b bool) SpanOption {
return func(o *SpanOptions) {
o.Record = b
}
}
// Options struct
type Options struct {
// Context used to store custome tracer options