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

[Tracing] Add first-class tracing support for Azure Service Bus #4575

Merged
merged 13 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Datadog.Trace.sln
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepNestedHierarchy", "trac
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.AWS.Kinesis", "tracer\test\test-applications\integrations\Samples.AWS.Kinesis\Samples.AWS.Kinesis.csproj", "{C7DE0626-9EB6-475E-AA0C-CB9DE21D4FAE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AzureServiceBus", "tracer\test\test-applications\integrations\Samples.AzureServiceBus\Samples.AzureServiceBus.csproj", "{BC44A41F-1BED-4438-9F66-0EA5607906D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1258,6 +1260,10 @@ Global
{C7DE0626-9EB6-475E-AA0C-CB9DE21D4FAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7DE0626-9EB6-475E-AA0C-CB9DE21D4FAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7DE0626-9EB6-475E-AA0C-CB9DE21D4FAE}.Release|Any CPU.Build.0 = Release|Any CPU
{BC44A41F-1BED-4438-9F66-0EA5607906D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC44A41F-1BED-4438-9F66-0EA5607906D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC44A41F-1BED-4438-9F66-0EA5607906D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC44A41F-1BED-4438-9F66-0EA5607906D5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1463,6 +1469,7 @@ Global
{959E9599-8D99-43BC-8038-B91F76179C1C} = {498A300E-D036-49B7-A43D-821D1CAF11A5}
{1B3E6BEE-F7AB-433E-A1D9-E8BE3782419B} = {498A300E-D036-49B7-A43D-821D1CAF11A5}
{C7DE0626-9EB6-475E-AA0C-CB9DE21D4FAE} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{BC44A41F-1BED-4438-9F66-0EA5607906D5} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F}
Expand Down
66 changes: 66 additions & 0 deletions docs/span_attribute_schema/v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,72 @@ http.status_code | Yes
http.url | Yes
span.kind | `client`

## AzureServiceBusInbound
### Span properties
Name | Required |
---------|----------------|
Name | `Message`; `ServiceBusReceiver.Peek`; `ServiceBusReceiver.Receive`; `ServiceBusReceiver.ReceiveDeferred`; `ServiceBusProcessor.ProcessMessage`; `ServiceBusSessionProcessor.ProcessSessionMessage`
Type | `http`; `custom`
### Tags
Name | Required |
---------|----------------|
az.namespace | `Microsoft.ServiceBus`
az.schema_url | Yes
messaging.operation | `receive`; `process`
messaging.source.name | Yes
messaging.system | `servicebus`
net.peer.name | Yes
otel.library.name | Yes
otel.library.version | No
otel.status_code | `STATUS_CODE_UNSET`; `STATUS_CODE_OK`; `STATUS_CODE_ERROR`
otel.status_description | No
otel.trace_id | Yes
span.kind | `consumer`

## AzureServiceBusOutbound
### Span properties
Name | Required |
---------|----------------|
Name | `Message`
Type | `custom`
### Tags
Name | Required |
---------|----------------|
az.namespace | `Microsoft.ServiceBus`
az.schema_url | Yes
messaging.destination.name | Yes
messaging.system | `servicebus`
net.peer.name | Yes
otel.library.name | Yes
otel.library.version | No
otel.status_code | `STATUS_CODE_UNSET`; `STATUS_CODE_OK`; `STATUS_CODE_ERROR`
otel.status_description | No
otel.trace_id | Yes
span.kind | `producer`

## AzureServiceBusRequest
### Span properties
Name | Required |
---------|----------------|
Name | `ServiceBusSender.Send`; `ServiceBusReceiver.Complete`; `ServiceBusSessionReceiver.RenewSessionLock`; `ServiceBusSessionReceiver.SetSessionState`; `ServiceBusSessionReceiver.GetSessionState`; `ServiceBusSender.Schedule`; `ServiceBusSender.Cancel`; `ServiceBusReceiver.RenewMessageLock`; `ServiceBusReceiver.Abandon`; `ServiceBusReceiver.Defer`; `ServiceBusReceiver.DeadLetter`
Type | `http`
### Tags
Name | Required |
---------|----------------|
az.namespace | `Microsoft.ServiceBus`
az.schema_url | Yes
messaging.destination.name | No
messaging.operation | Optional: `publish`; `receive`; `settle`
messaging.source.name | No
messaging.system | `servicebus`
net.peer.name | Yes
otel.library.name | Yes
otel.library.version | No
otel.status_code | `STATUS_CODE_UNSET`; `STATUS_CODE_OK`; `STATUS_CODE_ERROR`
otel.status_description | No
otel.trace_id | Yes
span.kind | `client`

## CosmosDb
### Span properties
Name | Required |
Expand Down
72 changes: 72 additions & 0 deletions docs/span_attribute_schema/v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,78 @@ peer.service | Yes
peer.service.remapped_from | No
span.kind | `client`

## AzureServiceBusInbound
### Span properties
Name | Required |
---------|----------------|
Name | `Message`; `ServiceBusReceiver.Peek`; `ServiceBusReceiver.Receive`; `ServiceBusReceiver.ReceiveDeferred`; `ServiceBusProcessor.ProcessMessage`; `ServiceBusSessionProcessor.ProcessSessionMessage`
Type | `http`; `custom`
### Tags
Name | Required |
---------|----------------|
az.namespace | `Microsoft.ServiceBus`
az.schema_url | Yes
messaging.operation | `receive`; `process`
messaging.source.name | Yes
messaging.system | `servicebus`
net.peer.name | Yes
otel.library.name | Yes
otel.library.version | No
otel.status_code | `STATUS_CODE_UNSET`; `STATUS_CODE_OK`; `STATUS_CODE_ERROR`
otel.status_description | No
otel.trace_id | Yes
span.kind | `consumer`

## AzureServiceBusOutbound
### Span properties
Name | Required |
---------|----------------|
Name | `Message`
Type | `custom`
### Tags
Name | Required |
---------|----------------|
_dd.peer.service.source | `messaging.destination.name`; `peer.service`
az.namespace | `Microsoft.ServiceBus`
az.schema_url | Yes
messaging.destination.name | Yes
messaging.system | `servicebus`
net.peer.name | Yes
otel.library.name | Yes
otel.library.version | No
otel.status_code | `STATUS_CODE_UNSET`; `STATUS_CODE_OK`; `STATUS_CODE_ERROR`
otel.status_description | No
otel.trace_id | Yes
peer.service | Yes
peer.service.remapped_from | No
span.kind | `producer`

## AzureServiceBusRequest
### Span properties
Name | Required |
---------|----------------|
Name | `ServiceBusSender.Send`; `ServiceBusReceiver.Complete`; `ServiceBusSessionReceiver.RenewSessionLock`; `ServiceBusSessionReceiver.SetSessionState`; `ServiceBusSessionReceiver.GetSessionState`; `ServiceBusSender.Schedule`; `ServiceBusSender.Cancel`; `ServiceBusReceiver.RenewMessageLock`; `ServiceBusReceiver.Abandon`; `ServiceBusReceiver.Defer`; `ServiceBusReceiver.DeadLetter`
Type | `http`
### Tags
Name | Required |
---------|----------------|
_dd.peer.service.source | `messaging.destination.name`; `peer.service`
az.namespace | `Microsoft.ServiceBus`
az.schema_url | Yes
messaging.destination.name | No
messaging.operation | Optional: `publish`; `receive`; `settle`
messaging.source.name | No
messaging.system | `servicebus`
net.peer.name | Yes
otel.library.name | Yes
otel.library.version | No
otel.status_code | `STATUS_CODE_UNSET`; `STATUS_CODE_OK`; `STATUS_CODE_ERROR`
otel.status_description | No
otel.trace_id | Yes
peer.service | Yes
peer.service.remapped_from | No
span.kind | `client`

## CosmosDb
### Span properties
Name | Required |
Expand Down
4 changes: 3 additions & 1 deletion tracer/build/_build/Build.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,8 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo
var includeSecurity = TracerDirectory.GlobFiles("test/test-applications/security/*/*.csproj");

var exclude = TracerDirectory.GlobFiles("test/test-applications/integrations/dependency-libs/**/*.csproj")
.Concat(TracerDirectory.GlobFiles("test/test-applications/debugger/dependency-libs/**/*.csproj"));
.Concat(TracerDirectory.GlobFiles("test/test-applications/debugger/dependency-libs/**/*.csproj"))
.Concat(TracerDirectory.GlobFiles("test/test-applications/integrations/Samples.AzureServiceBus/*.csproj"));

var projects = includeIntegration
.Concat(includeSecurity)
Expand Down Expand Up @@ -1525,6 +1526,7 @@ async Task RunWindowsIisIntegrationTests(Project project)
// These samples are currently skipped.
var projectsToSkip = new[]
{
"Samples.AzureServiceBus", // We are not running in CI because we haven't set up an emulator
"Samples.Msmq", // Doesn't run on Linux
"Samples.Owin.WebApi2", // Doesn't run on Linux
"Samples.RateLimiter", // I think we _should_ run this one (assuming it has tests)
Expand Down
14 changes: 14 additions & 0 deletions tracer/build/_build/GenerateSpanDocumentation/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,27 @@ public static Requirement GenerateRequirement(string line, ModelState state)
OperationName = null,
RequiredValue = $"`{parts[2]}`",
},
(_, "IfPresentMatches") => new Requirement
{
Property = $"{parts[1]}",
PropertyType = propertyType,
OperationName = null,
RequiredValue = $"Optional: `{parts[2]}`",
},
(_, "MatchesOneOf") => new Requirement
{
Property = $"{parts[1]}",
PropertyType = propertyType,
OperationName = null,
RequiredValue = string.Join("; ", parts.Skip(2).Select(s => $"`{s}`")),
},
(_, "IfPresentMatchesOneOf") => new Requirement
{
Property = $"{parts[1]}",
PropertyType = propertyType,
OperationName = null,
RequiredValue = "Optional: " + string.Join("; ", parts.Skip(2).Select(s => $"`{s}`")),
},
(ModelState.ParsingTags, "IsOptional") or (ModelState.ParsingMetrics, "IsOptional") => new Requirement
{
Property = $"{parts[1]}",
Expand Down
Loading
Loading