From 51fbbea94c4cfa2ba19f86ff112bc690418c7080 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Thu, 5 Dec 2024 12:33:19 +0000 Subject: [PATCH] Fix FaaS serialization and MockApmServer DTOs --- src/Elastic.Apm/Model/Transaction.cs | 1 + test/Elastic.Apm.Tests.MockApmServer/FaasDto.cs | 1 + test/Elastic.Apm.Tests.MockApmServer/TransactionDto.cs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Elastic.Apm/Model/Transaction.cs b/src/Elastic.Apm/Model/Transaction.cs index 2163a9ad9..928bfcf28 100644 --- a/src/Elastic.Apm/Model/Transaction.cs +++ b/src/Elastic.Apm/Model/Transaction.cs @@ -473,6 +473,7 @@ public string Name /// /// Contains data related to FaaS (Function as a Service) events. /// + [JsonPropertyName("faas")] public Faas FaaS { get; set; } /// diff --git a/test/Elastic.Apm.Tests.MockApmServer/FaasDto.cs b/test/Elastic.Apm.Tests.MockApmServer/FaasDto.cs index 295d8e046..1a52f83ff 100644 --- a/test/Elastic.Apm.Tests.MockApmServer/FaasDto.cs +++ b/test/Elastic.Apm.Tests.MockApmServer/FaasDto.cs @@ -9,6 +9,7 @@ namespace Elastic.Apm.Tests.MockApmServer; public class FaasDto { + [JsonPropertyName("cold_start")] public bool ColdStart { get; set; } public string Execution { get; set; } diff --git a/test/Elastic.Apm.Tests.MockApmServer/TransactionDto.cs b/test/Elastic.Apm.Tests.MockApmServer/TransactionDto.cs index bdaa9aeb1..1abeab2d2 100644 --- a/test/Elastic.Apm.Tests.MockApmServer/TransactionDto.cs +++ b/test/Elastic.Apm.Tests.MockApmServer/TransactionDto.cs @@ -46,10 +46,10 @@ internal class TransactionDto : ITimedDto public string Type { get; set; } - [JsonPropertyName("dropped_spans_stats")] public List DroppedSpanStats { get; set; } + [JsonPropertyName("faas")] public FaasDto FaaS { get; set; } public override string ToString() => new ToStringBuilder(nameof(TransactionDto))