Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.35k stars 4.71k forks source link

[FEATURE REQ] Messaging tracing: support disabling per-message tracing #43355

Open lmolkova opened 5 months ago

lmolkova commented 5 months ago

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:

  1. 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
  2. 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 not enabled - no tracing or context propagation happens - same as before.
github-actions[bot] commented 5 months ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.