Compare commits

...

2 Commits

Author SHA1 Message Date
9c8fbb2202 broker: add Event Context() method
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-05-05 16:22:06 +03:00
7c0a5f5e2a add abilit to skip span recording
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-05-04 19:31:35 +03:00
2 changed files with 4 additions and 1 deletions

View File

@@ -88,6 +88,8 @@ type BatchHandler func(Events) error
// Event is given to a subscription handler for processing
type Event interface {
// Context return context.Context for event
Context() context.Context
// Topic returns event topic
Topic() string
// Message returns broker message

View File

@@ -155,7 +155,8 @@ func NewEventOptions(opts ...EventOption) EventOptions {
// NewSpanOptions returns default SpanOptions
func NewSpanOptions(opts ...SpanOption) SpanOptions {
options := SpanOptions{
Kind: SpanKindInternal,
Kind: SpanKindInternal,
Record: true,
}
for _, o := range opts {
o(&options)