Open
Description
Library name
Azure.Messaging.EventHubs, Azure.Messaging.ServiceBus
Please describe the feature.
We had a several questions/issues from users who didn't like message+send spans. In case there is just one message in a batch, then having two spans does not bring any value.
Also, when batch size it huge, per-message tracing becomes too hard and might not make sense.
OTel semconv allow to create a span per message in a batch and a publish span OR create one publish span and reuse publish context on each message being published.
We can do the following:
- if user enabled per-message source, then we'll create span per message
- if sender source is enabled, we'll also create a publish span - this existing path, no changes are expected
- if user didn't enable per-message source, we won't create a span per message
- if sender source is enabled, we'll create a publish span:
- if some message have pre-existing context provided by user, we won't update it and will link to it
- otherwise, we'll inject publish span context into the message
- this is the new feature
- if sender source is enabled, we'll create a publish span:
- if sender source is not enabled - no tracing or context propagation happens - same as before.