Skip to content

Commit 8bb93d9

Browse files
[Azure Event Grid] Enable integration and add support metadata
1 parent f532080 commit 8bb93d9

10 files changed

Lines changed: 119 additions & 9 deletions

File tree

docs/span_attribute_schema/v0.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,44 @@ peer.address | No
642642
server.address | Yes
643643
span.kind | `consumer`
644644

645+
## AzureEventGridOutbound
646+
### Span properties
647+
Name | Required |
648+
---------|----------------|
649+
Name | `azure_eventgrid.send`
650+
Type | `queue`
651+
### Tags
652+
Name | Required |
653+
---------|----------------|
654+
_dd.base_service | No
655+
component | `AzureEventGrid`
656+
messaging.batch.message_count | No
657+
messaging.message_id | No
658+
messaging.operation | `send`
659+
messaging.system | Optional: `eventgrid`
660+
net.peer.name | No
661+
network.destination.name | Yes
662+
network.destination.port | No
663+
peer.address | No
664+
span.kind | `producer`
665+
666+
## AzureEventGridInbound
667+
### Span properties
668+
Name | Required |
669+
---------|----------------|
670+
Name | `azure_eventgrid.receive`
671+
Type | `queue`
672+
### Tags
673+
Name | Required |
674+
---------|----------------|
675+
_dd.base_service | No
676+
component | `AzureEventGrid`
677+
messaging.batch.message_count | No
678+
messaging.message_id | No
679+
messaging.operation | `receive`
680+
messaging.system | Optional: `eventgrid`
681+
span.kind | `consumer`
682+
645683
## CosmosDb
646684
### Span properties
647685
Name | Required |

docs/span_attribute_schema/v1.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,47 @@ peer.address | No
401401
server.address | Yes
402402
span.kind | `consumer`
403403

404+
## AzureEventGridOutbound
405+
### Span properties
406+
Name | Required |
407+
---------|----------------|
408+
Name | `azure_eventgrid.send`
409+
Type | `queue`
410+
### Tags
411+
Name | Required |
412+
---------|----------------|
413+
_dd.base_service | No
414+
_dd.peer.service.source | No
415+
component | `AzureEventGrid`
416+
messaging.batch.message_count | No
417+
messaging.message_id | No
418+
messaging.operation | `send`
419+
messaging.system | Optional: `eventgrid`
420+
net.peer.name | No
421+
network.destination.name | Yes
422+
network.destination.port | No
423+
peer.address | No
424+
peer.service | No
425+
peer.service.remapped_from | No
426+
span.kind | `producer`
427+
428+
## AzureEventGridInbound
429+
### Span properties
430+
Name | Required |
431+
---------|----------------|
432+
Name | `azure_eventgrid.receive`
433+
Type | `queue`
434+
### Tags
435+
Name | Required |
436+
---------|----------------|
437+
_dd.base_service | No
438+
component | `AzureEventGrid`
439+
messaging.batch.message_count | No
440+
messaging.message_id | No
441+
messaging.operation | `receive`
442+
messaging.system | Optional: `eventgrid`
443+
span.kind | `consumer`
444+
404445
## CosmosDb
405446
### Span properties
406447
Name | Required |

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/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)
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
// Exclude the Event Grid emulator endpoint from HTTP client tracing to avoid an extra http.request span.
6160
SetEnvironmentVariable(

tracer/test/snapshots/AzureFunctionsMessagingTriggerTests.EventGridOutputBinding_SubmitsTrace.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@
184184
_dd.top_level: 1.0
185185
}
186186
}
187-
]
187+
]

tracer/test/snapshots/AzureFunctionsMessagingTriggerTests.EventGridTrigger_SubmitsTrace.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@
184184
_dd.top_level: 1.0
185185
}
186186
}
187-
]
187+
]

0 commit comments

Comments
 (0)