Skip to content

Difference in behaviour between Microsoft.Azure.ServiceBus and Azure.Messaging.ServiceBus for adding Activity Tags to telemetry #2861

Open

Description

Hi,

Previously, when using the library, Microsoft.Azure.ServiceBus, if I added a custom property to the activity like so:

Activity.Current.Tags.Add("customProperty", "123")

When viewing the Request telemetry in Application Insights, it would show up under "Custom Properties". Which isn't the case for the newer library, Azure.Messaging.ServiceBus.

I've looked into why this might be, and found that the libraries use different DiagnosticEventHandlers:
Microsoft.Azure.ServiceBus uses ServiceBusDiagnosticsEventHandler which populates every tag on the Activity in the method OnEvent
Azure.Messaging.ServiceBus uses AzureSdkDiagnosticsEventHandler, overrides PopulateTags, but doesn't populate the telemetry object.

Was this an intended change, and is there an alternative that I can use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions