Skip to content

Commit 97cd799

Browse files
committed
Atempt to fix Azure Functions for .NET 10
1 parent 0b02cd3 commit 97cd799

File tree

3 files changed

+96
-63
lines changed

3 files changed

+96
-63
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public async Task SubmitsTraces()
280280
using var agent = EnvironmentHelper.GetMockAgent(useTelemetry: true);
281281
using (await RunAzureFunctionAndWaitForExit(agent, expectedExitCode: -1))
282282
{
283-
const int expectedSpanCount = 21;
283+
const int expectedSpanCount = 22;
284284
var spans = await agent.WaitForSpansAsync(expectedSpanCount);
285285

286286
using var s = new AssertionScope();

tracer/test/snapshots/AzureFunctionsTests.Isolated.verified.txt

Lines changed: 92 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,38 @@
33
TraceId: Id_1,
44
SpanId: Id_2,
55
Name: azure_functions.invoke,
6+
Resource: Timer ExitApp,
7+
Service: AzureFunctionsAllTriggers,
8+
Type: serverless,
9+
Tags: {
10+
aas.environment.extension_version: unknown,
11+
aas.environment.instance_id: unknown,
12+
aas.environment.instance_name: IntegrationTestHost,
13+
aas.environment.os: unknown,
14+
aas.environment.runtime: .NET,
15+
aas.function.method: Samples.AzureFunctions.AllTriggers.AllTriggers.ExitApp,
16+
aas.function.name: ExitApp,
17+
aas.function.trigger: Timer,
18+
aas.site.kind: functionapp,
19+
aas.site.name: AzureFunctionsAllTriggers,
20+
aas.site.type: function,
21+
component: AzureFunctions,
22+
env: integration_tests,
23+
language: dotnet,
24+
runtime-id: Guid_1,
25+
span.kind: server
26+
},
27+
Metrics: {
28+
process_id: 0,
29+
_dd.top_level: 1.0,
30+
_dd.tracer_kr: 1.0,
31+
_sampling_priority_v1: 1.0
32+
}
33+
},
34+
{
35+
TraceId: Id_3,
36+
SpanId: Id_4,
37+
Name: azure_functions.invoke,
638
Resource: Timer TriggerAllTimer,
739
Service: AzureFunctionsAllTriggers,
840
Type: serverless,
@@ -32,13 +64,13 @@
3264
}
3365
},
3466
{
35-
TraceId: Id_1,
36-
SpanId: Id_3,
67+
TraceId: Id_3,
68+
SpanId: Id_5,
3769
Name: http.request,
3870
Resource: GET localhost:00000/api/trigger,
3971
Service: AzureFunctionsAllTriggers-http-client,
4072
Type: http,
41-
ParentId: Id_2,
73+
ParentId: Id_4,
4274
Tags: {
4375
aas.site.name: AzureFunctionsAllTriggers,
4476
aas.site.type: function,
@@ -59,13 +91,13 @@
5991
}
6092
},
6193
{
62-
TraceId: Id_1,
63-
SpanId: Id_4,
94+
TraceId: Id_3,
95+
SpanId: Id_6,
6496
Name: azure_functions.invoke,
6597
Resource: GET /api/trigger,
6698
Service: AzureFunctionsAllTriggers,
6799
Type: serverless,
68-
ParentId: Id_3,
100+
ParentId: Id_5,
69101
Tags: {
70102
aas.environment.extension_version: unknown,
71103
aas.environment.instance_id: unknown,
@@ -96,13 +128,13 @@
96128
}
97129
},
98130
{
99-
TraceId: Id_1,
100-
SpanId: Id_5,
131+
TraceId: Id_3,
132+
SpanId: Id_7,
101133
Name: azure_functions.invoke,
102134
Resource: Http TriggerCaller,
103135
Service: AzureFunctionsAllTriggers,
104136
Type: serverless,
105-
ParentId: Id_4,
137+
ParentId: Id_6,
106138
Tags: {
107139
aas.environment.extension_version: unknown,
108140
aas.environment.instance_id: unknown,
@@ -129,12 +161,12 @@
129161
}
130162
},
131163
{
132-
TraceId: Id_1,
133-
SpanId: Id_6,
164+
TraceId: Id_3,
165+
SpanId: Id_8,
134166
Name: Manual inside Trigger,
135167
Resource: Manual inside Trigger,
136168
Service: AzureFunctionsAllTriggers,
137-
ParentId: Id_5,
169+
ParentId: Id_7,
138170
Tags: {
139171
aas.site.name: AzureFunctionsAllTriggers,
140172
aas.site.type: function,
@@ -143,13 +175,13 @@
143175
}
144176
},
145177
{
146-
TraceId: Id_1,
147-
SpanId: Id_7,
178+
TraceId: Id_3,
179+
SpanId: Id_9,
148180
Name: http.request,
149181
Resource: GET localhost:00000/api/simple,
150182
Service: AzureFunctionsAllTriggers-http-client,
151183
Type: http,
152-
ParentId: Id_6,
184+
ParentId: Id_8,
153185
Tags: {
154186
aas.site.name: AzureFunctionsAllTriggers,
155187
aas.site.type: function,
@@ -170,13 +202,13 @@
170202
}
171203
},
172204
{
173-
TraceId: Id_1,
174-
SpanId: Id_8,
205+
TraceId: Id_3,
206+
SpanId: Id_10,
175207
Name: http.request,
176208
Resource: GET localhost:00000/api/exception,
177209
Service: AzureFunctionsAllTriggers-http-client,
178210
Type: http,
179-
ParentId: Id_6,
211+
ParentId: Id_8,
180212
Tags: {
181213
aas.site.name: AzureFunctionsAllTriggers,
182214
aas.site.type: function,
@@ -197,13 +229,13 @@
197229
}
198230
},
199231
{
200-
TraceId: Id_1,
201-
SpanId: Id_9,
232+
TraceId: Id_3,
233+
SpanId: Id_11,
202234
Name: http.request,
203235
Resource: GET localhost:00000/api/error,
204236
Service: AzureFunctionsAllTriggers-http-client,
205237
Type: http,
206-
ParentId: Id_6,
238+
ParentId: Id_8,
207239
Tags: {
208240
aas.site.name: AzureFunctionsAllTriggers,
209241
aas.site.type: function,
@@ -224,13 +256,13 @@
224256
}
225257
},
226258
{
227-
TraceId: Id_1,
228-
SpanId: Id_10,
259+
TraceId: Id_3,
260+
SpanId: Id_12,
229261
Name: http.request,
230262
Resource: GET localhost:00000/api/badrequest,
231263
Service: AzureFunctionsAllTriggers-http-client,
232264
Type: http,
233-
ParentId: Id_6,
265+
ParentId: Id_8,
234266
Error: 1,
235267
Tags: {
236268
aas.site.name: AzureFunctionsAllTriggers,
@@ -253,13 +285,13 @@
253285
}
254286
},
255287
{
256-
TraceId: Id_1,
257-
SpanId: Id_11,
288+
TraceId: Id_3,
289+
SpanId: Id_13,
258290
Name: azure_functions.invoke,
259291
Resource: GET /api/simple,
260292
Service: AzureFunctionsAllTriggers,
261293
Type: serverless,
262-
ParentId: Id_7,
294+
ParentId: Id_9,
263295
Tags: {
264296
aas.environment.extension_version: unknown,
265297
aas.environment.instance_id: unknown,
@@ -290,13 +322,13 @@
290322
}
291323
},
292324
{
293-
TraceId: Id_1,
294-
SpanId: Id_12,
325+
TraceId: Id_3,
326+
SpanId: Id_14,
295327
Name: azure_functions.invoke,
296328
Resource: GET /api/exception,
297329
Service: AzureFunctionsAllTriggers,
298330
Type: serverless,
299-
ParentId: Id_8,
331+
ParentId: Id_10,
300332
Error: 1,
301333
Tags: {
302334
aas.environment.extension_version: unknown,
@@ -336,13 +368,13 @@ at Samples.AzureFunctions.V4Isolated.DirectFunctionExecutor.ExecuteAsync(Functio
336368
}
337369
},
338370
{
339-
TraceId: Id_1,
340-
SpanId: Id_13,
371+
TraceId: Id_3,
372+
SpanId: Id_15,
341373
Name: azure_functions.invoke,
342374
Resource: GET /api/error,
343375
Service: AzureFunctionsAllTriggers,
344376
Type: serverless,
345-
ParentId: Id_9,
377+
ParentId: Id_11,
346378
Error: 1,
347379
Tags: {
348380
aas.environment.extension_version: unknown,
@@ -375,13 +407,13 @@ at Samples.AzureFunctions.V4Isolated.DirectFunctionExecutor.ExecuteAsync(Functio
375407
}
376408
},
377409
{
378-
TraceId: Id_1,
379-
SpanId: Id_14,
410+
TraceId: Id_3,
411+
SpanId: Id_16,
380412
Name: azure_functions.invoke,
381413
Resource: GET /api/badrequest,
382414
Service: AzureFunctionsAllTriggers,
383415
Type: serverless,
384-
ParentId: Id_10,
416+
ParentId: Id_12,
385417
Tags: {
386418
aas.environment.extension_version: unknown,
387419
aas.environment.instance_id: unknown,
@@ -412,13 +444,13 @@ at Samples.AzureFunctions.V4Isolated.DirectFunctionExecutor.ExecuteAsync(Functio
412444
}
413445
},
414446
{
415-
TraceId: Id_1,
416-
SpanId: Id_15,
447+
TraceId: Id_3,
448+
SpanId: Id_17,
417449
Name: azure_functions.invoke,
418450
Resource: Http SimpleHttpTrigger,
419451
Service: AzureFunctionsAllTriggers,
420452
Type: serverless,
421-
ParentId: Id_11,
453+
ParentId: Id_13,
422454
Tags: {
423455
aas.environment.extension_version: unknown,
424456
aas.environment.instance_id: unknown,
@@ -445,13 +477,13 @@ at Samples.AzureFunctions.V4Isolated.DirectFunctionExecutor.ExecuteAsync(Functio
445477
}
446478
},
447479
{
448-
TraceId: Id_1,
449-
SpanId: Id_16,
480+
TraceId: Id_3,
481+
SpanId: Id_18,
450482
Name: azure_functions.invoke,
451483
Resource: Http Exception,
452484
Service: AzureFunctionsAllTriggers,
453485
Type: serverless,
454-
ParentId: Id_12,
486+
ParentId: Id_14,
455487
Error: 1,
456488
Tags: {
457489
aas.environment.extension_version: unknown,
@@ -484,13 +516,13 @@ at Samples.AzureFunctions.AllTriggers.AllTriggers.Exception(HttpRequestData req,
484516
}
485517
},
486518
{
487-
TraceId: Id_1,
488-
SpanId: Id_17,
519+
TraceId: Id_3,
520+
SpanId: Id_19,
489521
Name: azure_functions.invoke,
490522
Resource: Http ServerError,
491523
Service: AzureFunctionsAllTriggers,
492524
Type: serverless,
493-
ParentId: Id_13,
525+
ParentId: Id_15,
494526
Tags: {
495527
aas.environment.extension_version: unknown,
496528
aas.environment.instance_id: unknown,
@@ -517,13 +549,13 @@ at Samples.AzureFunctions.AllTriggers.AllTriggers.Exception(HttpRequestData req,
517549
}
518550
},
519551
{
520-
TraceId: Id_1,
521-
SpanId: Id_18,
552+
TraceId: Id_3,
553+
SpanId: Id_20,
522554
Name: azure_functions.invoke,
523555
Resource: Http BadRequest,
524556
Service: AzureFunctionsAllTriggers,
525557
Type: serverless,
526-
ParentId: Id_14,
558+
ParentId: Id_16,
527559
Tags: {
528560
aas.environment.extension_version: unknown,
529561
aas.environment.instance_id: unknown,
@@ -550,12 +582,12 @@ at Samples.AzureFunctions.AllTriggers.AllTriggers.Exception(HttpRequestData req,
550582
}
551583
},
552584
{
553-
TraceId: Id_1,
554-
SpanId: Id_19,
585+
TraceId: Id_3,
586+
SpanId: Id_21,
555587
Name: Manual inside Simple,
556588
Resource: Manual inside Simple,
557589
Service: AzureFunctionsAllTriggers,
558-
ParentId: Id_15,
590+
ParentId: Id_17,
559591
Tags: {
560592
aas.site.name: AzureFunctionsAllTriggers,
561593
aas.site.type: function,
@@ -564,12 +596,12 @@ at Samples.AzureFunctions.AllTriggers.AllTriggers.Exception(HttpRequestData req,
564596
}
565597
},
566598
{
567-
TraceId: Id_1,
568-
SpanId: Id_20,
599+
TraceId: Id_3,
600+
SpanId: Id_22,
569601
Name: Manual inside Exception,
570602
Resource: Manual inside Exception,
571603
Service: AzureFunctionsAllTriggers,
572-
ParentId: Id_16,
604+
ParentId: Id_18,
573605
Tags: {
574606
aas.site.name: AzureFunctionsAllTriggers,
575607
aas.site.type: function,
@@ -578,12 +610,12 @@ at Samples.AzureFunctions.AllTriggers.AllTriggers.Exception(HttpRequestData req,
578610
}
579611
},
580612
{
581-
TraceId: Id_1,
582-
SpanId: Id_21,
613+
TraceId: Id_3,
614+
SpanId: Id_23,
583615
Name: Manual inside ServerError,
584616
Resource: Manual inside ServerError,
585617
Service: AzureFunctionsAllTriggers,
586-
ParentId: Id_17,
618+
ParentId: Id_19,
587619
Tags: {
588620
aas.site.name: AzureFunctionsAllTriggers,
589621
aas.site.type: function,
@@ -592,12 +624,12 @@ at Samples.AzureFunctions.AllTriggers.AllTriggers.Exception(HttpRequestData req,
592624
}
593625
},
594626
{
595-
TraceId: Id_1,
596-
SpanId: Id_22,
627+
TraceId: Id_3,
628+
SpanId: Id_24,
597629
Name: Manual inside BadRequest,
598630
Resource: Manual inside BadRequest,
599631
Service: AzureFunctionsAllTriggers,
600-
ParentId: Id_18,
632+
ParentId: Id_20,
601633
Tags: {
602634
aas.site.name: AzureFunctionsAllTriggers,
603635
aas.site.type: function,

0 commit comments

Comments
 (0)