From 16dfdd17c7db49a20df1246b478c47c423a41ba6 Mon Sep 17 00:00:00 2001 From: Serkant Karaca Date: Fri, 18 Sep 2020 07:37:04 -0700 Subject: [PATCH] Increase diagnostics-id overhead in EventDataBatch (#15193) --- .../Microsoft.Azure.EventHubs/src/EventDataBatch.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/eventhub/Microsoft.Azure.EventHubs/src/EventDataBatch.cs b/sdk/eventhub/Microsoft.Azure.EventHubs/src/EventDataBatch.cs index ce4ccc8fd593..850529850880 100644 --- a/sdk/eventhub/Microsoft.Azure.EventHubs/src/EventDataBatch.cs +++ b/sdk/eventhub/Microsoft.Azure.EventHubs/src/EventDataBatch.cs @@ -14,7 +14,11 @@ namespace Microsoft.Azure.EventHubs public class EventDataBatch : IDisposable { const int MaxSizeLimit = 4 * 1024 * 1024; - const int DiagnosticsIdOverhead = 64; + + // System.Diagnostics.Activity.Id is 1024 bytes or shorter. + // However we will keep overhead at 128 bytes which should be enough for most scenarios. + // Any client in need of longer Ids should create batch with an appropriate mac-batch-size. + const int DiagnosticsIdOverhead = 128; readonly List eventDataList; readonly long maxSize;