Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[META 410] Instrumentation for Azure ServiceBus #1157

Closed
AlexanderWert opened this issue Jan 29, 2021 · 3 comments · Fixed by #1225
Closed

[META 410] Instrumentation for Azure ServiceBus #1157

AlexanderWert opened this issue Jan 29, 2021 · 3 comments · Fixed by #1225
Assignees
Milestone

Comments

@AlexanderWert
Copy link
Member

Provide instrumentation for Azure ServiceBus.

Meta issue: elastic/apm#410
SPEC: elastic/apm#411

@glucaci
Copy link
Contributor

glucaci commented Mar 8, 2021

Hi,
Is someone working on this? If not I will start to create something because we also need it.

We have already created support for MassTrasit which is supporting multiple transports frameworks.
https://github.com/swisslife-oss/elastic-apm-extensions#masstrasit

Let me know if you want to integrate it in Elastic Agent and I will do a PR.

@gregkalapos
Copy link
Contributor

@glucaci I think no one actively works on this right now.

The plan was to directly support Azure.Messaging.ServiceBus. I haven't looked much into it, but from what I saw this could be covered by diagnostic source. If you want to open a PR, I'm happy to review it.

Regarding MassTrasit: It wasn't on our roadmap so far, I can sync up on it internally.

@russcam
Copy link
Contributor

russcam commented Mar 9, 2021

I'll take a look at this

@russcam russcam self-assigned this Mar 9, 2021
@AlexanderWert AlexanderWert modified the milestones: 7.12, 7.13 Mar 24, 2021
russcam added a commit that referenced this issue Apr 6, 2021
This commit adds instrumentation for Azure Service Bus when an application is 
using Microsoft.Azure.ServiceBus 3.0.0+ or Azure.Messaging.ServiceBus 7.0.0+ nuget packages.

Two IDiagnosticListener implementations, one for Microsoft.Azure.ServiceBus 
and another for Azure.Messaging.ServiceBus, create transactions and spans for received 
and sent messages:

A new transaction is created when

- one or more messages are received from a queue or topic subscription.
- a message is receive deferred from a queue or topic subscription.

A new span is created when there is a current transaction, and when

- one or more messages are sent to a queue or topic.
- one or more messages are scheduled to a queue or a topic.

The diagnostic events do not expose details about sent or received messages.
The trace ids of messages are exposed but are not currently captured in this implementation.
Messages are often received in batches, and it is possible for each message to have its
own trace id, but the APM implementation does not have a concept for capturing such
data right now. See elastic/apm#122

A terraform template file is used to create a resource group, Azure Service Bus namespace 
resource in the resource group, and set RBAC rules to allow the Service Principal that issues
the creation access to the resources. The Service Principal credentials can are sourced from
a .credentials.json file in the root of the repository for CI, and from an account authenticated
with az for local development. A default location is set within the template, but all variables 
can be passed using standard Terraform input variable conventions.

Closes #1157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants