Skip to content

Commit 32e97da

Browse files
[Azure Event Grid] Enable integration and add support metadata
1 parent 4b804a8 commit 32e97da

9 files changed

Lines changed: 348 additions & 15 deletions

File tree

docs/span_attribute_schema/v0.md

Lines changed: 154 additions & 4 deletions
Large diffs are not rendered by default.

docs/span_attribute_schema/v1.md

Lines changed: 154 additions & 4 deletions
Large diffs are not rendered by default.

tracer/build/supported_versions.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,40 @@
401401
}
402402
]
403403
},
404+
{
405+
"integrationName": "AzureEventGrid",
406+
"assemblyName": "Azure.Messaging.EventGrid",
407+
"minAssemblyVersionInclusive": "4.0.0",
408+
"maxAssemblyVersionInclusive": "5.65535.65535",
409+
"packages": [
410+
{
411+
"name": "Azure.Messaging.EventGrid",
412+
"minVersionAvailableInclusive": "4.0.0",
413+
"minVersionSupportedInclusive": "4.0.0",
414+
"minVersionTestedInclusive": "4.0.0",
415+
"maxVersionSupportedInclusive": "5.0.0",
416+
"maxVersionAvailableInclusive": "5.0.0",
417+
"maxVersionTestedInclusive": "5.0.0"
418+
}
419+
]
420+
},
421+
{
422+
"integrationName": "AzureEventGrid",
423+
"assemblyName": "Azure.Messaging.EventGrid.Namespaces",
424+
"minAssemblyVersionInclusive": "1.0.0",
425+
"maxAssemblyVersionInclusive": "1.65535.65535",
426+
"packages": [
427+
{
428+
"name": "Azure.Messaging.EventGrid.Namespaces",
429+
"minVersionAvailableInclusive": "1.0.0",
430+
"minVersionSupportedInclusive": "1.0.0",
431+
"minVersionTestedInclusive": "1.0.0",
432+
"maxVersionSupportedInclusive": "1.1.0",
433+
"maxVersionAvailableInclusive": "1.1.0",
434+
"maxVersionTestedInclusive": "1.1.0"
435+
}
436+
]
437+
},
404438
{
405439
"integrationName": "AzureEventHubs",
406440
"assemblyName": "Azure.Messaging.EventHubs",

tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<assembly fullname="AWSSDK.SimpleNotificationService" />
1111
<assembly fullname="AWSSDK.SQS" />
1212
<assembly fullname="AWSSDK.StepFunctions" />
13+
<assembly fullname="Azure.Messaging.EventGrid" />
14+
<assembly fullname="Azure.Messaging.EventGrid.Namespaces" />
1315
<assembly fullname="Azure.Messaging.EventHubs" />
1416
<assembly fullname="Azure.Messaging.ServiceBus" />
1517
<assembly fullname="Confluent.Kafka" />

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Azure/EventGrid/EventGridCommon.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal static class EventGridCommon
2626
internal static CallTargetState CreateProducerSpan<TTarget, TEvents>(TTarget instance, ref TEvents events, bool injectContext, string? destinationNameOverride = null)
2727
{
2828
var tracer = Tracer.Instance;
29-
if (!tracer.CurrentTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AzureEventGrid, defaultValue: false))
29+
if (!tracer.CurrentTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AzureEventGrid))
3030
{
3131
return CallTargetState.GetDefault();
3232
}
@@ -50,7 +50,7 @@ internal static CallTargetState CreateNamespaceProducerSpanForEvent<TTarget>(TTa
5050
where TTarget : IEventGridSenderClient
5151
{
5252
var tracer = Tracer.Instance;
53-
if (!tracer.CurrentTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AzureEventGrid, defaultValue: false))
53+
if (!tracer.CurrentTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AzureEventGrid))
5454
{
5555
return CallTargetState.GetDefault();
5656
}
@@ -63,7 +63,7 @@ internal static CallTargetState CreateNamespaceProducerSpanForEvents<TTarget, TE
6363
where TTarget : IEventGridSenderClient
6464
{
6565
var tracer = Tracer.Instance;
66-
if (!tracer.CurrentTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AzureEventGrid, defaultValue: false))
66+
if (!tracer.CurrentTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AzureEventGrid))
6767
{
6868
return CallTargetState.GetDefault();
6969
}

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Azure/Functions/AzureFunctionsCommon.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ _ when type.StartsWith("eventGrid", StringComparison.OrdinalIgnoreCase) => "Even
311311
extractedContext = ExtractPropagatedContextFromMessaging(functionContext, "Properties", "PropertiesArray").MergeBaggageInto(Baggage.Current);
312312
break;
313313

314-
case "EventGrid" when tracer.CurrentTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AzureEventGrid, defaultValue: false):
314+
case "EventGrid" when tracer.CurrentTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AzureEventGrid):
315315
{
316316
extractedContext = EventGridFunctionsCommon.CreateReceiveSpanContext(tracer, functionContext, entry.Key as string, Baggage.Current);
317317
break;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class AzureEventGridNamespacesTests : TracingIntegrationTest
2323
public AzureEventGridNamespacesTests(ITestOutputHelper output)
2424
: base("AzureEventGridNamespaces", output)
2525
{
26-
SetEnvironmentVariable("DD_TRACE_AZUREEVENTGRID_ENABLED", "true");
2726
}
2827

2928
public static IEnumerable<object[]> GetEnabledConfig()

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public class AzureEventGridTests : TracingIntegrationTest
4949
public AzureEventGridTests(ITestOutputHelper output)
5050
: base("AzureEventGrid", output)
5151
{
52-
SetEnvironmentVariable("DD_TRACE_AZUREEVENTGRID_ENABLED", "true");
5352
}
5453

5554
public static IEnumerable<object[]> GetEnabledConfig()

tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/AzureFunctionsMessagingTriggerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public AzureFunctionsMessagingTriggerTests(ITestOutputHelper output)
5555
SetEnvironmentVariable("EVENTHUBS_CONNECTION_STRING", GetEventHubsConnectionString());
5656
SetEnvironmentVariable("EVENTGRID_TOPIC_ENDPOINT", GetEventGridTopicEndpoint());
5757
SetEnvironmentVariable("EVENTGRID_TOPIC_KEY", "test-key");
58-
SetEnvironmentVariable("DD_TRACE_AZUREEVENTGRID_ENABLED", "true");
5958
SetEnvironmentVariable("AzureWebJobsStorage", GetAzuriteConnectionString());
6059
// The Event Grid seeder publishes to the emulator's topic endpoint over HTTP. Exclude that URL from
6160
// HTTP client tracing so the publish doesn't add an http.request span — the azure_eventgrid.send span

0 commit comments

Comments
 (0)