-
Notifications
You must be signed in to change notification settings - Fork 206
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
Add instrumentation for Azure Service Bus #1225
Conversation
An outstanding item is to set the distributed tracing data for receive/receive deferred messages. Messages are typically retrieved and sent in batches however, where each message may represent its own distributed trace. elastic/apm#122 proposes introducing a |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
Going to rebase this against master, to pick up #1240 to run tests on CI |
Integration tests that run azure resources will be skipped if credentials are not available.
Not needed
b0de537
to
995f266
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a first look, very nice 👍
I added some comments below. On the central config part: I'm not sure it's worth the effort to make the new config runtime changeable right now in this PR - if it turns out to be more work, I think it's totally fine to do it in a follow up - just update the doc in that case.
docs/configuration.asciidoc
Outdated
|
||
[float] | ||
[[config-ignore-message-queues]] | ||
==== `IgnoreMessageQueues` (added[1.9]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==== `IgnoreMessageQueues` (added[1.9]) | |
==== `IgnoreMessageQueues` (added[1.10]) |
src/Elastic.Apm.AspNetCore/DiagnosticListener/AspNetCoreDiagnosticListener.cs
Outdated
Show resolved
Hide resolved
src/Elastic.Apm.Azure.ServiceBus/AzureMessagingServiceBusDiagnosticListener.cs
Outdated
Show resolved
Hide resolved
src/Elastic.Apm.Azure.ServiceBus/AzureMessagingServiceBusDiagnosticListener.cs
Show resolved
Hide resolved
@@ -266,6 +266,8 @@ internal WrappingConfigSnapshot(IConfigSnapshot wrapped, CentralConfigReader cen | |||
|
|||
public string HostName => _wrapped.HostName; | |||
|
|||
public IReadOnlyList<WildcardMatcher> IgnoreMessageQueues => _wrapped.IgnoreMessageQueues; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we'll need something like this:
_centralConfig.IgnoreMessageQueues ?? _wrapped.IgnoreMessageQueues;
_centralConfig.IgnoreMessageQueues
doesn't exist yet, that's what we should implement and parse in CentralConfigReader
, otherwise it'll only return values from the local config.
This PR adds instrumentation for Azure Service Bus when an application is using
Microsoft.Azure.ServiceBus
3.0.0+ orAzure.Messaging.ServiceBus
7.0.0+ nuget packages.Two
IDiagnosticListener
implementations, one forMicrosoft.Azure.ServiceBus
and another forAzure.Messaging.ServiceBus
, create transactions and spans for received and sent messages:A new transaction is created when
A new span is created when there is a current transaction, and when
A terrform 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 withaz
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