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
gregkalapos
left a comment
There was a problem hiding this comment.
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.
| ==== `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
|
|
||
| public string HostName => _wrapped.HostName; | ||
|
|
||
| public IReadOnlyList<WildcardMatcher> IgnoreMessageQueues => _wrapped.IgnoreMessageQueues; |
There was a problem hiding this comment.
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.ServiceBus3.0.0+ orAzure.Messaging.ServiceBus7.0.0+ nuget packages.Two
IDiagnosticListenerimplementations, one forMicrosoft.Azure.ServiceBusand 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.jsonfile in the root of the repository for CI, and from an account authenticated withazfor local development. A default location is set within the template, but all variables can be passed using standard Terraform input variable conventions.Closes #1157