Skip to content

Microsoft.Azure.EventHubs 4.1: events are not captured by DependencyCollector #1317

@mikhail-anfimau

Description

@mikhail-anfimau

EventHub client library now sends shortened versions of the events (i.e. "Send.Start" instead of "Microsoft.Azure.EventHubs.Send.Start" expected by AI.DependencyCollector).

The change is made in the following PR and is available since Microsoft.Azure.EventHubs version 4.1 (see diff):

        public const string DiagnosticSourceName = "Microsoft.Azure.EventHubs";

        public const string SendActivityName = "Send";
        public const string SendActivityStartName = SendActivityName + ".Start";
        public const string SendActivityExceptionName = SendActivityName + ".Exception";

EventHubsDiagnosticsEventHandler.cs still expects fully-qualified names:

        public override void OnEvent(KeyValuePair<string, object> evnt, DiagnosticListener ignored)
        {
            Activity currentActivity = Activity.Current;

            switch (evnt.Key)
            {
                case "Microsoft.Azure.EventHubs.Send.Start":
                case "Microsoft.Azure.EventHubs.Receive.Start":
                    break;
                case "Microsoft.Azure.EventHubs.Send.Stop":
                case "Microsoft.Azure.EventHubs.Receive.Stop":
                    this.OnDependency(evnt.Key, evnt.Value, currentActivity);
                    break;
            }
        }

Metadata

Metadata

Assignees

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