Skip to content

Commit 7b28c34

Browse files
[DSM] Enable DSM integration test for Azure Service Bus 7.18.0
Bump the DSM test sample to ASB 7.18.0 and enable the test in CI to verify whether DSM produce checkpoints are broken for this SDK version. - Bump Azure.Messaging.ServiceBus from 7.14.0 to 7.18.0 in DSM sample - Replace SkipInCI with RequiresDockerDependency/DockerGroup traits - Pre-create DSM entities in emulator config (admin API not available) - Skip admin API calls in sample app when using the emulator Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 84efe2b commit 7b28c34

File tree

4 files changed

+108
-7
lines changed

4 files changed

+108
-7
lines changed

docker/servicebus-emulator-config.json

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,94 @@
1515
"RequiresDuplicateDetection": false,
1616
"RequiresSession": false
1717
}
18+
},
19+
{
20+
"Name": "dsm-direct-queue",
21+
"Properties": {
22+
"DeadLetteringOnMessageExpiration": false,
23+
"DefaultMessageTimeToLive": "PT1H",
24+
"LockDuration": "PT1M",
25+
"MaxDeliveryCount": 10,
26+
"EnablePartitioning": false,
27+
"RequiresDuplicateDetection": false,
28+
"RequiresSession": false
29+
}
30+
}
31+
],
32+
"Topics": [
33+
{
34+
"Name": "dsm-topic-subscription-filters",
35+
"Properties": {
36+
"DefaultMessageTimeToLive": "PT1H"
37+
},
38+
"Subscriptions": [
39+
{
40+
"Name": "subscription1",
41+
"Properties": {
42+
"LockDuration": "PT1M",
43+
"MaxDeliveryCount": 10
44+
},
45+
"Rules": [
46+
{
47+
"Name": "typeFilter",
48+
"Properties": {
49+
"FilterType": "Correlation",
50+
"CorrelationFilter": {
51+
"Label": "order"
52+
}
53+
}
54+
}
55+
]
56+
},
57+
{
58+
"Name": "subscription2",
59+
"Properties": {
60+
"LockDuration": "PT1M",
61+
"MaxDeliveryCount": 10
62+
},
63+
"Rules": [
64+
{
65+
"Name": "typeFilter",
66+
"Properties": {
67+
"FilterType": "Correlation",
68+
"CorrelationFilter": {
69+
"Label": "order"
70+
}
71+
}
72+
}
73+
]
74+
}
75+
]
76+
},
77+
{
78+
"Name": "dsm-topic2",
79+
"Properties": {
80+
"DefaultMessageTimeToLive": "PT1H"
81+
},
82+
"Subscriptions": [
83+
{
84+
"Name": "subscription",
85+
"Properties": {
86+
"LockDuration": "PT1M",
87+
"MaxDeliveryCount": 10
88+
}
89+
}
90+
]
91+
},
92+
{
93+
"Name": "dsm-topic3",
94+
"Properties": {
95+
"DefaultMessageTimeToLive": "PT1H"
96+
},
97+
"Subscriptions": [
98+
{
99+
"Name": "subscription",
100+
"Properties": {
101+
"LockDuration": "PT1M",
102+
"MaxDeliveryCount": 10
103+
}
104+
}
105+
]
18106
}
19107
]
20108
}

tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Azure/DataStreamsMonitoringAzureServiceBusTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public static IEnumerable<object[]> GetPackageVersions()
3434
[SkippableTheory]
3535
[MemberData(nameof(GetPackageVersions))]
3636
[Trait("Category", "EndToEnd")]
37-
[Trait("SkipInCI", "True")] // "This has only been tested on a live Azure Service Bus namespace using a connection string. Unskip this if you'd like to run locally or if you've correctly configured piotr-rojek/devopsifyme-sbemulator in CI"
37+
[Trait("RequiresDockerDependency", "true")]
38+
[Trait("DockerGroup", "2")]
3839
public async Task HandleProduceAndConsume(string packageVersion)
3940
{
4041
SetEnvironmentVariable(ConfigurationKeys.DataStreamsMonitoring.Enabled, "1");
@@ -62,7 +63,8 @@ await Verifier.Verify(PayloadsToPoints(agent.DataStreams), settings)
6263
[SkippableTheory]
6364
[MemberData(nameof(GetPackageVersions))]
6465
[Trait("Category", "EndToEnd")]
65-
[Trait("SkipInCI", "True")] // This has only been tested on a live Azure Service Bus namespace using a connection string. Unskip this if you'd like to run locally or if you've correctly configured piotr-rojek/devopsifyme-sbemulator in CI
66+
[Trait("RequiresDockerDependency", "true")]
67+
[Trait("DockerGroup", "2")]
6668
public async Task ValidateSpanTags(string packageVersion)
6769
{
6870
SetEnvironmentVariable(ConfigurationKeys.DataStreamsMonitoring.Enabled, "1");

tracer/test/test-applications/integrations/Samples.DataStreams.AzureServiceBus/Program.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace Samples.DataStreams.AzureServiceBus
1515
public static class Program
1616
{
1717
private static readonly string ConnectionString = Environment.GetEnvironmentVariable("ASB_CONNECTION_STRING");
18+
private static readonly bool UseEmulator = ConnectionString?.Contains("UseDevelopmentEmulator=true") == true;
1819
private static readonly ServiceBusClient Client = new(ConnectionString);
1920
private static readonly ServiceBusAdministrationClient AdminClient = new(ConnectionString);
2021

@@ -99,6 +100,13 @@ public static async Task Main(string[] args)
99100

100101
private static async Task InitializeServiceBusAsync()
101102
{
103+
if (UseEmulator)
104+
{
105+
// Entities are pre-created via the emulator config (servicebus-emulator-config.json)
106+
Console.WriteLine("Using emulator — skipping admin API entity creation");
107+
return;
108+
}
109+
102110
// Create queue
103111
await AdminClient.CreateQueueAsync(QueueName);
104112

@@ -189,10 +197,13 @@ private static Func<ProcessErrorEventArgs, Task> ProcessError(string displayName
189197

190198
private static async Task DisposeServiceBusAsync()
191199
{
192-
await AdminClient.DeleteQueueAsync(QueueName); // Delete so each test is self-contained
193-
await AdminClient.DeleteTopicAsync(TopicWithFiltersName); // Delete so each test is self-contained
194-
await AdminClient.DeleteTopicAsync(Topic2Name); // Delete so each test is self-contained
195-
await AdminClient.DeleteTopicAsync(Topic3Name); // Delete so each test is self-contained
200+
if (!UseEmulator)
201+
{
202+
await AdminClient.DeleteQueueAsync(QueueName); // Delete so each test is self-contained
203+
await AdminClient.DeleteTopicAsync(TopicWithFiltersName); // Delete so each test is self-contained
204+
await AdminClient.DeleteTopicAsync(Topic2Name); // Delete so each test is self-contained
205+
await AdminClient.DeleteTopicAsync(Topic3Name); // Delete so each test is self-contained
206+
}
196207

197208
await Client.DisposeAsync();
198209
}

tracer/test/test-applications/integrations/Samples.DataStreams.AzureServiceBus/Samples.DataStreams.AzureServiceBus.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<ItemGroup>
4-
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.14.0" />
4+
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.18.0" />
55
<PackageReference Include="OpenTelemetry" Version="1.4.0" />
66
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.4.0" />
77
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.4.0" />

0 commit comments

Comments
 (0)